code-server
Version:
Run VS Code on a remote server.
281 lines • 1.71 MB
JavaScript
/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
var i6=Object.create;var tv=Object.defineProperty;var a0=Object.getOwnPropertyDescriptor;var s6=Object.getOwnPropertyNames;var a6=Object.getPrototypeOf,l6=Object.prototype.hasOwnProperty;var l0=r=>{throw TypeError(r)};var v=(r,t)=>()=>(r&&(t=r(r=0)),t);var c6=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),c0=(r,t)=>{for(var e in t)tv(r,e,{get:t[e],enumerable:!0})},d6=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s6(t))!l6.call(r,o)&&o!==e&&tv(r,o,{get:()=>t[o],enumerable:!(n=a0(t,o))||n.enumerable});return r};var d0=(r,t,e)=>(e=r!=null?i6(a6(r)):{},d6(t||!r||!r.__esModule?tv(e,"default",{value:r,enumerable:!0}):e,r));var w=(r,t,e,n)=>{for(var o=n>1?void 0:n?a0(t,e):t,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(t,e,o):s(o))||o);return n&&o&&tv(t,e,o),o},b=(r,t)=>(e,n)=>t(e,n,r);var Ew=(r,t,e)=>t.has(r)||l0("Cannot "+e);var gn=(r,t,e)=>(Ew(r,t,"read from private field"),e?e.call(r):t.get(r)),Wd=(r,t,e)=>t.has(r)?l0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),tg=(r,t,e,n)=>(Ew(r,t,"write to private field"),n?n.call(r,e):t.set(r,e),e),ng=(r,t,e)=>(Ew(r,t,"access private method"),e);var ww=c6((Xse,m0)=>{"use strict";function u6(r,t){var e=r;t.slice(0,-1).forEach(function(o){e=e[o]||{}});var n=t[t.length-1];return n in e}function u0(r){return typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function p0(r,t){return t==="constructor"&&typeof r[t]=="function"||t==="__proto__"}m0.exports=function(r,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(P){e.bools[P]=!0});var n={};function o(P){return n[P].some(function(M){return e.bools[M]})}Object.keys(t.alias||{}).forEach(function(P){n[P]=[].concat(t.alias[P]),n[P].forEach(function(M){n[M]=[P].concat(n[P].filter(function(X){return M!==X}))})}),[].concat(t.string).filter(Boolean).forEach(function(P){e.strings[P]=!0,n[P]&&[].concat(n[P]).forEach(function(M){e.strings[M]=!0})});var i=t.default||{},s={_:[]};function a(P,M){return e.allBools&&/^--[^=]+$/.test(M)||e.strings[P]||e.bools[P]||n[P]}function l(P,M,X){for(var N=P,ae=0;ae<M.length-1;ae++){var Y=M[ae];if(p0(N,Y))return;N[Y]===void 0&&(N[Y]={}),(N[Y]===Object.prototype||N[Y]===Number.prototype||N[Y]===String.prototype)&&(N[Y]={}),N[Y]===Array.prototype&&(N[Y]=[]),N=N[Y]}var W=M[M.length-1];p0(N,W)||((N===Object.prototype||N===Number.prototype||N===String.prototype)&&(N={}),N===Array.prototype&&(N=[]),N[W]===void 0||e.bools[W]||typeof N[W]=="boolean"?N[W]=X:Array.isArray(N[W])?N[W].push(X):N[W]=[N[W],X])}function c(P,M,X){if(!(X&&e.unknownFn&&!a(P,X)&&e.unknownFn(X)===!1)){var N=!e.strings[P]&&u0(M)?Number(M):M;l(s,P.split("."),N),(n[P]||[]).forEach(function(ae){l(s,ae.split("."),N)})}}Object.keys(e.bools).forEach(function(P){c(P,i[P]===void 0?!1:i[P])});var u=[];r.indexOf("--")!==-1&&(u=r.slice(r.indexOf("--")+1),r=r.slice(0,r.indexOf("--")));for(var p=0;p<r.length;p++){var m=r[p],g,y;if(/^--.+=/.test(m)){var h=m.match(/^--([^=]+)=([\s\S]*)$/);g=h[1];var I=h[2];e.bools[g]&&(I=I!=="false"),c(g,I,m)}else if(/^--no-.+/.test(m))g=m.match(/^--no-(.+)/)[1],c(g,!1,m);else if(/^--.+/.test(m))g=m.match(/^--(.+)/)[1],y=r[p+1],y!==void 0&&!/^(-|--)[^-]/.test(y)&&!e.bools[g]&&!e.allBools&&(!n[g]||!o(g))?(c(g,y,m),p+=1):/^(true|false)$/.test(y)?(c(g,y==="true",m),p+=1):c(g,e.strings[g]?"":!0,m);else if(/^-[^-]+/.test(m)){for(var x=m.slice(1,-1).split(""),E=!1,T=0;T<x.length;T++){if(y=m.slice(T+2),y==="-"){c(x[T],y,m);continue}if(/[A-Za-z]/.test(x[T])&&y[0]==="="){c(x[T],y.slice(1),m),E=!0;break}if(/[A-Za-z]/.test(x[T])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){c(x[T],y,m),E=!0;break}if(x[T+1]&&x[T+1].match(/\W/)){c(x[T],m.slice(T+2),m),E=!0;break}else c(x[T],e.strings[x[T]]?"":!0,m)}g=m.slice(-1)[0],!E&&g!=="-"&&(r[p+1]&&!/^(-|--)[^-]/.test(r[p+1])&&!e.bools[g]&&(!n[g]||!o(g))?(c(g,r[p+1],m),p+=1):r[p+1]&&/^(true|false)$/.test(r[p+1])?(c(g,r[p+1]==="true",m),p+=1):c(g,e.strings[g]?"":!0,m))}else if((!e.unknownFn||e.unknownFn(m)!==!1)&&s._.push(e.strings._||!u0(m)?m:Number(m)),t.stopEarly){s._.push.apply(s._,r.slice(p+1));break}}return Object.keys(i).forEach(function(P){u6(s,P.split("."))||(l(s,P.split("."),i[P]),(n[P]||[]).forEach(function(M){l(s,M.split("."),i[P])}))}),t["--"]?s["--"]=u.slice():u.forEach(function(P){s._.push(P)}),s}});function kw(r){let t=[];typeof r=="number"&&t.push("code/timeOrigin",r);function e(i,s){t.push(i,s?.startTime??Date.now())}function n(){let i=[];for(let s=0;s<t.length;s+=2)i.push({name:t[s],startTime:t[s+1]});return i}function o(i){if(typeof i>"u"){let s=t.length>=2&&t[0]==="code/timeOrigin",a=s?t[1]:void 0;t.length=0,s&&t.push("code/timeOrigin",a)}else for(let s=t.length-2;s>=0;s-=2)t[s]===i&&t.splice(s,2)}return{mark:e,getMarks:n,clearMarks:o}}function y6(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?kw():{mark(r,t){performance.mark(r,t)},clearMarks(r){performance.clearMarks(r)},getMarks(){let r=performance.timeOrigin;typeof r!="number"&&(r=(performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart)??0);let t=[{name:"code/timeOrigin",startTime:Math.round(r)}];for(let e of performance.getEntriesByType("mark"))t.push({name:e.name,startTime:Math.round(r+e.startTime)});return t}};if(typeof process=="object"){let r=performance?.timeOrigin;return kw(r)}else return console.trace("perf-util loaded in UNKNOWN environment"),kw()}function v6(r){return r.MonacoPerformanceMarks||(r.MonacoPerformanceMarks=y6()),r.MonacoPerformanceMarks}var Aw,qt,I6,I0,Xr=v(()=>{Aw=v6(globalThis),qt=Aw.mark,I6=Aw.clearMarks,I0=Aw.getMarks});function T6(){return globalThis._VSCODE_NLS_MESSAGES}function Mw(){return globalThis._VSCODE_NLS_LANGUAGE}function nv(r,t){let e;return t.length===0?e=r:e=r.replace(/\{(\d+)\}/g,(n,o)=>{let i=parseInt(o,10),s=t[i],a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),P6&&(e="\uFF3B"+e.replace(/[aouei]/g,"$&$&")+"\uFF3D"),e}function d(r,t,...e){return nv(typeof r=="number"?C0(r,t):t,e)}function C0(r,t){let e=T6()?.[r];if(typeof e!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${r} !!!`)}return e}function rg(r,t,...e){let n;typeof r=="number"?n=C0(r,t):n=t;let o=nv(n,e);return{value:o,original:t===n?o:nv(t,e)}}var P6,ee=v(()=>{P6=Mw()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0});function cg(r){switch(r){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}var Pi,ag,lg,sg,w0,R0,T0,Ow,P0,Uw,k6,k0,ig,ov,E0,Lw,A6,ts,Us,gr,A0,D6,rv,oe,vt,Ke,D0,iv,dg,_0,bn,Nw,M0,L0,O0,ei,Zr,Un,_6,Fw,M6,U0,fr,ug,N0,F0,sv,dae,H0,fe=v(()=>{ee();Pi="en",ag=!1,lg=!1,sg=!1,w0=!1,R0=!1,T0=!1,Ow=!1,P0=!1,Uw=!1,k6=!1,k0=!1,ov=Pi,E0=Pi,Lw=Pi,Us=globalThis;typeof Us.vscode<"u"&&typeof Us.vscode.process<"u"?gr=Us.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(gr=process);A0=typeof gr?.versions?.electron=="string",D6=A0&&gr?.type==="renderer";if(typeof gr=="object"){ag=gr.platform==="win32",lg=gr.platform==="darwin",sg=gr.platform==="linux",w0=sg&&!!gr.env.SNAP&&!!gr.env.SNAP_REVISION,P0=A0,k6=!!gr.env.CI||!!gr.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!gr.env.GITHUB_WORKSPACE,ig=Pi,ov=Pi;let r=gr.env.VSCODE_NLS_CONFIG;if(r)try{let t=JSON.parse(r);ig=t.userLocale,E0=t.osLocale,Lw=t.regionalLocale??t.osLocale,ov=t.resolvedLanguage||Pi,A6=t.languagePack?.translationsConfigFile}catch{}T0=!0}else typeof navigator=="object"&&!D6?(ts=navigator.userAgent,ag=ts.indexOf("Windows")>=0,lg=ts.indexOf("Macintosh")>=0,Uw=(ts.indexOf("Macintosh")>=0||ts.indexOf("iPad")>=0||ts.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,sg=ts.indexOf("Linux")>=0,R0=ts.indexOf("CrOS")>=0,k0=ts?.indexOf("Mobi")>=0,Ow=!0,ov=Mw()||Pi,ig=navigator.language.toLowerCase(),E0=ig,Lw=ig):console.error("Unable to resolve platform.");rv=0;lg?rv=1:ag?rv=3:sg&&(rv=2);oe=ag,vt=lg,Ke=sg,D0=w0,iv=R0,dg=T0,_0=P0,bn=Ow,Nw=Ow&&typeof Us.importScripts=="function",M0=Nw?Us.origin:void 0,L0=Uw,O0=k0,ei=rv,Zr=ts,Un=ov;(n=>{function r(){return Un}n.value=r;function t(){return Un.length===2?Un==="en":Un.length>=3?Un[0]==="e"&&Un[1]==="n"&&Un[2]==="-":!1}n.isDefaultVariant=t;function e(){return Un==="en"}n.isDefault=e})(_6||={});Fw=Lw,M6=typeof Us.postMessage=="function"&&!Us.importScripts,U0=(()=>{if(M6){let r=[];Us.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let n=0,o=r.length;n<o;n++){let i=r[n];if(i.id===e.data.vscodeScheduleAsyncWork){r.splice(n,1),i.callback();return}}});let t=0;return e=>{let n=++t;r.push({id:n,callback:e}),Us.postMessage({vscodeScheduleAsyncWork:n},"*")}}return r=>setTimeout(r)})(),fr=lg||Uw?2:ag?1:3,ug=!!(Zr&&Zr.indexOf("Chrome")>=0),N0=!!(Zr&&Zr.indexOf("Firefox")>=0),F0=!!(!ug&&Zr&&Zr.indexOf("Safari")>=0),sv=!!(Zr&&Zr.indexOf("Edg/")>=0),dae=!!(Zr&&Zr.indexOf("Android")>=0),H0=!!(Zr&&Zr.indexOf("Electron")>=0)});var rc,Hw,_r,Qt,av,lv,hr=v(()=>{fe();Hw=globalThis.vscode;if(typeof Hw<"u"&&typeof Hw.process<"u"){let r=Hw.process;rc={get platform(){return r.platform},get arch(){return r.arch},get env(){return r.env},cwd(){return r.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?rc={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:rc={get platform(){return oe?"win32":vt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};_r=rc.cwd,Qt=rc.env,av=rc.platform,lv=rc.arch});function H6(r,t){if(r===null||typeof r!="object")throw new cv(t,"Object",r)}function Nn(r,t){if(typeof r!="string")throw new cv(t,"string",r)}function rt(r){return r===ho||r===yr}function Vw(r){return r===ho}function Fs(r){return r>=L6&&r<=U6||r>=O6&&r<=N6}function dv(r,t,e,n){let o="",i=0,s=-1,a=0,l=0;for(let c=0;c<=r.length;++c){if(c<r.length)l=r.charCodeAt(c);else{if(n(l))break;l=ho}if(n(l)){if(!(s===c-1||a===1))if(a===2){if(o.length<2||i!==2||o.charCodeAt(o.length-1)!==ic||o.charCodeAt(o.length-2)!==ic){if(o.length>2){let u=o.lastIndexOf(e);u===-1?(o="",i=0):(o=o.slice(0,u),i=o.length-1-o.lastIndexOf(e)),s=c,a=0;continue}else if(o.length!==0){o="",i=0,s=c,a=0;continue}}t&&(o+=o.length>0?`${e}..`:"..",i=2)}else o.length>0?o+=`${e}${r.slice(s+1,c)}`:o=r.slice(s+1,c),i=c-s-1;s=c,a=0}else l===ic&&a!==-1?++a:a=-1}return o}function W6(r){return r?`${r[0]==="."?"":"."}${r}`:""}function W0(r,t){H6(t,"pathObject");let e=t.dir||t.root,n=t.base||`${t.name||""}${W6(t.ext)}`;return e?e===t.root?`${e}${n}`:`${e}${r}${n}`:n}var L6,O6,U6,N6,ic,ho,yr,Ns,F6,cv,vr,ln,V6,ze,Fn,Gn,$,Sn,Hs,It,Ze,ki,mae,gae,fae,wn,Fa,Oe=v(()=>{hr();L6=65,O6=97,U6=90,N6=122,ic=46,ho=47,yr=92,Ns=58,F6=63,cv=class extends Error{constructor(t,e,n){let o;typeof e=="string"&&e.indexOf("not ")===0?(o="must not be",e=e.replace(/^not /,"")):o="must be";let i=t.indexOf(".")!==-1?"property":"argument",s=`The "${t}" ${i} ${o} of type ${e}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}};vr=av==="win32";ln={resolve(...r){let t="",e="",n=!1;for(let o=r.length-1;o>=-1;o--){let i;if(o>=0){if(i=r[o],Nn(i,`paths[${o}]`),i.length===0)continue}else t.length===0?i=_r():(i=Qt[`=${t}`]||_r(),(i===void 0||i.slice(0,2).toLowerCase()!==t.toLowerCase()&&i.charCodeAt(2)===yr)&&(i=`${t}\\`));let s=i.length,a=0,l="",c=!1,u=i.charCodeAt(0);if(s===1)rt(u)&&(a=1,c=!0);else if(rt(u))if(c=!0,rt(i.charCodeAt(1))){let p=2,m=p;for(;p<s&&!rt(i.charCodeAt(p));)p++;if(p<s&&p!==m){let g=i.slice(m,p);for(m=p;p<s&&rt(i.charCodeAt(p));)p++;if(p<s&&p!==m){for(m=p;p<s&&!rt(i.charCodeAt(p));)p++;(p===s||p!==m)&&(l=`\\\\${g}\\${i.slice(m,p)}`,a=p)}}}else a=1;else Fs(u)&&i.charCodeAt(1)===Ns&&(l=i.slice(0,2),a=2,s>2&&rt(i.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(e=`${i.slice(a)}\\${e}`,n=c,c&&t.length>0)break}return e=dv(e,!n,"\\",rt),n?`${t}\\${e}`:`${t}${e}`||"."},normalize(r){Nn(r,"path");let t=r.length;if(t===0)return".";let e=0,n,o=!1,i=r.charCodeAt(0);if(t===1)return Vw(i)?"\\":r;if(rt(i))if(o=!0,rt(r.charCodeAt(1))){let a=2,l=a;for(;a<t&&!rt(r.charCodeAt(a));)a++;if(a<t&&a!==l){let c=r.slice(l,a);for(l=a;a<t&&rt(r.charCodeAt(a));)a++;if(a<t&&a!==l){for(l=a;a<t&&!rt(r.charCodeAt(a));)a++;if(a===t)return`\\\\${c}\\${r.slice(l)}\\`;a!==l&&(n=`\\\\${c}\\${r.slice(l,a)}`,e=a)}}}else e=1;else Fs(i)&&r.charCodeAt(1)===Ns&&(n=r.slice(0,2),e=2,t>2&&rt(r.charCodeAt(2))&&(o=!0,e=3));let s=e<t?dv(r.slice(e),!o,"\\",rt):"";if(s.length===0&&!o&&(s="."),s.length>0&&rt(r.charCodeAt(t-1))&&(s+="\\"),!o&&n===void 0&&r.includes(":")){if(s.length>=2&&Fs(s.charCodeAt(0))&&s.charCodeAt(1)===Ns)return`.\\${s}`;let a=r.indexOf(":");do if(a===t-1||rt(r.charCodeAt(a+1)))return`.\\${s}`;while((a=r.indexOf(":",a+1))!==-1)}return n===void 0?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(r){Nn(r,"path");let t=r.length;if(t===0)return!1;let e=r.charCodeAt(0);return rt(e)||t>2&&Fs(e)&&r.charCodeAt(1)===Ns&&rt(r.charCodeAt(2))},join(...r){if(r.length===0)return".";let t,e;for(let i=0;i<r.length;++i){let s=r[i];Nn(s,"path"),s.length>0&&(t===void 0?t=e=s:t+=`\\${s}`)}if(t===void 0)return".";let n=!0,o=0;if(typeof e=="string"&&rt(e.charCodeAt(0))){++o;let i=e.length;i>1&&rt(e.charCodeAt(1))&&(++o,i>2&&(rt(e.charCodeAt(2))?++o:n=!1))}if(n){for(;o<t.length&&rt(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return ln.normalize(t)},relative(r,t){if(Nn(r,"from"),Nn(t,"to"),r===t)return"";let e=ln.resolve(r),n=ln.resolve(t);if(e===n||(r=e.toLowerCase(),t=n.toLowerCase(),r===t))return"";if(e.length!==r.length||n.length!==t.length){let y=e.split("\\"),h=n.split("\\");y[y.length-1]===""&&y.pop(),h[h.length-1]===""&&h.pop();let I=y.length,x=h.length,E=I<x?I:x,T;for(T=0;T<E&&y[T].toLowerCase()===h[T].toLowerCase();T++);return T===0?n:T===E?x>E?h.slice(T).join("\\"):I>E?"..\\".repeat(I-1-T)+"..":"":"..\\".repeat(I-T)+h.slice(T).join("\\")}let o=0;for(;o<r.length&&r.charCodeAt(o)===yr;)o++;let i=r.length;for(;i-1>o&&r.charCodeAt(i-1)===yr;)i--;let s=i-o,a=0;for(;a<t.length&&t.charCodeAt(a)===yr;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===yr;)l--;let c=l-a,u=s<c?s:c,p=-1,m=0;for(;m<u;m++){let y=r.charCodeAt(o+m);if(y!==t.charCodeAt(a+m))break;y===yr&&(p=m)}if(m!==u){if(p===-1)return n}else{if(c>u){if(t.charCodeAt(a+m)===yr)return n.slice(a+m+1);if(m===2)return n.slice(a+m)}s>u&&(r.charCodeAt(o+m)===yr?p=m:m===2&&(p=3)),p===-1&&(p=0)}let g="";for(m=o+p+1;m<=i;++m)(m===i||r.charCodeAt(m)===yr)&&(g+=g.length===0?"..":"\\..");return a+=p,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===yr&&++a,n.slice(a,l))},toNamespacedPath(r){if(typeof r!="string"||r.length===0)return r;let t=ln.resolve(r);if(t.length<=2)return r;if(t.charCodeAt(0)===yr){if(t.charCodeAt(1)===yr){let e=t.charCodeAt(2);if(e!==F6&&e!==ic)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Fs(t.charCodeAt(0))&&t.charCodeAt(1)===Ns&&t.charCodeAt(2)===yr)return`\\\\?\\${t}`;return t},dirname(r){Nn(r,"path");let t=r.length;if(t===0)return".";let e=-1,n=0,o=r.charCodeAt(0);if(t===1)return rt(o)?r:".";if(rt(o)){if(e=n=1,rt(r.charCodeAt(1))){let a=2,l=a;for(;a<t&&!rt(r.charCodeAt(a));)a++;if(a<t&&a!==l){for(l=a;a<t&&rt(r.charCodeAt(a));)a++;if(a<t&&a!==l){for(l=a;a<t&&!rt(r.charCodeAt(a));)a++;if(a===t)return r;a!==l&&(e=n=a+1)}}}}else Fs(o)&&r.charCodeAt(1)===Ns&&(e=t>2&&rt(r.charCodeAt(2))?3:2,n=e);let i=-1,s=!0;for(let a=t-1;a>=n;--a)if(rt(r.charCodeAt(a))){if(!s){i=a;break}}else s=!1;if(i===-1){if(e===-1)return".";i=e}return r.slice(0,i)},basename(r,t){t!==void 0&&Nn(t,"suffix"),Nn(r,"path");let e=0,n=-1,o=!0,i;if(r.length>=2&&Fs(r.charCodeAt(0))&&r.charCodeAt(1)===Ns&&(e=2),t!==void 0&&t.length>0&&t.length<=r.length){if(t===r)return"";let s=t.length-1,a=-1;for(i=r.length-1;i>=e;--i){let l=r.charCodeAt(i);if(rt(l)){if(!o){e=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return e===n?n=a:n===-1&&(n=r.length),r.slice(e,n)}for(i=r.length-1;i>=e;--i)if(rt(r.charCodeAt(i))){if(!o){e=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":r.slice(e,n)},extname(r){Nn(r,"path");let t=0,e=-1,n=0,o=-1,i=!0,s=0;r.length>=2&&r.charCodeAt(1)===Ns&&Fs(r.charCodeAt(0))&&(t=n=2);for(let a=r.length-1;a>=t;--a){let l=r.charCodeAt(a);if(rt(l)){if(!i){n=a+1;break}continue}o===-1&&(i=!1,o=a+1),l===ic?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||o===-1||s===0||s===1&&e===o-1&&e===n+1?"":r.slice(e,o)},format:W0.bind(null,"\\"),parse(r){Nn(r,"path");let t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;let e=r.length,n=0,o=r.charCodeAt(0);if(e===1)return rt(o)?(t.root=t.dir=r,t):(t.base=t.name=r,t);if(rt(o)){if(n=1,rt(r.charCodeAt(1))){let p=2,m=p;for(;p<e&&!rt(r.charCodeAt(p));)p++;if(p<e&&p!==m){for(m=p;p<e&&rt(r.charCodeAt(p));)p++;if(p<e&&p!==m){for(m=p;p<e&&!rt(r.charCodeAt(p));)p++;p===e?n=p:p!==m&&(n=p+1)}}}}else if(Fs(o)&&r.charCodeAt(1)===Ns){if(e<=2)return t.root=t.dir=r,t;if(n=2,rt(r.charCodeAt(2))){if(e===3)return t.root=t.dir=r,t;n=3}}n>0&&(t.root=r.slice(0,n));let i=-1,s=n,a=-1,l=!0,c=r.length-1,u=0;for(;c>=n;--c){if(o=r.charCodeAt(c),rt(o)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),o===ic?i===-1?i=c:u!==1&&(u=1):i!==-1&&(u=-1)}return a!==-1&&(i===-1||u===0||u===1&&i===a-1&&i===s+1?t.base=t.name=r.slice(s,a):(t.name=r.slice(s,i),t.base=r.slice(s,a),t.ext=r.slice(i,a))),s>0&&s!==n?t.dir=r.slice(0,s-1):t.dir=t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},V6=(()=>{if(vr){let r=/\\/g;return()=>{let t=_r().replace(r,"/");return t.slice(t.indexOf("/"))}}return()=>_r()})(),ze={resolve(...r){let t="",e=!1;for(let n=r.length-1;n>=0&&!e;n--){let o=r[n];Nn(o,`paths[${n}]`),o.length!==0&&(t=`${o}/${t}`,e=o.charCodeAt(0)===ho)}if(!e){let n=V6();t=`${n}/${t}`,e=n.charCodeAt(0)===ho}return t=dv(t,!e,"/",Vw),e?`/${t}`:t.length>0?t:"."},normalize(r){if(Nn(r,"path"),r.length===0)return".";let t=r.charCodeAt(0)===ho,e=r.charCodeAt(r.length-1)===ho;return r=dv(r,!t,"/",Vw),r.length===0?t?"/":e?"./":".":(e&&(r+="/"),t?`/${r}`:r)},isAbsolute(r){return Nn(r,"path"),r.length>0&&r.charCodeAt(0)===ho},join(...r){if(r.length===0)return".";let t=[];for(let e=0;e<r.length;++e){let n=r[e];Nn(n,"path"),n.length>0&&t.push(n)}return t.length===0?".":ze.normalize(t.join("/"))},relative(r,t){if(Nn(r,"from"),Nn(t,"to"),r===t||(r=ze.resolve(r),t=ze.resolve(t),r===t))return"";let e=1,n=r.length,o=n-e,i=1,s=t.length-i,a=o<s?o:s,l=-1,c=0;for(;c<a;c++){let p=r.charCodeAt(e+c);if(p!==t.charCodeAt(i+c))break;p===ho&&(l=c)}if(c===a)if(s>a){if(t.charCodeAt(i+c)===ho)return t.slice(i+c+1);if(c===0)return t.slice(i+c)}else o>a&&(r.charCodeAt(e+c)===ho?l=c:c===0&&(l=0));let u="";for(c=e+l+1;c<=n;++c)(c===n||r.charCodeAt(c)===ho)&&(u+=u.length===0?"..":"/..");return`${u}${t.slice(i+l)}`},toNamespacedPath(r){return r},dirname(r){if(Nn(r,"path"),r.length===0)return".";let t=r.charCodeAt(0)===ho,e=-1,n=!0;for(let o=r.length-1;o>=1;--o)if(r.charCodeAt(o)===ho){if(!n){e=o;break}}else n=!1;return e===-1?t?"/":".":t&&e===1?"//":r.slice(0,e)},basename(r,t){t!==void 0&&Nn(t,"suffix"),Nn(r,"path");let e=0,n=-1,o=!0,i;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t===r)return"";let s=t.length-1,a=-1;for(i=r.length-1;i>=0;--i){let l=r.charCodeAt(i);if(l===ho){if(!o){e=i+1;break}}else a===-1&&(o=!1,a=i+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return e===n?n=a:n===-1&&(n=r.length),r.slice(e,n)}for(i=r.length-1;i>=0;--i)if(r.charCodeAt(i)===ho){if(!o){e=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":r.slice(e,n)},extname(r){Nn(r,"path");let t=-1,e=0,n=-1,o=!0,i=0;for(let s=r.length-1;s>=0;--s){let a=r[s];if(a==="/"){if(!o){e=s+1;break}continue}n===-1&&(o=!1,n=s+1),a==="."?t===-1?t=s:i!==1&&(i=1):t!==-1&&(i=-1)}return t===-1||n===-1||i===0||i===1&&t===n-1&&t===e+1?"":r.slice(t,n)},format:W0.bind(null,"/"),parse(r){Nn(r,"path");let t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;let e=r.charCodeAt(0)===ho,n;e?(t.root="/",n=1):n=0;let o=-1,i=0,s=-1,a=!0,l=r.length-1,c=0;for(;l>=n;--l){let u=r.charCodeAt(l);if(u===ho){if(!a){i=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===ic?o===-1?o=l:c!==1&&(c=1):o!==-1&&(c=-1)}if(s!==-1){let u=i===0&&e?1:i;o===-1||c===0||c===1&&o===s-1&&o===i+1?t.base=t.name=r.slice(u,s):(t.name=r.slice(u,o),t.base=r.slice(u,s),t.ext=r.slice(o,s))}return i>0?t.dir=r.slice(0,i-1):e&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};ze.win32=ln.win32=ln;ze.posix=ln.posix=ze;Fn=vr?ln.normalize:ze.normalize,Gn=vr?ln.isAbsolute:ze.isAbsolute,$=vr?ln.join:ze.join,Sn=vr?ln.resolve:ze.resolve,Hs=vr?ln.relative:ze.relative,It=vr?ln.dirname:ze.dirname,Ze=vr?ln.basename:ze.basename,ki=vr?ln.extname:ze.extname,mae=vr?ln.format:ze.format,gae=vr?ln.parse:ze.parse,fae=vr?ln.toNamespacedPath:ze.toNamespacedPath,wn=vr?ln.sep:ze.sep,Fa=vr?ln.delimiter:ze.delimiter});function mv(r){Bd.setUnexpectedErrorHandler(r)}function gv(r){if(!r||typeof r!="object")return!1;let t=r;return t.code==="EPIPE"&&t.syscall?.toUpperCase()==="WRITE"}function Ha(r){Bd.onUnexpectedError(r)}function pt(r){on(r)||Bd.onUnexpectedError(r)}function V0(r){on(r)||Bd.onUnexpectedExternalError(r)}function on(r){return r instanceof He?!0:r instanceof Error&&r.name===uv&&r.message===uv}function pg(){let r=new Error(uv);return r.name=r.message,r}function mt(r){return r?new Error(`Illegal argument: ${r}`):new Error("Illegal argument")}function fv(r){return r?new Error(`Illegal state: ${r}`):new Error("Illegal state")}function ye(r){return r?r.message?r.message:r.stack?r.stack.split(`
`)[0]:String(r):"Error"}var Bw,Bd,uv,He,pv,eo,Et,xe=v(()=>{Bw=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?eo.isErrorNoTelemetry(t)?new eo(t.message+`
`+t.stack):new Error(t.message+`
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Bd=new Bw;uv="Canceled";He=class extends Error{constructor(){super(uv),this.name=this.message}},pv=class r extends Error{static{this._name="PendingMigrationError"}static is(t){return t instanceof r||t instanceof Error&&t.name===r._name}constructor(t){super(t),this.name=r._name}};eo=class r extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof r)return t;let e=new r;return e.message=t.message,e.stack=t.stack,e}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Et=class r extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,r.prototype)}}});function G0(r,t){let e=Object.create(null);for(let n of r){let o=t(n),i=e[o];i||(i=e[o]=[]),i.push(n)}return e}var $0,z0,q0,qw=v(()=>{q0=class{constructor(t,e){this.toKey=e;this._map=new Map;this[$0]="SetWithKey";for(let n of t)this.add(n)}get size(){return this._map.size}add(t){let e=this.toKey(t);return this._map.set(e,t),this}delete(t){return this._map.delete(this.toKey(t))}has(t){return this._map.has(this.toKey(t))}*entries(){for(let t of this._map.values())yield[t,t]}keys(){return this.values()}*values(){for(let t of this._map.values())yield t}clear(){this._map.clear()}forEach(t,e){this._map.forEach(n=>t.call(e,n,n,this))}[(z0=Symbol.iterator,$0=Symbol.toStringTag,z0)](){return this.values()}}});function sc(r,t){let e=this,n=!1,o;return function(){if(n)return o;if(n=!0,t)try{o=r.apply(e,arguments)}finally{t()}else o=r.apply(e,arguments);return o}}var mg=v(()=>{});function j0(r,t,e=r.length-1){let n=B6(r,t,e);if(n!==-1)return r[n]}function B6(r,t,e=r.length-1){for(let n=e;n>=0;n--){let o=r[n];if(t(o,n))return n}return-1}function q6(r,t,e=0,n=r.length){let o=e,i=n;for(;o<i;){let s=Math.floor((o+i)/2);t(r[s])?o=s+1:i=s}return o-1}function Q0(r,t,e=0,n=r.length){let o=e,i=n;for(;o<i;){let s=Math.floor((o+i)/2);t(r[s])?i=s:o=s+1}return o}var K0,$w=v(()=>{K0=class r{constructor(t){this._array=t;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(t){if(r.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!t(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let e=q6(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=e+1,e===-1?void 0:this._array[e]}}});function Gt(r,t,e=(n,o)=>n===o){if(r===t)return!0;if(!r||!t||r.length!==t.length)return!1;for(let n=0,o=r.length;n<o;n++)if(!e(r[n],t[n]))return!1;return!0}function Y0(r,t,e){return $6(r.length,n=>e(r[n],t))}function $6(r,t){let e=0,n=r-1;for(;e<=n;){let o=(e+n)/2|0,i=t(o);if(i<0)e=o+1;else if(i>0)n=o-1;else return o}return-(e+1)}function hv(r,t,e){if(!Number.isFinite(r)||r<0||r>=t.length)throw new TypeError("invalid index");r=Math.trunc(r);let n=t[Math.floor(t.length*Math.random())],o=[],i=[],s=[];for(let a of t){let l=e(a,n);l<0?o.push(a):l>0?i.push(a):s.push(a)}return r<o.length?hv(r,o,e):r<o.length+s.length?s[0]:hv(r-(o.length+s.length),i,e)}function X0(r,t,e){if(e===0)return[];let n=r.slice(0,e).sort(t);return z6(r,t,n,e,r.length),n}function z6(r,t,e,n,o){for(let i=e.length;n<o;n++){let s=r[n];if(t(s,e[i-1])<0){e.pop();let a=Q0(e,l=>t(s,l)<0);e.splice(a,0,s)}}}function Zo(r){return r.filter(t=>!!t)}function Z0(r){let t=0;for(let e=0;e<r.length;e++)r[e]&&(r[t]=r[e],t+=1);r.length=t}function ac(r){return Array.isArray(r)&&r.length>0}function rn(r,t=e=>e){let e=new Set;return r.filter(n=>{let o=t(n);return e.has(o)?!1:(e.add(o),!0)})}function zw(r,t){return r.push(t),()=>G6(r,t)}function G6(r,t){let e=r.indexOf(t);if(e>-1)return r.splice(e,1),t}function Gw(r,t){let e;if(typeof t=="number"){let n=t;e=()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)}}else e=Math.random;for(let n=r.length-1;n>0;n-=1){let o=Math.floor(e()*(n+1)),i=r[n];r[n]=r[o],r[o]=i}}function qd(r){return Array.isArray(r)?r:[r]}function eO(r){return r[Math.floor(Math.random()*r.length)]}function nO(r,t){return(e,n)=>t(r(e),r(n))}var tO,oO,J0,Dt=v(()=>{$w();xe();(a=>{function r(l){return l<0}a.isLessThan=r;function t(l){return l<=0}a.isLessThanOrEqual=t;function e(l){return l>0}a.isGreaterThan=e;function n(l){return l===0}a.isNeitherLessOrGreaterThan=n,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(tO||={});oO=(r,t)=>r-t,J0=class r{constructor(t){this.iterate=t}static{this.empty=new r(t=>{})}forEach(t){this.iterate(e=>(t(e),!0))}toArray(){let t=[];return this.iterate(e=>(t.push(e),!0)),t}filter(t){return new r(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new r(e=>this.iterate(n=>e(t(n))))}some(t){let e=!1;return this.iterate(n=>(e=t(n),!e)),e}findFirst(t){let e;return this.iterate(n=>t(n)?(e=n,!1):!0),e}findLast(t){let e;return this.iterate(n=>(t(n)&&(e=n),!0)),e}findLastMaxBy(t){let e,n=!0;return this.iterate(o=>((n||tO.isGreaterThan(t(o,e)))&&(n=!1,e=o),!0)),e}}});function aO(r){let t=[];return r.forEach((e,n)=>{t.push(`${n} => ${e}`)}),`Map(${r.size}) {${t.join(", ")}}`}function lO(r){let t=[];return r.forEach(e=>{t.push(e)}),`Set(${r.size}) {${t.join(", ")}}`}function K6(r){return Array.isArray(r)}var Kw,rO,je,iO,Ws,sO,jw,Qw,ti,vv,fn=v(()=>{Kw=class{constructor(t,e){this.uri=t;this.value=e}};je=class r{constructor(t,e){this[rO]="ResourceMap";if(t instanceof r)this.map=new Map(t.map),this.toKey=e??r.defaultToKey;else if(K6(t)){this.map=new Map,this.toKey=e??r.defaultToKey;for(let[n,o]of t)this.set(n,o)}else this.map=new Map,this.toKey=t??r.defaultToKey}static{this.defaultToKey=t=>t.toString()}set(t,e){return this.map.set(this.toKey(t),new Kw(t,e)),this}get(t){return this.map.get(this.toKey(t))?.value}has(t){return this.map.has(this.toKey(t))}get size(){return this.map.size}clear(){this.map.clear()}delete(t){return this.map.delete(this.toKey(t))}forEach(t,e){typeof e<"u"&&(t=t.bind(e));for(let[n,o]of this.map)t(o.value,o.uri,this)}*values(){for(let t of this.map.values())yield t.value}*keys(){for(let t of this.map.values())yield t.uri}*entries(){for(let t of this.map.values())yield[t.uri,t.value]}*[(rO=Symbol.toStringTag,Symbol.iterator)](){for(let[,t]of this.map)yield[t.uri,t.value]}},Ws=class{constructor(t,e){this[iO]="ResourceSet";!t||typeof t=="function"?this._map=new je(t):(this._map=new je(e),t.forEach(this.add,this))}get size(){return this._map.size}add(t){return this._map.set(t,t),this}clear(){this._map.clear()}delete(t){return this._map.delete(t)}forEach(t,e){this._map.forEach((n,o)=>t.call(e,o,o,this))}has(t){return this._map.has(t)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(iO=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},jw=class{constructor(){this[sO]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,e=0){let n=this._map.get(t);if(n)return e!==0&&this.touch(n,e),n.value}set(t,e,n=0){let o=this._map.get(t);if(o)o.value=e,n!==0&&this.touch(o,n);else{switch(o={key:t,value:e,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(t,o),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,e){let n=this._state,o=this._head;for(;o;){if(e?t.bind(e)(o.value,o.key,this):t(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let t=this,e=this._state,n=this._head,o={[Symbol.iterator](){return o},[Symbol.dispose](){},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return o}values(){let t=this,e=this._state,n=this._head,o={[Symbol.iterator](){return o},[Symbol.dispose](){},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return o}entries(){let t=this,e=this._state,n=this._head,o={[Symbol.iterator](){return o},[Symbol.dispose](){},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return o}[(sO=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._head,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.next,n--;this._head=e,this._size=n,e&&(e.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._tail,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.previous,n--;this._tail=e,this._size=n,e&&(e.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let e=t.next,n=t.previous;if(!e||!n)throw new Error("Invalid list");e.previous=n,n.next=e}t.next=void 0,t.previous=void 0,this._state++}touch(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(t===this._head)return;let n=t.next,o=t.previous;t===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(e===2){if(t===this._tail)return;let n=t.next,o=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((e,n)=>{t.push([n,e])}),t}fromJSON(t){this.clear();for(let[e,n]of t)this.set(e,n)}},Qw=class extends jw{constructor(t,e=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,e=2){return super.get(t,e)}peek(t){return super.get(t,0)}set(t,e){return super.set(t,e,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},ti=class extends Qw{constructor(t,e=1){super(t,e)}trim(t){this.trimOld(t)}set(t,e){return super.set(t,e),this.checkTrim(),this}},vv=class{constructor(){this.map=new Map}add(t,e){let n=this.map.get(t);n||(n=new Set,this.map.set(t,n)),n.add(e)}delete(t,e){let n=this.map.get(t);n&&(n.delete(e),n.size===0&&this.map.delete(t))}forEach(t,e){let n=this.map.get(t);n&&n.forEach(e)}get(t){let e=this.map.get(t);return e||new Set}}});function Iv(r,t){if(!r)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function lc(r,t="Unreachable"){throw new Error(t)}function cc(r,t="unexpected state"){if(!r)throw typeof t=="string"?new Et(`Assertion Failed: ${t}`):t}function gg(r){r()||(r(),pt(new Et("Assertion Failed")))}var ni=v(()=>{xe()});function G(r){return typeof r=="string"}function fg(r){return cO(r,G)}function cO(r,t){return Array.isArray(r)&&r.every(t)}function ve(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function dO(r){let t=Object.getPrototypeOf(Uint8Array);return typeof r=="object"&&r instanceof t}function to(r){return typeof r=="number"&&!isNaN(r)}function uO(r){return!!r&&typeof r[Symbol.iterator]=="function"}function er(r){return r===!0||r===!1}function $n(r){return typeof r>"u"}function oi(r){return!Kt(r)}function Kt(r){return $n(r)||r===null}function hg(r){return cc(r!=null,"Argument is `undefined` or `null`."),r}function Wa(r){if(!ve(r))return!1;for(let t in r)if(Q6.call(r,t))return!1;return!0}function $d(r){return typeof r=="function"}function pO(r,t){if(G(t)){if(typeof r!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if($d(t)){try{if(r instanceof t)return}catch{}if(!Kt(r)&&r.constructor===t||t.length===1&&t.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Rn(r,t){for(let e in t)if(!(e in r))return!1;return!0}var Q6,Ie=v(()=>{ni();Q6=Object.prototype.hasOwnProperty});var sn,ri=v(()=>{Ie();(X=>{function r(N){return!!N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}X.is=r;let t=Object.freeze([]);function e(){return t}X.empty=e;function*n(N){yield N}X.single=n;function o(N){return r(N)?N:n(N)}X.wrap=o;function i(N){return N??t}X.from=i;function*s(N){for(let ae=N.length-1;ae>=0;ae--)yield N[ae]}X.reverse=s;function a(N){return!N||N[Symbol.iterator]().next().done===!0}X.isEmpty=a;function l(N){return N[Symbol.iterator]().next().value}X.first=l;function c(N,ae){let Y=0;for(let W of N)if(ae(W,Y++))return!0;return!1}X.some=c;function u(N,ae){let Y=0;for(let W of N)if(!ae(W,Y++))return!1;return!0}X.every=u;function p(N,ae){for(let Y of N)if(ae(Y))return Y}X.find=p;function*m(N,ae){for(let Y of N)ae(Y)&&(yield Y)}X.filter=m;function*g(N,ae){let Y=0;for(let W of N)yield ae(W,Y++)}X.map=g;function*y(N,ae){let Y=0;for(let W of N)yield*ae(W,Y++)}X.flatMap=y;function*h(...N){for(let ae of N)uO(ae)?yield*ae:yield ae}X.concat=h;function I(N,ae,Y){let W=Y;for(let J of N)W=ae(W,J);return W}X.reduce=I;function x(N){let ae=0;for(let Y of N)ae++;return ae}X.length=x;function*E(N,ae,Y=N.length){for(ae<-N.length&&(ae=0),ae<0&&(ae+=N.length),Y<0?Y+=N.length:Y>N.length&&(Y=N.length);ae<Y;ae++)yield N[ae]}X.slice=E;function T(N,ae=Number.POSITIVE_INFINITY){let Y=[];if(ae===0)return[Y,N];let W=N[Symbol.iterator]();for(let J=0;J<ae;J++){let we=W.next();if(we.done)return[Y,X.empty()];Y.push(we.value)}return[Y,{[Symbol.iterator](){return W}}]}X.consume=T;async function P(N){let ae=[];for await(let Y of N)ae.push(Y);return ae}X.asyncToArray=P;async function M(N){let ae=[];for await(let Y of N)ae=ae.concat(Y);return ae}X.asyncToArrayFlat=M})(sn||={})});function Y6(r){zd=r}function Va(r){return zd?.trackDisposable(r),r}function Ba(r){zd?.markAsDisposed(r)}function uc(r,t){zd?.setParent(r,t)}function X6(r,t){if(zd)for(let e of r)zd.setParent(e,t)}function bv(r){return typeof r=="object"&&r!==null&&typeof r.dispose=="function"&&r.dispose.length===0}function hn(r){if(sn.is(r)){let t=[];for(let e of r)if(e)try{e.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function Sv(...r){let t=se(()=>hn(r));return X6(r,t),t}function se(r){return new Jw(r)}function gO(r,t){return r.then(e=>(t.isDisposed?e.dispose():t.add(e),e))}var J6,zd,mO,Jw,re,D,Kn,Wo,Q=v(()=>{Dt();qw();fn();mg();ri();xe();J6=!1,zd=null,mO=class r{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(t){let e=this.livingDisposables.get(t);return e||(e={parent:null,source:null,isSingleton:!1,value:t,idx:r.idx++},this.livingDisposables.set(t,e)),e}trackDisposable(t,e){let n=this.getDisposableData(t);n.source||(n.source=e??new Error)}setParent(t,e){let n=this.getDisposableData(t);n.parent=e}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,e){let n=e.get(t);if(n)return n;let o=t.parent?this.getRootParent(this.getDisposableData(t.parent),e):t;return e.set(t,o),o}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,t).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(t=10,e){let n;if(e)n=e;else{let l=new Map,c=[...this.livingDisposables.values()].filter(p=>p.source!==null&&!this.getRootParent(p,l).isSingleton);if(c.length===0)return;let u=new Set(c.map(p=>p.value));if(n=c.filter(p=>!(p.parent&&u.has(p.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(l){function c(p,m){for(;p.length>0&&m.some(g=>typeof g=="string"?g===p[0]:p[0].match(g));)p.shift()}let u=l.source.stack.split(`
`).map(p=>p.trim().replace("at ","")).filter(p=>p!=="");return c(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}let i=new vv;for(let l of n){let c=o(l);for(let u=0;u<=c.length;u++)i.add(c.slice(0,u).join(`
`),l)}n.sort(nO(l=>l.idx,oO));let s="",a=0;for(let l of n.slice(0,t)){a++;let c=o(l),u=[];for(let p=0;p<c.length;p++){let m=c[p];m=`(shared with ${i.get(c.slice(0,p+1).join(`
`)).size}/${n.length} leaks) at ${m}`;let y=i.get(c.slice(0,p).join(`
`)),h=G0([...y].map(I=>o(I)[p]),I=>I);delete h[c[p]];for(let[I,x]of Object.entries(h))x&&u.unshift(` - stacktraces of ${x.length} other leaks continue with ${I}`);u.unshift(m)}s+=`
==================== Leaking disposable ${a}/${n.length}: ${l.value.constructor.name} ====================
${u.join(`
`)}
============================================================
`}return n.length>t&&(s+=`
... and ${n.length-t} more leaking disposables
`),{leaks:n,details:s}}};if(J6){let r="__is_disposable_tracked__";Y6(new class{trackDisposable(t){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[r]||console.log(e)},3e3)}setParent(t,e){if(t&&t!==D.None)try{t[r]=!0}catch{}}markAsDisposed(t){if(t&&t!==D.None)try{t[r]=!0}catch{}}markAsSingleton(t){}})}Jw=class{constructor(t){this._isDisposed=!1,this._fn=t,Va(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,Ba(this),this._fn()}}};re=class r{constructor(){this._toDispose=new Set;this._isDisposed=!1;Va(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Ba(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{hn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===D.None)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return uc(t,this),this._isDisposed?r.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.delete(t)&&uc(t,null)}assertNotDisposed(){this._isDisposed&&pt(new Et("Object disposed"))}},D=class{constructor(){this._store=new re;Va(this),uc(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){Ba(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}},Kn=class{constructor(){this._isDisposed=!1;Va(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),t&&uc(t,this),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Ba(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t&&uc(t,null),t}},Wo=class{constructor(t=new Map){this._isDisposed=!1;this._store=t,Va(this)}dispose(){Ba(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{hn(this._store.values())}finally{this._store.clear()}}has(t){return this._store.has(t)}get size(){return this._store.size}get(t){return this._store.get(t)}set(t,e,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(t)?.dispose(),this._store.set(t,e),uc(e,this)}deleteAndDispose(t){this._store.get(t)?.dispose(),this._store.delete(t)}deleteAndLeak(t){let e=this._store.get(t);return e&&uc(e,null),this._store.delete(t),e}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}});var cn,qa,xv=v(()=>{cn=class r{static{this.Undefined=new r(void 0)}constructor(t){this.element=t,this.next=r.Undefined,this.prev=r.Undefined}},qa=class{constructor(){this._first=cn.Undefined;this._last=cn.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===cn.Undefined}clear(){let t=this._first;for(;t!==cn.Undefined;){let e=t.next;t.prev=cn.Undefined,t.next=cn.Undefined,t=e}this._first=cn.Undefined,this._last=cn.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new cn(t);if(this._first===cn.Undefined)this._first=n,this._last=n;else if(e){let i=this._last;this._last=n,n.prev=i,i.next=n}else{let i=this._first;this._first=n,n.next=i,i.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==cn.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==cn.Undefined){let t=this._last.element;return this._remove(this._last),t}}peek(){if(this._last!==cn.Undefined)return this._last.element}_remove(t){if(t.prev!==cn.Undefined&&t.next!==cn.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===cn.Undefined&&t.next===cn.Undefined?(this._first=cn.Undefined,this._last=cn.Undefined):t.next===cn.Undefined?(this._last=this._last.prev,this._last.next=cn.Undefined):t.prev===cn.Undefined&&(this._first=this._first.next,this._first.prev=cn.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==cn.Undefined;)yield t.element,t=t.next}}});var Z6,no,Vs=v(()=>{Z6=globalThis.performance.now.bind(globalThis.performance),no=class r{static create(t){return new r(t)}constructor(t){this._now=t===!1?Date.now:Z6,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}});function yO(){return!!Qt.VSCODE_DEV}function bO(){return(n3++).toString(16).padStart(3,"0")}function tR(r,t){t instanceof re?t.add(r):Array.isArray(t)&&t.push(r)}function IO(r,t){if(t instanceof re)t.delete(r);else if(Array.isArray(t)){let e=t.indexOf(r);e!==-1&&t.splice(e,1)}r.dispose()}var fO,e3,t3,hO,F,Yw,vO,n3,Xw,Kd,jd,Zw,o3,Gd,r3,i3,R,eR,pc,Cv,yg,ue=v(()=>{qw();xe();mg();Q();xv();hr();Vs();fO=!1,e3=!1,t3=100,hO=6e4;(Wt=>{Wt.None=()=>D.None;function t(de){if(e3){let{onDidAddListener:j}=de,ie=Kd.create(),K=0;de.onDidAddListener=()=>{++K===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),ie.print()),j?.()}}}function e(de,j,ie){return g(de,()=>{},0,void 0,j??!0,void 0,ie)}Wt.defer=e;function n(de){return(j,ie=null,K)=>{let V=!1,le;return le=de(me=>{if(!V)return le?le.dispose():V=!0,j.call(ie,me)},null,K),V&&le.dispose(),le}}Wt.once=n;function o(de,j){return Wt.once(Wt.filter(de,j))}Wt.onceIf=o;function i(de,j,ie){return p((K,V=null,le)=>de(me=>K.call(V,j(me)),null,le),ie)}Wt.map=i;function s(de,j,ie){return p((K,V=null,le)=>de(me=>{j(me),K.call(V,me)},null,le),ie)}Wt.forEach=s;function a(de,j,ie){return p((K,V=null,le)=>de(me=>j(me)&&K.call(V,me),null,le),ie)}Wt.filter=a;function l(de){return de}Wt.signal=l;function c(...de){return(j,ie=null,K)=>{let V=Sv(...de.map(le=>le(me=>j.call(ie,me))));return m(V,K)}}Wt.any=c;function u(de,j,ie,K){let V=ie;return i(de,le=>(V=j(V,le),V),K)}Wt.reduce=u;function p(de,j){let ie,K={onWillAddFirstListener(){ie=de(V.fire,V)},onDidRemoveLastListener(){ie?.dispose()}};j||t(K);let V=new R(K);return j?.add(V),V.event}function m(de,j){return j instanceof Array?j.push(de):j&&j.add(de),de}function g(de,j,ie=100,K=!1,V=!1,le,me){let dt=D.None,We,et,lt=0,Lt,zt={leakWarningThreshold:le,onWillAddFirstListener(){dt=de(Zi=>{lt++,We=j(We,Zi),K&&!et&&(mo.fire(We),We=void 0),Lt=()=>{let Ua=We;We=void 0,et=void 0,(!K||lt>1)&&mo.fire(Ua),lt=0},typeof ie=="number"?(et&&clearTimeout(et),et=setTimeout(Lt,ie)):et===void 0&&(et=null,queueMicrotask(Lt))})},onWillRemoveListener(){V&<>0&&Lt?.()},onDidRemoveLastListener(){Lt=void 0,dt.dispose()}};me||t(zt);let mo=new R(zt);return me?.add(mo),mo.event}Wt.debounce=g;function y(de,j=0,ie,K){return Wt.debounce(de,(V,le)=>V?(V.push(le),V):[le],j,void 0,ie??!0,void 0,K)}Wt.accumulate=y;function h(de,j,ie=100,K=!0,V=!0,le,me){let dt,We,et,lt=0,Lt={leakWarningThreshold:le,onWillAddFirstListener(){dt=de(mo=>{lt++,We=j(We,mo),et===void 0&&(K&&(zt.fire(We),We=void 0,lt=0),typeof ie=="number"?et=setTimeout(()=>{V&<>0&&zt.fire(We),We=void 0,et=void 0,lt=0},ie):(et=0,queueMicrotask(()=>{V&<>0&&zt.fire(We),We=void 0,et=void 0,lt=0})))})},onDidRemoveLastListener(){dt.dispose()}};me||t(Lt);let zt=new R(Lt);return me?.add(zt),zt.event}Wt.throttle=h;function I(de,j=(K,V)=>K===V,ie){let K=!0,V;return a(de,le=>{let me=K||!j(le,V);return K=!1,V=le,me},ie)}Wt.latch=I;function x(de,j,ie){return[Wt.filter(de,j,ie),Wt.filter(de,K=>!j(K),ie)]}Wt.split=x;function E(de,j,ie=!1,K=[],V){let le=K.slice(),me;yO()&&(me={stack:Kd.create(),timerId:setTimeout(()=>{le&&le.length>0&&me&&!me.warned&&(me.warned=!0,console.warn(`[Event.buffer][${j}] potential LEAK detected: ${le.length} events buffered for ${hO/1e3}s without being consumed. Buffered here:`),me.stack.print())},hO),warned:!1},V&&V.add(se(()=>clearTimeout(me.timerId))));let dt=()=>{me&&clearTimeout(me.timerId)},We=de(Lt=>{le?(le.push(Lt),yO()&&me&&!me.warned&&le.length>=t3&&(me.warned=!0,console.warn(`[Event.buffer][${j}] potential LEAK detected: ${le.length} events buffered without being consumed. Buffered here:`),me.stack.print())):lt.fire(Lt)});V&&V.add(We);let et=()=>{le?.forEach(Lt=>lt.fire(Lt)),le=null,dt()},lt=new R({onWillAddFirstListener(){We||(We=de(Lt=>lt.fire(Lt)),V&&V.add(We))},onDidAddFirstListener(){le&&(ie?setTimeout(et):et())},onDidRemoveLastListener(){We&&We.dispose(),We=null,dt()}});return V&&V.add(lt),lt.event}Wt.buffer=E;function T(de,j){return(K,V,le)=>{let me=j(new M);return de(function(dt){let We=me.evaluate(dt);We!==P&&K.call(V,We)},void 0,le)}}Wt.chain=T;let P=Symbol("HaltChainable");class M{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(ie=>(j(ie),ie)),this}filter(j){return this.steps.push(ie=>j(ie)?ie:P),this}reduce(j,ie){let K=ie;return this.steps.push(V=>(K=j(K,V),K)),this}latch(j=(ie,K)=>ie===K){let ie=!0,K;return this.steps.push(V=>{let le=ie||!j(V,K);return ie=!1,K=V,le?V:P}),this}evaluate(j){for(let ie of this.steps)if(j=ie(j),j===P)break;return j}}function X(de,j,ie=K=>K){let K=(...dt)=>me.fire(ie(...dt)),V=()=>de.on(j,K),le=()=>de.removeListener(j,K),me=new R({onWillAddFirstListener:V,onDidRemoveLastListener:le});return me.event}Wt.fromNodeEventEmitter=X;function N(de,j,ie=K=>K){let K=(...dt)=>me.fire(ie(...dt)),V=()=>de.addEventListener(j,K),le=()=>de.removeEventListener(j,K),me=new R({onWillAddFirstListener:V,onDidRemoveLastListener:le});return me.event}Wt.fromDOMEventEmitter=N;function ae(de,j){let ie,K,V=new Promise(le=>{K=n(de)(le),tR(K,j),ie=()=>{IO(K,j)}});return V.cancel=ie,j&&V.finally(()=>IO(K,j)),V}Wt.toPromise=ae;function Y(de,j){return de(ie=>j.fire(ie))}Wt.forward=Y;function W(de,j,ie){return j(ie),de(K=>j(K))}Wt.runAndSubscribe=W;class J{constructor(j,ie){this._observable=j;this._counter=0;this._hasChanged=!1;let K={onWillAddFirstListener:()=>{j.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{j.removeObserver(this)}};ie||t(K),this.emitter=new R(K),ie&&ie.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,ie){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function we(de,j){return new J(de,j).emitter.event}Wt.fromObservable=we;function In(de){return(j,ie,K)=>{let V=0,le=!1,me={beginUpdate(){V++},endUpdate(){V--,V===0&&(de.reportChanges(),le&&(le=!1,j.call(ie)))},handlePossibleChange(){},handleChange(){le=!0}};de.addObserver(me),de.reportChanges();let dt={dispose(){de.removeObserver(me)}};return tR(dt,K),dt}}Wt.fromObservableLight=In})(F||={});Yw=class r{constructor(t){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${t}_${r._idPool++}`,r.all.add(this)}static{this.all=new Set}static{this._idPool=0}start(t){this._stopWatch=new no,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}},vO=-1,n3=1;Xw=class{constructor(t,e,n=bO()){this._errorHandler=t;this.threshold=e;this.name=n;this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,e){let n=this.threshold;if(n<=0||e<n)return;this._stacks||(this._stacks=new Map);let o=t.value,i=this._stacks.get(o)||0;if(this._stacks.set(o,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,a]=this.getMostFrequentStack(),l=/^[0-9a-f]+$/i.test(this.name)?void 0:this.name,c=`[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${a}):`;console.warn(c),console.warn(s);let u=a/e>.3?"dominated":"popular",p=new jd(u,c,s,e,l);this._errorHandler(p)}return()=>{let s=this._stacks.get(o)||0;s<=1?this._stacks.delete(o):this._stacks.set(o,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,e=0;for(let[n,o]of this._stacks)(!t||e<o)&&(t=[n,o],e=o);return t}},Kd=class r{constructor(t){this.value=t}static create(){let t=new Error;return new r(t.stack??"")}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},jd=class r extends Error{constructor(t,e,n,o,i){super(i?`[${i}] potential listener LEAK detected, ${t}`:`potential listener LEAK detected, ${t}`),this.name="ListenerLeakError",this.kind=t,this.listenerCount=o,this.details=e,this.stack=n}static is(t){return t instanceof r||t instanceof Error&&typeof t.kind=="string"&&typeof t.listenerCount=="number"}},Zw=class extends jd{constructor(t,e,n,o,i){super(t,e,n,o,i),this.name="ListenerRefusalError"}},o3=0,Gd=class{constructor(t){this.value=t;this.id=o3++}},r3=2,i3=(r,t)=>{if(r instanceof Gd)t(r);else for(let e=0;e<r.length;e++){let n=r[e];n&&t(n)}},R=class{constructor(t){this._size=0;this._options=t,(vO>0||this._options?.leakWarningThreshold)&&(this._leakWarningThreshold=this._options?.leakWarningThreshold??vO,this._leakWarningName=this._options?.leakWarningName??bO(),this._leakWarningErrorHandler=this._options?.onListenerError??pt),this._perfMon=this._options?._profName?new Yw(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}_getLeakageMonitor(){if(!(this._leakWarningThreshold===void 0||this._leakWarningName===void 0||this._leakWarningErrorHandler===void 0))return this._leakageMon??=new Xw(this._leakWarningErrorHandler,this._leakWarningThreshold,this._leakWarningName)}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(fO){let t=this._listeners;queueMicrotask(()=>{i3(t,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(t,e,n)=>{if(this._leakWarningThreshold!==void 0&&this._size>this._leakWarningThreshold**2){let l=this._getLeakageMonitor();if(l){let c=`[${l.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${l.threshold})`;console.warn(c);let u=l.getMostFrequentStack()??["UNKNOWN stack",-1],p=u[1]/this._size>.3?"dominated":"popular",m=new Zw(p,`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||pt)(m),D.None}}if(this._disposed)return D.None;e&&(t=t.bind(e));let o=new Gd(t),i,s;if(this._leakWarningThreshold!==void 0&&this._size>=Math.ceil(this._leakWarningThreshold*.2)){let l=this._getLeakageMonitor();l&&this._size+1>=l.threshold&&(o.stack=Kd.create(),i=l.check(o.stack,this._size+1))}fO&&(o.stack=s??Kd.create()),this._listeners?this._listeners instanceof Gd?(this._deliveryQueue??=new eR,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=se(()=>{i?.(),this._removeListener(o)});return tR(a,n),a},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,n=e.indexOf(t);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*r3<=e.length){let i=0;for(let s=0;s<e.length;s++)e[s]?e[i++]=e[s]:o&&i<this._deliveryQueue.end&&(this._deliveryQueue.end--,i<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=i}}_deliver(t,e){if(!t)return;let n=this._options?.onListenerError||pt;if(!n){t.value(e);return}try{t.value(e)}catch(o){n(o)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Gd)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},eR=class{constructor(){this.i=-1;this.end=0}enqueue(t,e,n){this.i=0,this.end=n,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},pc=class extends R{constructor(e){super(e);this._isPaused=0;this._eventQueue=new qa;this._mergeFn=e?.merge}get isPaused(){return this._isPaused!==0}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}},Cv=class{constructor(){this.hasListeners=!1;this.events=[];this.emitter=new R({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(t){let e={event:t,listener:null};return this.events.push(e),this.hasListeners&&this.hook(e),se(sc(()=>{this.hasListeners&&this.unhook(e);let o=this.events.indexOf(e);this.events.splice(o,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(t=>this.hook(t))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(t=>this.unhook(t))}hook(t){t.listener=t.event(e=>this.emitter.fire(e))}unhook(t){t.listener?.dispose(),t.listener=null}dispose(){this.emitter.dispose();for(let t of this.events)t.listener?.dispose();this.events=[]}},yg=class{constructor(){this.listening=!1;this.inputEvent=F.None;this.inputEventListener=D.None;this.emitter=new R({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}});this.event=this.emitter.event}set input(t){this.inputEvent=t,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=t(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}});var SO,Ae,mc,_t,Jt=v(()=>{xe();ue();Q();SO=Object.freeze(function(r,t){let e=setTimeout(r.bind(t),0);return{dispose(){clearTimeout(e)}}});(i=>{function r(s){return s===i.None||s===i.Cancelled||s instanceof mc?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}i.isCancellationToken=r,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:F.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:SO});function n(s,a){if(s.aborted)return i.Cancelled;let l=a.add(new mc);return a.add(F.once(F.fromDOMEventEmitter(s,"abort"))(()=>l.cancel())),l}i.fromAbortSignal=n,i.toAbortSignal=(s,a)=>{if(s===i.None)return new AbortController().signal;if(s.isCancellationRequested)return AbortSignal.abort(new He);let l=new AbortController;return a.add(s.onCancellationRequested(()=>l.abort(new He))),l.signal}})(Ae||={});mc=class{constructor(){this._isCancelled=!1;this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?SO:(this._emitter||(this._emitter=new R),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},_t=class{constructor(t){this._token=void 0;this._parentListener=void 0;this._parentListener=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new mc),this._token}cancel(){this._token?this._token instanceof mc&&this._token.cancel():this._token=Ae.Cancelled}dispose(t=!1){t&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof mc&&this._token.dispose():this._token=Ae.None}}});var ii=v(()=>{});function s3(r){return r}var Ev,xO=v(()=>{Jt();Ev=class{constructor(t,e){this.lastCache=void 0;this.lastArgKey=void 0;typeof t=="function"?(this._fn=t,this._computeKey=s3):(this._fn=e,this._computeKey=t.getCacheKey)}get(t){let e=this._computeKey(t);return this.lastArgKey!==e&&(this.lastArgKey=e,this.lastCache=this._fn(t)),this.lastCache}}});var Yt,ns=v(()=>{Yt=class{constructor(t){this.executor=t;this._state=0}get hasValue(){return this._state===2}get value(){if(this._state===0){this._state=1;try{this._value=this.executor()}catch(t){this._error=t}finally{this._state=2}}else if(this._state===1)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}});var nR=v(()=>{});function vg(r){return!r||typeof r!="string"?!0:r.trim().length===0}function TO(r,...t){return t.length===0?r:r.replace(l3,function(e,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=t.length?e:t[o]})}function Lr(r,t){return Object.keys(t).length===0?r:r.replace(c3,(e,n)=>t[n]??e)}function wv(r){return r.replace(/[<>"'&]/g,t=>{switch(t){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return t})}function PO(r){return r.replace(/[<>&]/g,function(t){switch(t){case"<":return"<";case">":return">";case"&":return"&";default:return t}})}function yo(r){return r.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function kO(r,t,e=f3){return r.length<=t?r:`${r.substr(0,t)}${e}`}function oR(r,t){if(!r||!t)return r;let e=t.length,n=0;if(e===1){let o=t.charCodeAt(0);for(;n<r.length&&r.charCodeAt(n)===o;)n++}else for(;r.startsWith(t,n);)n+=e;return r.substring(n)}function gc(r,t){if(!r||!t)return r;let e=t.length,n=r.length;if(e===1){let i=n,s=t.charCodeAt(0);for(;i>0&&r.charCodeAt(i-1)===s;)i--;return r.substring(0,i)}let o=n;for(;o>0&&r.endsWith(t,o);)o-=e;return r.substring(0,o)}function AO(r,t,e={}){if(!r)throw new Error("Cannot create regex from empty string");t||(r=yo(r)),e.wholeWord&&(/\B/.test(r.charAt(0))||(r="\\b"+r),/\B/.test(r.charAt(r.length-1))||(r=r+"\\b"));let n="";return e.global&&(n+="g"),e.matchCase||(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),new RegExp(r,n)}function fc(r,t){return r<t?-1:r>t?1:0}function rR(r,t,e=0,n=r.length,o=0,i=t.length){for(;e<n&&o<i;e++,o++){let l=r.charCodeAt(e),c=t.charCodeAt(o);if(l<c)return-1;if(l>c)return 1}let s=n-e,a=i-o;return s<a?-1:s>a?1:0}function Qd(r,t){return hc(r,t,0,r.length,0,t.length)}function hc(r,t,e=0,n=r.length,o=0,i=t.length){for(;e<n&&o<i;e++,o++){let l=r.charCodeAt(e),c=t.charCodeAt(o);if(l===c)continue;if(l>=128||c>=128)return fc(r.substring(e,n).toLowerCase(),t.substring(o,i).toLowerCase());CO(l)&&(l-=32),CO(c)&&(c-=32);let u=l-c;if(u!==0)return u}let s=n-e,a=i-o;return s<a?-1:s>a?1:0}function CO(r){return r>=97&&r<=122}function iR(r){return r>=65&&r<=90}function Po(r,t){return r.length===t.length&&hc(r,t)===0}function $a(r,t){let e=t.length;return e<=r.length&&hc(r,t,0,e)===0}function DO(r,t){let e=r.length,n=e-t.length;return n>=0&&hc(r,t,n,e)===0}function _O(r){return 55296<=r&&r<=56319}function sR(r){return 56320<=r&&r<=57343}function MO(r,t){return(r-55296<<10)+(t-56320)+65536}function m3(r){return!!(r&&r.length>0&&r.charCodeAt(0)===65279)}function LO(r){return m3(r)?r.substr(1):r}function aR(r){return r.charAt(0).toUpperCase()+r.slice(1)}function g3(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}var l3,c3,d3,u3,p3,ale,lle,EO,wO,RO,f3,Tt=v(()=>{xO();ii();ns();nR();l3=/{(\d+)}/g;c3=/{([^}]+)}/g;d3=/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,u3=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,p3=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,ale=new RegExp("(?:"+[d3.source,u3.source,p3.source].join("|")+")","g"),lle=String.fromCharCode(65279);EO=class r{static{this._INSTANCE=null}static getInstance(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this._data=g3()}getGraphemeBreakType(t){if(t<32)return t===10?3:t===13?2:4;if(t<127)return 0;let e=this._data,n=e.length/3,o=1;for(;o<=n;)if(t<e[3*o])o=2*o;else if(t>e[3*o+1])o=2*o+1;else return e[3*o+2];return 0}};wO=class r{constructor(t){this.confusableDictionary=t}static{this.ambiguousCharacterData=new Yt(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new Ev(t=>{let e=t.split(",");function n(p){let m=new Map;for(let g=0;g<p.length;g+=2)m.set(p[g],p[g+1]);return m}function o(p,m){let g=new Map(p);for(let[y,h]of m)g.set(y,h);return g}function i(p,m){if(!p)return m;let g=new Map;for(let[y,h]of p)m.has(y)&&g.set(y,h);return g}let s=this.ambiguousCharacterData.value,a=e.filter(p=>!p.startsWith("_")&&Object.hasOwn(s,p));a.length===0&&(a=["_default"]);let l;for(let p of a){let m=n(s[p]);l=i(l,m)}let c=n(s._common),u=o(c,l);return new r(u)})}static getInstance(t){return r.cache.get(Array.from(t).join(","))}static{this._locales=new Yt(()=>Object.keys(r.ambiguousCharacterData.value).filter(t=>!t.startsWith("_")))}static getLocales(){return r._locales.value}isAmbiguous(t){return this.confusableDictionary.has(t)}containsAmbiguousCharacter(t){for(let e=0;e<t.length;e++){let n=t.codePointAt(e);if(typeof n=="number"&&this.isAmbiguous(n))return!0}return!1}getPrimaryConfusable(t){return this.confusableDictionary.get(t)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},RO=class r{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(r.getRawData())].flat())),this._data}static isInvisibleCharacter(t){return r.getData().has(t)}static containsInvisibleCharacter(t){for(let e=0;e<t.length;e++){let n=t.codePointAt(e);if(typeof n=="number"&&(r.isInvisibleCharacter(n)||n===32))return!0}return!1}static get codePoints(){return r.getData()}},f3="\u2026"});function za(r){return r===47||r===92}function yc(r){return r.replace(/[\\/]/g,ze.sep)}function OO(r){return r.indexOf("/")===-1&&(r=yc(r)),/^[a-zA-Z]:(\/|$)/.test(r)&&(r="/"+r),r}function lR(r,t=ze.sep){if(!r)return"";let e=r.length,n=r.charCodeAt(0);if(za(n)){if(za(r.charCodeAt(1))&&!za(r.charCodeAt(2))){let i=3,s=i;for(;i<e&&!za(r.charCodeAt(i));i++);if(s!==i&&!za(r.charCodeAt(i+1))){for(i+=1;i<e;i++)if(za(r.charCodeAt(i)))return r.slice(0,i+1).replace(/[\\/]/g,t)}}return t}else if(UO(n)&&r.charCodeAt(1)===58)return za(r.charCodeAt(2))?r.slice(0,2)+t:r.slice(0,2);let o=r.indexOf("://");if(o!==-1){for(o+=3;o<e;o++)if(za(r.charCodeAt(o)))return r.slice(0,o+1)}return""}function Ga(r,t,e){let n=r===t;return!e||n?n:!r||!t?!1:Po(r,t)}function tr(r,t,e,n=!1){let o=n?ze.sep:wn;if(r===t)return!0;if(!r||!t||((r.indexOf("..")>=0||t.indexOf("..")>=0)&&(r=n?ze.normalize(r):Fn(r),t=n?ze.normalize(t):Fn(t)),t.length>r.length))return!1;if(e){if(!$a(r,t))return!1;if(t.length===r.length)return!0;let s=t.length;return t.charAt(t.length-1)===o&&s--,r.charAt(s)===o}return t.charAt(t.length-1)!==o&&(t+=o),r.indexOf(t)===0}function UO(r){return r>=65&&r<=90||r>=97&&r<=122}function NO(r){return oe?(r=gc(r,wn),r.endsWith(":")&&(r+=wn)):(r=gc(r,wn),r||(r=wn)),r}function cR(r){let t=Fn(r);return oe?r.length>3?!1:Rv(t)&&(r.length===2||t.charCodeAt(2)===92):t===ze.sep}function Rv(r,t=oe){return t?UO(r.charCodeAt(0))&&r.charCodeAt(1)===58:!1}function FO(r,t,e=8){let n="";for(let i=0;i<e;i++){let s;i===0&&oe&&!t&&(e===3||e===4)?s=y3:s=h3,n+=s.charAt(Math.floor(Math.random()*s.length))}let o;return t?o=`${t}-${n}`:o=n,r?$(r,o):o}var h3,y3,si=v(()=>{ii();Oe();fe();Tt();Ie();h3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",y3="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789"});var Ka=v(()=>{});function x3(r,t){if(!r.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${r.authority}", path: "${r.path}", query: "${r.query}", fragment: "${r.fragment}"}`);if(r.scheme&&!I3.test(r.scheme)){let e=[...r.scheme.matchAll(/[^\w\d+.-]/gu)],n=e.length>0?` Found '${e[0][0]}' at index ${e[0].index} (${e.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${r.scheme.length})`)}if(r.path){if(r.authority){if(!b3.test(r.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(S3.test(r.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function C3(r,t){return!r&&!t?"file":r}function E3(r,t){switch(r){case"https":case"http":case"file":t?t[0]!==Ai&&(t=Ai+t):t=Ai;break}return t}function rs(r){return!r||typeof r!="object"?!1:typeof r.scheme=="string"&&(typeof r.authority=="string"||typeof r.authority>"u")&&(typeof r.path=="string"||typeof r.path>"u")&&(typeof r.query=="string"||typeof r.query>"u")&&(typeof r.fragment=="string"||typeof r.fragment>"u")}function HO(r,t,e){let n,o=-1;for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||t&&s===47||e&&s===91||e&&s===93||e&&s===58)o!==-1&&(n+=encodeURIComponent(r.substring(o,i)),o=-1),n!==void 0&&(n+=r.charAt(i));else{n===void 0&&(n=r.substr(0,i));let a=BO[s];a!==void 0?(o!==-1&&(n+=encodeURIComponent(r.substring(o,i)),o=-1),n+=a):o===-1&&(o=i)}}return o!==-1&&(n+=encodeURIComponent(r.substring(o))),n!==void 0?n:r}function R3(r){let t=r.indexOf("?"),e=r.indexOf("#");if((t===-1||e!==-1&&e<t)&&(t=e),t===-1)return r;let n=r.substring(0,t),o=t;for(;t<r.length;t++){let i=r.charCodeAt(t);(i===35||i===63)&&(o<t&&(n+=r.substring(o,t)),n+=BO[i],o=t+1)}return o<r.length&&(n+=r.substring(o)),n}function Jd(r,t){let e;return r.authority&&r.path.length>1&&r.scheme==="file"?e=`//${r.authority}${r.path}`:r.path.charCodeAt(0)===47&&(r.path.charCodeAt(1)>=65&&r.path.charCodeAt(1)<=90||r.path.charCodeAt(1)>=97&&r.path.charCodeAt(1)<=122)&&r.path.charCodeAt(2)===58?t?e=r.path.substr(1):e=r.path[1].toLowerCase()+r.path.substr(2):e=r.path,oe&&(e=e.replace(/\//g,"\\")),e}function dR(r,t){let e=t?R3:HO,n="",{scheme:o,authority:i,path:s,query:a,fragment:l}=r;if(o&&(n+=o,n+=":"),(i||o==="file")&&(n+=Ai,n+=Ai),i){let c=i.indexOf("@");if(c!==-1){let u=i.substr(0,c);i=i.substr(c+1),c=u.indexOf(":"),c===-1?n+=e(u,!1,!1):(n+=e(u.substr(0,c),!1,!1),n+=":",n+=e(u.substr(c+1),!1,!1)),n+="@"}i=i.toLowerCase(),c=i.lastIndexOf(":"),c===-1?n+=e(i,!1,!0):(n+=e(i.substr(0,c),!1,!0),n+=i.substr(c))}if(s){let c=o.toLowerCase();if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){let u=s.charCodeAt(1);u>=65&&u<=90&&c!=="http"&&c!=="https"&&(s=`/${String.fromCharCode(u+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){let u=s.charCodeAt(0);u>=65&&u<=90&&c!=="http"&&c!=="https"&&(s=`${String.fromCharCode(u+32)}:${s.substr(2)}`)}n+=e(s,!0,!1)}return a&&(n+="?",n+=e(a,!1,!1)),l&&(n+="#",n+=t?l:HO(l,!1,!1)),n}function qO(r){try{return decodeURIComponent(r)}catch{return r.length>3?r.substr(0,3)+qO(r.substr(3)):r}}function Tv(r){return r.match(WO)?r.replace(WO,t=>qO(t)):r}var I3,b3,S3,an,Ai,w3,S,VO,ja,BO,WO,te=v(()=>{ii();Ka();Oe();fe();I3=/^\w[\w\d+.-]*$/,b3=/^\//,S3=/^\/\//;an="",Ai="/",w3=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,S=class r{static isUri(t){return t instanceof r?!0:!t||typeof t!="object"?!1:typeof t.authority=="string"&&typeof t.fragment=="string"&&typeof t.path=="string"&&typeof t.query=="string"&&typeof t.scheme=="string"&&typeof t.fsPath=="string"&&typeof t.with=="function"&&typeof t.toString=="function"}constructor(t,e,n,o,i,s=!1){typeof t=="object"?(this.scheme=t.scheme||an,this.authority=t.authority||an,this.path=t.path||an,this.query=t.query||an,this.fragment=t.fragment||an):(this.scheme=C3(t,s),this.authority=e||an,this.path=E3(this.scheme,n||an),this.query=o||an,this.fragment=i||an,x3(this,s))}get fsPath(){return Jd(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:n,path:o,query:i,fragment:s}=t;return e===void 0?e=this.scheme:e===null&&(e=an),n===void 0?n=this.authority:n===null&&(n=an),o===void 0?o=this.path:o===null&&(o=an),i===void 0?i=this.query:i===null&&(i=an),s===void 0?s=this.fragment:s===null&&(s=an),e===this.scheme&&n===this.authority&&o===this.path&&i===this.query&&s===this.fragment?this:new ja(e,n,o,i,s)}static parse(t,e=!1){let n=w3.exec(t);return n?new ja(n[2]||an,Tv(n[4]||an),Tv(n[5]||an),Tv(n[7]||an),Tv(n[9]||an),e):new ja(an,an,an,an,an)}static file(t){let e=an;if(oe&&(t=t.replace(/\\/g,Ai)),t[0]===Ai&&t[1]===Ai){let n=t.indexOf(Ai,2);n===-1?(e=t.substring(2),t=Ai):(e=t.substring(2,n),t=t.substring(n)||Ai)}return new ja("file",e,t,an,an)}static from(t,e){return new ja(t.scheme,t.authority,t.path,t.query,t.fragment,e)}static joinPath(t,...e){if(!t.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${t.toString()}`);let n;return oe&&t.scheme==="file"?n=r.file(ln.join(Jd(t,!0),...e)).path:n=ze.join(t.path,...e),t.with({path:n})}toString(t=!1){return dR(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof r)return t;{let e=new ja(t);return e._formatted=t.external??null,e._fsPath=t._sep===VO?t.fsPath??null:null,e}}else return t}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};VO=oe?1:void 0,ja=class extends S{constructor(){super(...arguments);this._formatted=null;this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Jd(this,!1)),this._fsPath}toString(e=!1){return e?dR(this,!0):(this._formatted||(this._formatted=dR(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=VO),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},BO={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};WO=/(%[0-9A-Za-z][0-9A-Za-z])+/g});function mR(r){return`${r.quality??"oss"}-${r.commit??"dev"}`}var q,bg,is,uR,$O,zO,Pv,GO,KO,Sg,pR,Pt,Ele,wle,T3,Me=v(()=>{xe();fe();Tt();te();Oe();Q();(ke=>(ke.inMemory="inmemory",ke.vscode="vscode",ke.internal="private",ke.walkThrough="walkThrough",ke.walkThroughSnippet="walkThroughSnippet",ke.vscodeOnboardingSample="vscode-onboarding-sample",ke.http="http",ke.https="https",ke.file="file",ke.mailto="mailto",ke.untitled="untitled",ke.data="data",ke.command="command",ke.vscodeRemote="vscode-remote",ke.vscodeRemoteResource="vscode-remote-resource",ke.vscodeManagedRemoteResource="vscode-managed-remote-resource",ke.vscodeUserData="vscode-userdata",ke.vscodeCustomEditor="vscode-custom-editor",ke.vscodeWindowCanvas="vscode-window-canvas",ke.vscodeNotebookCell="vscode-notebook-cell",ke.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",ke.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",ke.vscodeNotebookCellOutput="vscode-notebook-cell-output",ke.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",ke.vscodeNotebookMetadata="vscode-notebook-metadata",ke.vscodeInteractiveInput="vscode-interactive-input",ke.vscodeSettings="vscode-settings",ke.vscodeWorkspaceTrust="vscode-workspace-trust",ke.vscodeTerminal="vscode-terminal",ke.vscodeImageCarousel="vscode-image-carousel",ke.vscodeChatCodeBlock="vscode-chat-code-block",ke.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",ke.vscodeChatEditor="vscode-chat-editor",ke.vscodeChatInput="chatSessionInput",ke.sessionsChatInput="sessions-chat",ke.vscodeLocalChatSession="vscode-chat-session",ke.vscodeChatResponseResource="vscode-chat-response-resource",ke.agentHostTerminal="agenthost-terminal",ke.vscodeChatTerminalOutput="vscode-chat-terminal-output",ke.webviewPanel="webview-panel",ke.vscodeWebview="vscode-webview",ke.vscodeBrowser="vscode-browser",ke.extension="extension",ke.vscodeFileResource="vscode-file",ke.tmp="tmp",ke.vsls="vsls",ke.git="git",ke.vscodeSourceControl="vscode-scm",ke.commentsInput="comment",ke.codeSetting="code-setting",ke.outputChannel="output",ke.accessibleView="accessible-view",ke.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",ke.chatEditingModel="chat-editing-text-model",ke.copilotPr="copilot-pr"))(q||={});bg="vscode-tkn",is="tkn",uR=class{constructor(){this._hosts=Object.create(null);this._ports=Object.create(null);this._connectionTokens=Object.create(null);this._preferredWebSchema="http";this._delegate=null;this._serverRootPath="/"}setPreferredWebSchema(t){this._preferredWebSchema=t}setDelegate(t){this._delegate=t}setServerRootPath(t,e){this._serverRootPath=ze.join(e??"/",mR(t))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return ze.join(this._serverRootPath,q.vscodeRemoteResource)}set(t,e,n){this._hosts[t]=e,this._ports[t]=n}setConnectionToken(t,e){this._connectionTokens[t]=e}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(t){if(this._delegate)try{return this._delegate(t)}catch(a){return V0(a),t}let e=t.authority,n=this._hosts[e];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[e],i=this._connectionTokens[e],s=`path=${encodeURIComponent(t.path)}`;return typeof i=="string"&&(s+=`&${is}=${encodeURIComponent(i)}`),S.from({scheme:bn?this._preferredWebSchema:q.vscodeRemoteResource,authority:`${n}:${o}`,path:bn?(window.location.pathname+"/"+this._remoteResourcesPath).replace(/\/\/+/g,"/"):this._remoteResourcesPath,query:s})}},$O=new uR;zO="vs/../../extensions",Pv="vs/../../node_modules",GO="vs/../../node_modules.asar",KO="vs/../../node_modules.asar.unpacked",Sg="vscode-app",pR=class r{constructor(){this.browserUriProviders=new Map}static{this.FALLBACK_AUTHORITY=Sg}registerBrowserUriProvider(t,e){if(this.browserUriProviders.has(t))throw new Error(`Browser URI provider already registered for ${t}`);return this.browserUriProviders.set(t,e),se(()=>this.browserUriProviders.delete(t))}resolveBrowserUri(t){return this.browserUriProviders.get(t.scheme)?.resolve(t)}asBrowserUri(t){let e=this.toUri(t);return this.uriToBrowserUri(e)}uriToBrowserUri(t){let e=this.browserUriProviders.get(t.scheme);return e?.uriToBrowserUri?e.uriToBrowserUri(t):t.scheme===q.vscodeRemote?$O.rewrite(t):t.scheme===q.file&&(dg||M0===`${q.vscodeFileResource}://${r.FALLBACK_AUTHORITY}`)?t.with({scheme:q.vscodeFileResource,authority:t.authority||r.FALLBACK_AUTHORITY,query:null,fragment:null}):t}asFileUri(t){let e=this.toUri(t);return this.uriToFileUri(e)}uriToFileUri(t){return t.scheme===q.vscodeFileResource?t.with({scheme:q.file,authority:t.authority!==r.FALLBACK_AUTHORITY?t.authority:null,query:null,fragment:null}):t}toUri(t){if(S.isUri(t))return t;if(globalThis._VSCODE_FILE_ROOT){let e=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(e))return S.joinPath(S.parse(e,!0),t);let n=$(e,t);return S.file(n)}throw new Error("Cannot determine URI for module id!")}},Pt=new pR,Ele=Object.freeze({"Cache-Control":"no-cache, no-store"}),wle=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});(i=>{let r=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(r.get("3"));let e="vscode-coi";function n(s){let a;typeof s=="string"?a=new URL(s).searchParams:s instanceof URL?a=s.searchParams:S.isUri(s)&&(a=new URL(s.toString(!0)).searchParams);let l=a?.get(e);if(l)return r.get(l)}i.getHeadersFromQuery=n;function o(s,a,l){if(!globalThis.crossOriginIsolated)return;let c=a&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(e,c):s[e]=c}i.addSearchParam=o})(T3||={})});function Di(r){return Jd(r,!0)}var vc,gt,Qa,fR,Tn,Bs,QO,P3,xn,xg,Xd,ge,hR,_le,k3,JO,gR,jO,Mle,Lle,A3,it=v(()=>{ii();si();Me();Oe();fe();Tt();te();vc=class{constructor(t){this._ignorePathCasing=t}compare(t,e,n=!1){return t===e?0:fc(this.getComparisonKey(t,n),this.getComparisonKey(e,n))}isEqual(t,e,n=!1){return t===e?!0:!t||!e?!1:this.getComparisonKey(t,n)===this.getComparisonKey(e,n)}getComparisonKey(t,e=!1){return t.with({path:this._ignorePathCasing(t)?t.path.toLowerCase():void 0,fragment:e?null:void 0}).toString()}ignorePathCasing(t){return this._ignorePathCasing(t)}isEqualOrParent(t,e,n=!1,o=!1){if(t.scheme===e.scheme){if(t.scheme===q.file)return tr(Di(t),Di(e),this._ignorePathCasing(t))&&t.query===e.query&&(n||t.fragment===e.fragment);if(gR(t.authority,e.authority)){let i=this._ignorePathCasing(t);if(!tr(t.path,e.path,i,!0))return!1;if(!o&&(t.path.includes("\\")||e.path.includes("\\"))){let s=yc(ln.normalize(Di(t))),a=yc(ln.normalize(Di(e)));if(!tr(s,a,i,!0))return!1}return t.query===e.query&&(n||t.fragment===e.fragment)}}return!1}joinPath(t,...e){return S.joinPath(t,...e)}basenameOrAuthority(t){return xn(t)||t.authority}basename(t,e){return ze.basename(t.path,e)}extname(t){return ze.extname(t.path)}dirname(t){if(t.path.length===0)return t;let e;return t.scheme===q.file?e=S.file(It(Di(t))).path:(e=ze.dirname(t.path),t.authority&&e.length&&e.charCodeAt(0)!==47&&(console.error(`dirname("${t.toString})) resulted in a relative path`),e="/")),t.with({path:e})}normalizePath(t){if(!t.path.length)return t;let e;return t.scheme===q.file?e=S.file(Fn(Di(t))).path:e=ze.normalize(t.path),t.with({path:e})}relativePath(t,e){if(t.scheme!==e.scheme||!gR(t.authority,e.authority))return;if(t.scheme===q.file){let i=Hs(Di(t),Di(e));return oe?yc(i):i}let n=t.path||"/",o=e.path||"/";if(this._ignorePathCasing(t)){let i=0;for(let s=Math.min(n.length,o.length);i<s&&!(n.charCodeAt(i)!==o.charCodeAt(i)&&n.charAt(i).toLowerCase()!==o.charAt(i).toLowerCase());i++);n=o.substr(0,i)+n.substr(i)}return ze.relative(n,o)}resolvePath(t,e){if(t.scheme===q.file){let n=S.file(Sn(Di(t),e));return t.with({authority:n.authority,path:n.path})}return e=OO(e),t.with({path:ze.resolve(t.path,e)})}isAbsolutePath(t){return!!t.path&&t.path[0]==="/"}isEqualAuthority(t,e){return t===e||t!==void 0&&e!==void 0&&Po(t,e)}hasTrailingPathSeparator(t,e=wn){if(t.scheme===q.file){let n=Di(t);return n.length>lR(n).length&&n[n.length-1]===e}else{let n=t.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(t.fsPath)}}removeTrailingPathSeparator(t,e=wn){return jO(t,e)?t.with({path:t.path.substr(0,t.path.length-1)}):t}addTrailingPathSeparator(t,e=wn){let n=!1;if(t.scheme===q.file){let o=Di(t);n=o!==void 0&&o.length===lR(o).length&&o[o.length-1]===e}else{e="/";let o=t.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!jO(t,e)?t.with({path:t.path+"/"}):t}},gt=new vc(()=>!1),Qa=new vc(r=>r.scheme===q.file?!Ke:!0),fR=new vc(r=>!0),Tn=gt.isEqual.bind(gt),Bs=gt.isEqualOrParent.bind(gt),QO=gt.getComparisonKey.bind(gt),P3=gt.basenameOrAuthority.bind(gt),xn=gt.basename.bind(gt),xg=gt.extname.bind(gt),Xd=gt.dirname.bind(gt),ge=gt.joinPath.bind(gt),hR=gt.normalizePath.bind(gt),_le=gt.relativePath.bind(gt),k3=gt.resolvePath.bind(gt),JO=gt.isAbsolutePath.bind(gt),gR=gt.isEqualAuthority.bind(gt),jO=gt.hasTrailingPathSeparator.bind(gt),Mle=gt.removeTrailingPathSeparator.bind(gt),Lle=gt.addTrailingPathSeparator.bind(gt);(i=>{i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function o(s){let a=new Map;s.path.substring(s.path.indexOf(";")+1,s.path.lastIndexOf(";")).split(";").forEach(u=>{let[p,m]=u.split(":");p&&m&&a.set(p,m)});let c=s.path.substring(0,s.path.indexOf(";"));return c&&a.set(i.META_DATA_MIME,c),a}i.parseMetaData=o})(A3||={})});var YO,XO=v(()=>{YO=Symbol("MicrotaskDelay")});function wg(r){return!!r&&typeof r.then=="function"}function or(r){let t=new _t,e=r(t.token),n=!1,o=new Promise((i,s)=>{let a=t.token.onCancellationRequested(()=>{n=!0,a.dispose(),s(new He)});Promise.resolve(e).then(l=>{a.dispose(),t.dispose(),n?bv(l)&&l.dispose():i(l)},l=>{a.dispose(),t.dispose(),s(l)})});return new class{cancel(){t.cancel(),t.dispose()}then(i,s){return o.then(i,s)}catch(i){return this.then(void 0,i)}finally(i){return o.finally(i)}}}function bR(r,t){return new Promise((e,n)=>{let o=t.onCancellationRequested(()=>{o.dispose(),n(new He)});r.then(e,n).finally(()=>o.dispose())})}function _v(r,t,e){let n,o=setTimeout(()=>{n?.(void 0),e?.()},t);return Promise.race([r.finally(()=>clearTimeout(o)),new Promise(i=>n=i)])}function SR(){let r,t;return{promise:new Promise((n,o)=>{r=n,t=o}),resolve:r,reject:t}}function ko(r,t){return t?new Promise((e,n)=>{let o=setTimeout(()=>{i.dispose(),e()},r),i=t.onCancellationRequested(()=>{clearTimeout(o),i.dispose(),n(new He)})}):or(e=>ko(r,e))}async function tU(r,t,e){let n;for(let o=0;o<e;o++)try{return await r()}catch(i){n=i,await ko(t)}throw n}var yR,Zd,Ja,D3,_3,Cg,Or,Ur,Qle,Eg,Nr,eu,nr,Ic,Av,tu,xR,kv,vR,Dv,jn,Pn,ZO,IR,eU,Ue=v(()=>{Jt();xe();ue();Q();it();fe();XO();ns();yR=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new _t}queue(t){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=t,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise((n,o)=>{this.activePromise.then(e,e).then(n,o)})}return new Promise((e,n)=>{this.queuedPromise.then(e,n)})}return this.activePromise=t(this.cancellationTokenSource.token),new Promise((e,n)=>{this.activePromise.then(o=>{this.activePromise=null,e(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel(),this.queuedPromiseFactory=null}},Zd=class{constructor(){this.current=Promise.resolve(null)}queue(t){return this.current=this.current.then(()=>t(),()=>t())}},Ja=class{constructor(){this.promiseMap=new Map}queue(t,e){let o=(this.promiseMap.get(t)??Promise.resolve()).catch(()=>{}).then(e).finally(()=>{this.promiseMap.get(t)===o&&this.promiseMap.delete(t)});return this.promiseMap.set(t,o),o}peek(t){return this.promiseMap.get(t)||void 0}keys(){return this.promiseMap.keys()}},D3=(r,t)=>{let e=!0,n=setTimeout(()=>{e=!1,t()},r);return{isTriggered:()=>e,dispose:()=>{clearTimeout(n),e=!1}}},_3=r=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,r())}),{isTriggered:()=>t,dispose:()=>{t=!1}}},Cg=class{constructor(t){this.defaultDelay=t;this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(t,e=this.defaultDelay){if(this.task=t,this.cancelTimeout(),!this.completionPromise){let o=new Promise((i,s)=>{this.doResolve=i,this.doReject=s}).then(()=>{if(this.completionPromise!==o)throw new He;this.completionPromise=null,this.doResolve=null;let i=this.task;return this.task=null,i()});this.completionPromise=o}let n=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=e===YO?_3(n):D3(e,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.task=null,this.completionPromise&&(this.doReject?.(new He),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},Or=class{constructor(t){this.delayer=new Cg(t),this.throttler=new yR}trigger(t,e){return this.delayer.trigger(()=>this.throttler.queue(t),e)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},Ur=class{constructor(){this._isOpen=!1,this._promise=new Promise((t,e)=>{this._completePromise=t})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Qle=2**31-1,Eg=class{constructor(t){this._size=0;this._isDisposed=!1;this.maxDegreeOfParalellism=t,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new R}whenIdle(){return this.size>0?F.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(t){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((e,n)=>{this.outstandingPromises.push({factory:t,c:e,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){let t=this.outstandingPromises.shift();this.runningPromises++;let e=t.factory();e.then(t.c,t.e),e.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}},Nr=class extends Eg{constructor(){super(1)}},eu=class{constructor(){this.queues=new Map;this.drainers=new Set;this.drainListeners=void 0;this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let t=new jn;return this.drainers.add(t),t.p}isDrained(){for(let[,t]of this.queues)if(t.size>0)return!1;return!0}queueSize(t,e=gt){let n=e.getComparisonKey(t);return this.queues.get(n)?.size??0}queueFor(t,e,n=gt){let o=n.getComparisonKey(t),i=this.queues.get(o);if(!i){i=new Nr;let s=this.drainListenerCount++,a=F.once(i.onDrained)(()=>{i?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(s),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Wo),this.drainListeners.set(s,a),this.queues.set(o,i)}return i.queue(e)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let t of this.drainers)t.complete();this.drainers.clear()}dispose(){for(let[,t]of this.queues)t.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}},nr=class{constructor(t,e){this.timeoutToken=void 0,this.runner=t,this.timeout=e,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(t=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,t)}get delay(){return this.timeout}set delay(t){this.timeout=t}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}},Ic=class{constructor(t,e){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.runner=t,this.timeout=e,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(t=this.timeout){t%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${t}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(t/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}},Av=class extends nr{constructor(e,n){super(e,n);this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}},tu=class extends D{constructor(e,n){super();this.options=e;this.handler=n;this.pendingWork=[];this.throttler=this._register(new Kn);this.disposed=!1;this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let o of e)this.pendingWork.push(o);let n=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||n>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-n,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new nr(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};(function(){let r=globalThis;typeof r.requestIdleCallback!="function"||typeof r.cancelIdleCallback!="function"?kv=(t,e,n)=>{U0(()=>{if(o)return;let i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:kv=(t,e,n)=>{let o=t.requestIdleCallback(e,typeof n=="number"?{timeout:n}:void 0),i=!1;return{dispose(){i||(i=!0,t.cancelIdleCallback(o))}}},xR=(t,e)=>kv(globalThis,t,e)})();vR=class{constructor(t,e){this._didRun=!1;this._executor=()=>{try{this._value=e()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=kv(t,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},Dv=class extends vR{constructor(t){super(globalThis,t)}};jn=class r{static fromPromise(t){let e=new r;return e.settleWith(t),e}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((t,e)=>{this.completeCallback=t,this.errorCallback=e})}complete(t){return this.isSettled?Promise.resolve():new Promise(e=>{this.completeCallback(t),this.outcome={outcome:0,value:t},e()})}error(t){return this.isSettled?Promise.resolve():new Promise(e=>{this.errorCallback(t),this.outcome={outcome:1,value:t},e()})}settleWith(t){return t.then(e=>this.complete(e),e=>this.error(e))}cancel(){return this.error(new He)}};(e=>{async function r(n){let o,i=await Promise.all(n.map(s=>s.then(a=>a,a=>{o||(o=a)})));if(typeof o<"u")throw o;return i}e.settled=r;function t(n){return new Promise(async(o,i)=>{try{await n(o,i)}catch(s){i(s)}})}e.withAsyncBody=t})(Pn||={});ZO=class r{static fromArray(t){return new r(e=>{e.emitMany(t)})}static fromPromise(t){return new r(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new r(async e=>{await Promise.all(t.map(async n=>e.emitOne(await n)))})}static merge(t){return new r(async e=>{await Promise.all(t.map(async n=>{for await(let o of n)e.emitOne(o)}))})}static{this.EMPTY=r.fromArray([])}constructor(t,e){this._state=0,this._results=[],this._error=null,this._onReturn=e,this._onStateChanged=new R,queueMicrotask(async()=>{let n={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=()=>{},n.emitMany=()=>{},n.reject=()=>{}}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await F.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,e){return new r(async n=>{for await(let o of t)n.emitOne(e(o))})}map(t){return r.map(this,t)}static filter(t,e){return new r(async n=>{for await(let o of t)e(o)&&n.emitOne(o)})}filter(t){return r.filter(this,t)}static coalesce(t){return r.filter(t,e=>!!e)}coalesce(){return r.coalesce(this)}static async toPromise(t){let e=[];for await(let n of t)e.push(n);return e}toPromise(){return r.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}},IR=class{constructor(){this._unsatisfiedConsumers=[];this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(t){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let e=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(e,t)}else this._unconsumedValues.push(t)}produceFinal(t){this._ensureNoFinalValue(),this._finalValue=t;for(let e of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(e,t);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new Et("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(t,e){e.ok?t.complete(e.value):t.error(e.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let t=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return t.ok?Promise.resolve(t.value):Promise.reject(t.error)}else{let t=new jn;return this._unsatisfiedConsumers.push(t),t.p}}},eU=class r{constructor(t,e){this._onReturn=e;this._producerConsumer=new IR;this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async t=>(this._finishError(t),{done:!0,value:void 0})};queueMicrotask(async()=>{let n=t({emitOne:o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),emitMany:o=>{for(let i of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}})},reject:o=>this._finishError(o)});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(t){return new r(e=>{e.emitMany(t)})}static fromPromise(t){return new r(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new r(async e=>{await Promise.all(t.map(async n=>e.emitOne(await n)))})}static merge(t){return new r(async e=>{await Promise.all(t.map(async n=>{for await(let o of n)e.emitOne(o)}))})}static{this.EMPTY=r.fromArray([])}static map(t,e){return new r(async n=>{for await(let o of t)n.emitOne(e(o))})}static tee(t){let e,n,o=new jn,i=async()=>{if(!(!e||!n))try{for await(let l of t)e.emitOne(l),n.emitOne(l)}catch(l){e.reject(l),n.reject(l)}finally{o.complete()}},s=new r(async l=>(e=l,i(),o.p)),a=new r(async l=>(n=l,i(),o.p));return[s,a]}map(t){return r.map(this,t)}static coalesce(t){return r.filter(t,e=>!!e)}coalesce(){return r.coalesce(this)}static filter(t,e){return new r(async n=>{for await(let o of t)e(o)&&n.emitOne(o)})}filter(t){return r.filter(this,t)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(t){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:t})}[Symbol.asyncIterator](){return this._iterator}}});function Rg(r){return nU(r,"NFC",M3)}function O3(r){return nU(r,"NFD",L3)}function nU(r,t,e){if(!r)return r;let n=e.get(r);if(n)return n;let o;return U3.test(r)?o=r.normalize(t):o=r,e.set(r,o),o}var M3,L3,U3,N3,Mv=v(()=>{fn();M3=new ti(1e4);L3=new ti(1e4);U3=/[^\u0000-\u0080]/;N3=(function(){let r=new ti(1e4),t=/[\u0300-\u036f]/g;return function(e){let n=r.get(e);if(n)return n;let o=O3(e).replace(t,""),i=(o.length===e.length?o:e).toLowerCase();return r.set(e,i),i}})()});import*as Ne from"fs";import{tmpdir as F3}from"os";import{promisify as bc}from"util";async function iU(r,t=0,e){if(cR(r))throw new Error("rimraf - will refuse to recursively delete root");return t===0?CR(r):H3(r,e)}async function H3(r,t=FO(F3())){try{try{await Ne.promises.rename(r,t)}catch(e){return e.code==="ENOENT"?void 0:CR(r)}CR(t).catch(()=>{})}catch(e){if(e.code!=="ENOENT")throw e}}async function CR(r){return Ne.promises.rm(r,{recursive:!0,force:!0,maxRetries:3})}async function Lv(r,t){try{return await oU(r,t)}catch(e){if(e.code==="ENOENT"&&oe&&cR(r))try{return await oU(`${r}.`,t)}catch{}throw e}}async function oU(r,t){return V3(await(t?W3(r):Ne.promises.readdir(r)))}async function W3(r){try{return await Ne.promises.readdir(r,{withFileTypes:!0})}catch(n){n.code!=="ENOENT"&&console.warn("[node.js fs] readdir with filetypes failed with error: ",n)}let t=[],e=await Lv(r);for(let n of e){let o=!1,i=!1,s=!1;try{let a=await Ne.promises.lstat($(r,n));o=a.isFile(),i=a.isDirectory(),s=a.isSymbolicLink()}catch(a){a.code!=="ENOENT"&&console.warn("[node.js fs] unexpected error from lstat after readdir: ",a)}t.push({name:n,isFile:()=>o,isDirectory:()=>i,isSymbolicLink:()=>s})}return t}function V3(r){return r.map(t=>typeof t=="string"?vt?Rg(t):t:(t.name=vt?Rg(t.name):t.name,t))}async function B3(r){let t=await Lv(r),e=[];for(let n of t)await Ao.existsDirectory($(r,n))&&e.push(n);return e}function $3(r,t,e){return q3.queueFor(S.file(r),()=>{let n=K3(e);return new Promise((o,i)=>G3(r,t,n,s=>s?i(s):o()))},Qa)}function z3(r){sU=r}function G3(r,t,e,n){if(!sU)return Ne.writeFile(r,t,{mode:e.mode,flag:e.flag},n);Ne.open(r,e.flag,e.mode,(o,i)=>{if(o)return n(o);Ne.writeFile(i,t,s=>{if(s)return Ne.close(i,()=>n(s));Ne.fdatasync(i,a=>(a&&(console.warn("[node.js fs] fdatasync is now disabled for this session because it failed: ",a),z3(!1)),Ne.close(i,l=>n(l))))})})}function K3(r){return r?{mode:typeof r.mode=="number"?r.mode:438,flag:typeof r.flag=="string"?r.flag:"w"}:{mode:438,flag:"w"}}async function j3(r,t,e=6e4){if(r!==t)try{await aU(r,t,e)}catch(n){if(r.toLowerCase()!==t.toLowerCase()&&n.code==="EXDEV"||r.endsWith("."))await cU(r,t,{preserveSymlinks:!1}),await iU(r,1);else throw n}}async function aU(r,t,e=6e4,n=Ne.promises.rename){r!==t&&(oe&&typeof e=="number"?await lU(r,t,Date.now(),e,0,n):await n(r,t))}async function lU(r,t,e,n,o,i){try{return await i(r,t)}catch(s){if(s.code!=="EACCES"&&s.code!=="EPERM"&&s.code!=="EBUSY")throw s;if(Date.now()-e>=n)throw console.error(`[node.js fs] rename failed after ${o} retries with error: ${s}`),s;if(o===0){let a=!1;try{let{stat:l}=await Ao.stat(t);l.isFile()||(a=!0)}catch{}if(a)throw s}return await ko(Math.min(100,o*10)),lU(r,t,e,n,o+1,i)}}async function cU(r,t,e){return dU(r,t,{root:{source:r,target:t},options:e,handledSourcePaths:new Set})}async function dU(r,t,e){if(e.handledSourcePaths.has(r))return;e.handledSourcePaths.add(r);let{stat:n,symbolicLink:o}=await Ao.stat(r);if(o){if(e.options.preserveSymlinks)try{return await Y3(r,t,e)}catch{}if(o.dangling)return}return n.isDirectory()?Q3(r,t,n.mode&rU,e):J3(r,t,n.mode&rU)}async function Q3(r,t,e,n){await Ne.promises.mkdir(t,{recursive:!0,mode:e});let o=await Lv(r);for(let i of o)await dU($(r,i),$(t,i),n)}async function J3(r,t,e){await Ne.promises.copyFile(r,t),await Ne.promises.chmod(t,e)}async function Y3(r,t,e){let n=await Ne.promises.readlink(r);tr(n,e.root.source,!Ke)&&(n=$(e.root.target,n.substr(e.root.source.length+1))),await Ne.promises.symlink(n,t)}async function X3(r,t){try{return await bc(Ne.realpath)(r)}catch(e){if(t?.strict)throw e;let n=Z3(r);return await Ne.promises.access(n,Ne.constants.R_OK),n}}function Z3(r){return gc(Fn(r),wn)}var Ao,q3,sU,rU,Ce,vo=v(()=>{Ue();si();Mv();Oe();fe();it();te();Tt();(n=>{async function r(o){let i;try{if(i=await Ne.promises.lstat(o),!i.isSymbolicLink())return{stat:i}}catch{}try{return{stat:await Ne.promises.stat(o),symbolicLink:i?.isSymbolicLink()?{dangling:!1}:void 0}}catch(s){if(s.code==="ENOENT"&&i)return{stat:i,symbolicLink:{dangling:!0}};if(oe&&s.code==="EACCES")try{return{stat:await Ne.promises.stat(await Ne.promises.readlink(o)),symbolicLink:{dangling:!1}}}catch(a){if(a.code==="ENOENT"&&i)return{stat:i,symbolicLink:{dangling:!0}};throw a}throw s}}n.stat=r;async function t(o){try{let{stat:i,symbolicLink:s}=await n.stat(o);return i.isFile()&&s?.dangling!==!0}catch{}return!1}n.existsFile=t;async function e(o){try{let{stat:i,symbolicLink:s}=await n.stat(o);return i.isDirectory()&&s?.dangling!==!0}catch{}return!1}n.existsDirectory=e})(Ao||={});q3=new eu;sU=!0;rU=511;Ce=new class{get read(){return(r,t,e,n,o)=>new Promise((i,s)=>{Ne.read(r,t,e,n,o,(a,l,c)=>a?s(a):i({bytesRead:l,buffer:c}))})}get write(){return(r,t,e,n,o)=>new Promise((i,s)=>{Ne.write(r,t,e,n,o,(a,l,c)=>a?s(a):i({bytesWritten:l,buffer:c}))})}get readFile(){return bc(Ne.readFile)}get fdatasync(){return bc(Ne.fdatasync)}get fstat(){return bc(Ne.fstat)}get open(){return bc(Ne.open)}get close(){return bc(Ne.close)}get ftruncate(){return bc(Ne.ftruncate)}async getFreeDiskSpace(r){for(r=Sn(r);;)try{let{bavail:t,bsize:e}=await Ne.promises.statfs(r);return t*e}catch(t){let e=It(r);if(t.code!=="ENOENT"||e===r)throw t;r=e}}async exists(r){try{return await Ne.promises.access(r),!0}catch{return!1}}get readdir(){return Lv}get readDirsInDir(){return B3}get writeFile(){return $3}get rm(){return iU}get rename(){return j3}get renameAtomic(){return aU}get copy(){return cU}get realpath(){return X3}}});import{promises as qs}from"fs";async function Pg({userLocale:r,osLocale:t,userDataPath:e,commit:n,nlsMetadataPath:o,nlsMetadataHash:i}){if(qt("code/willGenerateNls"),process.env.VSCODE_DEV||r==="pseudo"||r.startsWith("en")||!n||!e)return Tg(r,t,o);try{let s=await eG(e);if(!s)return Tg(r,t,o);let a=tG(s,r);if(!a)return Tg(r,t,o);let l=s[a],c=l?.translations?.vscode;if(!l||typeof l.hash!="string"||!l.translations||typeof c!="string"||!await Ce.exists(c))return Tg(r,t,o);let u=`${l.hash}.${a}`,p=$(e,"clp",u),m=$(p,i??n),g=$(m,"nls.messages.json"),y=$(p,"tcf.json"),h=$(p,"corrupted.info");await Ce.exists(h)&&await qs.rm(p,{recursive:!0,force:!0,maxRetries:3});let I={userLocale:r,osLocale:t,resolvedLanguage:a,defaultMessagesFile:$(o,"nls.messages.json"),languagePack:{translationsConfigFile:y,messagesFile:g,corruptMarkerFile:h},locale:r,availableLanguages:{"*":a},_languagePackId:u,_languagePackSupport:!0,_translationsConfigFile:y,_cacheRoot:p,_resolvedLanguagePackCoreLocation:m,_corruptedFile:h};if(await Ce.exists(g))return nG(m).catch(()=>{}),qt("code/didGenerateNls"),I;let[x,E,T]=await Promise.all([qs.readFile($(o,"nls.keys.json"),"utf-8").then(X=>JSON.parse(X)),qs.readFile($(o,"nls.messages.json"),"utf-8").then(X=>JSON.parse(X)),qs.readFile(c,"utf-8").then(X=>JSON.parse(X))]),P=[],M=0;for(let[X,N]of x){let ae=T.contents[X];for(let Y of N)P.push(ae?.[Y]||E[M]),M++}return await qs.mkdir(m,{recursive:!0}),await Promise.all([qs.writeFile(g,JSON.stringify(P),"utf-8"),qs.writeFile(y,JSON.stringify(l.translations),"utf-8")]),qt("code/didGenerateNls"),I}catch(s){console.error("Generating translation files failed.",s)}return Tg(r,t,o)}async function eG(r){let t=$(r,"languagepacks.json");try{return JSON.parse(await qs.readFile(t,"utf-8"))}catch{return}}function tG(r,t){try{for(;t;){if(r[t])return t;let e=t.lastIndexOf("-");if(e>0)t=t.substring(0,e);else return}}catch(e){console.error("Resolving language pack configuration failed.",e)}}function Tg(r,t,e){return qt("code/didGenerateNls"),{userLocale:r,osLocale:t,resolvedLanguage:"en",defaultMessagesFile:$(e,"nls.messages.json"),locale:r,availableLanguages:{}}}function nG(r){let t=new Date;return qs.utimes(r,t,t)}var ER=v(()=>{Oe();Xr();vo()});function oG(r,t,e){t[_i.DI_TARGET]===t?t[_i.DI_DEPENDENCIES].push({id:r,index:e}):(t[_i.DI_DEPENDENCIES]=[{id:r,index:e}],t[_i.DI_TARGET]=t)}function A(r){if(_i.serviceIds.has(r))return _i.serviceIds.get(r);let t=function(e,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");oG(t,e,o)};return t.toString=()=>r,_i.serviceIds.set(r,t),t}var _i,Hn,Z=v(()=>{(o=>{o.serviceIds=new Map,o.DI_TARGET="$di$target",o.DI_DEPENDENCIES="$di$dependencies";function n(i){return i[o.DI_DEPENDENCIES]||[]}o.getServiceDependencies=n})(_i||={});Hn=A("instantiationService")});function Uv(r,t){return t.COPILOT_HOME||$(r,".copilot")}var Ice,wR=v(()=>{Oe();Z();Ice=A("copilotHomeService")});function RR(r,t){return t&&(r.stack||r.stacktrace)?d(119,null,pU(r),uU(r.stack)||uU(r.stacktrace)):pU(r)}function uU(r){return Array.isArray(r)?r.join(`
`):r}function pU(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?d(118,null,r.message):r.message||d(116,null)}function rr(r=null,t=!1){if(!r)return d(116,null);if(Array.isArray(r)){let e=Zo(r),n=rr(e[0],t);return e.length>1?d(117,null,n,e.length):n}if(G(r))return r;if(r.detail){let e=r.detail;if(e.error)return RR(e.error,t);if(e.exception)return RR(e.exception,t)}return r.stack?RR(r,t):r.message?r.message:d(116,null)}var $s=v(()=>{Dt();Ie();ee()});function kg(r){let t=r;return t?[t.on,t.pause,t.resume,t.destroy].every(e=>typeof e=="function"):!1}function Nv(r){let t=r;return t?kg(t.stream)&&Array.isArray(t.buffer)&&typeof t.ended=="boolean":!1}function zs(r,t){return new TR(r,t)}function mU(r,t){let e=[],n;for(;(n=r.read())!==null;)e.push(n);return t(e)}function gU(r,t,e){let n=[],o;for(;(o=r.read())!==null&&n.length<e;)n.push(o);return o===null&&n.length>0?t(n):{read:()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let i=o;return o=void 0,i}return r.read()}}}function Fv(r,t){return new Promise((e,n)=>{let o=[];Ya(r,{onData:i=>{t&&o.push(i)},onError:i=>{t?n(i):e(void 0)},onEnd:()=>{e(t?t(o):void 0)}})})}function Ya(r,t,e){r.on("error",n=>{e?.isCancellationRequested||t.onError(n)}),r.on("end",()=>{e?.isCancellationRequested||t.onEnd()}),r.on("data",n=>{e?.isCancellationRequested||t.onData(n)})}function fU(r,t){return new Promise((e,n)=>{let o=new re,i=[],s=c=>{if(i.push(c),i.length>t)return o.dispose(),r.pause(),e({stream:r,buffer:i,ended:!1})},a=c=>(o.dispose(),n(c)),l=()=>(o.dispose(),e({stream:r,buffer:i,ended:!0}));o.add(se(()=>r.removeListener("error",a))),r.on("error",a),o.add(se(()=>r.removeListener("end",l))),r.on("end",l),o.add(se(()=>r.removeListener("data",s))),r.on("data",s)})}function hU(){let r=zs(()=>{throw new Error("not supported")});return r.end(),r}function yU(r){let t=!1;return{read:()=>t?null:(t=!0,r)}}function Hv(r,t,e){let n=zs(e);return Ya(r,{onData:o=>n.write(t.data(o)),onError:o=>n.error(t.error?t.error(o):o),onEnd:()=>n.end()}),n}var TR,Xa=v(()=>{xe();Q();TR=class{constructor(t,e){this.reducer=t;this.options=e;this.state={flowing:!1,ended:!1,destroyed:!1};this.buffer={data:[],error:[]};this.listeners={data:[],error:[],end:[]};this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(t){if(!this.state.destroyed){if(this.state.flowing)this.emitData(t);else if(this.buffer.data.push(t),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(e=>this.pendingWritePromises.push(e))}}error(t){this.state.destroyed||(this.state.flowing?this.emitError(t):this.buffer.error.push(t))}end(t){this.state.destroyed||(typeof t<"u"&&this.write(t),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(t){this.listeners.data.slice(0).forEach(e=>e(t))}emitError(t){this.listeners.error.length===0?pt(t):this.listeners.error.slice(0).forEach(e=>e(t))}emitEnd(){this.listeners.end.slice(0).forEach(t=>t())}on(t,e){if(!this.state.destroyed)switch(t){case"data":this.listeners.data.push(e),this.resume();break;case"end":this.listeners.end.push(e),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(e),this.state.flowing&&this.flowErrors();break}}removeListener(t,e){if(this.state.destroyed)return;let n;switch(t){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(e);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let e=this.reducer(this.buffer.data);this.emitData(e)}else for(let e of this.buffer.data)this.emitData(e);this.buffer.data.length=0;let t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(e=>e())}flowErrors(){if(this.listeners.error.length>0){for(let t of this.buffer.error)this.emitError(t);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}});function iG(r,t,e=0){let n=t.byteLength,o=r.byteLength;if(n===0)return 0;if(n===1)return r.indexOf(t[0],e);if(n>o-e)return-1;let i=rG.value;i.fill(t.length);for(let c=0;c<t.length;c++)i[t[c]]=t.length-c-1;let s=e+t.length-1,a=s,l=-1;for(;s<o;)if(r[s]===t[a]){if(a===0){l=s;break}s--,a--}else s+=Math.max(t.length-a,i[r[s]]),a=t.length-1;return l}function sG(r,t){return r[t]*2**24+r[t+1]*2**16+r[t+2]*2**8+r[t+3]}function aG(r,t,e){r[e+3]=t,t=t>>>8,r[e+2]=t,t=t>>>8,r[e+1]=t,t=t>>>8,r[e]=t}function lG(r,t){return r[t+0]<<0>>>0|r[t+1]<<8>>>0|r[t+2]<<16>>>0|r[t+3]<<24>>>0}function cG(r,t,e){r[e+0]=t&255,t=t>>>8,r[e+1]=t&255,t=t>>>8,r[e+2]=t&255,t=t>>>8,r[e+3]=t&255}function dG(r,t){return r[t]}function uG(r,t,e){r[e]=t}function SU(r){return mU(r,t=>t.length===1?t[0]:O.concat(t))}function xU(r){return yU(r)}function Ir(r){return Fv(r,t=>t.length===1?t[0]:O.concat(t))}async function CU(r){return r.ended?O.concat(r.buffer):O.concat([...r.buffer,await Ir(r.stream)])}function EU(r){return Hv(r,{data:t=>typeof t=="string"?O.fromString(t):O.wrap(t)},t=>O.concat(t))}function wU(r){return zs(t=>O.concat(t),r)}function ir(r){let t=Uint8Array.fromBase64;if(typeof t=="function"&&r.length>=64&&!/[\t\n\f\r ]/.test(r))try{let l=r.includes("-")||r.includes("_")?"base64url":"base64";return O.wrap(t.call(Uint8Array,r,{alphabet:l,lastChunkHandling:"loose"}))}catch{}let e=0,n=0,o=0,i=new Uint8Array(Math.floor(r.length/4*3)),s=l=>{switch(n){case 3:i[o++]=e|l,n=0;break;case 2:i[o++]=e|l>>>2,e=l<<6,n=3;break;case 1:i[o++]=e|l>>>4,e=l<<4,n=2;break;default:e=l<<2,n=1}};for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);if(c>=65&&c<=90)s(c-65);else if(c>=97&&c<=122)s(c-97+26);else if(c>=48&&c<=57)s(c-48+52);else if(c===43||c===45)s(62);else if(c===47||c===95)s(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${r[l]}`)}}let a=o;for(;n>0;)s(0);return O.wrap(i).slice(0,a)}function oo({buffer:r},t=!0,e=!1){let n=r.toBase64;if(typeof n=="function")return n.call(r,{alphabet:e?"base64url":"base64",omitPadding:!t});let o=e?mG:pG,i="",s=r.byteLength%3,a=0;for(;a<r.byteLength-s;a+=3){let l=r[a+0],c=r[a+1],u=r[a+2];i+=o[l>>>2],i+=o[(l<<4|c>>>4)&63],i+=o[(c<<2|u>>>6)&63],i+=o[u&63]}if(s===1){let l=r[a+0];i+=o[l>>>2],i+=o[l<<4&63],t&&(i+="==")}else if(s===2){let l=r[a+0],c=r[a+1];i+=o[l>>>2],i+=o[(l<<4|c>>>4)&63],i+=o[c<<2&63],t&&(i+="=")}return i}function Gs({buffer:r}){let t=r.toHex;if(typeof t=="function")return t.call(r);let e="";for(let n=0;n<r.length;n++){let o=r[n];e+=IU[o>>>4],e+=IU[o&15]}return e}function Dg(r){let t=Uint8Array.fromHex;if(typeof t=="function")return O.wrap(t.call(Uint8Array,r));if(r.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(r.length>>1);for(let n=0;n<r.length;)e[n>>1]=bU(r,n++)<<4|bU(r,n++);return O.wrap(e)}function bU(r,t){let e=r.charCodeAt(t);if(e>=48&&e<=57)return e-48;if(e>=97&&e<=102)return e-87;if(e>=65&&e<=70)return e-55;throw new SyntaxError(`Invalid hex character at position ${t}`)}var nu,rG,Ag,PR,O,pG,mG,IU,Ve=v(()=>{ns();Xa();nu=typeof Buffer<"u",rG=new Yt(()=>new Uint8Array(256)),O=class r{static alloc(t){return nu?new r(Buffer.allocUnsafe(t)):new r(new Uint8Array(t))}static wrap(t){return nu&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new r(t)}static fromString(t,e){if(!(e?.dontUseNodeBuffer||!1)&&nu)return new r(Buffer.from(t));if(Ag||(Ag=new TextEncoder),t.length>65536&&typeof Ag.encodeInto=="function"){let o=new Uint8Array(r.byteLength(t)),i=0,s=0;for(;s<t.length;){let a=Math.min(s+65536,t.length);if(a<t.length){let c=t.charCodeAt(a-1);c>=55296&&c<=56319&&a--}let{written:l}=Ag.encodeInto(t.slice(s,a),o.subarray(i));i+=l,s=a}return new r(i===o.byteLength?o:o.subarray(0,i))}return new r(Ag.encode(t))}static fromByteArray(t){let e=r.alloc(t.length);for(let n=0,o=t.length;n<o;n++)e.buffer[n]=t[n];return e}static concat(t,e){if(typeof e>"u"){e=0;for(let i=0,s=t.length;i<s;i++)e+=t[i].byteLength}let n=r.alloc(e),o=0;for(let i=0,s=t.length;i<s;i++){let a=t[i];n.set(a,o),o+=a.byteLength}return n}static isNativeBuffer(t){return nu&&Buffer.isBuffer(t)}static byteLength(t){if(nu)return Buffer.byteLength(t);let e=0;for(let n=0,o=t.length;n<o;n++){let i=t.charCodeAt(n);if(i<128)e+=1;else if(i<2048)e+=2;else if(i>=55296&&i<=56319&&n+1<o){let s=t.charCodeAt(n+1);s>=56320&&s<=57343?(e+=4,n++):e+=3}else e+=3}return e}constructor(t){this.buffer=t,this.byteLength=this.buffer.byteLength}clone(){let t=r.alloc(this.byteLength);return t.set(this),t}toString(){return nu?this.buffer.toString():(PR||(PR=new TextDecoder(void 0,{ignoreBOM:!0})),PR.decode(this.buffer))}slice(t,e){return new r(this.buffer.subarray(t,e))}set(t,e){if(t instanceof r)this.buffer.set(t.buffer,e);else if(t instanceof Uint8Array)this.buffer.set(t,e);else if(t instanceof ArrayBuffer)this.buffer.set(new Uint8Array(t),e);else if(ArrayBuffer.isView(t))this.buffer.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),e);else throw new Error("Unknown argument 'array'")}readUInt32BE(t){return sG(this.buffer,t)}writeUInt32BE(t,e){aG(this.buffer,t,e)}readUInt32LE(t){return lG(this.buffer,t)}writeUInt32LE(t,e){cG(this.buffer,t,e)}readUInt8(t){return dG(this.buffer,t)}writeUInt8(t,e){uG(this.buffer,t,e)}indexOf(t,e=0){return iG(this.buffer,t instanceof r?t.buffer:t,e)}equals(t){return this===t?!0:this.byteLength!==t.byteLength?!1:this.buffer.every((e,n)=>e===t.buffer[n])}};pG="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mG="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";IU="0123456789abcdef"});function Fr(r){return AR(r,0)}function AR(r,t){switch(typeof r){case"object":return r===null?Ks(349,t):Array.isArray(r)?yG(r,t):vG(r,t);case"string":return RU(r,t);case"boolean":return gG(r,t);case"number":return Ks(r,t);case"undefined":return Ks(937,t);default:return Ks(617,t)}}function Ks(r,t){return(t<<5)-t+r|0}function gG(r,t){return Ks(r?433:863,t)}function RU(r,t){t=Ks(149417,t);for(let e=0,n=r.length;e<n;e++)t=Ks(r.charCodeAt(e),t);return t}function yG(r,t){return t=Ks(fG,t),r.reduce((e,n)=>AR(n,e),t)}function vG(r,t){return t=Ks(hG,t),Object.keys(r).sort().reduce((e,n)=>(e=RU(n,e),AR(r[n],e)),t)}function kR(r,t,e=32){let n=e-t,o=~((1<<n)-1);return(r<<t|(o&r)>>>n)>>>0}function _g(r,t=32){return r instanceof ArrayBuffer?Gs(O.wrap(new Uint8Array(r))):(r>>>0).toString(16).padStart(t/4,"0")}var fG,hG,Za,Mi=v(()=>{Ve();ni();Tt();fG=104579,hG=181387;Za=class r{constructor(){this._h0=1732584193;this._h1=4023233417;this._h2=2562383102;this._h3=271733878;this._h4=3285377520;this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}update(t){let e=t.length;if(e===0)return;let n=this._buff,o=this._buffLen,i=this._leftoverHighSurrogate,s,a;for(i!==0?(s=i,a=-1,i=0):(s=t.charCodeAt(0),a=0);;){let l=s;if(_O(s))if(a+1<e){let c=t.charCodeAt(a+1);sR(c)?(a++,l=MO(s,c)):l=65533}else{i=s;break}else sR(s)&&(l=65533);if(o=this._push(n,o,l),a++,a<e)s=t.charCodeAt(a);else break}this._buffLen=o,this._leftoverHighSurrogate=i}_push(t,e,n){return n<128?t[e++]=n:n<2048?(t[e++]=192|(n&1984)>>>6,t[e++]=128|(n&63)>>>0):n<65536?(t[e++]=224|(n&61440)>>>12,t[e++]=128|(n&4032)>>>6,t[e++]=128|(n&63)>>>0):(t[e++]=240|(n&1835008)>>>18,t[e++]=128|(n&258048)>>>12,t[e++]=128|(n&4032)>>>6,t[e++]=128|(n&63)>>>0),e>=64&&(this._step(),e-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),e}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),_g(this._h0)+_g(this._h1)+_g(this._h2)+_g(this._h3)+_g(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=r._bigBlock32,e=this._buffDV;for(let p=0;p<64;p+=4)t.setUint32(p,e.getUint32(p,!1),!1);for(let p=64;p<320;p+=4)t.setUint32(p,kR(t.getUint32(p-12,!1)^t.getUint32(p-32,!1)^t.getUint32(p-56,!1)^t.getUint32(p-64,!1),1),!1);let n=this._h0,o=this._h1,i=this._h2,s=this._h3,a=this._h4,l,c,u;for(let p=0;p<80;p++)p<20?(l=o&i|~o&s,c=1518500249):p<40?(l=o^i^s,c=1859775393):p<60?(l=o&i|o&s|i&s,c=2400959708):(l=o^i^s,c=3395469782),u=kR(n,5)+l+a+c+t.getUint32(p*4,!1)&4294967295,a=s,s=i,i=kR(o,30),o=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+i&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}});function DR(...r){switch(r.length){case 1:return d(4219,null,r[0]);case 2:return d(4220,null,r[0],r[1]);case 3:return d(4221,null,r[0],r[1],r[2]);default:return}}var IG,bG,el,TU=v(()=>{ii();xe();ee();IG=d(4218,null),bG=d(4217,null),el=class r{constructor(){this._input="";this._start=0;this._current=0;this._tokens=[];this._errors=[];this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(t){switch(t.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return t.isTripleEq?"===":"==";case 4:return t.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">";case 8:return">=";case 9:return"=~";case 10:return t.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return t.lexeme;case 18:return t.lexeme;case 19:return t.lexeme;case 20:return"EOF";default:throw fv(`unhandled token type: ${JSON.stringify(t)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(t=>t.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(t){return this._input=t,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){let e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){let e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(DR("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(DR("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(DR("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(t){return this._isAtEnd()||this._input.charCodeAt(this._current)!==t?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(t){this._tokens.push({type:t,offset:this._start})}_error(t){let e=this._start,n=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:n};this._errors.push({offset:e,lexeme:n,additionalInfo:t}),this._tokens.push(o)}_string(){this.stringRe.lastIndex=this._start;let t=this.stringRe.exec(this._input);if(t){this._current=this._start+t[0].length;let e=this._input.substring(this._start,this._current),n=r._keywords.get(e);n?this._addToken(n):this._tokens.push({type:17,lexeme:e,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(IG);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let t=this._current,e=!1,n=!1;for(;;){if(t>=this._input.length){this._current=t,this._error(bG);return}let i=this._input.charCodeAt(t);if(e)e=!1;else if(i===47&&!n){t++;break}else i===91?n=!0:i===92?e=!0:i===93&&(n=!1);t++}for(;t<this._input.length&&r._regexFlags.has(this._input.charCodeAt(t));)t++;this._current=t;let o=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:o,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}});function ou(r,t){return r.cmp(t)}function Vv(r,t){if(typeof r=="string"){let e=parseFloat(r);isNaN(e)||(r=e)}return typeof r=="string"||typeof r=="number"?t(r):Io.INSTANCE}function AU(r){let t=null;for(let e=0,n=r.length;e<n;e++){let o=r[e].substituteConstants();if(r[e]!==o&&t===null){t=[];for(let i=0;i<e;i++)t[i]=r[i]}t!==null&&(t[e]=o)}return t===null?r:t}function DU(r,t){return r<t?-1:r>t?1:0}function Ec(r,t,e,n){return r<e?-1:r>e?1:t<n?-1:t>n?1:0}function kU(r){return r.type===9?r.expr:[r]}var Qn,SG,xG,CG,EG,wG,PU,RG,TG,PG,kG,_R,tt,Io,Vo,js,tl,ru,iu,nl,Qs,ol,Sc,xc,Cc,rl,MR,Wv,Mg,C,ss,ro=v(()=>{ii();fe();Tt();TU();Z();ee();xe();Qn=new Map;Qn.set("false",!1);Qn.set("true",!0);Qn.set("isMac",vt);Qn.set("isLinux",Ke);Qn.set("isWindows",oe);Qn.set("isChromeOS",iv);Qn.set("isWeb",bn);Qn.set("isMacNative",vt&&!bn);Qn.set("isEdge",sv);Qn.set("isFirefox",N0);Qn.set("isChrome",ug);Qn.set("isSafari",F0);SG=Object.prototype.hasOwnProperty,xG={regexParsingWithErrorRecovery:!0},CG=d(4197,null),EG=d(4198,null),wG=d(4200,null),PU=d(4196,null),RG=d(4203,null),TG=d(4204,null),PG=d(4201,null),kG=d(4202,null),_R=class r{constructor(t=xG){this._config=t;this._scanner=new el;this._tokens=[];this._current=0;this._parsingErrors=[];this._flagsGYRe=/g|y/g}static{this._parseError=new Error}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}parse(t){if(t===""){this._parsingErrors.push({message:CG,offset:0,lexeme:"",additionalInfo:EG});return}this._tokens=this._scanner.reset(t).scan(),this._current=0,this._parsingErrors=[];try{let e=this._expr();if(!this._isAtEnd()){let n=this._peek(),o=n.type===17?TG:void 0;throw this._parsingErrors.push({message:RG,offset:n.offset,lexeme:el.getLexeme(n),additionalInfo:o}),r._parseError}return e}catch(e){if(e!==r._parseError)throw e;return}}_expr(){return this._or()}_or(){let t=[this._and()];for(;this._matchOne(16);){let e=this._and();t.push(e)}return t.length===1?t[0]:tt.or(...t)}_and(){let t=[this._term()];for(;this._matchOne(15);){let e=this._term();t.push(e)}return t.length===1?t[0]:tt.and(...t)}_term(){if(this._matchOne(2)){let t=this._peek();switch(t.type){case 11:return this._advance(),Io.INSTANCE;case 12:return this._advance(),Vo.INSTANCE;case 0:{this._advance();let e=this._expr();return this._consume(1,PU),e?.negate()}case 17:return this._advance(),Qs.create(t.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",t)}}return this._primary()}_primary(){let t=this._peek();switch(t.type){case 11:return this._advance(),tt.true();case 12:return this._advance(),tt.false();case 0:{this._advance();let e=this._expr();return this._consume(1,PU),e}case 17:{let e=t.lexeme;if(this._advance(),this._matchOne(9)){let o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);let i=o.lexeme,s=i.lastIndexOf("/"),a=s===i.length-1?void 0:this._removeFlagsGY(i.substring(s+1)),l;try{l=new RegExp(i.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",o)}return rl.create(e,l)}switch(o.type){case 10:case 19:{let i=[o.lexeme];this._advance();let s=this._peek(),a=0;for(let m=0;m<o.lexeme.length;m++)o.lexeme.charCodeAt(m)===40?a++:o.lexeme.charCodeAt(m)===41&&a--;for(;!this._isAtEnd()&&s.type!==15&&s.type!==16;){switch(s.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let m=0;m<s.lexeme.length;m++)s.lexeme.charCodeAt(m)===40?a++:o.lexeme.charCodeAt(m)===41&&a--}if(a<0)break;i.push(el.getLexeme(s)),this._advance(),s=this._peek()}let l=i.join(""),c=l.lastIndexOf("/"),u=c===l.length-1?void 0:this._removeFlagsGY(l.substring(c+1)),p;try{p=new RegExp(l.substring(1,c),u)}catch{throw this._errExpectedButGot("REGEX",o)}return tt.regex(e,p)}case 18:{let i=o.lexeme;this._advance();let s=null;if(!vg(i)){let a=i.indexOf("/"),l=i.lastIndexOf("/");if(a!==l&&a>=0){let c=i.slice(a+1,l),u=i[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(s===null)throw this._errExpectedButGot("REGEX",o);return rl.create(e,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,wG);let o=this._value();return tt.notIn(e,o)}switch(this._peek().type){case 3:{this._advance();let o=this._value();if(this._previous().type===18)return tt.equals(e,o);switch(o){case"true":return tt.has(e);case"false":return tt.not(e);default:return tt.equals(e,o)}}case 4:{this._advance();let o=this._value();if(this._previous().type===18)return tt.notEquals(e,o);switch(o){case"true":return tt.not(e);case"false":return tt.has(e);default:return tt.notEquals(e,o)}}case 5:return this._advance(),xc.create(e,this._value());case 6:return this._advance(),Cc.create(e,this._value());case 7:return this._advance(),ol.create(e,this._value());case 8:return this._advance(),Sc.create(e,this._value());case 13:return this._advance(),tt.in(e,this._value());default:return tt.has(e)}}case 20:throw this._parsingErrors.push({message:PG,offset:t.offset,lexeme:"",additionalInfo:kG}),r._parseError;default:throw this._errExpectedButGot(`true | false | KEY
| KEY '=~' REGEX
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let t=this._peek();switch(t.type){case 17:case 18:return this._advance(),t.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(t){return t.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(t){return this._check(t)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(t,e){if(this._check(t))return this._advance();throw this._errExpectedButGot(e,this._peek())}_errExpectedButGot(t,e,n){let o=d(4199,null,t,el.getLexeme(e)),i=e.offset,s=el.getLexeme(e);return this._parsingErrors.push({message:o,offset:i,lexeme:s,additionalInfo:n}),r._parseError}_check(t){return this._peek().type===t}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},tt=class{static false(){return Io.INSTANCE}static true(){return Vo.INSTANCE}static has(t){return js.create(t)}static equals(t,e){return tl.create(t,e)}static notEquals(t,e){return nl.create(t,e)}static regex(t,e){return rl.create(t,e)}static in(t,e){return ru.create(t,e)}static notIn(t,e){return iu.create(t,e)}static not(t){return Qs.create(t)}static and(...t){return Wv.create(t,null,!0)}static or(...t){return Mg.create(t,null,!0)}static greater(t,e){return ol.create(t,e)}static greaterEquals(t,e){return Sc.create(t,e)}static smaller(t,e){return xc.create(t,e)}static smallerEquals(t,e){return Cc.create(t,e)}static{this._parser=new _R({regexParsingWithErrorRecovery:!1})}static deserialize(t){return t==null?void 0:this._parser.parse(t)}};Io=class r{constructor(){this.type=0}static{this.INSTANCE=new r}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!1}serialize(){return"false"}keys(){return[]}map(t){return this}negate(){return Vo.INSTANCE}},Vo=class r{constructor(){this.type=1}static{this.INSTANCE=new r}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!0}serialize(){return"true"}keys(){return[]}map(t){return this}negate(){return Io.INSTANCE}},js=class r{constructor(t,e){this.key=t;this.negated=e;this.type=2}static create(t,e=null){let n=Qn.get(t);return typeof n=="boolean"?n?Vo.INSTANCE:Io.INSTANCE:new r(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:DU(this.key,t.key)}equals(t){return t.type===this.type?this.key===t.key:!1}substituteConstants(){let t=Qn.get(this.key);return typeof t=="boolean"?t?Vo.INSTANCE:Io.INSTANCE:this}evaluate(t){return!!t.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(t){return t.mapDefined(this.key)}negate(){return this.negated||(this.negated=Qs.create(this.key,this)),this.negated}},tl=class r{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=4}static create(t,e,n=null){if(typeof e=="boolean")return e?js.create(t,n):Qs.create(t,n);let o=Qn.get(t);return typeof o=="boolean"?e===(o?"true":"false")?Vo.INSTANCE:Io.INSTANCE:new r(t,e,n)}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){let t=Qn.get(this.key);if(typeof t=="boolean"){let e=t?"true":"false";return this.value===e?Vo.INSTANCE:Io.INSTANCE}return this}evaluate(t){return t.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(t){return t.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=nl.create(this.key,this.value,this)),this.negated}},ru=class r{constructor(t,e){this.key=t;this.valueKey=e;this.type=10;this.negated=null}static create(t,e){return new r(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.valueKey,t.key,t.valueKey)}equals(t){return t.type===this.type?this.key===t.key&&this.valueKey===t.valueKey:!1}substituteConstants(){return this}evaluate(t){let e=t.getValue(this.valueKey),n=t.getValue(this.key);if(Array.isArray(e)){if(e.includes(n))return!0;if(oe&&typeof n=="string"&&n.startsWith("file:///")){let o=n.toLowerCase();return e.some(i=>typeof i=="string"&&i.toLowerCase()===o)}return!1}if(typeof n=="string"&&typeof e=="object"&&e!==null){if(SG.call(e,n))return!0;if(oe&&n.startsWith("file:///")){let o=n.toLowerCase();return Object.keys(e).some(i=>i.toLowerCase()===o)}return!1}return!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(t){return t.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=iu.create(this.key,this.valueKey)),this.negated}},iu=class r{constructor(t,e){this.key=t;this.valueKey=e;this.type=11;this._negated=ru.create(t,e)}static create(t,e){return new r(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:this._negated.cmp(t._negated)}equals(t){return t.type===this.type?this._negated.equals(t._negated):!1}substituteConstants(){return this}evaluate(t){return!this._negated.evaluate(t)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(t){return t.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},nl=class r{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=5}static create(t,e,n=null){if(typeof e=="boolean")return e?Qs.create(t,n):js.create(t,n);let o=Qn.get(t);return typeof o=="boolean"?e===(o?"true":"false")?Io.INSTANCE:Vo.INSTANCE:new r(t,e,n)}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){let t=Qn.get(this.key);if(typeof t=="boolean"){let e=t?"true":"false";return this.value===e?Io.INSTANCE:Vo.INSTANCE}return this}evaluate(t){return t.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(t){return t.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=tl.create(this.key,this.value,this)),this.negated}},Qs=class r{constructor(t,e){this.key=t;this.negated=e;this.type=3}static create(t,e=null){let n=Qn.get(t);return typeof n=="boolean"?n?Io.INSTANCE:Vo.INSTANCE:new r(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:DU(this.key,t.key)}equals(t){return t.type===this.type?this.key===t.key:!1}substituteConstants(){let t=Qn.get(this.key);return typeof t=="boolean"?t?Io.INSTANCE:Vo.INSTANCE:this}evaluate(t){return!t.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(t){return t.mapNot(this.key)}negate(){return this.negated||(this.negated=js.create(this.key,this)),this.negated}};ol=class r{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=12}static create(t,e,n=null){return Vv(e,o=>new r(t,o,n))}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(t){return t.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=Cc.create(this.key,this.value,this)),this.negated}},Sc=class r{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=13}static create(t,e,n=null){return Vv(e,o=>new r(t,o,n))}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(t){return t.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=xc.create(this.key,this.value,this)),this.negated}},xc=class r{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=14}static create(t,e,n=null){return Vv(e,o=>new r(t,o,n))}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(t){return t.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=Sc.create(this.key,this.value,this)),this.negated}},Cc=class r{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=15}static create(t,e,n=null){return Vv(e,o=>new r(t,o,n))}cmp(t){return t.type!==this.type?this.type-t.type:Ec(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(t){return t.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=ol.create(this.key,this.value,this)),this.negated}},rl=class r{constructor(t,e){this.key=t;this.regexp=e;this.type=7;this.negated=null}static create(t,e){return new r(t,e)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.key<t.key)return-1;if(this.key>t.key)return 1;let e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return e<n?-1:e>n?1:0}equals(t){if(t.type===this.type){let e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return this.key===t.key&&e===n}return!1}substituteConstants(){return this}evaluate(t){let e=t.getValue(this.key);return this.regexp?this.regexp.test(e):!1}serialize(){let t=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${t}`}keys(){return[this.key]}map(t){return t.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=MR.create(this)),this.negated}},MR=class r{constructor(t){this._actual=t;this.type=8}static create(t){return new r(t)}cmp(t){return t.type!==this.type?this.type-t.type:this._actual.cmp(t._actual)}equals(t){return t.type===this.type?this._actual.equals(t._actual):!1}substituteConstants(){return this}evaluate(t){return!this._actual.evaluate(t)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(t){return new r(this._actual.map(t))}negate(){return this._actual}};Wv=class r{constructor(t,e){this.expr=t;this.negated=e;this.type=6}static create(t,e,n){return r._normalizeArr(t,e,n)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let e=0,n=this.expr.length;e<n;e++){let o=ou(this.expr[e],t.expr[e]);if(o!==0)return o}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].equals(t.expr[e]))return!1;return!0}return!1}substituteConstants(){let t=AU(this.expr);return t===this.expr?this:r.create(t,this.negated,!1)}evaluate(t){for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].evaluate(t))return!1;return!0}static _normalizeArr(t,e,n){let o=[],i=!1;for(let s of t)if(s){if(s.type===1){i=!0;continue}if(s.type===0)return Io.INSTANCE;if(s.type===6){o.push(...s.expr);continue}o.push(s)}if(o.length===0&&i)return Vo.INSTANCE;if(o.length!==0){if(o.length===1)return o[0];o.sort(ou);for(let s=1;s<o.length;s++)o[s-1].equals(o[s])&&(o.splice(s,1),s--);if(o.length===1)return o[0];for(;o.length>1;){let s=o.findLastIndex(p=>p.type===9);if(s===-1)break;let a=o.splice(s,1)[0],l=o.pop(),c=o.length===0,u=Mg.create(a.expr.map(p=>r.create([p,l],null,n)),null,c);if(u){if(u.type===0)return Io.INSTANCE;o.push(u),o.sort(ou)}}if(o.length===1)return o[0];if(o.some(s=>s.type===6)){let s=o.flatMap(a=>a.type===6?a.expr:[a]).sort(ou);o.length=0;for(let a of s)(o.length===0||!o[o.length-1].equals(a))&&o.push(a)}if(n){for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++)if(o[s].negate().equals(o[a]))return Io.INSTANCE;if(o.length===1)return o[0]}return new r(o,e)}}serialize(){return this.expr.map(t=>t.serialize()).join(" && ")}keys(){let t=[];for(let e of this.expr)t.push(...e.keys());return t}map(t){return new r(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());this.negated=Mg.create(t,this,!0)}return this.negated}},Mg=class r{constructor(t,e){this.expr=t;this.negated=e;this.type=9}static create(t,e,n){return r._normalizeArr(t,e,n)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let e=0,n=this.expr.length;e<n;e++){let o=ou(this.expr[e],t.expr[e]);if(o!==0)return o}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].equals(t.expr[e]))return!1;return!0}return!1}substituteConstants(){let t=AU(this.expr);return t===this.expr?this:r.create(t,this.negated,!1)}evaluate(t){for(let e=0,n=this.expr.length;e<n;e++)if(this.expr[e].evaluate(t))return!0;return!1}static _normalizeArr(t,e,n){let o=[],i=!1;if(t){for(let s=0,a=t.length;s<a;s++){let l=t[s];if(l){if(l.type===0){i=!0;continue}if(l.type===1)return Vo.INSTANCE;if(l.type===9){o=o.concat(l.expr);continue}o.push(l)}}if(o.length===0&&i)return Io.INSTANCE;o.sort(ou)}if(o.length!==0){if(o.length===1)return o[0];for(let s=1;s<o.length;s++)o[s-1].equals(o[s])&&(o.splice(s,1),s--);if(o.length===1)return o[0];if(n){for(let s=0;s<o.length;s++)for(let a=s+1;a<o.length;a++)if(o[s].negate().equals(o[a]))return Vo.INSTANCE;if(o.length===1)return o[0]}return new r(o,e)}}serialize(){return this.expr.map(t=>t.serialize()).join(" || ")}keys(){let t=[];for(let e of this.expr)t.push(...e.keys());return t}map(t){return new r(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());for(;t.length>1;){let e=t.shift(),n=t.shift(),o=[];for(let i of kU(e))for(let s of kU(n))o.push(Wv.create([i,s],null,!1));t.unshift(r.create(o,null,!1))}this.negated=r.create(t,this,!0)}return this.negated}},C=class r extends js{static{this._info=[]}static all(){return r._info.values()}constructor(t,e,n){super(t,null),this._defaultValue=e,typeof n=="object"?r._info.push({...n,key:t}):n!==!0&&r._info.push({key:t,description:n,type:e!=null?typeof e:void 0})}bindTo(t){return t.createKey(this.key,this._defaultValue)}getValue(t){return t.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(t){return tl.create(this.key,t)}notEqualsTo(t){return nl.create(this.key,t)}greater(t){return ol.create(this.key,t)}},ss=A("contextKeyService")});function OR(r){return to(r)}function UR(r,t){return r!==0&&r<=t}function MU(r,t,e){switch(t){case 1:r.trace(e);break;case 2:r.debug(e);break;case 3:r.info(e);break;case 4:r.warn(e);break;case 5:r.error(e);break;case 0:break;default:throw new Error(`Invalid log level ${t}`)}}function DG(r){switch(r){case"debug":return console.debug;case"error":return console.error;case"info":return console.info;case"log":return console.log;case"warn":return console.warn}}function as(r,...t){if(!AG){_U=!0;try{DG(r).apply(console,t)}finally{_U=!1}}}function su(r,t=!1){let e="";for(let n=0;n<r.length;n++){let o=r[n];if(o instanceof Error&&(o=rr(o,t)),typeof o=="object")try{o=JSON.stringify(o)}catch{}e+=(n>0?" ":"")+o}return e}function Ng(r){if(r.verbose)return 1;if(typeof r.logLevel=="string"){let t=_G(r.logLevel.toLowerCase());if(t!==void 0)return t}return Ug}function NR(r){switch(r){case 1:return"trace";case 2:return"debug";case 3:return"info";case 4:return"warn";case 5:return"error";case 0:return"off"}}function _G(r){switch(r){case"trace":return 1;case"debug":return 2;case"info":return 3;case"warn":return 4;case"error":return 5;case"critical":return 5;case"off":return 0}}var z,Bo,Ug,AG,_U,wc,Lg,au,Bv,Og,LR,qv,ade,De=v(()=>{ee();$s();ue();Mi();Q();fn();fe();it();Ie();te();ro();Z();z=A("logService"),Bo=A("loggerService");Ug=3;AG=!1,_U=!1;wc=class extends D{constructor(){super(...arguments);this.level=Ug;this._onDidChangeLogLevel=this._register(new R)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return UR(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}},Lg=class extends wc{constructor(e){super();this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...n){this.canLog(1)&&this.log(1,su([e,...n],!0))}debug(e,...n){this.canLog(2)&&this.log(2,su([e,...n]))}info(e,...n){this.canLog(3)&&this.log(3,su([e,...n]))}warn(e,...n){this.canLog(4)&&this.log(4,su([e,...n]))}error(e,...n){if(this.canLog(5))if(e instanceof Error){let o=Array.prototype.slice.call(arguments);o[0]=e.stack,this.log(5,su(o))}else this.log(5,su([e,...n]))}flush(){}},au=class extends wc{constructor(e=Ug,n=!0){super();this.useColors=n;this.setLevel(e)}trace(e,...n){this.canLog(1)&&(this.useColors?as("log","%cTRACE","color: #888",e,...n):as("log",e,...n))}debug(e,...n){this.canLog(2)&&(this.useColors?as("log","%cDEBUG","background: #eee; color: #888",e,...n):as("log",e,...n))}info(e,...n){this.canLog(3)&&(this.useColors?as("log","%c INFO","color: #33f",e,...n):as("log",e,...n))}warn(e,...n){this.canLog(4)&&(this.useColors?as("warn","%c WARN","color: #993",e,...n):as("log",e,...n))}error(e,...n){this.canLog(5)&&(this.useColors?as("error","%c ERR","color: #f33",e,...n):as("error",e,...n))}flush(){}},Bv=class extends wc{constructor(e){super();this.loggers=e;e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let n of this.loggers)n.setLevel(e);super.setLevel(e)}trace(e,...n){for(let o of this.loggers)o.trace(e,...n)}debug(e,...n){for(let o of this.loggers)o.debug(e,...n)}info(e,...n){for(let o of this.loggers)o.info(e,...n)}warn(e,...n){for(let o of this.loggers)o.warn(e,...n)}error(e,...n){for(let o of this.loggers)o.error(e,...n)}flush(){for(let e of this.loggers)e.flush()}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}},Og=class extends D{constructor(e,n,o){super();this.logLevel=e;this.logsHome=n;this._loggers=new je;this._onDidChangeLoggers=this._register(new R);this.onDidChangeLoggers=this._onDidChangeLoggers.event;this._onDidChangeLogLevel=this._register(new R);this.onDidChangeLogLevel=this._onDidChangeLogLevel.event;this._onDidChangeVisibility=this._register(new R);this.onDidChangeVisibility=this._onDidChangeVisibility.event;if(o)for(let i of o)this._loggers.set(i.resource,{logger:void 0,info:i})}getLoggerEntry(e){return G(e)?[...this._loggers.values()].find(n=>n.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,n){let o=this.toResource(e),i=G(e)?e:n?.id??Fr(o.toString()).toString(16),s=this._loggers.get(o)?.logger,a=n?.logLevel==="always"?1:n?.logLevel;s||(s=this.doCreateLogger(o,a??this.getLogLevel(o)??this.logLevel,{...n,id:i}));let l={logger:s,info:{resource:o,id:i,logLevel:a,name:n?.name,hidden:n?.hidden,group:n?.group,extensionId:n?.extensionId,when:n?.when}};return this.registerLogger(l.info),this._loggers.set(o,l),s}toResource(e){return G(e)?ge(this.logsHome,`${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`):e}setLogLevel(e,n){if(S.isUri(e)){let o=e,i=n,s=this._loggers.get(o);s&&i!==s.info.logLevel&&(s.info.logLevel=i===this.logLevel?void 0:i,s.logger?.setLevel(i),this._loggers.set(s.info.resource,s),this._onDidChangeLogLevel.fire([o,i]))}else{this.logLevel=e;for(let[o,i]of this._loggers.entries())this._loggers.get(o)?.info.logLevel===void 0&&i.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,n){let o=this.getLoggerEntry(e);o&&n!==!o.info.hidden&&(o.info.hidden=!n,this._loggers.set(o.info.resource,o),this._onDidChangeVisibility.fire([o.info.resource,n]))}getLogLevel(e){let n;return e&&(n=this._loggers.get(e)?.info.logLevel),n??this.logLevel}registerLogger(e){let n=this._loggers.get(e.resource);n?n.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){let n=this.toResource(e),o=this._loggers.get(n);o&&(o.logger&&o.logger.dispose(),this._loggers.delete(n),this._onDidChangeLoggers.fire({added:[],removed:[o.info]}))}*getRegisteredLoggers(){for(let e of this._loggers.values())yield e.info}getRegisteredLogger(e){return this._loggers.get(e)?.info}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}},LR=class{constructor(){this.onDidChangeLogLevel=new R().event}setLevel(t){}getLevel(){return 3}trace(t,...e){}debug(t,...e){}info(t,...e){}warn(t,...e){}error(t,...e){}critical(t,...e){}dispose(){}flush(){}},qv=class extends LR{};ade=new C("logLevel",NR(3))});var il,$v=v(()=>{Q();De();il=class extends D{constructor(t,e=[]){super(),this.logger=new Bv([t,...e]),this._register(t.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(t){this.logger.setLevel(t)}getLevel(){return this.logger.getLevel()}trace(t,...e){this.logger.trace(t,...e)}debug(t,...e){this.logger.debug(t,...e)}info(t,...e){this.logger.info(t,...e)}warn(t,...e){this.logger.warn(t,...e)}error(t,...e){this.logger.error(t,...e)}flush(){this.logger.flush()}}});function MG(r,t){return r.dependencies?.[t]?.replace(/^[~^]/,"")}var io,FR,Je,ai=v(()=>{hr();FR=globalThis.vscode;if(typeof FR<"u"&&typeof FR.context<"u"){let r=FR.context.configuration();if(r)io=r.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){io=globalThis._VSCODE_PRODUCT_JSON;let r=globalThis._VSCODE_PACKAGE_JSON;if(Qt.VSCODE_DEV&&Object.assign(io,{nameShort:`${io.nameShort} Dev`,nameLong:`${io.nameLong} Dev`,dataFolderName:`${io.dataFolderName}-dev`,serverDataFolderName:io.serverDataFolderName?`${io.serverDataFolderName}-dev`:void 0}),io.version||Object.assign(io,{version:r.version}),!io.copilotVersions){let t=MG(r,"@github/copilot-sdk");r.copilotRuntimeVersion&&t&&Object.assign(io,{copilotVersions:{runtime:r.copilotRuntimeVersion,sdk:t}})}Object.assign(io,{extensionsGallery:Qt.EXTENSIONS_GALLERY?JSON.parse(Qt.EXTENSIONS_GALLERY):io.extensionsGallery||{serviceUrl:"https://open-vsx.org/vscode/gallery",itemUrl:"https://open-vsx.org/vscode/item",extensionUrlTemplate:"https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest",resourceUrlTemplate:"https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",controlUrl:"",recommendationsUrl:""},telemetryEndpoint:Qt.CS_TELEMETRY_URL||io.telemetryEndpoint||"https://v1.telemetry.coder.com/track"})}else io={nameShort:"code-server",nameLong:"code-server",applicationName:"code-server",dataFolderName:".code-server",sharedDataFolderName:".vscode-oss-shared",win32MutexName:"codeserver",licenseName:"MIT",licenseUrl:"https://github.com/coder/code-server/blob/main/LICENSE",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverGreeting:[],serverLicense:[],serverLicensePrompt:"",serverApplicationName:"code-server-oss",serverDataFolderName:".vscode-server-oss",tunnelApplicationName:"code-tunnel-oss",win32DirName:"code-server",win32NameVersion:"code-server",win32RegValueName:"CodeOSS",win32x64AppId:"{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}",win32arm64AppId:"{{D1ACE434-89C5-48D1-88D3-E2991DF85475}",win32x64UserAppId:"{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}",win32arm64UserAppId:"{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}",win32AppUserModelId:"coder.code-server",win32ShellNameShort:"c&ode-server",win32TunnelServiceMutex:"vscodeoss-tunnelservice",win32TunnelMutex:"vscodeoss-tunnel",darwinBundleIdentifier:"com.coder.code.server",darwinProfileUUID:"47827DD9-4734-49A0-AF80-7E19B11495CC",darwinProfilePayloadUUID:"CF808BE7-53F3-46C6-A7E2-7EDB98A5E959",linuxDesktopName:"com.visualstudio.CodeOSS",linuxIconName:"com.coder.code.server",licenseFileName:"LICENSE.txt",reportIssueUrl:"https://github.com/coder/code-server/issues/new",nodejsArtifactFeed:"",electronArtifactFeed:"",urlProtocol:"code-oss",agentsTelemetryAppName:"agents",webviewContentExternalBaseUrlTemplate:"https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/",builtInExtensions:[{name:"ms-vscode.js-debug-companion",version:"1.1.3",sha256:"7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93",repo:"https://github.com/microsoft/vscode-js-debug-companion",metadata:{id:"99cb0b7f-7354-4278-b8da-6cc79972169d",publisherId:{publisherId:"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee",publisherName:"ms-vscode",displayName:"Microsoft",flags:"verified"},publisherDisplayName:"Microsoft"}},{name:"ms-vscode.js-debug",version:"1.140.1",sha256:"7accf7857ea4f4717b6211a2b75f5b434faf477033203a8919b6d26b6abc1897",repo:"https://github.com/microsoft/vscode-js-debug",metadata:{id:"25629058-ddac-4e17-abba-74678e126c5d",publisherId:{publisherId:"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee",publisherName:"ms-vscode",displayName:"Microsoft",flags:"verified"},publisherDisplayName:"Microsoft"}},{name:"ms-vscode.vscode-js-profile-table",version:"1.0.11",sha256:"a962a1e6a3baf74c9354b7f47fa96e6d6f0423a63bff55d7f976b6134a748ae9",repo:"https://github.com/microsoft/vscode-js-profile-visualizer",metadata:{id:"7e52b41b-71ad-457b-ab7e-0620f1fc4feb",publisherId:{publisherId:"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee",publisherName:"ms-vscode",displayName:"Microsoft",flags:"verified"},publisherDisplayName:"Microsoft"}}],defaultChatAgent:{extensionId:"GitHub.copilot",chatExtensionId:"GitHub.copilot-chat",chatExtensionOutputId:"GitHub.copilot-chat.GitHub Copilot Chat.log",chatExtensionOutputExtensionStateCommand:"github.copilot.debug.extensionState",documentationUrl:"https://aka.ms/github-copilot-overview",termsStatementUrl:"https://aka.ms/github-copilot-terms-statement",privacyStatementUrl:"https://aka.ms/github-copilot-privacy-statement",skusDocumentationUrl:"https://aka.ms/github-copilot-plans",optimizeUsageDocumentationUrl:"https://aka.ms/token-usage-tips",publicCodeMatchesUrl:"https://aka.ms/github-copilot-match-public-code",managePlanUrl:"https://aka.ms/github-copilot-manage-plan",upgradePlanUrl:"https://aka.ms/github-copilot-upgrade-plan",signUpUrl:"https://aka.ms/github-sign-up",provider:{default:{id:"github",name:"GitHub"},enterprise:{id:"github-enterprise",name:"GHE"},google:{id:"google",name:"Google"},apple:{id:"apple",name:"Apple"},microsoft:{id:"microsoft",name:"Microsoft"}},providerExtensionId:"vscode.github-authentication",providerUriSetting:"github-enterprise.uri",providerScopes:[["read:user","user:email","repo","workflow"],["user:email"],["read:user"]],entitlementUrl:"https://api.github.com/copilot_internal/user",entitlementSignupLimitedUrl:"https://api.github.com/copilot_internal/subscribe_limited_user",chatQuotaExceededContext:"github.copilot.chat.quotaExceeded",completionsQuotaExceededContext:"github.copilot.completions.quotaExceeded",walkthroughCommand:"github.copilot.open.walkthrough",completionsMenuCommand:"github.copilot.toggleStatusMenu",chatRefreshTokenCommand:"github.copilot.refreshToken",generateCommitMessageCommand:"github.copilot.git.generateCommitMessage",resolveMergeConflictsCommand:"github.copilot.git.resolveMergeConflicts",completionsAdvancedSetting:"github.copilot.advanced",completionsEnablementSetting:"github.copilot.enable",nextEditSuggestionsSetting:"github.copilot.nextEditSuggestions.enabled",tokenEntitlementUrl:"https://api.github.com/copilot_internal/v2/token",mcpRegistryDataUrl:"https://api.github.com/copilot/mcp_registry",mcpConnectorsUrl:"https://api.github.com/copilot-connectors/api/v1",managedSettingsUrl:"https://api.github.com/copilot_internal/managed_settings"},trustedExtensionAuthAccess:["vscode.git","vscode.github","github.vscode-pull-request-github","github.copilot","github.copilot-chat"],onboardingKeymaps:[{id:"vscode",label:"VS Code",description:"Default keyboard mapping"},{id:"sublime",label:"Sublime Text",extensionId:"ms-vscode.sublime-keybindings",description:"Keyboard mapping from Sublime Text"},{id:"intellij",label:"IntelliJ / JetBrains",extensionId:"k--kato.intellij-idea-keybindings",description:"Keyboard mapping from IntelliJ IDEA"},{id:"vim",label:"Vim",extensionId:"vscodevim.vim",description:"Vim modal editing"},{id:"eclipse",label:"Eclipse",extensionId:"alphabotsec.vscode-eclipse-keybindings",description:"Keyboard mapping from Eclipse"},{id:"notepadpp",label:"Notepad++",extensionId:"ms-vscode.notepadplusplus-keybindings",description:"Keyboard mapping from Notepad++"}],onboardingThemes:[{id:"dark-2026",label:"Dark 2026",themeId:"Dark 2026",type:"dark"},{id:"hc-dark",label:"Dark High Contrast",themeId:"Default High Contrast",type:"hcDark"},{id:"solarized-dark",label:"Solarized Dark",themeId:"Solarized Dark",type:"dark"},{id:"light-2026",label:"Light 2026",themeId:"Light 2026",type:"light"},{id:"hc-light",label:"Light High Contrast",themeId:"Default High Contrast Light",type:"hcLight"},{id:"solarized-light",label:"Solarized Light",themeId:"Solarized Light",type:"light"}],builtInExtensionsEnabledWithAutoUpdates:["GitHub.copilot-chat"],sessionsWindowAllowedExtensions:[],voiceWsUrl:"wss://falcon-caas.mai.microsoft.com/voice-code/api/v1/realtime/voice",enableTelemetry:!0,quality:"stable",codeServerVersion:"4.146.0",documentationUrl:"https://go.microsoft.com/fwlink/?LinkID=533484#vscode",keyboardShortcutsUrlMac:"https://go.microsoft.com/fwlink/?linkid=832143",keyboardShortcutsUrlLinux:"https://go.microsoft.com/fwlink/?linkid=832144",keyboardShortcutsUrlWin:"https://go.microsoft.com/fwlink/?linkid=832145",introductoryVideosUrl:"https://go.microsoft.com/fwlink/?linkid=832146",tipsAndTricksUrl:"https://go.microsoft.com/fwlink/?linkid=852118",newsletterSignupUrl:"https://www.research.net/r/vsc-newsletter",linkProtectionTrustedDomains:["https://open-vsx.org"],aiConfig:{ariaKey:"code-server"},extensionPointExtensionKind:{typescriptServerPlugins:["workspace"]},version:"1.146.0",commit:"9cc1033c190703416bbd5ec95d8f7db9f3edb63d",date:"2026-11-10T19:27:51Z"},Object.keys(io).length===0&&Object.assign(io,{version:"1.104.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",defaultChatAgent:{extensionId:"GitHub.copilot",chatExtensionId:"GitHub.copilot-chat",provider:{default:{id:"github",name:"GitHub"},enterprise:{id:"github-enterprise",name:"GitHub Enterprise"}},providerScopes:[]}});Je=io});function LG(){return!!process.versions.electron&&!!Je.commit&&!process.env.VSCODE_DEV}function OG(){return LG()?KO:Pv}function LU(r=process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH){return r?S.file(r):Pt.asFileUri(OG())}var OU=v(()=>{Me();te();ai()});import*as zv from"fs/promises";async function Fg(r){try{return await zv.access(r),!0}catch{return!1}}function UG(){return process.platform!=="linux"?!1:process.report?.getReport()?.header?.glibcVersionRuntime===void 0}function NG(){let r=`${process.platform}-${process.arch}`;if(process.platform!=="linux")return[r];let t=[`linux-${process.arch}`,`linuxmusl-${process.arch}`];return UG()?t.reverse():t}async function UU(r){let t=[];for(let e of await FG(r))for(let n of NG()){let o=await HG(S.joinPath(e,`copilot-sdk-${n}`),n,t);if(o)return o}throw new Error(`Unable to resolve @github/copilot SDK runtime paths. Tried: ${t.join(", ")}`)}async function FG(r){let t=S.joinPath(r,"@github");try{let e=S.file(It(await zv.realpath(S.joinPath(t,"copilot-sdk").fsPath)));if(e.fsPath!==t.fsPath)return[t,e]}catch{}return[t]}async function HG(r,t,e){let n=S.joinPath(r,"prebuilds",t),o=S.joinPath(n,process.platform==="win32"?"copilot-runtime.exe":"copilot-runtime").fsPath,i=S.joinPath(n,"runtime.node").fsPath,s=S.joinPath(r,"copilot-sdk"),a=S.joinPath(s,"index.js").fsPath,l=S.joinPath(s,"extension.js").fsPath,c=S.joinPath(r,"preloads","extension_bootstrap.mjs").fsPath;e.push(`${o} with ${i}, ${a}, ${l}, and ${c}`);let[u,p,m,g,y]=await Promise.all([Fg(o),Fg(i),Fg(a),Fg(l),Fg(c)]);if(u&&p&&m)return{runtimePath:o,sdkPath:a,...g&&y?{extensionSdkPath:s.fsPath,extensionBootstrapPath:c}:{}}}var NU=v(()=>{Oe();te()});function HR(r){return WG.test(r)}var WG,Ee,Vt=v(()=>{WG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ee=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(r),r[6]=r[6]&15|64,r[8]=r[8]&63|128;let n=0,o="";return o+=t[r[n++]],o+=t[r[n++]],o+=t[r[n++]],o+=t[r[n++]],o+="-",o+=t[r[n++]],o+=t[r[n++]],o+="-",o+=t[r[n++]],o+=t[r[n++]],o+="-",o+=t[r[n++]],o+=t[r[n++]],o+="-",o+=t[r[n++]],o+=t[r[n++]],o+=t[r[n++]],o+=t[r[n++]],o+=t[r[n++]],o+=t[r[n++]],o}})()});var lu,FU=v(()=>{Ue();xe();Vt();ee();De();lu=class{constructor(t){this._logService=t;this._runtimeScopes=new WeakMap;this._runtimes=new WeakMap;this._operations=new Ja}getStatus(t,e){return e.enabled?this._getStatusAfterOperations(t,e):Promise.resolve(void 0)}refresh(t,e,n){return this._operations.queue(this,async()=>{let o=e();if(!o.enabled)throw new Error(d(3497,null));this._requireRuntime(t,n),this._invalidateStatus();let i=await this._getStatus(t,o);if(i.state==="error")throw new Error(i.detail??d(3498,null))})}create(t,e){return this._mutate(()=>e,"create",n=>t.create({sandboxConfig:n}))}trust(t,e){return this._mutate(()=>e,"trust",async n=>{let o=await t.trust({sandboxConfig:n});return o.state==="error"&&this._logService.warn("[Copilot] Sandbox certificate trust failed",o.detail),o})}install(t,e,n){return this._mutate(e,"install",async o=>{let i=this._requireRuntime(t,n),s=await this._check(t,o,i);await this._installCertificate(t,{sandboxConfig:o},s)})}installForHost(t){return this._mutate(()=>{},"install",async()=>{let e=await this._query(()=>t.checkInstallationSupport()),n=await this._query(()=>t.getStatus({}));await this._installCertificate(t,{},{...n,canInstall:e&&n.canInstall})})}createForHost(t){return this._mutate(()=>{},"create",()=>t.create({}))}getStatusForHost(t){return this._query(()=>t.getStatus({}))}trustForHost(t){return this._mutate(()=>{},"trust",async()=>{let e=await t.trust({});if(e.state!=="installed"||e.detail!==void 0)throw new Error(e.detail??d(3504,null))})}rotateForHost(t){return this._mutate(()=>{},"rotate",async()=>{let e=await this._query(()=>t.checkInstallationSupport()),n=await this._query(()=>t.getStatus({}));await this._rotateCertificate(t,{},{...n,canInstall:e&&n.canInstall})})}removeForHost(t){return this._mutate(()=>{},"remove",()=>this._removeCertificate(t))}async _installCertificate(t,e,n){if(n.state==="installed"&&n.detail===void 0)return;if(n.state!=="notInstalled"&&n.state!=="installed"||!n.canInstall)throw new Error(n.detail??d(3496,null));if(n.detail!==void 0){let i=await t.rotate(e);if(i.detail!==void 0||i.state!=="installed"&&(i.state!=="notInstalled"||!i.canInstall))throw new Error(i.detail??d(3500,null));if(i.state==="installed")return}else await t.create(e);let o=await t.trust(e);if(o.state!=="installed"||o.detail!==void 0)throw new Error(o.detail??d(3505,null))}rotate(t,e,n){return this._mutate(e,"rotate",async o=>{let i=this._requireRuntime(t,n),s=await this._check(t,o,i);await this._rotateCertificate(t,{sandboxConfig:o},s)})}async _rotateCertificate(t,e,n){if(n.state!=="notInstalled"&&n.state!=="installed"||!n.canInstall)throw new Error(n.detail??d(3502,null));let o=await t.rotate(e);if(o.detail!==void 0||o.state!=="installed"&&(o.state!=="notInstalled"||!o.canInstall))throw new Error(o.detail??d(3501,null));if(o.state==="installed")return;let i=await t.trust(e);if(i.state!=="installed"||i.detail!==void 0)throw new Error(i.detail??d(3505,null))}remove(t,e,n){return this._mutate(()=>{n()},"remove",async()=>(this._requireRuntime(t,e),this._removeCertificate(t)))}async _removeCertificate(t){let e=await t.remove();if(e.state!=="notInstalled")throw new Error(e.detail??d(3499,null));return e}_requireRuntime(t,e){if(this._runtimeScopes.get(t)!==e)throw new Error(d(3494,null));return this._getRuntime(t)}_getStatusAfterOperations(t,e){return this._operations.peek(this)?this._operations.queue(this,()=>this._getStatus(t,e)):this._getStatus(t,e)}_getRuntime(t){let e=this._runtimes.get(t);if(!e){let n=this._runtimeScopes.get(t);n||(n=Ee(),this._runtimeScopes.set(t,n)),e={scopeId:n,configurations:new Map},this._runtimes.set(t,e)}return e}_getStatus(t,e){let n=this._getRuntime(t),o=JSON.stringify([e.auth?.git,e.auth?.gh,e.credentials]),i=n.configurations.get(o);if(!i){let s=n.configurations;i=this._check(t,e,n).then(a=>this._runtimes.get(t)===n&&s.get(o)===i?a:this._getStatusAfterOperations(t,e)),n.configurations.set(o,i)}return i}_mutate(t,e,n){return this._operations.queue(this,async()=>{try{let o=t();if(o&&!o.enabled)throw new Error(d(3495,null));return this._invalidateStatus(),await n(o)}catch(o){throw this._logService.warn(`[Copilot] Failed to ${e} sandbox certificate`,o),o}finally{this._invalidateStatus()}})}_invalidateStatus(){this._runtimes=new WeakMap}async _check(t,e,n){try{if(!await this._query(()=>t.checkRelevance({sandboxConfig:e})))return{scopeId:n.scopeId,state:"notRequired",canInstall:!1,requiresRotation:!1};n.installationSupport??=this._query(()=>t.checkInstallationSupport());let i=await n.installationSupport,s=await this._query(()=>t.getStatus({sandboxConfig:e}));return s.state==="error"&&this._logService.warn("[Copilot] Sandbox certificate status unavailable",s.detail),{scopeId:n.scopeId,state:s.state,canInstall:i&&s.canInstall,requiresRotation:(s.state==="installed"||s.state==="notInstalled")&&s.detail!==void 0,...s.detail!==void 0?{detail:s.detail}:{}}}catch(o){return this._logService.warn("[Copilot] Failed to check sandbox certificate status",o),{scopeId:n.scopeId,state:"error",canInstall:!1,requiresRotation:!1,detail:ye(o)}}}async _query(t){let e=await _v(t(),5e3);if(e===void 0)throw new Error(d(3503,null));return e}};lu=w([b(0,z)],lu)});var WU={};c0(WU,{executeCopilotCertificateCommand:()=>HU,runAgentHostCertificateCommand:()=>$G});import{CopilotClient as BG,RuntimeConnection as qG}from"@github/copilot-sdk";import*as WR from"os";async function HU(r,t,e,n){let o=1,i,s=[];try{await t.start();let a=t.rpc.sandbox.proxyCa;switch(r){case"create":i=(await e.createForHost(a)).certificatePath,o=0;break;case"trust":await e.trustForHost(a),i=d(3511,null),o=0;break;case"remove":await e.removeForHost(a),i=d(3510,null),o=0;break;case"status":{let l=await e.getStatusForHost(a);switch(i=l.detail?`${l.state}: ${l.detail}`:l.state,l.state){case"installed":o=l.detail===void 0?0:5;break;case"notInstalled":o=l.detail===void 0?3:5;break;case"unsupported":o=4;break;default:o=1}break}}}catch(a){s.push(a)}finally{try{s.push(...await t.stop())}catch(a){s.push(a)}}if(s.length)throw new AggregateError(s,s.map(ye).join(`
`));return i!==void 0&&n(i),o}async function $G(r,t){if(r!=="create"&&r!=="trust"&&r!=="remove"&&r!=="status")throw new Error(d(3508,null));if(r==="trust"&&!t)throw new Error(d(3506,null));if(r==="remove"&&!t)throw new Error(d(3509,null));let e=Sn(Uv(WR.homedir(),process.env));console.error(d(3507,null,e));let{runtimePath:n}=await UU(LU()),o=new re;try{let i=o.add(new il(o.add(new au(4)))),s=new lu(i),a=new BG({connection:qG.forStdio({path:n}),baseDirectory:e,workingDirectory:WR.homedir(),mode:"empty",useLoggedInUser:!1});return await HU(r,a,s,l=>console.log(l))}catch(i){return console.error(ye(i)),1}finally{o.dispose()}}var VU=v(()=>{Oe();Q();xe();ee();wR();De();$v();OU();NU();FU()});var sl,Gv=v(()=>{sl=class r{constructor(...t){this._entries=new Map;for(let[e,n]of t)this.set(e,n)}set(t,e){let n=this._entries.get(t);return this._entries.set(t,e),n}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}clone(){return new r(...this._entries)}}});var ht,Hg=v(()=>{ht=class{constructor(t,e=[],n=!1){this.ctor=t,this.staticArguments=e,this.supportsDelayedInstantiation=n}}});function Wg(r,t=!1){let e=0,n=r.length,o="",i=0,s=16,a=0;function l(h){let I=0,x=0;for(;I<h;){let E=r.charCodeAt(e);if(E>=48&&E<=57)x=x*16+E-48;else if(E>=65&&E<=70)x=x*16+E-65+10;else if(E>=97&&E<=102)x=x*16+E-97+10;else break;e++,I++}return I<h&&(x=-1),x}function c(h){e=h,o="",i=0,s=16,a=0}function u(){let h=e;if(r.charCodeAt(e)===48)e++;else for(e++;e<r.length&&cu(r.charCodeAt(e));)e++;if(e<r.length&&r.charCodeAt(e)===46)if(e++,e<r.length&&cu(r.charCodeAt(e)))for(e++;e<r.length&&cu(r.charCodeAt(e));)e++;else return a=3,r.substring(h,e);let I=e;if(e<r.length&&(r.charCodeAt(e)===69||r.charCodeAt(e)===101))if(e++,(e<r.length&&r.charCodeAt(e)===43||r.charCodeAt(e)===45)&&e++,e<r.length&&cu(r.charCodeAt(e))){for(e++;e<r.length&&cu(r.charCodeAt(e));)e++;I=e}else a=3;return r.substring(h,I)}function p(){let h="",I=e;for(;;){if(e>=n){h+=r.substring(I,e),a=2;break}let x=r.charCodeAt(e);if(x===34){h+=r.substring(I,e),e++;break}if(x===92){if(h+=r.substring(I,e),e++,e>=n){a=2;break}switch(r.charCodeAt(e++)){case 34:h+='"';break;case 92:h+="\\";break;case 47:h+="/";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+=`
`;break;case 114:h+="\r";break;case 116:h+=" ";break;case 117:{let T=l(4);T>=0?h+=String.fromCharCode(T):a=4;break}default:a=5}I=e;continue}if(x>=0&&x<=31)if(Kv(x)){h+=r.substring(I,e),a=2;break}else a=6;e++}return h}function m(){if(o="",a=0,i=e,e>=n)return i=n,s=17;let h=r.charCodeAt(e);if(VR(h)){do e++,o+=String.fromCharCode(h),h=r.charCodeAt(e);while(VR(h));return s=15}if(Kv(h))return e++,o+=String.fromCharCode(h),h===13&&r.charCodeAt(e)===10&&(e++,o+=`
`),s=14;switch(h){case 123:return e++,s=1;case 125:return e++,s=2;case 91:return e++,s=3;case 93:return e++,s=4;case 58:return e++,s=6;case 44:return e++,s=5;case 34:return e++,o=p(),s=10;case 47:{let I=e-1;if(r.charCodeAt(e+1)===47){for(e+=2;e<n&&!Kv(r.charCodeAt(e));)e++;return o=r.substring(I,e),s=12}if(r.charCodeAt(e+1)===42){e+=2;let x=n-1,E=!1;for(;e<x;){if(r.charCodeAt(e)===42&&r.charCodeAt(e+1)===47){e+=2,E=!0;break}e++}return E||(e++,a=1),o=r.substring(I,e),s=13}return o+=String.fromCharCode(h),e++,s=16}case 45:if(o+=String.fromCharCode(h),e++,e===n||!cu(r.charCodeAt(e)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=u(),s=11;default:for(;e<n&&g(h);)e++,h=r.charCodeAt(e);if(i!==e){switch(o=r.substring(i,e),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(h),e++,s=16}}function g(h){if(VR(h)||Kv(h))return!1;switch(h){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function y(){let h;do h=m();while(h>=12&&h<=15);return h}return{setPosition:c,getPosition:()=>e,scan:t?y:m,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>e-i,getTokenError:()=>a}}function VR(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function Kv(r){return r===10||r===13||r===8232||r===8233}function cu(r){return r>=48&&r<=57}function li(r,t,e){t==="__proto__"?Object.defineProperty(r,"__proto__",{value:e,enumerable:!0,writable:!0,configurable:!0}):r[t]=e}function bo(r,t=[],e=jv.DEFAULT){let n=null,o=[],i=[];function s(l){Array.isArray(o)?o.push(l):n!==null&&li(o,n,l)}return du(r,{onObjectBegin:()=>{let l={};s(l),i.push(o),o=l,n=null},onObjectProperty:l=>{n=l},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let l=[];s(l),i.push(o),o=l,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:s,onError:(l,c,u)=>{t.push({error:l,offset:c,length:u})}},e),o[0]}function BU(r,t=[],e=jv.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(l){n.type==="property"&&(n.length=l-n.offset,n=n.parent)}function i(l){return n.children.push(l),l}du(r,{onObjectBegin:l=>{n=i({type:"object",offset:l,length:-1,parent:n,children:[]})},onObjectProperty:(l,c,u)=>{n=i({type:"property",offset:c,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:l,offset:c,length:u,parent:n})},onObjectEnd:(l,c)=>{n.length=l+c-n.offset,n=n.parent,o(l+c)},onArrayBegin:(l,c)=>{n=i({type:"array",offset:l,length:-1,parent:n,children:[]})},onArrayEnd:(l,c)=>{n.length=l+c-n.offset,n=n.parent,o(l+c)},onLiteralValue:(l,c,u)=>{i({type:al(l),offset:c,length:u,parent:n,value:l}),o(c+u)},onSeparator:(l,c,u)=>{n.type==="property"&&(l===":"?n.colonOffset=c:l===","&&o(c))},onError:(l,c,u)=>{t.push({error:l,offset:c,length:u})}},e);let a=n.children[0];return a&&delete a.parent,a}function BR(r,t){if(!r)return;let e=r;for(let n of t)if(typeof n=="string"){if(e.type!=="object"||!Array.isArray(e.children))return;let o=!1;for(let i of e.children)if(Array.isArray(i.children)&&i.children[0].value===n){e=i.children[1],o=!0;break}if(!o)return}else{let o=n;if(e.type!=="array"||o<0||!Array.isArray(e.children)||o>=e.children.length)return;e=e.children[o]}return e}function du(r,t,e=jv.DEFAULT){let n=Wg(r,!1);function o(Y){return Y?()=>Y(n.getTokenOffset(),n.getTokenLength()):()=>!0}function i(Y){return Y?W=>Y(W,n.getTokenOffset(),n.getTokenLength()):()=>!0}let s=o(t.onObjectBegin),a=i(t.onObjectProperty),l=o(t.onObjectEnd),c=o(t.onArrayBegin),u=o(t.onArrayEnd),p=i(t.onLiteralValue),m=i(t.onSeparator),g=o(t.onComment),y=i(t.onError),h=e&&e.disallowComments,I=e&&e.allowTrailingComma;function x(){for(;;){let Y=n.scan();switch(n.getTokenError()){case 4:E(14);break;case 5:E(15);break;case 3:E(13);break;case 1:h||E(11);break;case 2:E(12);break;case 6:E(16);break}switch(Y){case 12:case 13:h?E(10):g();break;case 16:E(1);break;case 15:case 14:break;default:return Y}}}function E(Y,W=[],J=[]){if(y(Y),W.length+J.length>0){let we=n.getToken();for(;we!==17;){if(W.indexOf(we)!==-1){x();break}else if(J.indexOf(we)!==-1)break;we=x()}}}function T(Y){let W=n.getTokenValue();return Y?p(W):a(W),x(),!0}function P(){switch(n.getToken()){case 11:{let Y=0;try{Y=JSON.parse(n.getTokenValue()),typeof Y!="number"&&(E(2),Y=0)}catch{E(2)}p(Y);break}case 7:p(null);break;case 8:p(!0);break;case 9:p(!1);break;default:return!1}return x(),!0}function M(){return n.getToken()!==10?(E(3,[],[2,5]),!1):(T(!1),n.getToken()===6?(m(":"),x(),ae()||E(4,[],[2,5])):E(5,[],[2,5]),!0)}function X(){s(),x();let Y=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(Y||E(4,[],[]),m(","),x(),n.getToken()===2&&I)break}else Y&&E(6,[],[]);M()||E(4,[],[2,5]),Y=!0}return l(),n.getToken()!==2?E(7,[2],[]):x(),!0}function N(){c(),x();let Y=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(Y||E(4,[],[]),m(","),x(),n.getToken()===4&&I)break}else Y&&E(6,[],[]);ae()||E(4,[],[4,5]),Y=!0}return u(),n.getToken()!==4?E(8,[4],[]):x(),!0}function ae(){switch(n.getToken()){case 3:return N();case 1:return X();case 10:return T(!0);default:return P()}}return x(),n.getToken()===17?e.allowEmptyContent?!0:(E(4,[],[]),!1):ae()?(n.getToken()!==17&&E(9,[],[]),!0):(E(4,[],[]),!1)}function al(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(r){if(Array.isArray(r))return"array"}else return"null";return"object"}default:return"null"}}var jv,qo=v(()=>{(t=>t.DEFAULT={allowTrailingComma:!0})(jv||={})});function qU(r,t,e){let n,o,i,s,a;if(t){for(s=t.offset,a=s+t.length,i=s;i>0&&!Vg(r,i-1);)i--;let T=a;for(;T<r.length&&!Vg(r,T);)T++;o=r.substring(i,T),n=GG(o,e)}else o=r,n=0,i=0,s=0,a=r.length;let l=KG(e,r),c=!1,u=0,p;e.insertSpaces?p=$R(" ",e.tabSize||4):p=" ";let m=Wg(o,!1),g=!1;function y(){return l+$R(p,n+u)}function h(){let T=m.scan();for(c=!1;T===15||T===14;)c=c||T===14,T=m.scan();return g=T===16||m.getTokenError()!==0,T}let I=[];function x(T,P,M){!g&&P<a&&M>s&&r.substring(P,M)!==T&&I.push({offset:P,length:M-P,content:T})}let E=h();if(E!==17){let T=m.getTokenOffset()+i,P=$R(p,n);x(P,i,T)}for(;E!==17;){let T=m.getTokenOffset()+m.getTokenLength()+i,P=h(),M="";for(;!c&&(P===12||P===13);){let N=m.getTokenOffset()+i;x(" ",T,N),T=m.getTokenOffset()+m.getTokenLength()+i,M=P===12?y():"",P=h()}if(P===2)E!==1&&(u--,M=y());else if(P===4)E!==3&&(u--,M=y());else{switch(E){case 3:case 1:u++,M=y();break;case 5:case 12:M=y();break;case 13:c?M=y():M=" ";break;case 6:M=" ";break;case 10:if(P===6){M="";break}case 7:case 8:case 9:case 11:case 2:case 4:P===12||P===13?M=" ":P!==5&&P!==17&&(g=!0);break;case 16:g=!0;break}c&&(P===12||P===13)&&(M=y())}let X=m.getTokenOffset()+i;x(M,T,X),E=P}return I}function $R(r,t){let e="";for(let n=0;n<t;n++)e+=r;return e}function GG(r,t){let e=0,n=0,o=t.tabSize||4;for(;e<r.length;){let i=r.charAt(e);if(i===" ")n++;else if(i===" ")n+=o;else break;e++}return Math.floor(n/o)}function KG(r,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n==="\r")return e+1<t.length&&t.charAt(e+1)===`
`?`\r
`:"\r";if(n===`
`)return`
`}return r&&r.eol||`
`}function Vg(r,t){return`\r
`.indexOf(r.charAt(t))!==-1}var $U=v(()=>{qo()});function Qv(r,t,e,n,o){let i=t.slice(),a=BU(r,[]),l,c;for(;i.length>0&&(c=i.pop(),l=BR(a,i),l===void 0&&e!==void 0);)typeof c=="string"?e={[c]:e}:e=[e];if(l)if(l.type==="object"&&typeof c=="string"&&Array.isArray(l.children)){let u=BR(l,[c]);if(u!==void 0)if(e===void 0){if(!u.parent)throw new Error("Malformed AST");let p=l.children.indexOf(u.parent),m,g=u.parent.offset+u.parent.length;if(p>0){let y=l.children[p-1];m=y.offset+y.length}else if(m=l.offset+1,l.children.length>1)g=l.children[1].offset;else{let y=Wg(r,!0);y.setPosition(g),y.scan()===5&&(g=y.getPosition())}return uu(r,{offset:m,length:g-m,content:""},n)}else return uu(r,{offset:u.offset,length:u.length,content:JSON.stringify(e)},n);else{if(e===void 0)return[];let p=`${JSON.stringify(c)}: ${JSON.stringify(e)}`,m=o?o(l.children.map(y=>y.children[0].value)):l.children.length,g;if(m>0){let y=l.children[m-1];g={offset:y.offset+y.length,length:0,content:","+p}}else l.children.length===0?g={offset:l.offset+1,length:0,content:p}:g={offset:l.offset+1,length:0,content:p+","};return uu(r,g,n)}}else if(l.type==="array"&&typeof c=="number"&&Array.isArray(l.children))if(e!==void 0){let u=`${JSON.stringify(e)}`,p;if(l.children.length===0||c===0)p={offset:l.offset+1,length:0,content:l.children.length===0?u:u+","};else{let m=c===-1||c>l.children.length?l.children.length:c,g=l.children[m-1];p={offset:g.offset+g.length,length:0,content:","+u}}return uu(r,p,n)}else{let u=c,p=l.children[u],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===u){let g=l.children[u-1],y=g.offset+g.length,h=l.offset+l.length;m={offset:y,length:h-1-y,content:""}}else m={offset:p.offset,length:l.children[u+1].offset-p.offset,content:""};return uu(r,m,n)}else throw new Error(`Can not add ${typeof c!="number"?"index":"property"} to parent of type ${l.type}`);else return e===void 0?[]:uu(r,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(e)},n)}function uu(r,t,e){let n=zR(r,t),o=t.offset,i=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;o>0&&!Vg(n,o-1);)o--;for(;i<n.length&&!Vg(n,i);)i++}let s=qU(n,{offset:o,length:i-o},e);for(let l=s.length-1;l>=0;l--){let c=s[l];n=zR(n,c),o=Math.min(o,c.offset),i=Math.max(i,c.offset+c.length),i+=c.content.length-c.length}let a=r.length-(n.length-i)-o;return[{offset:o,length:a,content:n.substring(o,i)}]}function zR(r,t){return r.substring(0,t.offset)+t.content+r.substring(t.offset+t.length)}function Jv(r,t){let e=t.slice(0).sort((o,i)=>{let s=o.offset-i.offset;return s===0?o.length-i.length:s}),n=r.length;for(let o=e.length-1;o>=0;o--){let i=e[o];if(i.offset+i.length<=n)r=zR(r,i);else throw new Error("Overlapping edit");n=i.offset}return r}var GR=v(()=>{qo();$U()});function ci(r){if(!r||typeof r!="object"||r instanceof RegExp)return r;let t=Array.isArray(r)?[]:{};return Object.entries(r).forEach(([e,n])=>{t[e]=n&&typeof n=="object"?ci(n):n}),t}function zU(r){if(!r||typeof r!="object")return r;let t=[r];for(let e=0;e<t.length;e++){let n=t[e];t[e]=void 0,Object.freeze(n);for(let o in n)if(GU.call(n,o)){let i=n[o];typeof i=="object"&&!Object.isFrozen(i)&&!dO(i)&&t.push(i)}}return r}function so(r,t){return KR(r,t,new Set)}function KR(r,t,e){if(Kt(r))return r;let n=t(r);if(typeof n<"u")return n;if(Array.isArray(r)){let o=[];for(let i of r)o.push(KR(i,t,e));return o}if(ve(r)){if(e.has(r))throw new Error("Cannot clone recursive data-structure");e.add(r);let o={};for(let i in r)GU.call(r,i)&&(o[i]=KR(r[i],t,e));return e.delete(r),o}return r}function Ys(r,t,e=!0){return ve(r)?(ve(t)&&Object.keys(t).forEach(n=>{n in r?e&&(ve(r[n])&&ve(t[n])?Ys(r[n],t[n],e):r[n]=t[n]):r[n]=t[n]}),r):t}function Ge(r,t){if(r===t)return!0;if(r==null||t===null||t===void 0||typeof r!=typeof t||typeof r!="object"||Array.isArray(r)!==Array.isArray(t))return!1;let e,n;if(Array.isArray(r)){if(r.length!==t.length)return!1;for(e=0;e<r.length;e++)if(!Ge(r[e],t[e]))return!1}else{let o=[];for(n in r)o.push(n);o.sort();let i=[];for(n in t)i.push(n);if(i.sort(),!Ge(o,i))return!1;for(e=0;e<o.length;e++)if(!Ge(r[o[e]],t[o[e]]))return!1}return!0}function pu(r){let t=[];return JSON.stringify(r,function(e,n){if(typeof n=="object"&&n!==null){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(n))return"[Circular]";t.push(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}function jR(r,t){let e=t.toLowerCase(),n=Object.keys(r).find(o=>o.toLowerCase()===e);return n?r[n]:r[t]}var GU,Xt=v(()=>{Ie();GU=Object.prototype.hasOwnProperty});function Yv(r){let t=r;return t&&typeof t=="object"&&(!t.overrideIdentifier||typeof t.overrideIdentifier=="string")&&(!t.resource||t.resource instanceof S)}function KU(r){let t=r;return t&&typeof t=="object"&&(!t.overrideIdentifiers||Array.isArray(t.overrideIdentifiers))&&!t.overrideIdentifier&&(!t.resource||t.resource instanceof S)}function jU(r){switch(r){case 1:return"APPLICATION";case 2:return"USER";case 3:return"USER_LOCAL";case 4:return"USER_REMOTE";case 5:return"WORKSPACE";case 6:return"WORKSPACE_FOLDER";case 7:return"DEFAULT";case 8:return"MEMORY"}}function Xv(r,t){let e=Object.create(null);for(let n in r)Object.hasOwn(r,n)&&JR(e,n,r[n],t);return e}function JR(r,t,e,n){let o=t.split("."),i=o.pop(),s=r;for(let a=0;a<o.length;a++){let l=o[a],c=Object.hasOwn(s,l)?s[l]:void 0;switch(typeof c){case"undefined":c=Object.create(null),li(s,l,c);break;case"object":if(c===null){n(`Ignoring ${t} as ${o.slice(0,a+1).join(".")} is null`);return}break;default:n(`Ignoring ${t} as ${o.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}s=c}if(typeof s=="object"&&s!==null)try{s[i]=e}catch{n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(s)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(s)}`)}function QU(r,t){let e=t.split(".");JU(r,e)}function JU(r,t){if(!r)return;let e=r,n=t.shift();if(t.length===0){delete e[n];return}if(Object.keys(e).indexOf(n)!==-1){let o=e[n];typeof o=="object"&&o!==null&&!Array.isArray(o)&&(JU(o,t),Object.keys(o).length===0&&delete e[n])}}function Bg(r,t,e){function n(s,a){let l=s;for(let c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}let o=t.split("."),i=n(r,o);return typeof i>"u"?e:i}function YU(r){return r.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}var bt,dn=v(()=>{ni();qo();Ie();te();Z();bt=A("configurationService")});function XU(r){let t=!1,e=new Map,n=new Map;if(jG(r,u=>{if(r===u)return!0;let p=JSON.stringify(u);if(p.length<30)return!0;let m=e.get(p);if(!m){let g={schemas:[u]};return e.set(p,g),n.set(u,g),!0}return m.schemas.push(u),n.set(u,m),t=!0,!1}),e.clear(),!t)return JSON.stringify(r);let i="$defs";for(;r.hasOwnProperty(i);)i+="_";let s=[];function a(u){return JSON.stringify(u,(p,m)=>{if(m!==u){let g=n.get(m);if(g&&g.schemas.length>1)return g.id||(g.id=`_${s.length}`,s.push(g.schemas[0])),{$ref:`#/${i}/${g.id}`}}return m})}let l=a(r),c=[];for(let u=0;u<s.length;u++)c.push(`"_${u}":${a(s[u])}`);return c.length?`${l.substring(0,l.length-1)},"${i}":{${c.join(",")}}}`:l}function mu(r){return typeof r=="object"&&r!==null}function jG(r,t){if(!r||typeof r!="object")return;let e=(...l)=>{for(let c of l)mu(c)&&s.push(c)},n=(...l)=>{for(let c of l)if(mu(c))for(let u in c){let p=c[u];mu(p)&&s.push(p)}},o=(...l)=>{for(let c of l)if(Array.isArray(c))for(let u of c)mu(u)&&s.push(u)},i=l=>{if(Array.isArray(l))for(let c of l)mu(c)&&s.push(c);else mu(l)&&s.push(l)},s=[r],a=s.pop();for(;a;)t(a)&&(e(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),n(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),o(a.anyOf,a.allOf,a.oneOf,a.prefixItems),i(a.items)),a=s.pop()}var ZU=v(()=>{});var YR,St,$o=v(()=>{ni();Ie();YR=class{constructor(){this.data=new Map}add(t,e){Iv(G(t)),Iv(ve(e)),Iv(!this.data.has(t),"There is already an extension with this id"),this.data.set(t,e)}knows(t){return this.data.has(t)}as(t){return this.data.get(t)||null}dispose(){this.data.forEach(t=>{$d(t.dispose)&&t.dispose()}),this.data.clear()}},St=new YR});function tN(r){return r.length>0&&r.charAt(r.length-1)==="#"?r.substring(0,r.length-1):r}var Rc,XR,QG,Zv=v(()=>{ue();ZU();Q();$o();Rc={JSONContribution:"base.contributions.json"};XR=class extends D{constructor(){super(...arguments);this.schemasById={};this.schemaAssociations={};this._onDidChangeSchema=this._register(new R);this.onDidChangeSchema=this._onDidChangeSchema.event;this._onDidChangeSchemaAssociations=this._register(new R);this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(e,n,o){let i=tN(e);this.schemasById[i]=n,this._onDidChangeSchema.fire(e),o&&o.add(se(()=>{delete this.schemasById[i],this._onDidChangeSchema.fire(e)}))}registerSchemaAssociation(e,n){let o=tN(e);return this.schemaAssociations[o]||(this.schemaAssociations[o]=[]),this.schemaAssociations[o].includes(n)||(this.schemaAssociations[o].push(n),this._onDidChangeSchemaAssociations.fire()),se(()=>{let i=this.schemaAssociations[o];if(i){let s=i.indexOf(n);s!==-1&&(i.splice(s,1),i.length===0&&delete this.schemaAssociations[o],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){let n=this.schemasById[e];return n?XU(n):void 0}hasSchemaContent(e){return!!this.schemasById[e]}getSchemaAssociations(){return this.schemaAssociations}},QG=new XR;St.add(Rc.JSONContribution,QG)});function JG(r,t){return r===t?!0:!r||!t?!1:typeof r=="string"||typeof t=="string"?r===t:r.id===t.id}function gu(r){let t=[];if(ls.test(r)){let e=nN.exec(r);for(;e?.length;){let n=e[1].trim();n&&t.push(n),e=nN.exec(r)}}return rn(t)}function rN(r){return r.reduce((t,e)=>`${t}[${e}]`,"")}function YG(r){switch(Array.isArray(r)?r[0]:r){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function XG(r,t,e){if(!r.trim())return d(4189,null);if(ls.test(r))return d(4190,null,r);if($g.getConfigurationProperties()[r]!==void 0&&(!e||!ZG.has(e.toLowerCase())))return d(4188,null,r);if(t.policy&&t.policyReference)return d(4186,null,r);if(t.policy?.name&&$g.getPolicyConfigurations().get(t.policy?.name)!==void 0)return d(4187,null,r,t.policy?.name,$g.getPolicyConfigurations().get(t.policy?.name));if(t.agentHost){for(let[n,o]of $g.getAgentHostSyncConfigurations())if(o.key===t.agentHost.key&&n!==r)return d(4185,null,r,t.agentHost.key,n)}return null}var Jn,eI,tI,nI,oI,rI,iI,qg,Tc,sI,ZR,oN,nN,ll,ls,$g,ZG,br=v(()=>{Dt();ue();Ie();ee();dn();Zv();$o();Q();ai();Jn={Configuration:"base.contributions.configuration"};eI={properties:{},patternProperties:{}},tI={properties:{},patternProperties:{}},nI={properties:{},patternProperties:{}},oI={properties:{},patternProperties:{}},rI={properties:{},patternProperties:{}},iI={properties:{},patternProperties:{}},qg={properties:{},patternProperties:{}},Tc="vscode://schemas/settings/resourceLanguage",sI=St.as(Rc.JSONContribution),ZR=class extends D{constructor(){super();this.registeredConfigurationDefaults=[];this.excludedConfigurationKeys=new Map;this.overrideIdentifiers=new Set;this._onDidSchemaChange=this._register(new R);this.onDidSchemaChange=this._onDidSchemaChange.event;this._onDidUpdateConfiguration=this._register(new R);this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event;this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:d(4192,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.policyReferenceConfigurations=new Map,this.agentHostSyncConfigurations=new Map,this.excludedConfigurationProperties={},sI.registerSchema(Tc,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,n=!0){return this.registerConfigurations([e],n),e}registerConfigurations(e,n=!0){let o=new Set;this.doRegisterConfigurations(e,n,o),sI.registerSchema(Tc,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o})}deregisterConfigurations(e){let n=new Set;this.doDeregisterConfigurations(e,n),sI.registerSchema(Tc,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}updateConfigurations({add:e,remove:n}){let o=new Set;this.doDeregisterConfigurations(n,o),this.doRegisterConfigurations(e,!1,o),sI.registerSchema(Tc,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o})}registerDefaultConfigurations(e){let n=new Set;this.doRegisterDefaultConfigurations(e,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,n){this.registeredConfigurationDefaults.push(...e);let o=[];for(let{overrides:i,source:s}of e)for(let a in i){n.add(a);let l=this.configurationDefaultsOverrides.get(a)??this.configurationDefaultsOverrides.set(a,{configurationDefaultOverrides:[]}).get(a),c=i[a];if(l.configurationDefaultOverrides.push({value:c,source:s}),ls.test(a)){let u=this.mergeDefaultConfigurationsForOverrideIdentifier(a,c,s,l.configurationDefaultOverrideValue);if(!u)continue;l.configurationDefaultOverrideValue=u,this.updateDefaultOverrideProperty(a,u,s),o.push(...gu(a))}else{let u=this.mergeDefaultConfigurationsForConfigurationProperty(a,c,s,l.configurationDefaultOverrideValue);if(!u)continue;l.configurationDefaultOverrideValue=u;let p=this.excludedConfigurationProperties[a],m=this.configurationProperties[a]??(p?.experiment?p:void 0);m&&(this.updatePropertyDefaultValue(a,m),m.included!==!1&&this.updateSchema(a,m))}}this.doRegisterOverrideIdentifiers(o)}deregisterDefaultConfigurations(e){let n=new Set;this.doDeregisterDefaultConfigurations(e,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,n){for(let o of e){let i=this.registeredConfigurationDefaults.indexOf(o);i!==-1&&this.registeredConfigurationDefaults.splice(i,1)}for(let{overrides:o,source:i}of e)for(let s in o){let a=this.configurationDefaultsOverrides.get(s);if(!a)continue;let l=a.configurationDefaultOverrides.findIndex(c=>i?JG(c.source,i):c.value===o[s]);if(l!==-1){if(a.configurationDefaultOverrides.splice(l,1),a.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(s),ls.test(s)){let c;for(let u of a.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(s,u.value,u.source,c);c&&!Wa(c.value)?(a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(s,c,i)):(this.configurationDefaultsOverrides.delete(s),delete this.configurationProperties[s],delete this.defaultLanguageConfigurationOverridesNode.properties[s])}else{let c;for(let m of a.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(s,m.value,m.source,c);a.configurationDefaultOverrideValue=c;let u=this.excludedConfigurationProperties[s],p=this.configurationProperties[s]??(u?.experiment?u:void 0);p&&(this.updatePropertyDefaultValue(s,p),p.included!==!1&&this.updateSchema(s,p))}n.add(s)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,n,o){let i={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:n.value,description:d(4191,null,YU(e)),$ref:Tc,defaultDefaultValue:n.value,source:o,defaultValueSource:o};this.configurationProperties[e]=i,this.defaultLanguageConfigurationOverridesNode.properties[e]=i}mergeDefaultConfigurationsForOverrideIdentifier(e,n,o,i){let s=i?.value||{},a=i?.source??new Map;if(!(a instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(let l of Object.keys(n)){let c=n[l];if(ve(c)&&($n(s[l])||ve(s[l]))){if(s[l]={...s[l]??{},...c},o)for(let p in c)a.set(`${l}.${p}`,o)}else s[l]=c,o?a.set(l,o):a.delete(l)}return{value:s,source:a}}mergeDefaultConfigurationsForConfigurationProperty(e,n,o,i){let s=this.excludedConfigurationProperties[e],a=this.configurationProperties[e]??(s?.experiment?s:void 0),l=i?.value??a?.defaultDefaultValue,c=o;if(ve(n)&&(a!==void 0&&a.type==="object"||a===void 0&&($n(l)||ve(l)))){if(c=i?.source??new Map,!(c instanceof Map)){console.error("defaultValueSource is not a Map");return}for(let p in n)o&&c.set(`${e}.${p}`,o);n={...ve(l)?l:{},...n}}return{value:n,source:c}}deltaConfiguration(e){let n=!1,o=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,o),n=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,o),n=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,o),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,o),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o,defaultsOverrides:n})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let n of e)this.overrideIdentifiers.add(n);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,n,o){e.forEach(i=>{this.validateAndRegisterProperties(i,n,i.extensionInfo,i.restrictedProperties,void 0,o),this.configurationContributors.push(i),this.registerJSONConfiguration(i)})}doDeregisterConfigurations(e,n){let o=i=>{let s=this.excludedConfigurationKeys.get(i);if(s){for(let a of s)n.add(a),this.agentHostSyncConfigurations.delete(a),this.excludedConfigurationProperties[a]?.experiment&&delete this.excludedConfigurationProperties[a];this.excludedConfigurationKeys.delete(i)}if(i.properties)for(let a in i.properties){n.add(a);let l=this.configurationProperties[a];if(l?.policy?.name&&this.policyConfigurations.delete(l.policy.name),this.agentHostSyncConfigurations.delete(a),l?.policyReference?.name){let c=this.policyReferenceConfigurations.get(l.policyReference.name);c&&(c.delete(a),c.size===0&&this.policyReferenceConfigurations.delete(l.policyReference.name))}delete this.configurationProperties[a],this.removeFromSchema(a,i.properties[a])}i.allOf?.forEach(a=>o(a))};for(let i of e){o(i);let s=this.configurationContributors.indexOf(i);s!==-1&&this.configurationContributors.splice(s,1)}}validateAndRegisterProperties(e,n=!0,o,i,s=4,a){s=Kt(e.scope)?s:e.scope;let l=e.properties;if(l)for(let u in l){let p=l[u];if(p.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},n&&XG(u,p,o?.id)){delete l[u];continue}p.source=o,p.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,p),ls.test(u)?p.scope=void 0:(p.scope=Kt(p.scope)?s:p.scope,p.restricted=Kt(p.restricted)?!!i?.includes(u):p.restricted),p.experiment?p.tags?.some(I=>I.toLowerCase()==="onexp")||(p.tags=p.tags??[],p.tags.push("onExP")):p.tags?.some(I=>I.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${u}'. Please use 'experiment' property instead.`),p.experiment={mode:"startup"});let m=l[u].hasOwnProperty("included")&&!l[u].included,g=l[u].policy?.name,y=l[u].policyReference?.name,h=l[u].agentHost;if(h&&this.agentHostSyncConfigurations.set(u,h),m){if(this.excludedConfigurationProperties[u]=l[u],g&&(this.policyConfigurations.set(g,u),a.add(u)),y&&(this.addPolicyReferenceConfiguration(y,u),a.add(u)),h||p.experiment){a.add(u);let I=this.excludedConfigurationKeys.get(e);I||(I=new Set,this.excludedConfigurationKeys.set(e,I)),I.add(u)}delete l[u]}else a.add(u),g&&this.policyConfigurations.set(g,u),y&&this.addPolicyReferenceConfiguration(y,u),this.configurationProperties[u]=l[u],!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage)}let c=e.allOf;if(c)for(let u of c)this.validateAndRegisterProperties(u,n,o,i,s,a)}addPolicyReferenceConfiguration(e,n){let o=this.policyReferenceConfigurations.get(e);o||(o=new Set,this.policyReferenceConfigurations.set(e,o)),o.add(n)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getPolicyReferenceConfigurations(){return this.policyReferenceConfigurations}getAgentHostSyncConfigurations(){return this.agentHostSyncConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){let e=new Map;for(let[n,o]of this.configurationDefaultsOverrides)o.configurationDefaultOverrideValue&&e.set(n,o.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){let n=o=>{let i=o.properties;if(i)for(let a in i)this.updateSchema(a,i[a]);o.allOf?.forEach(n)};n(e)}updateSchema(e,n){switch(eI.properties[e]=n,n.scope){case 1:tI.properties[e]=n;break;case 2:oI.properties[e]=n;break;case 3:nI.properties[e]=n;break;case 7:rI.properties[e]=n;break;case 4:iI.properties[e]=n;break;case 5:qg.properties[e]=n;break;case 6:qg.properties[e]=n,this.resourceLanguageSettingsSchema.properties[e]=n;break}}removeFromSchema(e,n){switch(delete eI.properties[e],n.scope){case 1:delete tI.properties[e];break;case 2:delete oI.properties[e];break;case 3:delete nI.properties[e];break;case 7:delete rI.properties[e];break;case 4:delete iI.properties[e];break;case 5:case 6:delete qg.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let n=`[${e}]`,o={type:"object",description:d(4193,null),errorMessage:d(4194,null),$ref:Tc};this.updatePropertyDefaultValue(n,o),eI.properties[n]=o,tI.properties[n]=o,nI.properties[n]=o,oI.properties[n]=o,rI.properties[n]=o,iI.properties[n]=o,qg.properties[n]=o}}registerOverridePropertyPatternKey(){let e={type:"object",description:d(4193,null),errorMessage:d(4194,null),$ref:Tc};eI.patternProperties[ll]=e,tI.patternProperties[ll]=e,nI.patternProperties[ll]=e,oI.patternProperties[ll]=e,rI.patternProperties[ll]=e,iI.patternProperties[ll]=e,qg.patternProperties[ll]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,n){let o=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue,i,s;o&&(!n.disallowConfigurationDefault||!o.source)&&(i=o.value,s=o.source),$n(i)&&(i=n.defaultDefaultValue,s=void 0),$n(i)&&(i=YG(n.type)),n.default=i,n.defaultValueSource=s}},oN="\\[([^\\]]+)\\]",nN=new RegExp(oN,"g"),ll=`^(${oN})+$`,ls=new RegExp(ll);$g=new ZR;St.add(Jn.Configuration,$g);ZG=new Set(Je.defaultChatAgent?[Je.defaultChatAgent.extensionId,Je.defaultChatAgent.chatExtensionId].map(r=>r.toLowerCase()):[])});var eT,tT,aI,nT,Xs,fu,Li,zg=v(()=>{Dt();ni();ii();Tt();eT=class{constructor(){this._value="";this._pos=0}reset(t){return this._value=t,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(t){let e=t.charCodeAt(0),n=this._value.charCodeAt(this._pos);return e-n}value(){return this._value[this._pos]}},tT=class{constructor(t=!0){this._caseSensitive=t}reset(t){return this._value=t,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let t=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(t)this._from++;else break;else t=!1;return this}cmp(t){return this._caseSensitive?rR(t,this._value,0,t.length,this._from,this._to):hc(t,this._value,0,t.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},aI=class{constructor(t=!0,e=!0){this._splitOnBackslash=t;this._caseSensitive=e}reset(t){this._from=0,this._to=0,this._value=t,this._valueLen=t.length;for(let e=t.length-1;e>=0;e--,this._valueLen--){let n=this._value.charCodeAt(e);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let t=!0;for(;this._to<this._valueLen;this._to++){let e=this._value.charCodeAt(this._to);if(e===47||this._splitOnBackslash&&e===92)if(t)this._from++;else break;else t=!1}return this}cmp(t){return this._caseSensitive?rR(t,this._value,0,t.length,this._from,this._to):hc(t,this._value,0,t.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},nT=class{constructor(t,e){this._ignorePathCasing=t;this._ignoreQueryAndFragment=e;this._states=[];this._stateIdx=0}reset(t){return this._value=t,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new aI(!1,!this._ignorePathCasing(t)),this._pathIterator.reset(t.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(t)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(t){if(this._states[this._stateIdx]===1)return Qd(t,this._value.scheme);if(this._states[this._stateIdx]===2)return Qd(t,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(t);if(this._states[this._stateIdx]===4)return fc(t,this._value.query);if(this._states[this._stateIdx]===5)return fc(t,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}},Xs=class r{static{this.Val=Symbol("undefined_placeholder")}static wrap(t){return t===void 0?r.Val:t}static unwrap(t){return t===r.Val?void 0:t}},fu=class{constructor(){this.height=1;this.value=void 0;this.key=void 0;this.left=void 0;this.mid=void 0;this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){let t=this.right;return this.right=t.left,t.left=this,this.updateHeight(),t.updateHeight(),t}rotateRight(){let t=this.left;return this.left=t.right,t.right=this,this.updateHeight(),t.updateHeight(),t}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}},Li=class r{static forUris(t=()=>!1,e=()=>!1){return new r(new nT(t,e))}static forPaths(t=!1){return new r(new aI(void 0,!t))}static forStrings(){return new r(new eT)}static forConfigKeys(){return new r(new tT)}constructor(t){this._iter=t}clear(){this._root=void 0}fill(t,e){if(e){let n=e.slice(0);Gw(n);for(let o of n)this.set(o,t)}else{let n=t.slice(0);Gw(n);for(let o of n)this.set(o[0],o[1])}}set(t,e){let n=this._iter.reset(t),o;this._root||(this._root=new fu,this._root.segment=n.value());let i=[];for(o=this._root;;){let a=n.cmp(o.segment);if(a>0)o.left||(o.left=new fu,o.left.segment=n.value()),i.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new fu,o.right.segment=n.value()),i.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new fu,o.mid.segment=n.value()),i.push([0,o]),o=o.mid;else break}let s=Xs.unwrap(o.value);o.value=Xs.wrap(e),o.key=t;for(let a=i.length-1;a>=0;a--){let l=i[a][1];l.updateHeight();let c=l.balanceFactor();if(c<-1||c>1){let u=i[a][0],p=i[a+1][0];if(u===1&&p===1)i[a][1]=l.rotateLeft();else if(u===-1&&p===-1)i[a][1]=l.rotateRight();else if(u===1&&p===-1)l.right=i[a+1][1]=i[a+1][1].rotateRight(),i[a][1]=l.rotateLeft();else if(u===-1&&p===1)l.left=i[a+1][1]=i[a+1][1].rotateLeft(),i[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(i[a-1][0]){case-1:i[a-1][1].left=i[a][1];break;case 1:i[a-1][1].right=i[a][1];break;case 0:i[a-1][1].mid=i[a][1];break}else this._root=i[0][1]}}return s}get(t){return Xs.unwrap(this._getNode(t)?.value)}_getNode(t){let e=this._iter.reset(t),n=this._root;for(;n;){let o=e.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(e.hasNext())e.next(),n=n.mid;else break}return n}has(t){let e=this._getNode(t);return!(e?.value===void 0&&e?.mid===void 0)}delete(t){return this._delete(t,!1)}deleteSuperstr(t){return this._delete(t,!0)}_delete(t,e){let n=this._iter.reset(t),o=[],i=this._root;for(;i;){let s=n.cmp(i.segment);if(s>0)o.push([-1,i]),i=i.left;else if(s<0)o.push([1,i]),i=i.right;else if(n.hasNext())n.next(),o.push([0,i]),i=i.mid;else break}if(i){if(e?(i.left=void 0,i.mid=void 0,i.right=void 0,i.height=1):(i.key=void 0,i.value=void 0),!i.mid&&!i.value)if(i.left&&i.right){let s=[[1,i]],a=this._min(i.right,s);if(a.key){i.key=a.key,i.value=a.value,i.segment=a.segment;let l=a.right;if(s.length>1){let[u,p]=s[s.length-1];switch(u){case-1:p.left=l;break;case 0:cc(!1);case 1:cc(!1)}}else i.right=l;let c=this._balanceByStack(s);if(o.length>0){let[u,p]=o[o.length-1];switch(u){case-1:p.left=c;break;case 0:p.mid=c;break;case 1:p.right=c;break}}else this._root=c}}else{let s=i.left??i.right;if(o.length>0){let[a,l]=o[o.length-1];switch(a){case-1:l.left=s;break;case 0:l.mid=s;break;case 1:l.right=s;break}}else this._root=s}this._root=this._balanceByStack(o)??this._root}}_min(t,e){for(;t.left;)e.push([-1,t]),t=t.left;return t}_balanceByStack(t){for(let e=t.length-1;e>=0;e--){let n=t[e][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),t[e][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),t[e][1]=n.rotateRight()),e>0)switch(t[e-1][0]){case-1:t[e-1][1].left=t[e][1];break;case 1:t[e-1][1].right=t[e][1];break;case 0:t[e-1][1].mid=t[e][1];break}else return t[0][1]}}findSubstr(t){let e=this._iter.reset(t),n=this._root,o;for(;n;){let i=e.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else if(e.hasNext())e.next(),o=Xs.unwrap(n.value)||o,n=n.mid;else break}return n&&Xs.unwrap(n.value)||o}findSuperstr(t){return this._findSuperstrOrElement(t,!1)}_findSuperstrOrElement(t,e){let n=this._iter.reset(t),o=this._root;for(;o;){let i=n.cmp(o.segment);if(i>0)o=o.left;else if(i<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):e?Xs.unwrap(o.value):void 0}}hasElementOrSubtree(t){return this._findSuperstrOrElement(t,!0)!==void 0}forEach(t){for(let[e,n]of this)t(n,e)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(t){let e=[];return this._dfsEntries(t,e),e[Symbol.iterator]()}_dfsEntries(t,e){t&&(t.left&&this._dfsEntries(t.left,e),t.value!==void 0&&e.push([t.key,Xs.unwrap(t.value)]),t.mid&&this._dfsEntries(t.mid,e),t.right&&this._dfsEntries(t.right,e))}_isBalanced(){let t=e=>{if(!e)return!0;let n=e.balanceFactor();return n<-1||n>1?!1:t(e.left)&&t(e.right)};return t(this._root)}}});function Pc(r){return r.create===!0}function Hr(r){return!!(r.capabilities&2)}function iN(r){return!!(r.capabilities&524288)}function oT(r){return!!(r.capabilities&8)}function sN(r){return!!(r.capabilities&131072)}function aN(r){return!!(r.capabilities&262144)}function ea(r){return!!(r.capabilities&4)}function cI(r){return!!(r.capabilities&16)}function dI(r){return Hr(r)?!!(r.capabilities&16384):!1}function rT(r){return Hr(r)?!!(r.capabilities&32768):!1}function lN(r){return!!(r.capabilities&65536)}function cN(r){return!!(r.capabilities&1048576)}function Do(r,t){return hu.create(r,t)}function ta(r){return r||Do(d(4434,null),"Unknown")}function iT(r,t){return r.name=t?`${t} (FileSystemError)`:"FileSystemError",r}function cl(r){if(!r)return"Unknown";if(r instanceof hu)return r.code;let t=/^(.+) \(FileSystemError\)$/.exec(r.name);if(!t)return"Unknown";switch(t[1]){case"EntryExists":return"EntryExists";case"EntryIsADirectory":return"EntryIsADirectory";case"EntryNotADirectory":return"EntryNotADirectory";case"EntryNotFound":return"EntryNotFound";case"EntryTooLarge":return"EntryTooLarge";case"EntryWriteLocked":return"EntryWriteLocked";case"NoPermissions":return"NoPermissions";case"Unavailable":return"Unavailable"}return"Unknown"}function wt(r){if(r instanceof kn)return r.fileOperationResult;switch(cl(r)){case"EntryNotFound":return 1;case"EntryIsADirectory":return 0;case"EntryNotADirectory":return 9;case"EntryWriteLocked":return 5;case"NoPermissions":return 6;case"EntryExists":return 4;case"EntryTooLarge":return 7;default:return 10}}function dN(r,t,e){return!r||!t||r===t||t.length>r.length?!1:(t.charAt(t.length-1)!==wn&&(t+=wn),e?$a(r,t):r.indexOf(t)===0)}function sT(r){if(!(typeof r.size!="number"||typeof r.mtime!="number"))return r.mtime.toString(29)+r.size.toString(31)}var Le,hu,Zs,lI,kn,yu,vu,uI,Oi,st=v(()=>{zg();Oe();Tt();Ie();te();ee();Z();fe();Me();ns();Le=A("fileService");hu=class r extends Error{constructor(e,n){super(e);this.code=n}static create(e,n){let o=new r(e.toString(),n);return iT(o,n),o}};Zs=class{constructor(t,e,n){this.resource=t;this.operation=e;this.target=n}isOperation(t){return this.operation===t}},lI=class r{constructor(t,e){this.ignorePathCasing=e;this.correlationId=void 0;this.added=new Yt(()=>{let t=Li.forUris(()=>this.ignorePathCasing);return t.fill(this.rawAdded.map(e=>[e,!0])),t});this.updated=new Yt(()=>{let t=Li.forUris(()=>this.ignorePathCasing);return t.fill(this.rawUpdated.map(e=>[e,!0])),t});this.deleted=new Yt(()=>{let t=Li.forUris(()=>this.ignorePathCasing);return t.fill(this.rawDeleted.map(e=>[e,!0])),t});this.rawAdded=[];this.rawUpdated=[];this.rawDeleted=[];for(let n of t){switch(n.type){case 1:this.rawAdded.push(n.resource);break;case 0:this.rawUpdated.push(n.resource);break;case 2:this.rawDeleted.push(n.resource);break}this.correlationId!==r.MIXED_CORRELATION&&(typeof n.cId=="number"?this.correlationId===void 0?this.correlationId=n.cId:this.correlationId!==n.cId&&(this.correlationId=r.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=r.MIXED_CORRELATION))}}static{this.MIXED_CORRELATION=null}contains(t,...e){return this.doContains(t,{includeChildren:!1},...e)}affects(t,...e){return this.doContains(t,{includeChildren:!0},...e)}doContains(t,e,...n){if(!t)return!1;let o=n.length>0;return!!((!o||n.includes(1))&&(this.added.value.get(t)||e.includeChildren&&this.added.value.findSuperstr(t))||(!o||n.includes(0))&&(this.updated.value.get(t)||e.includeChildren&&this.updated.value.findSuperstr(t))||(!o||n.includes(2))&&(this.deleted.value.findSubstr(t)||e.includeChildren&&this.deleted.value.findSuperstr(t)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(t){return this.correlationId===t}hasCorrelation(){return typeof this.correlationId=="number"}};kn=class extends Error{constructor(e,n,o){super(e);this.fileOperationResult=n;this.options=o}},yu=class extends kn{constructor(e,n,o,i){super(e,n,i);this.fileOperationResult=n;this.size=o}},vu=class extends kn{constructor(e,n,o){super(e,2,o);this.stat=n}},uI="";Oi=class r{static{this.KB=1024}static{this.MB=r.KB*r.KB}static{this.GB=r.MB*r.KB}static{this.TB=r.GB*r.KB}static formatSize(t){return to(t)||(t=0),t<r.KB?d(4429,null,t.toFixed(0)):t<r.MB?d(4431,null,(t/r.KB).toFixed(2)):t<r.GB?d(4432,null,(t/r.MB).toFixed(2)):t<r.TB?d(4430,null,(t/r.GB).toFixed(2)):d(4433,null,(t/r.TB).toFixed(2))}}});function Gg(r){return Object.isFrozen(r)?r:zU(r)}function dl(r,t){let{added:e,removed:n,updated:o}=uN(t?.rawConfiguration,r?.rawConfiguration),i=[],s=r?.getAllOverrideIdentifiers()||[],a=t?.getAllOverrideIdentifiers()||[];if(t){let l=a.filter(c=>!s.includes(c));for(let c of l)i.push([c,t.getKeysForOverrideIdentifier(c)])}if(r){let l=s.filter(c=>!a.includes(c));for(let c of l)i.push([c,r.getKeysForOverrideIdentifier(c)])}if(t&&r){for(let l of s)if(a.includes(l)){let c=uN({contents:r.getOverrideValue(void 0,l)||{},keys:r.getKeysForOverrideIdentifier(l)},{contents:t.getOverrideValue(void 0,l)||{},keys:t.getKeysForOverrideIdentifier(l)});i.push([l,[...c.added,...c.removed,...c.updated]])}}return{added:e,removed:n,updated:o,overrides:i}}function uN(r,t){let e=r?t?r.keys.filter(i=>t.keys.indexOf(i)===-1):[...r.keys]:[],n=t?r?t.keys.filter(i=>r.keys.indexOf(i)===-1):[...t.keys]:[],o=[];if(r&&t){for(let i of t.keys)if(r.keys.indexOf(i)!==-1){let s=Bg(t.contents,i),a=Bg(r.contents,i);Ge(s,a)||o.push(i)}}return{added:e,removed:n,updated:o}}var yn,pI,mI,aT,Iu,gI,lT=v(()=>{Dt();ue();qo();Q();fn();Xt();Ie();te();dn();br();st();$o();yn=class r{constructor(t,e,n,o,i){this._contents=t;this._keys=e;this._overrides=n;this._raw=o;this.logService=i;this.overrideConfigurations=new Map}static createEmptyModel(t){return new r({},[],[],void 0,t)}get rawConfiguration(){if(!this._rawConfiguration)if(this._raw){let t=(Array.isArray(this._raw)?this._raw:[this._raw]).map(e=>{if(e instanceof r)return e;let n=new pI("",this.logService);return n.parseRaw(e),n.configurationModel});this._rawConfiguration=t.reduce((e,n)=>n===e?n:e.merge(n),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}get raw(){if(this._raw&&!(Array.isArray(this._raw)&&this._raw.every(t=>t instanceof r)))return this._raw}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(t){return t?Bg(this.contents,t):this.contents}inspect(t,e){let n=this;return{get value(){return Gg(n.rawConfiguration.getValue(t))},get override(){return e?Gg(n.rawConfiguration.getOverrideValue(t,e)):void 0},get merged(){return Gg(e?n.rawConfiguration.override(e).getValue(t):n.rawConfiguration.getValue(t))},get overrides(){let o=[];for(let{contents:i,identifiers:s,keys:a}of n.rawConfiguration.overrides){let l=new r(i,a,[],void 0,n.logService).getValue(t);l!==void 0&&o.push({identifiers:s,value:l})}return o.length?Gg(o):void 0}}}getOverrideValue(t,e){let n=this.getContentsForOverrideIdentifer(e);return n?t?Bg(n,t):n:void 0}getKeysForOverrideIdentifier(t){let e=[];for(let n of this.overrides)n.identifiers.includes(t)&&e.push(...n.keys);return rn(e)}getAllOverrideIdentifiers(){let t=[];for(let e of this.overrides)t.push(...e.identifiers);return rn(t)}override(t){let e=this.overrideConfigurations.get(t);return e||(e=this.createOverrideConfigurationModel(t),this.overrideConfigurations.set(t,e)),e}merge(...t){let e=ci(this.contents),n=ci(this.overrides),o=[...this.keys],i=this._raw?Array.isArray(this._raw)?[...this._raw]:[this._raw]:[this];for(let s of t)if(i.push(...s._raw?Array.isArray(s._raw)?s._raw:[s._raw]:[s]),!s.isEmpty()){this.mergeContents(e,s.contents);for(let a of s.overrides){let[l]=n.filter(c=>Gt(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=rn(l.keys)):n.push(ci(a))}for(let a of s.keys)o.indexOf(a)===-1&&o.push(a)}return new r(e,o,n,!i.length||i.every(s=>s instanceof r)?void 0:i,this.logService)}createOverrideConfigurationModel(t){let e=this.getContentsForOverrideIdentifer(t);if(!e||typeof e!="object"||!Object.keys(e).length)return this;let n={};for(let o of rn([...Object.keys(this.contents),...Object.keys(e)])){let i=this.contents[o],s=e[o];s&&(typeof i=="object"&&typeof s=="object"?(i=ci(i),this.mergeContents(i,s)):i=s),li(n,o,i)}return new r(n,this.keys,this.overrides,void 0,this.logService)}mergeContents(t,e){for(let n of Object.keys(e)){if(Object.hasOwn(t,n)&&ve(t[n])&&ve(e[n])){this.mergeContents(t[n],e[n]);continue}li(t,n,ci(e[n]))}}getContentsForOverrideIdentifer(t){let e=null,n=null,o=i=>{i&&(n?this.mergeContents(n,i):n=ci(i))};for(let i of this.overrides)i.identifiers.length===1&&i.identifiers[0]===t?e=i.contents:i.identifiers.includes(t)&&o(i.contents);return o(e),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(t,e){this.updateValue(t,e,!0)}setValue(t,e){this.updateValue(t,e,!1)}removeValue(t){let e=this.keys.indexOf(t);e!==-1&&(this.keys.splice(e,1),QU(this.contents,t),ls.test(t)&&this.overrides.splice(this.overrides.findIndex(n=>Gt(n.identifiers,gu(t))),1))}updateValue(t,e,n){if(JR(this.contents,t,e,o=>this.logService.error(o)),n=n||this.keys.indexOf(t)===-1,n&&this.keys.push(t),ls.test(t)){let o=this.contents[t],i=gu(t),s={identifiers:i,keys:Object.keys(o),contents:Xv(o,l=>this.logService.error(l))},a=this.overrides.findIndex(l=>Gt(l.identifiers,i));a!==-1?this.overrides[a]=s:this.overrides.push(s)}}},pI=class{constructor(t,e){this._name=t;this.logService=e;this._raw=null;this._configurationModel=null;this._restrictedConfigurations=[];this._parseErrors=[]}get configurationModel(){return this._configurationModel||yn.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(t,e){if(!Kt(t)){let n=this.doParseContent(t);this.parseRaw(n,e)}}reparse(t){this._raw&&this.parseRaw(this._raw,t)}parseRaw(t,e){this._raw=t;let{contents:n,keys:o,overrides:i,restricted:s,hasExcludedProperties:a}=this.doParseRaw(t,e);this._configurationModel=new yn(n,o,i,a?[t]:void 0,this.logService),this._restrictedConfigurations=s||[]}doParseContent(t){let e={},n=null,o=[],i=[],s=[];function a(c){Array.isArray(o)?o.push(c):n!==null&&li(o,n,c)}let l={onObjectBegin:()=>{let c={};a(c),i.push(o),o=c,n=null},onObjectProperty:c=>{n=c},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let c=[];a(c),i.push(o),o=c,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:a,onError:(c,u,p)=>{s.push({error:c,offset:u,length:p})}};if(t)try{du(t,l),e=o[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return e}doParseRaw(t,e){let n=St.as(Jn.Configuration),o=n.getConfigurationProperties(),i=n.getExcludedConfigurationProperties(),s=this.filter(t,o,i,!0,e);t=s.raw;let a=Xv(t,u=>this.logService.error(`Conflict in settings file ${this._name}: ${u}`)),l=Object.keys(t),c=this.toOverrides(t,u=>this.logService.error(`Conflict in settings file ${this._name}: ${u}`));return{contents:a,keys:l,overrides:c,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(t,e,n,o,i){let s=!1;if(!i?.scopes&&!i?.skipRestricted&&!i?.skipUnregistered&&!i?.exclude?.length)return{raw:t,restricted:[],hasExcludedProperties:s};let a={},l=[];for(let c in t)if(Object.hasOwn(t,c))if(ls.test(c)&&o){let u=this.filter(t[c],e,n,!1,i);li(a,c,u.raw),s=s||u.hasExcludedProperties,l.push(...u.restricted)}else{let u=this.filterProperty(c,t[c],e,n,i);l.push(...u.restricted),s=s||u.hasExcludedProperties,u.included?li(a,c,u.value):s=!0}return{raw:a,restricted:l,hasExcludedProperties:s}}filterProperty(t,e,n,o,i){let s=Object.hasOwn(n,t)?n[t]:void 0,a=Object.hasOwn(o,t)?o[t]:void 0;if(s)return{included:this.shouldInclude(t,s,a,i),value:e,restricted:s.restricted?[t]:[],hasExcludedProperties:!1};if(!ve(e)||Array.isArray(e))return this.filterUnregisteredLeaf(t,e,a,n,o,i);if(a)return{included:this.shouldInclude(t,s,a,i),value:e,restricted:[],hasExcludedProperties:!1};if(i.exclude?.includes(t))return{included:!1,value:e,restricted:[],hasExcludedProperties:!1};let l=Object.keys(e);if(l.length===0)return this.filterUnregisteredLeaf(t,e,a,n,o,i);let c={},u=[],p=!1,m=!1;for(let g of l){let y=this.filterProperty(`${t}.${g}`,e[g],n,o,i);y.restricted.length&&u.push(...y.restricted),m=m||y.hasExcludedProperties,y.included?(li(c,g,y.value),p=!0):m=!0}return{included:p,value:c,restricted:u,hasExcludedProperties:m}}filterUnregisteredLeaf(t,e,n,o,i,s){let a=n?void 0:this.findRegisteredAncestor(t,o,i);return a?{included:this.shouldInclude(a.path,a.schema,a.excludedSchema,s),value:e,restricted:a.schema?.restricted?[a.path]:[],hasExcludedProperties:!1}:{included:this.shouldInclude(t,void 0,n,s),value:e,restricted:[],hasExcludedProperties:!1}}findRegisteredAncestor(t,e,n){let o=t.lastIndexOf(".");for(;o>0;){let i=t.substring(0,o),s=Object.hasOwn(e,i)?e[i]:void 0,a=Object.hasOwn(n,i)?n[i]:void 0;if(s||a)return{path:i,schema:s,excludedSchema:a};o=t.lastIndexOf(".",o-1)}}shouldInclude(t,e,n,o){if(o.exclude?.includes(t))return!1;if(o.include?.includes(t))return!0;if(o.skipRestricted&&e?.restricted||o.skipUnregistered&&!e)return!1;let i=e??n,s=i?typeof i.scope<"u"?i.scope:4:void 0;return s===void 0||o.scopes===void 0?!0:o.scopes.includes(s)}toOverrides(t,e){let n=[];for(let o of Object.keys(t))if(ls.test(o)){let i={},s=t[o];for(let a in s)i[a]=s[a];n.push({identifiers:gu(o),keys:Object.keys(i),contents:Xv(i,e)})}return n}},mI=class extends D{constructor(e,n,o,i,s){super();this.userSettingsResource=e;this.parseOptions=n;this.fileService=i;this.logService=s;this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this.parser=new pI(this.userSettingsResource.toString(),s),this._register(this.fileService.watch(o.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(F.any(F.filter(this.fileService.onDidFilesChange,a=>a.contains(this.userSettingsResource)),F.filter(this.fileService.onDidRunOperation,a=>(a.isOperation(0)||a.isOperation(3)||a.isOperation(1)||a.isOperation(4))&&o.isEqual(a.resource,e)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{let e=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(e.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return yn.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}},aT=class{constructor(t,e,n,o,i,s,a,l,c,u,p,m,g){this.key=t;this.overrides=e;this._value=n;this.overrideIdentifiers=o;this.defaultConfiguration=i;this.policyConfiguration=s;this.applicationConfiguration=a;this.userConfiguration=l;this.localUserConfiguration=c;this.remoteUserConfiguration=u;this.workspaceConfiguration=p;this.folderConfigurationModel=m;this.memoryConfigurationModel=g}get value(){return Gg(this._value)}toInspectValue(t){return t?.value!==void 0||t?.override!==void 0||t?.overrides!==void 0?t:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}},Iu=class r{constructor(t,e,n,o,i,s,a,l,c,u){this._defaultConfiguration=t;this._policyConfiguration=e;this._applicationConfiguration=n;this._localUserConfiguration=o;this._remoteUserConfiguration=i;this._workspaceConfiguration=s;this._folderConfigurations=a;this._memoryConfiguration=l;this._memoryConfigurationByResource=c;this.logService=u;this._workspaceConsolidatedConfiguration=null;this._foldersConsolidatedConfigurations=new je;this._userConfiguration=null}getValue(t,e,n){return this.getConsolidatedConfigurationModel(t,e,n).getValue(t)}updateValue(t,e,n={}){let o;n.resource?(o=this._memoryConfigurationByResource.get(n.resource),o||(o=yn.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(n.resource,o))):o=this._memoryConfiguration,e===void 0?o.removeValue(t):o.setValue(t,e),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(t,e,n){let o=this.getConsolidatedConfigurationModel(t,e,n),i=this.getFolderConfigurationModelForResource(e.resource,n),s=e.resource?this._memoryConfigurationByResource.get(e.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(let l of o.overrides)for(let c of l.identifiers)o.getOverrideValue(t,c)!==void 0&&a.add(c);return new aT(t,e,o.getValue(t),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,i||void 0,s)}keys(t){let e=this.getFolderConfigurationModelForResource(void 0,t);return{default:this._defaultConfiguration.keys.slice(0),policy:this._policyConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:e?e.keys.slice(0):[]}}updateDefaultConfiguration(t){this._defaultConfiguration=t,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(t){this._policyConfiguration=t}updateApplicationConfiguration(t){this._applicationConfiguration=t,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(t){this._localUserConfiguration=t,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(t){this._remoteUserConfiguration=t,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(t){this._workspaceConfiguration=t,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(t,e){this._folderConfigurations.set(t,e),this._foldersConsolidatedConfigurations.delete(t)}deleteFolderConfiguration(t){this.folderConfigurations.delete(t),this._foldersConsolidatedConfigurations.delete(t)}compareAndUpdateDefaultConfiguration(t,e){let n=[];if(!e){let{added:o,updated:i,removed:s}=dl(this._defaultConfiguration,t);e=[...o,...i,...s]}for(let o of e)for(let i of gu(o)){let s=this._defaultConfiguration.getKeysForOverrideIdentifier(i),a=t.getKeysForOverrideIdentifier(i),l=[...a.filter(c=>s.indexOf(c)===-1),...s.filter(c=>a.indexOf(c)===-1),...s.filter(c=>!Ge(this._defaultConfiguration.override(i).getValue(c),t.override(i).getValue(c)))];n.push([i,l])}return this.updateDefaultConfiguration(t),{keys:e,overrides:n}}compareAndUpdatePolicyConfiguration(t){let{added:e,updated:n,removed:o}=dl(this._policyConfiguration,t),i=[...e,...n,...o];return i.length&&this.updatePolicyConfiguration(t),{keys:i,overrides:[]}}compareAndUpdateApplicationConfiguration(t){let{added:e,updated:n,removed:o,overrides:i}=dl(this.applicationConfiguration,t),s=[...e,...n,...o];return s.length&&this.updateApplicationConfiguration(t),{keys:s,overrides:i}}compareAndUpdateLocalUserConfiguration(t){let{added:e,updated:n,removed:o,overrides:i}=dl(this.localUserConfiguration,t),s=[...e,...n,...o];return s.length&&this.updateLocalUserConfiguration(t),{keys:s,overrides:i}}compareAndUpdateRemoteUserConfiguration(t){let{added:e,updated:n,removed:o,overrides:i}=dl(this.remoteUserConfiguration,t),s=[...e,...n,...o];return s.length&&this.updateRemoteUserConfiguration(t),{keys:s,overrides:i}}compareAndUpdateWorkspaceConfiguration(t){let{added:e,updated:n,removed:o,overrides:i}=dl(this.workspaceConfiguration,t),s=[...e,...n,...o];return s.length&&this.updateWorkspaceConfiguration(t),{keys:s,overrides:i}}compareAndUpdateFolderConfiguration(t,e){let n=this.folderConfigurations.get(t),{added:o,updated:i,removed:s,overrides:a}=dl(n,e),l=[...o,...i,...s];return(l.length||!n)&&this.updateFolderConfiguration(t,e),{keys:l,overrides:a}}compareAndDeleteFolderConfiguration(t){let e=this.folderConfigurations.get(t);if(!e)throw new Error("Unknown folder");this.deleteFolderConfiguration(t);let{added:n,updated:o,removed:i,overrides:s}=dl(e,void 0);return{keys:[...n,...o,...i],overrides:s}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{let t=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new yn(t.contents,t.keys,t.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(t,e,n){let o=this.getConsolidatedConfigurationModelForResource(e,n);if(e.overrideIdentifier&&(o=o.override(e.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(t)!==void 0){o=o.merge();for(let i of this._policyConfiguration.keys)o.setValue(i,this._policyConfiguration.getValue(i))}return o}getConsolidatedConfigurationModelForResource({resource:t},e){let n=this.getWorkspaceConsolidatedConfiguration();if(e&&t){let o=e.getFolder(t);o&&(n=this.getFolderConsolidatedConfiguration(o.uri)||n);let i=this._memoryConfigurationByResource.get(t);i&&(n=n.merge(i))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(t){let e=this._foldersConsolidatedConfigurations.get(t);if(!e){let n=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(t);o?(e=n.merge(o),this._foldersConsolidatedConfigurations.set(t,e)):e=n}return e}getFolderConfigurationModelForResource(t,e){if(e&&t){let n=e.getFolder(t);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((t,e)=>{let{contents:n,overrides:o,keys:i}=this._folderConfigurations.get(e);return t.push([e,{contents:n,overrides:o,keys:i}]),t},[])}}allKeys(){let t=new Set;return this._defaultConfiguration.keys.forEach(e=>t.add(e)),this.userConfiguration.keys.forEach(e=>t.add(e)),this._workspaceConfiguration.keys.forEach(e=>t.add(e)),this._folderConfigurations.forEach(e=>e.keys.forEach(n=>t.add(n))),[...t.values()]}allOverrideIdentifiers(){let t=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(e=>t.add(e)),this.userConfiguration.getAllOverrideIdentifiers().forEach(e=>t.add(e)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(e=>t.add(e)),this._folderConfigurations.forEach(e=>e.getAllOverrideIdentifiers().forEach(n=>t.add(n))),[...t.values()]}getAllKeysForOverrideIdentifier(t){let e=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(t).forEach(n=>e.add(n)),this.userConfiguration.getKeysForOverrideIdentifier(t).forEach(n=>e.add(n)),this._workspaceConfiguration.getKeysForOverrideIdentifier(t).forEach(n=>e.add(n)),this._folderConfigurations.forEach(n=>n.getKeysForOverrideIdentifier(t).forEach(o=>e.add(o))),[...e.values()]}static parse(t,e){let n=this.parseConfigurationModel(t.defaults,e),o=this.parseConfigurationModel(t.policy,e),i=this.parseConfigurationModel(t.application,e),s=this.parseConfigurationModel(t.userLocal,e),a=this.parseConfigurationModel(t.userRemote,e),l=this.parseConfigurationModel(t.workspace,e),c=t.folders.reduce((u,p)=>(u.set(S.revive(p[0]),this.parseConfigurationModel(p[1],e)),u),new je);return new r(n,o,i,s,a,l,c,yn.createEmptyModel(e),new je,e)}static parseConfigurationModel(t,e){return new yn(t.contents,t.keys,t.overrides,t.raw,e)}},gI=class{constructor(t,e,n,o,i){this.change=t;this.previous=e;this.currentConfiguraiton=n;this.currentWorkspace=o;this.logService=i;this._marker=`
`;this._markerCode1=this._marker.charCodeAt(0);this._markerCode2=46;this.affectedKeys=new Set;this._previousConfiguration=void 0;for(let s of t.keys)this.affectedKeys.add(s);for(let[,s]of t.overrides)for(let a of s)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(let s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Iu.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(t,e){let n=this._marker+t,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;let i=o+n.length;if(i>=this._affectsConfigStr.length)return!1;let s=this._affectsConfigStr.charCodeAt(i);if(s!==this._markerCode1&&s!==this._markerCode2)return!1;if(e){let a=this.previousConfiguration?this.previousConfiguration.getValue(t,e,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(t,e,this.currentWorkspace);return!Ge(a,l)}return!0}}});function tK(r){return{type:r.type,managedSettings:r.managedSettings,restrictedValue:r.restrictedValue}}function pN(r){if(r.restrictedValue!==void 0)return r.restrictedValue;switch(r.type){case"boolean":return!1;case"number":return 0;case"string":return""}}var mN,fI,ul,bu=v(()=>{ue();ri();Q();Z();mN=A("policy"),fI=class extends D{constructor(){super(...arguments);this.policyDefinitions={};this.policies=new Map;this.policyValueSources=new Map;this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event}async updatePolicyDefinitions(e){let n=!1;for(let o of Object.keys(e))this.policyDefinitions[o]!==e[o]&&(this.policyDefinitions[o]=e[o],n=!0);return n&&await this._updatePolicyDefinitions(this.policyDefinitions),this.getPolicyValues()}getPolicyValue(e){return this.policies.get(e)}getPolicyValueSource(e){return this.getStoredPolicyValueSource(e)}getStoredPolicyValueSource(e){if(this.policies.has(e))return this.policyValueSources.get(e)??"device"}serialize(){return sn.reduce(Object.entries(this.policyDefinitions),(e,[n,o])=>({...e,[n]:{definition:tK(o),value:this.policies.get(n)}}),{})}getPolicyValues(){return sn.reduce(this.policies.entries(),(e,[n,o])=>({...e,[n]:o}),{})}updatePolicyValue(e,n,o="device"){if(n===void 0){let a=this.policies.delete(e),l=this.policyValueSources.delete(e);return a||l}let i=this.policies.get(e)!==n,s=this.getStoredPolicyValueSource(e)!==o;return!i&&!s?!1:(this.policies.set(e,n),this.policyValueSources.set(e,o),!0)}clearPolicyValues(){this.policies.clear(),this.policyValueSources.clear()}},ul=class{constructor(){this.onDidChange=F.None;this.policyDefinitions={}}async updatePolicyDefinitions(){return{}}getPolicyValue(){}getPolicyValueSource(){}serialize(){}}});var hI,yI,Su,gN=v(()=>{ue();Q();Xt();Ie();lT();br();De();bu();$o();xe();qo();hI=class extends D{constructor(e){super();this.logService=e;this._onDidChangeConfiguration=this._register(new R);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this._configurationModel=yn.createEmptyModel(e)}get configurationModel(){return this._configurationModel}async initialize(){return this.resetConfigurationModel(),this._register(St.as(Jn.Configuration).onDidUpdateConfiguration(({properties:e,defaultsOverrides:n})=>this.onDidUpdateConfiguration(Array.from(e),n))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(e,n){this.updateConfigurationModel(e,this.getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=yn.createEmptyModel(this.logService);let e=this.getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}getConfigurationProperties(){let e=St.as(Jn.Configuration),n={...e.getConfigurationProperties()};for(let[o,i]of Object.entries(e.getExcludedConfigurationProperties()))i.experiment&&(n[o]=i);return n}updateConfigurationModel(e,n){let o=this.getConfigurationDefaultOverrides();for(let i of e){let s=o[i],a=n[i];s!==void 0?this._configurationModel.setValue(i,s):a?this._configurationModel.setValue(i,this.getDefaultValue(i,a)):this._configurationModel.removeValue(i)}}getDefaultValue(e,n){return ci(n.default)}},yI=class{constructor(){this.onDidChangeConfiguration=F.None;this.configurationModel=yn.createEmptyModel(new qv)}async initialize(){return this.configurationModel}},Su=class extends D{constructor(e,n,o){super();this.defaultConfiguration=e;this.policyService=n;this.logService=o;this._onDidChangeConfiguration=this._register(new R);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this._submittedPolicyDefinitions=new Map;this._policyNameByKey=new Map;this._configurationModel=yn.createEmptyModel(this.logService),this.configurationRegistry=St.as(Jn.Configuration)}get configurationModel(){return this._configurationModel}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions([...this.defaultConfiguration.configurationModel.keys,...Object.keys(this.configurationRegistry.getExcludedConfigurationProperties())]),!1),this._register(this.policyService.onDidChange(e=>this.onDidChangePolicies(e))),this._register(this.defaultConfiguration.onDidChangeConfiguration(async({properties:e})=>this.update(await this.updatePolicyDefinitions(e),!0))),this._configurationModel}toPolicyDefinitionType(e,n){let i=(Array.isArray(e)?e:[e]).filter(s=>s==="string"||s==="number"||s==="array"||s==="object"||s==="boolean");if(i.length===0){this.logService.warn(`PolicyConfiguration#updatePolicyDefinitions - policy '${n}' has unsupported type '${e}'`);return}return i.includes("number")?"number":i.includes("boolean")?"boolean":"string"}async updatePolicyDefinitions(e){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",e);let n=[],o=new Set,i=this.configurationRegistry.getConfigurationProperties(),s=this.configurationRegistry.getExcludedConfigurationProperties();for(let l of e){let c=i[l]??s[l];if(!c){n.push(l);let p=this._policyNameByKey.get(l);p!==void 0&&(this._policyNameByKey.delete(l),o.add(p));continue}let u=c.policy?.name??c.policyReference?.name;u&&(n.push(l),o.add(u),this._policyNameByKey.set(l,u))}let a={};for(let l of o){let c=this.resolvePolicyDefinition(l);c&&!this.isSamePolicyDefinition(this._submittedPolicyDefinitions.get(l),c)&&(this._submittedPolicyDefinitions.set(l,c),a[l]=c)}return Wa(a)||await this.policyService.updatePolicyDefinitions(a),n}isSamePolicyDefinition(e,n){return!!e&&e.type===n.type&&e.value===n.value&&e.managedSettings===n.managedSettings&&e.restrictedValue===n.restrictedValue}resolvePolicyDefinition(e){let n=this.configurationRegistry.getConfigurationProperties(),o=this.configurationRegistry.getExcludedConfigurationProperties(),i=this.configurationRegistry.getPolicyConfigurations().get(e);if(i!==void 0){let a=n[i]??o[i];if(a?.policy){let l=this.toPolicyDefinitionType(a.type,e),{value:c,managedSettings:u,restrictedValue:p}=a.policy;return l?{type:l,value:c,managedSettings:u,restrictedValue:p}:void 0}}let s=this.configurationRegistry.getPolicyReferenceConfigurations().get(e);for(let a of s??[]){let l=n[a]??o[a];if(l?.policyReference){let c=this.toPolicyDefinitionType(l.type,e);return c?{type:c}:void 0}}}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);let n=this.configurationRegistry.getPolicyConfigurations(),o=this.configurationRegistry.getPolicyReferenceConfigurations(),i=[];for(let s of e){let a=n.get(s);a&&i.push(a);let l=o.get(s);l&&i.push(...l)}this.update(i,!0)}update(e,n){this.logService.trace("PolicyConfiguration#update",e);let o=this.configurationRegistry.getConfigurationProperties(),i=this.configurationRegistry.getExcludedConfigurationProperties(),s=[],a=this._configurationModel.isEmpty();for(let l of e){let c=o[l]??i[l],u=c?.policy?.name??c?.policyReference?.name;if(u){let p=this.policyService.getPolicyValue(u),m=Array.isArray(c.type)?c.type.includes("string"):c.type==="string";if(G(p)&&!m)try{p=this.parse(p)}catch(g){this.logService.error(`Error parsing policy value ${u}:`,ye(g));continue}(a?p!==void 0:!Ge(this._configurationModel.getValue(l),p))&&s.push([l,p])}else this._configurationModel.getValue(l)!==void 0&&s.push([l,void 0])}if(s.length){this.logService.trace("PolicyConfiguration#changed",s);let l=this._configurationModel;this._configurationModel=yn.createEmptyModel(this.logService);for(let c of l.keys)this._configurationModel.setValue(c,l.getValue(c));for(let[c,u]of s)u===void 0?this._configurationModel.removeValue(c):this._configurationModel.setValue(c,u);n&&this._onDidChangeConfiguration.fire(this._configurationModel)}}parse(e){let n={},o=null,i=[],s=[],a=[];function l(u){if(Array.isArray(i))i.push(u);else if(o!==null){if(Object.hasOwn(i,o))throw new Error(`Duplicate property found: ${o}`);li(i,o,u)}}if(e&&(du(e,{onObjectBegin:()=>{let u={};l(u),s.push(i),i=u,o=null},onObjectProperty:u=>{o=u},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{let u=[];l(u),s.push(i),i=u,o=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:l,onError:(u,p,m)=>{a.push({error:u,offset:p,length:m})}}),n=i[0]||n),a.length>0)throw new Error(a.map(u=>ye(u.error)).join(`
`));return n}};Su=w([b(1,mN),b(2,z)],Su)});var xu,cT,dT=v(()=>{Dt();Ue();Ve();ue();qo();GR();Q();fn();Xt();fe();it();dn();lT();br();gN();st();bu();xu=class extends D{constructor(e,n,o,i){super();this.settingsResource=e;this.logService=i;this._onDidChangeConfiguration=this._register(new R);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this.defaultConfiguration=this._register(new hI(i)),this.policyConfiguration=o instanceof ul?new yI:this._register(new Su(this.defaultConfiguration,o,i)),this.userConfiguration=this._register(new mI(this.settingsResource,{},Qa,n,i)),this.configuration=new Iu(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,yn.createEmptyModel(i),yn.createEmptyModel(i),yn.createEmptyModel(i),yn.createEmptyModel(i),new je,yn.createEmptyModel(i),new je,i),this.configurationEditing=new cT(e,n,this),this.reloadConfigurationScheduler=this._register(new nr(()=>this.reloadConfiguration(),50)),this._register(this.defaultConfiguration.onDidChangeConfiguration(({defaults:s,properties:a})=>this.onDidDefaultConfigurationChange(s,a))),this._register(this.policyConfiguration.onDidChangeConfiguration(s=>this.onDidPolicyConfigurationChange(s))),this._register(this.userConfiguration.onDidChange(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){let[e,n,o]=await Promise.all([this.defaultConfiguration.initialize(),this.policyConfiguration.initialize(),this.userConfiguration.loadConfiguration()]);this.configuration=new Iu(e,n,yn.createEmptyModel(this.logService),o,yn.createEmptyModel(this.logService),yn.createEmptyModel(this.logService),new je,yn.createEmptyModel(this.logService),new je,this.logService)}getConfigurationData(){return this.configuration.toData()}getValue(e,n){let o=typeof e=="string"?e:void 0,i=Yv(e)?e:Yv(n)?n:{};return this.configuration.getValue(o,i,void 0)}async updateValue(e,n,o,i,s){let a=KU(o)?o:Yv(o)?{resource:o.resource,overrideIdentifiers:o.overrideIdentifier?[o.overrideIdentifier]:void 0}:void 0,l=a?i:o;if(l!==void 0&&l!==3&&l!==2)throw new Error(`Unable to write ${e} to target ${l}.`);a?.overrideIdentifiers&&(a.overrideIdentifiers=rn(a.overrideIdentifiers),a.overrideIdentifiers=a.overrideIdentifiers.length?a.overrideIdentifiers:void 0);let c=this.inspect(e,{resource:a?.resource,overrideIdentifier:a?.overrideIdentifiers?a.overrideIdentifiers[0]:void 0});if(c.policyValue!==void 0)throw new Error(`Unable to write ${e} because it is configured in system policy.`);if(Ge(n,c.defaultValue)&&(n=void 0),a?.overrideIdentifiers?.length&&a.overrideIdentifiers.length>1){let p=a.overrideIdentifiers.sort(),m=this.configuration.localUserConfiguration.overrides.find(g=>Gt([...g.identifiers].sort(),p));m&&(a.overrideIdentifiers=m.identifiers)}let u=a?.overrideIdentifiers?.length?[rN(a.overrideIdentifiers),e]:[e];await this.configurationEditing.write(u,n),await this.reloadConfiguration()}inspect(e,n={}){return this.configuration.inspect(e,n,void 0)}keys(){return this.configuration.keys(void 0)}async reloadConfiguration(){let e=await this.userConfiguration.loadConfiguration();this.onDidChangeUserConfiguration(e)}onDidChangeUserConfiguration(e){let n=this.configuration.toData(),o=this.configuration.compareAndUpdateLocalUserConfiguration(e);this.trigger(o,n,2)}onDidDefaultConfigurationChange(e,n){let o=this.configuration.toData(),i=this.configuration.compareAndUpdateDefaultConfiguration(e,n);this.trigger(i,o,7)}onDidPolicyConfigurationChange(e){let n=this.configuration.toData(),o=this.configuration.compareAndUpdatePolicyConfiguration(e);this.trigger(o,n,7)}trigger(e,n,o){let i=new gI(e,{data:n},this.configuration,void 0,this.logService);i.source=o,this._onDidChangeConfiguration.fire(i)}},cT=class{constructor(t,e,n){this.settingsResource=t;this.fileService=e;this.configurationService=n;this.queue=new Nr}write(t,e){return this.queue.queue(()=>this.doWriteConfiguration(t,e))}async doWriteConfiguration(t,e){let n;try{n=(await this.fileService.readFile(this.settingsResource)).value.toString()}catch(s){if(s.fileOperationResult===1)n="{}";else throw s}let o=[];if(bo(n,o,{allowTrailingComma:!0,allowEmptyContent:!0}),o.length>0)throw new Error("Unable to write into the settings file. Please open the file to correct errors/warnings in the file and try again.");let i=this.getEdits(n,t,e);n=Jv(n,i),await this.fileService.writeFile(this.settingsResource,O.fromString(n))}getEdits(t,e,n){let{tabSize:o,insertSpaces:i,eol:s}=this.formattingOptions;if(!e.length){let a=JSON.stringify(n,null,i?" ".repeat(o):" ");return[{content:a,length:a.length,offset:0}]}return Qv(t,e,n,{tabSize:o,insertSpaces:i,eol:s})}get formattingOptions(){if(!this._formattingOptions){let t=fr===3||fr===2?`
`:`\r
`,e=this.configurationService.getValue("files.eol",{overrideIdentifier:"jsonc"});e&&typeof e=="string"&&e!=="auto"&&(t=e),this._formattingOptions={eol:t,insertSpaces:!!this.configurationService.getValue("editor.insertSpaces",{overrideIdentifier:"jsonc"}),tabSize:this.configurationService.getValue("editor.tabSize",{overrideIdentifier:"jsonc"})}}return this._formattingOptions}}});function oK(r){let t=r&&typeof r=="object"?r.code:void 0;return typeof t=="string"&&/^[A-Za-z0-9_.-]{1,64}$/.test(t)?t:r instanceof Error&&/^[A-Za-z0-9_.-]{1,64}$/.test(r.name)?r.name:"error"}function kc(r){return r.res.statusCode&&r.res.statusCode>=200&&r.res.statusCode<300||r.res.statusCode===1223}function vN(r){return!!r.res.statusCode&&r.res.statusCode>=400&&r.res.statusCode<500}function IN(r){return!!r.res.statusCode&&r.res.statusCode>=500&&r.res.statusCode<600}function rK(r,t){if(!r)return;let e=r[t]??r[t.toLowerCase()];return Array.isArray(e)?e[0]:e}function bN(r){let t=rK(r,"retry-after");if(!t)return;let e=parseInt(t,10);return Number.isFinite(e)&&e>0?e:void 0}function SN(r){return r.res.statusCode===204}async function Cu(r){return SN(r)?null:(await Ir(r.stream)).toString()}function mT(r,t,e){return new Promise((n,o)=>{let i=[],s=0;Ya(r.stream,{onData:a=>{s+=a.byteLength,s>t?(o(e()),r.stream.destroy()):i.push(a)},onError:o,onEnd:()=>n(O.concat(i).toString())})})}async function ds(r){if(!kc(r))throw new Error("Server returned "+r.res.statusCode);return Cu(r)}async function us(r){if(!kc(r))throw new Error("Server returned "+r.res.statusCode);if(SN(r))return null;let e=(await Ir(r.stream)).toString();try{return JSON.parse(e)}catch(n){throw n.message+=`:
`+e,n}}function iK(r=!0,t=!0){if(fN===r&&hN===t)return;fN=r,hN=t;let e=St.as(Jn.Configuration),n=uT;uT=[{id:"http",order:15,title:d(4620,null),type:"object",scope:2,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:t,markdownDescription:d(4635,null),restricted:!0}}},{id:"http",order:15,title:d(4620,null),type:"object",scope:1,properties:{"http.electronFetch":{type:"boolean",default:!1,description:d(4618,null),restricted:!0}}},{id:"http",order:15,title:d(4620,null),type:"object",scope:r?1:2,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:d(4623,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,agentHost:{key:"http.proxy",scope:"ambient",transform:o=>typeof o=="string"?o:""}},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:d(4631,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:d(4625,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,agentHost:{key:"http.proxyKerberosServicePrincipal",scope:"ambient",transform:o=>typeof o=="string"?o:""}},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:d(4622,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,agentHost:{key:"http.noProxy",scope:"ambient",transform:o=>Array.isArray(o)?o:[]}},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:d(4624,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[d(4628,null),d(4629,null),d(4627,null),d(4630,null)],default:"override",markdownDescription:d(4626,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:d(4632,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificatesNode":{type:"boolean",tags:["experimental"],default:gT,markdownDescription:d(4633,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:d(4634,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:d(4619,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.webSocketAdditionalSupport":{type:"boolean",default:!0,markdownDescription:d(4636,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.experimental.networkInterfaceCheckInterval":{type:"number",default:300,minimum:-1,tags:["experimental"],markdownDescription:d(4621,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}}}}],e.updateConfigurations({add:uT,remove:n})}var ao,yN,pT,vI,gT,uT,fN,hN,Ui=v(()=>{Ve();xe();ue();Q();Xa();ee();br();Z();$o();ao=A("requestService"),yN="NO_FETCH_TELEMETRY",pT=class{constructor(t){this.original=t}toJSON(){if(!this.headers){let t=Object.create(null);for(let e in this.original)e.toLowerCase()==="authorization"||e.toLowerCase()==="proxy-authorization"?t[e]="*****":t[e]=this.original[e];this.headers=t}return this.headers}};vI=class extends D{constructor(e){super();this.logService=e;this.counter=0;this._onDidCompleteRequest=this._register(new R);this.onDidCompleteRequest=this._onDidCompleteRequest.event}async logAndRequest(e,n){if(e.logUrl===!1)return this._logHostAndRequest(e,n);let o=`#${++this.counter}: ${e.url}`;this.logService.trace(`${o} - begin`,e.type,new pT(e.headers??{}));let i=Date.now();try{let s=await n();return this.logService.trace(`${o} - end`,e.type,s.res.statusCode,s.res.headers),this._onDidCompleteRequest.fire({callSite:e.callSite,latency:Date.now()-i,statusCode:s.res.statusCode}),s}catch(s){throw on(s)?this.logService.trace(`${o} - cancelled`,e.type):this.logService.error(`${o} - error`,e.type,ye(s)),s}}async _logHostAndRequest(e,n){let o="<invalid url>";try{o=new URL(e.url??"").host}catch{}let i=`#${++this.counter}: ${o}`;this.logService.trace(`${i} - begin`,e.type);let s=Date.now();try{let a=await n();return this.logService.trace(`${i} - end`,e.type,a.res.statusCode),this._onDidCompleteRequest.fire({callSite:e.callSite,latency:Date.now()-s,statusCode:a.res.statusCode}),a}catch(a){throw on(a)?this.logService.trace(`${i} - cancelled`,e.type):this.logService.error(`${i} - error`,e.type,oK(a)),a}}};gT=!0,uT=[];iK()});var Ut,An,Dn=v(()=>{Z();Ut=A("environmentService"),An=Ut});import*as fT from"os";function lK({useAlternateBitness:r=!1}={}){return r?jg===0?process.env["ProgramFiles(x86)"]||null:Eu===0&&process.env.ProgramW6432||null:process.env.ProgramFiles||null}async function II({useAlternateBitness:r=!1,findPreview:t=!1}={}){let e=lK({useAlternateBitness:r});if(!e)return null;let n=$(e,"PowerShell");if(!await Ao.existsDirectory(n))return null;let o=-1,i=null;for(let l of await Ce.readdir(n)){let c=-1;if(t){let p=l.indexOf("-");if(p<0)continue;let m=l.substring(0,p);if(!xN.test(m)||l.substring(p+1)!=="preview")continue;c=parseInt(m,10)}else{if(!xN.test(l))continue;c=parseInt(l,10)}if(c<=o)continue;let u=$(n,l,"pwsh.exe");await Ao.existsFile(u)&&(i=u,o=c)}if(!i)return null;let s=e.includes("x86")?" (x86)":"",a=t?" Preview":"";return new Dc(i,`PowerShell${a}${s}`,!0)}async function CN({findPreview:r}={}){if(!process.env.LOCALAPPDATA)return null;let t=$(process.env.LOCALAPPDATA,"Microsoft","WindowsApps");if(!await Ao.existsDirectory(t))return null;let{pwshMsixDirRegex:e,pwshMsixName:n}=r?{pwshMsixDirRegex:aK,pwshMsixName:"PowerShell Preview (Store)"}:{pwshMsixDirRegex:sK,pwshMsixName:"PowerShell (Store)"};for(let o of await Ce.readdir(t))if(e.test(o)){let i=$(t,o,"pwsh.exe");return new Dc(i,n)}return null}function cK(){let r=$(fT.homedir(),".dotnet","tools","pwsh.exe");return new Dc(r,".NET Core PowerShell Global Tool")}function dK(){let r=$(fT.homedir(),"scoop","apps"),t=$(r,"pwsh","current","pwsh.exe");return new Dc(t,"PowerShell (Scoop)")}function uK(){let r=$(process.env.windir,jg===1&&Eu!==1?"SysNative":"System32","WindowsPowerShell","v1.0","powershell.exe");return new Dc(r,"Windows PowerShell",!0)}async function*pK(){let r=await II();r&&(yield r),r=await II({useAlternateBitness:!0}),r&&(yield r),r=await CN(),r&&(yield r),r=cK(),r&&(yield r),r=await II({findPreview:!0}),r&&(yield r),r=await CN({findPreview:!0}),r&&(yield r),r=await II({useAlternateBitness:!0,findPreview:!0}),r&&(yield r),r=await dK(),r&&(yield r),r=uK(),r&&(yield r)}async function*hT(){for await(let r of pK())await r.exists()&&(yield r)}async function EN(){for await(let r of hT())return r;return null}var xN,sK,aK,jg,Eu,Dc,yT=v(()=>{Oe();vo();xN=/^\d+$/,sK=/^Microsoft.PowerShell_.*/,aK=/^Microsoft.PowerShellPreview_.*/;switch(process.arch){case"ia32":jg=1;break;case"arm":case"arm64":jg=2;break;default:jg=0;break}process.env.PROCESSOR_ARCHITEW6432?Eu=process.env.PROCESSOR_ARCHITEW6432==="ARM64"?2:0:process.env.PROCESSOR_ARCHITECTURE==="ARM64"?Eu=2:process.env.PROCESSOR_ARCHITECTURE==="X86"?Eu=1:Eu=0;Dc=class{constructor(t,e,n){this.exePath=t;this.displayName=e;this.knownToExist=n}async exists(){return this.knownToExist===void 0&&(this.knownToExist=await Ao.existsFile(this.exePath)),this.knownToExist}}});function wN(r,...t){let e=t.reduce((i,s)=>(i[s]=!0,i),{}),n=[/^ELECTRON_.+$/,/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,/^SNAP(|_.*)$/,/^GDK_PIXBUF_.+$/,/^CODE_SERVER_.+$/,/^CS_.+$/];Object.keys(r).filter(i=>!e[i]).forEach(i=>{for(let s=0;s<n.length;s++)if(i.search(n[s])!==-1){delete r[i];break}})}function wu(r){if(!r)return;let t=new Set(["DEBUG","NODE_OPTIONS","VSCODE_NODE_OPTIONS","LD_PRELOAD","DYLD_INSERT_LIBRARIES"]);for(let e of Object.keys(r))t.has(e.toUpperCase())&&delete r[e]}var Ru=v(()=>{});import{promises as RN}from"fs";function TN(r=Qt){return r.comspec||"cmd.exe"}function PN(r){let t=[],e=!1,n=function(o){if(e){t.push(o);return}(!r.send(o,s=>{if(s&&console.error(s),e=!1,t.length>0){let a=t.slice(0);t=[],a.forEach(l=>n(l))}})||oe)&&(e=!0)};return{send:n}}async function mK(r){if(await Ce.exists(r)){let t;try{t=await RN.stat(r)}catch(e){e.message.startsWith("EACCES")&&(t=await RN.lstat(r))}return t?!t.isDirectory():!1}return!1}async function Qg(r,t,e,n=Qt,o=mK){if(Gn(r))return await o(r)?r:void 0;if(t===void 0&&(t=_r()),It(r)!=="."){let l=$(t,r);return await o(l)?l:void 0}let s=jR(n,"PATH");if(e===void 0&&G(s)&&(e=s.split(Fa)),e===void 0||e.length===0){let l=$(t,r);return await o(l)?l:void 0}for(let l of e){let c;if(Gn(l)?c=$(l,r):c=$(t,l,r),oe){let p=(jR(n,"PATHEXT")||".COM;.EXE;.BAT;.CMD").split(";").map(async m=>{let g=c+m;return await o(g)?g:void 0});for(let m of p){let g=await m;if(g)return g}}if(await o(c))return c}let a=$(t,r);return await o(a)?a:void 0}var Jg=v(()=>{Xt();Oe();fe();hr();Ru();Ie();vo();Me()});import{userInfo as fK}from"os";async function bI(r,t){return r===1?oe?yK():TN(t):hK(r,t)}function hK(r,t){if(Ke&&r===2||vt&&r===3)return"/bin/bash";if(!vT){let e;if(oe)e="/bin/bash";else{if(e=t.SHELL,!e)try{e=fK().shell}catch{}e||(e="sh"),e==="/bin/false"&&(e="/bin/bash")}vT=e}return vT}async function yK(){return IT||(IT=(await EN()).exePath),IT}var vT,IT,bT=v(()=>{fe();yT();Jg();vT=null;IT=null});function SI(r,t,e=IK){let n=r.find((h,I)=>h.length>0&&h[0]!=="-"&&t.hasOwnProperty(h)&&t[h].type==="subcommand"),o={},i=["_"],s=[],a={},l;for(let h in t){let I=t[h];I.type==="subcommand"?h===n&&(l=I):(I.alias&&(o[h]=I.alias),I.type==="string"||I.type==="string[]"?(i.push(h),I.deprecates&&i.push(...I.deprecates)):I.type==="boolean"&&(s.push(h),I.deprecates&&s.push(...I.deprecates)),I.global&&(a[h]=I))}if(l&&n){let h=a;for(let T in l.options)h[T]=l.options[T];let I=r.filter(T=>T!==n),x=e.getSubcommandReporter?e.getSubcommandReporter(n):void 0,E=SI(I,h,x);return{[n]:E,_:[]}}let c=new Set(s),u=new Set,p=r.filter(h=>{if(h.startsWith("--no-")){let I=h.slice(2);if(c.has(I))return u.add(I),!1}return!0}),m=(0,AN.default)(p,{string:i,boolean:s,alias:o});for(let h of u)m[h]=!0;let g={},y=m;g._=m._.map(h=>String(h)).filter(h=>h.length>0),delete y._;for(let h in t){let I=t[h];if(I.type==="subcommand")continue;I.alias&&delete y[I.alias];let x=y[h];if(I.deprecates)for(let E of I.deprecates)y.hasOwnProperty(E)&&(x||(x=y[E],x&&e.onDeprecatedOption(E,I.deprecationMessage||d(4252,null,h))),delete y[E]);if(typeof x<"u"){if(I.type==="string[]"){if(Array.isArray(x)||(x=[x]),!I.allowEmptyValue){let E=x.filter(T=>T.length>0);E.length!==x.length&&(e.onEmptyValue(h),x=E.length>0?E:void 0)}}else I.type==="string"&&(Array.isArray(x)?(x=x.pop(),e.onMultipleValues(h,x)):!x&&!I.allowEmptyValue&&(e.onEmptyValue(h),x=void 0));g[h]=x,I.deprecationMessage&&e.onDeprecatedOption(h,I.deprecationMessage)}delete y[h]}for(let h in y)e.onUnknownOption(h);return g}function bK(r,t){let e="";return t.args&&(Array.isArray(t.args)?e=` <${t.args.join("> <")}>`:e=` <${t.args}>`),t.alias?`-${t.alias} --${r}${e}`:`--${r}${e}`}function SK(r,t){let e=[];for(let n in r){let o=r[n],i=bK(n,o);e.push([i,o.description])}return DN(e,t)}function DN(r,t){let n=r.reduce((s,a)=>Math.max(s,a[0].length),12)+2+1;if(t-n<25)return r.reduce((s,a)=>s.concat([` ${a[0]}`,` ${a[1]}`]),[]);let o=t-n-1,i=[];for(let s of r){let a=s[0],l=xK(s[1],o),c=kN(n-a.length-2);i.push(" "+a+c+l[0]);for(let u=1;u<l.length;u++)i.push(kN(n)+l[u])}return i}function kN(r){return" ".repeat(r)}function xK(r,t){let e=[];for(;r.length;){let n=r.length<t?r.length:r.lastIndexOf(" ",t);n===0&&(n=t);let o=r.slice(0,n).trim();r=r.slice(n).trimStart(),e.push(o)}return e}function _N(r,t,e,n,o){let i=process.stdout.isTTY&&process.stdout.columns||80,s=o?.noInputFiles?"":o?.isChat?` [${d(4251,null)}]`:` [${d(4278,null)}...]`,a=o?.isChat?" chat":"",l=[`${r} ${e}`];l.push(""),l.push(`${d(4297,null)}: ${t}${a} [${d(4276,null)}]${s}`),l.push(""),o?.noPipe!==!0&&(l.push(CK(t,o?.isChat)),l.push(""));let c={},u=[];for(let p in n){let m=n[p];if(m.type==="subcommand")m.description&&u.push({command:p,description:m.description});else if(m.description&&m.cat){let g=m.cat,y=c[g];y||(c[g]=y={}),y[p]=m}}for(let p in c){let m=p,g=c[m];g&&(l.push(vK[m]),l.push(...SK(g,i)),l.push(""))}return u.length&&(l.push(d(4288,null)),l.push(...DN(u.map(p=>[p.command,p.description]),i)),l.push("")),l.join(`
`)}function CK(r,t){let e;return oe?t?e=`echo Hello World | ${r} chat <prompt> -`:e=`echo Hello World | ${r} -`:t?e=`ps aux | grep code | ${r} chat <prompt> -`:e=`ps aux | grep code | ${r} -`,d(4287,null,e)}function MN(r,t){return`${r||d(4295,null)}
${t||d(4294,null)}
${process.arch}`}var AN,vK,$t,IK,Yg=v(()=>{AN=d0(ww(),1);fe();ee();vK={o:d(4277,null),e:d(4261,null),t:d(4291,null),m:d(4272,null)},$t={chat:{type:"subcommand",description:"Pass in a prompt to run in a chat session in the current working directory.",options:{_:{type:"string[]",description:d(4281,null)},mode:{type:"string",cat:"o",alias:"m",args:"mode",description:d(4248,null)},"add-file":{type:"string[]",cat:"o",alias:"a",args:"path",description:d(4243,null)},maximize:{type:"boolean",cat:"o",description:d(4247,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:d(4284,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:d(4275,null)},profile:{type:"string",cat:"o",args:"profileName",description:d(4280,null)},help:{type:"boolean",alias:"h",description:d(4263,null)}}},"serve-web":{type:"subcommand",description:"Run a server that displays the editor UI in browsers.",options:{"cli-data-dir":{type:"string",args:"dir",description:d(4249,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"}}},agent:{type:"subcommand",description:"Start and interact with AI agent hosts.",options:{"cli-data-dir":{type:"string",args:"dir",description:d(4249,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"}}},tunnel:{type:"subcommand",description:"Make the current machine accessible from vscode.dev or other machines through a secure tunnel.",options:{"cli-data-dir":{type:"string",args:"dir",description:d(4249,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"},user:{type:"subcommand",options:{login:{type:"subcommand",options:{provider:{type:"string"},"access-token":{type:"string"}}}}}}},diff:{type:"boolean",cat:"o",alias:"d",args:["file","file"],description:d(4253,null)},merge:{type:"boolean",cat:"o",alias:"m",args:["path1","path2","base","result"],description:d(4273,null)},add:{type:"boolean",cat:"o",alias:"a",args:"folder",description:d(4242,null)},remove:{type:"boolean",cat:"o",args:"folder",description:d(4282,null)},goto:{type:"boolean",cat:"o",alias:"g",args:"file:line[:character]",description:d(4262,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:d(4274,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:d(4283,null)},agents:{type:"boolean",cat:"o",deprecates:["sessions"],description:d(4245,null)},"session-title-base64":{type:"string"},wait:{type:"boolean",cat:"o",alias:"w",description:d(4301,null)},waitMarkerFilePath:{type:"string"},locale:{type:"string",cat:"o",args:"locale",description:d(4269,null)},"user-data-dir":{type:"string",cat:"o",args:"dir",description:d(4298,null)},profile:{type:"string",cat:"o",args:"profileName",description:d(4280,null)},help:{type:"boolean",cat:"o",alias:"h",description:d(4263,null)},"stdin-to-clipboard":{type:"boolean",cat:"o",alias:"c",description:d(4250,null)},"extensions-dir":{type:"string",deprecates:["extensionHomePath"],cat:"e",args:"dir",description:d(4260,null)},"extensions-download-dir":{type:"string"},"builtin-extensions-dir":{type:"string"},"shared-data-dir":{type:"string"},"list-extensions":{type:"boolean",cat:"e",description:d(4268,null)},"agent-plugins-dir":{type:"string"},"agents-user-data-dir":{type:"string"},"agents-extensions-dir":{type:"string"},"show-versions":{type:"boolean",cat:"e",description:d(4285,null)},category:{type:"string",allowEmptyValue:!0,cat:"e",description:d(4246,null),args:"category"},"install-extension":{type:"string[]",cat:"e",args:"ext-id | path",description:d(4267,null)},"pre-release":{type:"boolean",cat:"e",description:d(4266,null)},"uninstall-extension":{type:"string[]",cat:"e",args:"ext-id",description:d(4293,null)},"update-extensions":{type:"boolean",cat:"e",description:d(4296,null)},"enable-proposed-api":{type:"string[]",allowEmptyValue:!0,cat:"e",args:"ext-id",description:d(4259,null)},"add-mcp":{type:"string[]",cat:"m",args:"json",description:d(4244,null)},version:{type:"boolean",cat:"t",alias:"v",description:d(4300,null)},verbose:{type:"boolean",cat:"t",global:!0,description:d(4299,null)},log:{type:"string[]",cat:"t",args:"level",global:!0,description:d(4271,null)},status:{type:"boolean",alias:"s",cat:"t",description:d(4286,null)},"prof-startup":{type:"boolean",cat:"t",description:d(4279,null)},"prof-append-timers":{type:"string"},"prof-duration-markers":{type:"string[]"},"prof-duration-markers-file":{type:"string"},"no-cached-data":{type:"boolean"},"prof-startup-prefix":{type:"string"},"prof-v8-extensions":{type:"boolean"},"disable-extensions":{type:"boolean",deprecates:["disableExtensions"],cat:"t",description:d(4256,null)},"disable-extension":{type:"string[]",cat:"t",args:"ext-id",description:d(4255,null)},sync:{type:"string",cat:"t",description:d(4292,null),args:["on | off"]},"inspect-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugPluginHost"],args:"port",cat:"t",description:d(4265,null)},"inspect-brk-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugBrkPluginHost"],args:"port",cat:"t",description:d(4264,null)},"disable-lcd-text":{type:"boolean",cat:"t",description:d(4258,null)},"disable-gpu":{type:"boolean",cat:"t",description:d(4257,null)},"disable-chromium-sandbox":{type:"boolean",cat:"t",description:d(4254,null)},sandbox:{type:"boolean"},"locate-shell-integration-path":{type:"string",cat:"t",args:["shell"],description:d(4270,null)},telemetry:{type:"boolean",cat:"t",description:d(4289,null)},remote:{type:"string",allowEmptyValue:!0},"folder-uri":{type:"string[]",cat:"o",args:"uri"},"file-uri":{type:"string[]",cat:"o",args:"uri"},"locate-extension":{type:"string[]"},extensionDevelopmentPath:{type:"string[]"},extensionDevelopmentKind:{type:"string[]"},extensionTestsPath:{type:"string"},extensionEnvironment:{type:"string"},debugId:{type:"string"},debugRenderer:{type:"boolean"},"inspect-ptyhost":{type:"string",allowEmptyValue:!0},"inspect-brk-ptyhost":{type:"string",allowEmptyValue:!0},"inspect-agenthost":{type:"string",allowEmptyValue:!0},"inspect-brk-agenthost":{type:"string",allowEmptyValue:!0},"inspect-sharedprocess":{type:"string",allowEmptyValue:!0},"inspect-brk-sharedprocess":{type:"string",allowEmptyValue:!0},"export-default-configuration":{type:"string"},"export-policy-data":{type:"string",allowEmptyValue:!0},"export-default-keybindings":{type:"string",allowEmptyValue:!0},"install-source":{type:"string"},"enable-smoke-test-driver":{type:"boolean"},"skip-sessions-welcome":{type:"boolean"},logExtensionHostCommunication:{type:"boolean"},"skip-release-notes":{type:"boolean"},"skip-welcome":{type:"boolean"},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"},"disable-updates":{type:"boolean"},"share-secrets-with-agents-app":{type:"boolean"},transient:{type:"boolean",cat:"t",description:d(4290,null)},"use-inmemory-secretstorage":{type:"boolean",deprecates:["disable-keytar"]},"password-store":{type:"string"},"disable-workspace-trust":{type:"boolean"},"disable-crash-reporter":{type:"boolean"},"crash-reporter-directory":{type:"string"},"crash-reporter-id":{type:"string"},"skip-add-to-recently-opened":{type:"boolean"},"open-url":{type:"boolean"},"file-write":{type:"boolean"},"file-chmod":{type:"boolean"},"install-builtin-extension":{type:"string[]"},force:{type:"boolean"},"do-not-sync":{type:"boolean"},"do-not-include-pack-dependencies":{type:"boolean"},trace:{type:"boolean"},"trace-memory-infra":{type:"boolean"},"trace-category-filter":{type:"string"},"trace-options":{type:"string"},"preserve-env":{type:"boolean"},"force-user-env":{type:"boolean"},"force-disable-user-env":{type:"boolean"},"open-devtools":{type:"boolean"},"disable-gpu-sandbox":{type:"boolean"},logsPath:{type:"string"},"__enable-file-policy":{type:"boolean"},editSessionId:{type:"string"},continueOn:{type:"string"},"enable-coi":{type:"boolean"},"unresponsive-sample-interval":{type:"string"},"unresponsive-sample-period":{type:"string"},"enable-rdp-display-tracking":{type:"boolean"},"disable-layout-restore":{type:"boolean"},"disable-experiments":{type:"boolean"},"no-proxy-server":{type:"boolean"},"no-sandbox":{type:"boolean",alias:"sandbox"},"proxy-server":{type:"string"},"proxy-bypass-list":{type:"string"},"proxy-pac-url":{type:"string"},"js-flags":{type:"string"},inspect:{type:"string",allowEmptyValue:!0},"inspect-brk":{type:"string",allowEmptyValue:!0},nolazy:{type:"boolean"},"force-device-scale-factor":{type:"string"},"force-renderer-accessibility":{type:"boolean"},"ignore-certificate-errors":{type:"boolean"},"allow-insecure-localhost":{type:"boolean"},"log-net-log":{type:"string"},vmodule:{type:"string"},_urls:{type:"string[]"},"disable-dev-shm-usage":{type:"boolean"},"profile-temp":{type:"boolean"},"ozone-platform":{type:"string"},"enable-tracing":{type:"string"},"trace-startup-format":{type:"string"},"trace-startup-file":{type:"string"},"trace-startup-duration":{type:"string"},"xdg-portal-required-version":{type:"string"},_:{type:"string[]"}},IK={onUnknownOption:()=>{},onMultipleValues:()=>{},onEmptyValue:()=>{},onDeprecatedOption:()=>{}}});function ST(r){return r.VSCODE_CLI==="1"}var LN=v(()=>{Oe();fe();ee();Yg()});function ON(r,t,e){return Math.min(Math.max(r,t),e)}var UN=v(()=>{ni()});import{spawn as EK}from"child_process";async function pl(r,t,e,n){return e["force-disable-user-env"]?(t.trace("resolveShellEnv(): skipped (--force-disable-user-env)"),{}):oe?(t.trace("resolveShellEnv(): skipped (Windows)"),{}):ST(n)&&!e["force-user-env"]?(t.trace("resolveShellEnv(): skipped (VSCODE_CLI is set)"),{}):(ST(n)?t.trace("resolveShellEnv(): running (--force-user-env)"):t.trace("resolveShellEnv(): running (macOS/Linux)"),xT||(xT=Pn.withAsyncBody(async(o,i)=>{let s=new _t,a=1e4,l=r.getValue("application.shellEnvironmentResolutionTimeout");typeof l=="number"&&(a=ON(l,1,120)*1e3);let c=setTimeout(()=>{s.dispose(!0),i(new Error(d(4639,null)))},a);try{o(await wK(t,s.token))}catch(u){!on(u)&&!s.token.isCancellationRequested?i(new Error(d(4637,null,rr(u)))):o({})}finally{clearTimeout(c),s.dispose()}})),xT)}async function wK(r,t){let e=process.env.ELECTRON_RUN_AS_NODE;r.trace("getUnixShellEnvironment#runAsNode",e);let n=process.env.ELECTRON_NO_ATTACH_CONSOLE;r.trace("getUnixShellEnvironment#noAttach",n);let o=Ee().replace(/-/g,"").substr(0,12),i=new RegExp(o+"({.*})"+o),s={...process.env,ELECTRON_RUN_AS_NODE:"1",ELECTRON_NO_ATTACH_CONSOLE:"1",VSCODE_RESOLVING_ENVIRONMENT:"1"};r.trace("getUnixShellEnvironment#env",s);let a=await bI(fr,s);return r.trace("getUnixShellEnvironment#shell",a),new Promise((l,c)=>{if(t.isCancellationRequested)return c(new He);let u=Ze(a),p,m,g="";/^(?:pwsh|powershell)(?:-preview)?$/.test(u)?(p=`& '${process.execPath}' ${g} -p '''${o}'' + JSON.stringify(process.env) + ''${o}'''`,m=["-Login","-Command"]):u==="nu"?(p=`^'${process.execPath}' ${g} -p '"${o}" + JSON.stringify(process.env) + "${o}"'`,m=["-i","-l","-c"]):u==="xonsh"?(p=`import os, json; print("${o}", json.dumps(dict(os.environ)), "${o}")`,m=["-i","-l","-c"]):(p=`'${process.execPath}' ${g} -p '"${o}" + JSON.stringify(process.env) + "${o}"'`,u==="tcsh"||u==="csh"?m=["-ic"]:m=["-i","-l","-c"]),r.trace("getUnixShellEnvironment#spawn",JSON.stringify(m),p);let y=EK(a,[...m,p],{detached:!0,stdio:["ignore","pipe","pipe"],env:s});t.onCancellationRequested(()=>(y.kill(),c(new He))),y.on("error",x=>{r.error("getUnixShellEnvironment#errorChildProcess",rr(x)),c(x)});let h=[];y.stdout.on("data",x=>h.push(x));let I=[];y.stderr.on("data",x=>I.push(x)),y.on("close",(x,E)=>{let T=Buffer.concat(h).toString("utf8");r.trace("getUnixShellEnvironment#raw",T);let P=Buffer.concat(I).toString("utf8");if(P.trim()&&r.trace("getUnixShellEnvironment#stderr",P),x||E)return c(new Error(d(4638,null,x,E)));let M=i.exec(T),X=M?M[1]:"{}";try{let N=JSON.parse(X);e?N.ELECTRON_RUN_AS_NODE=e:delete N.ELECTRON_RUN_AS_NODE,n?N.ELECTRON_NO_ATTACH_CONSOLE=n:delete N.ELECTRON_NO_ATTACH_CONSOLE,delete N.VSCODE_RESOLVING_ENVIRONMENT,delete N.XDG_RUNTIME_DIR,r.trace("getUnixShellEnvironment#result",N),l(N)}catch(N){r.error("getUnixShellEnvironment#errorCaught",rr(N)),c(N)}})})}var xT,Xg=v(()=>{Oe();ee();Jt();$s();xe();fe();Vt();bT();LN();Ue();UN()});import{parse as NN}from"url";function RK(r,t){return r.protocol==="http:"?t.HTTP_PROXY||t.http_proxy||null:r.protocol==="https:"&&(t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy)||null}async function FN(r,t,e={}){let n=NN(r),o=e.proxyUrl||RK(n,t);if(!o)return null;let i=NN(o);if(!/^https?:$/.test(i.protocol||""))return null;let s={host:i.hostname||"",port:(i.port?+i.port:0)||(i.protocol==="https"?443:80),auth:i.auth,rejectUnauthorized:er(e.strictSSL)?e.strictSSL:!0,keepAlive:!0};if(n.protocol==="http:"){let{default:a}=await import("http-proxy-agent");return new a.HttpProxyAgent(o,s)}else{let{default:a}=await import("https-proxy-agent");return new a.HttpsProxyAgent(o,s)}}var HN=v(()=>{Ie()});import{parse as WN}from"url";import{createGunzip as TK}from"zlib";function AK(r){if(r instanceof Error){let t=r.code;return!!t&&PK.has(t)}return!1}async function DK(r,t,e,n){let o=await import("kerberos"),i=o.default||o,s=new URL(r),a=t||(process.platform==="win32"?`HTTP/${s.hostname}`:`HTTP@${s.hostname}`);return e.debug(`${n} Kerberos authentication lookup`,`proxyURL:${s}`,`spn:${a}`),(await i.initializeClient(a)).step("")}async function _K(r){return(WN(r.url).protocol==="https:"?await import("https"):await import("http")).request}function MK(r,t){try{let e=new URL(r),n=new URL(t,e);if(n.protocol==="http:"||n.protocol==="https:")return{url:n.toString(),crossOrigin:e.origin!==n.origin}}catch{}}function LK(r,t,e){if(!r||!t&&!e)return r;let n={};for(let o of Object.keys(r)){let i=o.toLowerCase();if(!(t&&VN.has(i))){switch(i){case"content-type":case"content-encoding":case"content-language":case"content-location":case"content-length":case"origin":if(e)continue;break}n[o]=r[o]}}return n}async function BN(r,t){let n,o=kK.test(r.type||"GET");for(let i=1;i<=3;i++)try{return await OK(r,t)}catch(s){if(n=s,s instanceof He||!o||!AK(s)||i===3)throw s;await ko(100*i,t)}throw n}async function OK(r,t){return Pn.withAsyncBody(async(e,n)=>{let o=WN(r.url),i=!!o.auth||r.user!==void 0||r.password!==void 0||Object.keys(r.headers??{}).some(g=>VN.has(g.toLowerCase())),s=!r.isChromiumNetwork||to(r.followRedirects)||i,a=to(r.followRedirects)?r.followRedirects:r.isChromiumNetwork?20:3,l=r.getRawRequest?r.getRawRequest(r):await _K(r),c={hostname:o.hostname,port:o.port?parseInt(o.port):o.protocol==="https:"?443:80,protocol:o.protocol,path:o.path,method:r.type||"GET",headers:r.headers,agent:r.agent,rejectUnauthorized:er(r.strictSSL)?r.strictSSL:!0};r.user&&r.password&&(c.auth=r.user+":"+r.password),r.disableCache&&(c.cache="no-store"),r.isChromiumNetwork&&(s&&(c.redirect="manual"),c.url=r.url);let u=(g,y,h=r.type)=>{let I=g&&g>=300&&g<400&&a>0&&y?MK(r.url,y):void 0;if(I){let x=h!==(r.type||"GET")&&(h==="GET"||h==="HEAD");return BN({...r,url:I.url,type:h,data:x?void 0:r.data,followRedirects:a-1,headers:LK(r.headers,I.crossOrigin,x),user:I.crossOrigin?void 0:r.user,password:I.crossOrigin?void 0:r.password},t).then(e,n),!0}return!1},p=l(c,g=>{if(!r.isChromiumNetwork&&u(g.statusCode,g.headers.location))g.resume();else{let y=g;!r.isChromiumNetwork&&g.headers["content-encoding"]==="gzip"&&(y=g.pipe(TK())),e({res:g,stream:EU(y)})}});if(p.on("error",n),r.isChromiumNetwork&&s&&p.on("redirect",(g,y,h,I)=>{p.abort(),u(g,h,y)||e({res:{statusCode:g,headers:I},stream:hU()})}),r.timeout)if(r.isChromiumNetwork){let g=setTimeout(()=>{p.abort(),n(new Error(`Request timeout after ${r.timeout}ms`))},r.timeout);p.on("response",()=>clearTimeout(g)),p.on("error",()=>clearTimeout(g)),p.on("abort",()=>clearTimeout(g))}else p.setTimeout(r.timeout);r.isChromiumNetwork&&p.removeHeader("Content-Length"),r.data&&typeof r.data=="string"&&p.write(r.data),p.end();let m=t.onCancellationRequested(()=>{m.dispose(),p.abort(),n(new He)});p.on("response",()=>m.dispose()),p.on("error",()=>m.dispose()),p.on("abort",()=>m.dispose())})}var PK,kK,VN,ml,CT=v(()=>{Ue();Ve();xe();Xa();Ie();dn();Dn();Xg();De();Ui();HN();PK=new Set(["EAI_AGAIN","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ENETDOWN","ENETUNREACH","EPROTO"]),kK=/^(GET|HEAD|OPTIONS)$/i,VN=new Set(["authorization","cookie","cookie2"]);ml=class extends vI{constructor(e,n,o,i){super(i);this.machine=e;this.configurationService=n;this.environmentService=o;this.configure(),this._register(n.onDidChangeConfiguration(s=>{s.affectsConfiguration("http")&&this.configure()}))}configure(){this.proxyUrl=this.getConfigValue("http.proxy"),this.strictSSL=!!this.getConfigValue("http.proxyStrictSSL"),this.authorization=this.getConfigValue("http.proxyAuthorization")}async request(e,n){let{proxyUrl:o,strictSSL:i}=this,s;try{s=await pl(this.configurationService,this.logService,this.environmentService.args,process.env)}catch(c){this.shellEnvErrorLogged||(this.shellEnvErrorLogged=!0,this.logService.error("resolving shell environment failed",ye(c)))}let a={...process.env,...s},l=e.agent?e.agent:await FN(e.url||"",a,{proxyUrl:o,strictSSL:i});return e.agent=l,e.strictSSL=i,this.authorization&&(e.headers={...e.headers||{},"Proxy-Authorization":this.authorization}),this.logAndRequest(e,()=>BN(e,n))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){try{let n=this.getConfigValue("http.proxyKerberosServicePrincipal");return"Negotiate "+await DK(e,n,this.logService,"RequestService#lookupKerberosAuthorization")}catch(n){this.logService.debug("RequestService#lookupKerberosAuthorization Kerberos authentication failed",n);return}}async loadCertificates(){return(await import("@vscode/proxy-agent")).loadSystemCertificates({loadSystemCertificatesFromNode:()=>this.getConfigValue("http.systemCertificatesNode",gT),log:this.logService})}getConfigValue(e,n){if(this.machine==="remote")return this.configurationService.getValue(e);let o=this.configurationService.inspect(e);return o.userLocalValue??o.defaultValue??n}};ml=w([b(1,bt),b(2,An),b(3,z)],ml)});function ET(r){if(!r)return;let t=r.indexOf("+");return t<0?r:r.substr(0,t)}var wT=v(()=>{Me()});function UK(r){if(ei===2&&/^penguin(\.|$)/i.test(r))return"chromebook"}function qN(r,t,e,n,o,i,s,a,l,c,u){let p=Object.create(null);p["common.machineId"]=i,p["common.sqmId"]=s,p["common.devDeviceId"]=a,p.sessionID=Ee()+Date.now(),p.commitHash=n,p.version=o,p["common.releaseDate"]=c,p["common.platformVersion"]=(r||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),p["common.platform"]=cg(ei),p["common.nodePlatform"]=av,p["common.nodeArch"]=e,p["common.product"]=u||"desktop",l&&(p["common.msftInternal"]=l);let m=0,g=Date.now();Object.defineProperties(p,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-g,enumerable:!0},"common.sequence":{get:()=>m++,enumerable:!0}}),D0&&(p["common.snap"]="true");let y=UK(t);return y&&(p["common.platformDetail"]=y),p}function $N(r){let t=Qt.USERDNSDOMAIN;if(!t)return!1;let e=t.toLowerCase();return r.some(n=>e===n)}var TT=v(()=>{fe();hr();Vt()});function zN(r){return r?.includes("model-router:")?xI:r}var Mt,xI,Yge,PT,kT,GN,KN,Tu,CI,Zg,_n=v(()=>{Z();Mt=A("telemetryService"),xI="modelRouter";Yge=A("customEndpointTelemetryService"),PT="telemetry.currentSessionDate",kT="telemetry.firstSessionDate",GN="telemetry.lastSessionDate",KN="telemetry",Tu="telemetry.telemetryLevel",CI="telemetry.enableCrashReporter",Zg="telemetry.enableTelemetry"});function wI(r,t){return!t.isBuilt&&!t.disableTelemetry?!0:!(t.disableTelemetry||!r.enableTelemetry)}function RI(r,t){return t.extensionTestsLocationURI?!0:!(t.isBuilt||t.disableTelemetry||r.enableTelemetry&&r.aiConfig?.ariaKey)}function tf(r){let t=r.getValue(Tu),e=r.getValue(CI);if(r.getValue(Zg)===!1||e===!1)return 0;switch(t===void 0?"all":t){case"all":return 3;case"error":return 2;case"crash":return 1;case"off":return 0;default:return 0}}function TI(r){let t={},e={},n={};ZN(r,n);for(let o in n){o=o.length>150?o.substr(o.length-149):o;let i=n[o];typeof i=="number"?e[o]=i:typeof i=="boolean"?e[o]=i?1:0:typeof i=="string"?(i.length>8192&&console.warn(`Telemetry property: ${o} has been trimmed to 8192, the original length is ${i.length}`),t[o]=i.substring(0,8191)):typeof i<"u"&&i!==null&&(t[o]=String(i))}return{properties:t,measurements:e}}function XN(r,t){if(!r)return"none";let e=ET(r),n=t?.remoteExtensionTips;if(n&&Object.prototype.hasOwnProperty.call(n,e))return e;let o=t?.virtualWorkspaceExtensionTips;return o&&Object.prototype.hasOwnProperty.call(o,e)?e:"other"}function ZN(r,t,e=0,n){if(!r||typeof r!="object"&&typeof r!="function")return;let o=r;for(let i of Object.getOwnPropertyNames(o)){let s=o[i],a=n?n+i:i;Array.isArray(s)?t[a]=pu(s):s instanceof Date?t[a]=s.toISOString():ve(s)?e<2?ZN(s,t,e+1,a+"."):t[a]=pu(s):t[a]=s}}function eF(r,t){let e=r.msftInternalDomains||[],n=t.getValue("telemetry.internalTesting");return $N(e)||n}function tF(r){return[r.appRoot,r.extensionsPath,r.userHome.fsPath,r.tmpDir.fsPath,r.userDataPath]}function nF(r){return[r.userHome.fsPath,r.tmpDir.fsPath]}function jN(r,t){let e=[];for(let n of t)for(;;){let o=n.exec(r);if(!o)break;e.push([o.index,n.lastIndex])}return e}function NK(r,t,e){if(!r||!r.includes("/")&&!r.includes("\\"))return r;let n=r,o=jN(r,t),i=jN(r,e),s=/(?:^|[\\\/])((node_modules|node_modules\.asar)[\\\/].*)$/,a=/^(.*?)((?:\.vscode(?:-[a-z]+)*|resources[\\\/]app)[\\\/]extensions[\\\/].*)$/i,l=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w\-\._@]+(\\\\|\\|\/))+[\w\-\._@]*/g,c=0;for(n="";;){let u=l.exec(r);if(!u)break;if(!o.some(([m,g])=>u.index<g&&m<l.lastIndex)){let m=i.some(([y,h])=>u.index<h&&y<l.lastIndex),g=m?null:a.exec(u[0]);if(g)n+=r.substring(c,u.index)+"<REDACTED: user-file-path>/"+g[2];else{let y=m?null:s.exec(u[0]);y?n+=r.substring(c,u.index)+"<REDACTED: user-file-path>/"+y[1]:n+=r.substring(c,u.index)+"<REDACTED: user-file-path>"}c=l.lastIndex}}return c<r.length&&(n+=r.substr(c)),n}function QN(r,t=r){for(let e of oF)if(e.regex.test(t))return`<REDACTED: ${e.label}>`;return r}function HK(r){if(!r)return r;let t=!1;for(let n of oF)if(n.regex.test(r)){t=!0;break}if(!t)return r;if(!r.includes(`
`))return QN(r);let e=r.split(`
`);for(let n=0;n<e.length;n++){let o=n<e.length-1?e[n]+`
`:e[n];e[n]=QN(e[n],o)}return e.join(`
`)}function nf(r,t,e=t,n=[]){return r?so(r,o=>{if(o instanceof Sr||Object.hasOwnProperty.call(o,"isTrustedTelemetryValue"))return o.value;if(typeof o=="string"){let i=o.replaceAll("%20"," ");i.includes("OneDrive - ")&&(i=i.replace(FK,"OneDrive")),i=NK(i,e,n);for(let s of t)i=i.replace(s,"");return i=HK(i),i}}):{}}var Sr,ef,JN,DT,EI,YN,oF,FK,Wr=v(()=>{Xt();Ie();ee();wT();TT();_n();Sr=class{constructor(t){this.value=t;this.isTrustedTelemetryValue=!0}},ef=class{constructor(){this.telemetryLevel=0;this.sessionId="someValue.sessionId";this.machineId="someValue.machineId";this.sqmId="someValue.sqmId";this.devDeviceId="someValue.devDeviceId";this.firstSessionDate="someValue.firstSessionDate";this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}setCommonProperty(){}},JN=new ef,DT="telemetry",EI={id:DT,name:d(4660,null)},YN={log:()=>null,flush:()=>Promise.resolve(void 0)};oF=[{label:"URL",regex:/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]*/},{label:"Google API Key",regex:/AIza[0-9A-Za-z_\-]{20,}/},{label:"JWT",regex:/eyJ[0eXAiOiJKV1Qi|hbGci|a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+/},{label:"Slack Token",regex:/xox[pbar]\-[A-Za-z0-9]/},{label:"GitHub Token",regex:/(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/},{label:"Generic Secret",regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:"CLI Credentials",regex:/((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/},{label:"CLI Password Flag",regex:/(?:^|[\s"'`])(?:--?(?:pw|pass)(?:\s+|=)|\/pass:|sshpass\s+-p\s*)["']?[^\s"'$\-]/i},{label:"CLI Basic Auth",regex:/(?:^|\s)(?:-u(?:\s+|=)?|--user(?:\s+|=))["']?(?!\d+:\d+\b)[^\s:"']+:[^\s"']+/},{label:"Microsoft Entra ID",regex:/eyJ(?:0eXAiOiJKV1Qi|hbGci|[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.)/},{label:"Email",regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/}],FK=/OneDrive - (?:[^\\\/\r\n"<>|:*?]+(?=[\\\/])|[^\\\/\r\n"'`]+)/g});var ufe,of=v(()=>{ee();ufe={Extensions:{name:{key:"extensionsConfigurationTitle",value:d(141,null)}},IntegratedTerminal:{name:{key:"terminalIntegratedConfigurationTitle",value:d(144,null)}},InteractiveSession:{name:{key:"interactiveSessionConfigurationTitle",value:d(142,null)}},Telemetry:{name:{key:"telemetryConfigurationTitle",value:d(143,null)}},Update:{name:{key:"updateConfigurationTitle",value:d(145,null)}}}});function rF(r){return r===0?VK:WK}function iF(r,t){let e=rF(r),n=t?.toLowerCase();return!n||!BK.test(n)?`${e}.cache`:`${e}.${n}.cache`}function sF(r,t,e){let n=e?r.toLowerCase():r;return n.startsWith(`${rF(t)}.`)&&n.endsWith(".cache")}function _T(r){return qK(r)}function qK(r){return r.contributes&&r.contributes.localizations?r.contributes.localizations.length>0:!1}function aF(r){return r.map(t=>t.split("@")[0])}var WK,VK,PI,BK,kI,un,rf,_c,ffe,Yn=v(()=>{Tt();Z();wT();WK="extensions.user",VK="extensions.builtin",PI="undefined_publisher",BK=/^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$/;kI=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"],un=class{constructor(t){this.value=t,this._lower=t.toLowerCase()}static equals(t,e){if(typeof t>"u"||t===null)return typeof e>"u"||e===null;if(typeof e>"u"||e===null)return!1;if(typeof t=="string"||typeof e=="string"){let n=typeof t=="string"?t:t.value,o=typeof e=="string"?e:e.value;return Po(n,o)}return t._lower===e._lower}static toKey(t){return typeof t=="string"?t.toLowerCase():t._lower}},rf=class{constructor(t){this._set=new Set;if(t)for(let e of t)this.add(e)}get size(){return this._set.size}add(t){this._set.add(un.toKey(t))}delete(t){return this._set.delete(un.toKey(t))}has(t){return this._set.has(un.toKey(t))}},_c=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(t){this._map.delete(un.toKey(t))}get(t){return this._map.get(un.toKey(t))}has(t){return this._map.has(un.toKey(t))}set(t,e){this._map.set(un.toKey(t),e)}values(){return this._map.values()}forEach(t){this._map.forEach(t)}[Symbol.iterator](){return this._map[Symbol.iterator]()}};ffe=A("IBuiltinExtensionsScannerService")});function OT(r){switch(r){case"win32-x64":return"Windows 64 bit";case"win32-arm64":return"Windows ARM";case"linux-x64":return"Linux 64 bit";case"linux-arm64":return"Linux ARM 64";case"linux-armhf":return"Linux ARM";case"alpine-x64":return"Alpine Linux 64 bit";case"alpine-arm64":return"Alpine ARM 64";case"darwin-x64":return"Mac";case"darwin-arm64":return"Mac Silicon";case"web":return"Web";case"universal":return"universal";case"unknown":return"unknown";case"undefined":return"undefined"}}function uF(r){switch(r){case"win32-x64":return"win32-x64";case"win32-arm64":return"win32-arm64";case"linux-x64":return"linux-x64";case"linux-arm64":return"linux-arm64";case"linux-armhf":return"linux-armhf";case"alpine-x64":return"alpine-x64";case"alpine-arm64":return"alpine-arm64";case"darwin-x64":return"darwin-x64";case"darwin-arm64":return"darwin-arm64";case"web":return"web";case"universal":return"universal";default:return"unknown"}}function AI(r,t){switch(r){case 3:return t==="x64"?"win32-x64":t==="arm64"?"win32-arm64":"unknown";case 2:return t==="x64"?"linux-x64":t==="arm64"?"linux-arm64":t==="arm"?"linux-armhf":"unknown";case"alpine":return t==="x64"?"alpine-x64":t==="arm64"?"alpine-arm64":"unknown";case 1:return t==="x64"?"darwin-x64":t==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}function Au(r,t){return t==="web"&&!r.includes("web")}function af(r,t,e){return Au(t,e)?!1:r==="undefined"||r==="universal"?!0:r==="unknown"?!1:r===e}function pF(r){let t=r;return!!t&&typeof t=="object"&&typeof t.id=="string"&&(!t.uuid||typeof t.uuid=="string")}async function DI(r,t){let e;try{e=await t.resolve(r)}catch(n){if(n.fileOperationResult===1)return 0;throw n}return e.children?(await Promise.all(e.children.map(o=>DI(o.resource,t)))).reduce((o,i)=>o+i,0):e.size??0}function gF(r,t){return r?t?.capabilities.signing?.allPrivateRepositorySigned===!0:t?.capabilities.signing?.allPublicRepositorySigned===!0}var ku,sf,$K,lF,LT,cF,dF,So,Vr,Nt,Du,_fe,Mfe,Br,Lfe,Ofe,lf,mF,_o=v(()=>{fe();of();ee();br();Yn();st();Z();$o();ku="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",sf=new RegExp(ku),$K="^([a-z0-9A-Z][a-z0-9-A-Z]*)$",lF="__web_extension",LT="extensionInstallSource",cF="dependecyOrPackExtensionInstall",dF="clientTargetPlatform";So=A("extensionGalleryService"),Vr=class extends Error{constructor(e,n){super(e);this.code=n;this.name=n}},Nt=class extends Error{constructor(e,n){super(e);this.code=n;this.name=n}},Du=A("extensionManagementService"),_fe=A("IGlobalExtensionEnablementService"),Mfe=A("IExtensionTipsService"),Br=A("IAllowedExtensionsService");Lfe=rg(4328,"Extensions"),Ofe=rg(4345,"Preferences"),lf="extensions.allowed",mF="extensions.requestTimeout";St.as(Jn.Configuration).registerConfiguration({id:"extensions",order:30,title:d(4344,null),type:"object",properties:{[lf]:{type:"object",markdownDescription:d(4334,null),default:"*",defaultSnippets:[{body:{},description:d(4339,null)},{body:{"*":!0},description:d(4335,null)}],scope:1,policy:{name:"AllowedExtensions",category:"Extensions",minimumVersion:"1.96",localization:{description:{key:"extensions.allowed.policy",value:d(4340,null)}}},additionalProperties:!1,patternProperties:{[ku]:{anyOf:[{type:["boolean","string"],enum:[!0,!1,"stable"],description:d(4332,null),enumDescriptions:[d(4338,null),d(4336,null),d(4337,null)]},{type:"array",items:{type:"string"},description:d(4333,null)}]},[$K]:{type:["boolean","string"],enum:[!0,!1,"stable"],description:d(4327,null),enumDescriptions:[d(4343,null),d(4341,null),d(4342,null)]},"\\*":{type:"boolean",enum:[!0,!1],description:d(4329,null),enumDescriptions:[d(4331,null),d(4330,null)]}}}}})});var _I,ft,Nfe,Ffe,fF,Hfe,Wfe,Vfe,Bfe,qfe,$fe,zfe,ps,hF,MI,Gfe,yF,Kfe,jfe,Qfe,LI,Jfe,Yfe,Xfe,Zfe,ehe,the,nhe,vF,ohe,rhe,ihe,she,ahe,lhe,che,dhe,uhe,phe,gl=v(()=>{_I={},ft={exports:_I};(function(r,t){if(typeof _I=="object"&&typeof ft=="object")ft.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e=t();for(var n in e)(typeof _I=="object"?_I:r)[n]=e[n]}})(typeof self<"u"?self:void 0,(function(){return(function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(n,o,i){e.o(n,o)||Object.defineProperty(n,o,{enumerable:!0,get:i})},e.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,o){if(1&o&&(n=e(n)),8&o||4&o&&typeof n=="object"&&n&&n.__esModule)return n;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&o&&typeof n!="string")for(var s in n)e.d(i,s,function(a){return n[a]}.bind(null,s));return i},e.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(o,"a",o),o},e.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},e.p="",e(e.s=0)})([function(r,t,e){(function(n){var o;t=r.exports=At,o=typeof n=="object"&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var k=Array.prototype.slice.call(arguments,0);k.unshift("SEMVER"),console.log.apply(console,k)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=t.re=[],l=t.src=[],c=0,u=c++;l[u]="0|[1-9]\\d*";var p=c++;l[p]="[0-9]+";var m=c++;l[m]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var g=c++;l[g]="("+l[u]+")\\.("+l[u]+")\\.("+l[u]+")";var y=c++;l[y]="("+l[p]+")\\.("+l[p]+")\\.("+l[p]+")";var h=c++;l[h]="(?:"+l[u]+"|"+l[m]+")";var I=c++;l[I]="(?:"+l[p]+"|"+l[m]+")";var x=c++;l[x]="(?:-("+l[h]+"(?:\\."+l[h]+")*))";var E=c++;l[E]="(?:-?("+l[I]+"(?:\\."+l[I]+")*))";var T=c++;l[T]="[0-9A-Za-z-]+";var P=c++;l[P]="(?:\\+("+l[T]+"(?:\\."+l[T]+")*))";var M=c++,X="v?"+l[g]+l[x]+"?"+l[P]+"?";l[M]="^"+X+"$";var N="[v=\\s]*"+l[y]+l[E]+"?"+l[P]+"?",ae=c++;l[ae]="^"+N+"$";var Y=c++;l[Y]="((?:<|>)?=?)";var W=c++;l[W]=l[p]+"|x|X|\\*";var J=c++;l[J]=l[u]+"|x|X|\\*";var we=c++;l[we]="[v=\\s]*("+l[J]+")(?:\\.("+l[J]+")(?:\\.("+l[J]+")(?:"+l[x]+")?"+l[P]+"?)?)?";var In=c++;l[In]="[v=\\s]*("+l[W]+")(?:\\.("+l[W]+")(?:\\.("+l[W]+")(?:"+l[E]+")?"+l[P]+"?)?)?";var Wt=c++;l[Wt]="^"+l[Y]+"\\s*"+l[we]+"$";var de=c++;l[de]="^"+l[Y]+"\\s*"+l[In]+"$";var j=c++;l[j]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var ie=c++;l[ie]="(?:~>?)";var K=c++;l[K]="(\\s*)"+l[ie]+"\\s+",a[K]=new RegExp(l[K],"g");var V=c++;l[V]="^"+l[ie]+l[we]+"$";var le=c++;l[le]="^"+l[ie]+l[In]+"$";var me=c++;l[me]="(?:\\^)";var dt=c++;l[dt]="(\\s*)"+l[me]+"\\s+",a[dt]=new RegExp(l[dt],"g");var We=c++;l[We]="^"+l[me]+l[we]+"$";var et=c++;l[et]="^"+l[me]+l[In]+"$";var lt=c++;l[lt]="^"+l[Y]+"\\s*("+N+")$|^$";var Lt=c++;l[Lt]="^"+l[Y]+"\\s*("+X+")$|^$";var zt=c++;l[zt]="(\\s*)"+l[Y]+"\\s*("+N+"|"+l[we]+")",a[zt]=new RegExp(l[zt],"g");var mo=c++;l[mo]="^\\s*("+l[we]+")\\s+-\\s+("+l[we]+")\\s*$";var Zi=c++;l[Zi]="^\\s*("+l[In]+")\\s+-\\s+("+l[In]+")\\s*$";var Ua=c++;l[Ua]="(<|>)?=?\\s*\\*";for(var Ro=0;Ro<35;Ro++)o(Ro,l[Ro]),a[Ro]||(a[Ro]=new RegExp(l[Ro]));function Os(k,U){if(k instanceof At)return k;if(typeof k!="string"||k.length>i||!(U?a[ae]:a[M]).test(k))return null;try{return new At(k,U)}catch{return null}}function At(k,U){if(k instanceof At){if(k.loose===U)return k;k=k.version}else if(typeof k!="string")throw new TypeError("Invalid Version: "+k);if(k.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof At))return new At(k,U);o("SemVer",k,U),this.loose=U;var H=k.trim().match(U?a[ae]:a[M]);if(!H)throw new TypeError("Invalid Version: "+k);if(this.raw=k,this.major=+H[1],this.minor=+H[2],this.patch=+H[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");H[4]?this.prerelease=H[4].split(".").map((function(Te){if(/^[0-9]+$/.test(Te)){var Fe=+Te;if(Fe>=0&&Fe<s)return Fe}return Te})):this.prerelease=[],this.build=H[5]?H[5].split("."):[],this.format()}t.parse=Os,t.valid=function(k,U){var H=Os(k,U);return H?H.version:null},t.clean=function(k,U){var H=Os(k.trim().replace(/^[=v]+/,""),U);return H?H.version:null},t.SemVer=At,At.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},At.prototype.toString=function(){return this.version},At.prototype.compare=function(k){return o("SemVer.compare",this.version,this.loose,k),k instanceof At||(k=new At(k,this.loose)),this.compareMain(k)||this.comparePre(k)},At.prototype.compareMain=function(k){return k instanceof At||(k=new At(k,this.loose)),Na(this.major,k.major)||Na(this.minor,k.minor)||Na(this.patch,k.patch)},At.prototype.comparePre=function(k){if(k instanceof At||(k=new At(k,this.loose)),this.prerelease.length&&!k.prerelease.length)return-1;if(!this.prerelease.length&&k.prerelease.length)return 1;if(!this.prerelease.length&&!k.prerelease.length)return 0;var U=0;do{var H=this.prerelease[U],Te=k.prerelease[U];if(o("prerelease compare",U,H,Te),H===void 0&&Te===void 0)return 0;if(Te===void 0)return 1;if(H===void 0)return-1;if(H!==Te)return Na(H,Te)}while(++U)},At.prototype.inc=function(k,U){switch(k){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",U);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",U);break;case"prepatch":this.prerelease.length=0,this.inc("patch",U),this.inc("pre",U);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",U),this.inc("pre",U);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var H=this.prerelease.length;--H>=0;)typeof this.prerelease[H]=="number"&&(this.prerelease[H]++,H=-2);H===-1&&this.prerelease.push(0)}U&&(this.prerelease[0]===U?isNaN(this.prerelease[1])&&(this.prerelease=[U,0]):this.prerelease=[U,0]);break;default:throw new Error("invalid increment argument: "+k)}return this.format(),this.raw=this.version,this},t.inc=function(k,U,H,Te){typeof H=="string"&&(Te=H,H=void 0);try{return new At(k,H).inc(U,Te).version}catch{return null}},t.diff=function(k,U){if(ke(k,U))return null;var H=Os(k),Te=Os(U);if(H.prerelease.length||Te.prerelease.length){for(var Fe in H)if((Fe==="major"||Fe==="minor"||Fe==="patch")&&H[Fe]!==Te[Fe])return"pre"+Fe;return"prerelease"}for(var Fe in H)if((Fe==="major"||Fe==="minor"||Fe==="patch")&&H[Fe]!==Te[Fe])return Fe},t.compareIdentifiers=Na;var Yy=/^[0-9]+$/;function Na(k,U){var H=Yy.test(k),Te=Yy.test(U);return H&&Te&&(k=+k,U=+U),H&&!Te?-1:Te&&!H?1:k<U?-1:k>U?1:0}function Ri(k,U,H){return new At(k,H).compare(new At(U,H))}function Od(k,U,H){return Ri(k,U,H)>0}function Ud(k,U,H){return Ri(k,U,H)<0}function ke(k,U,H){return Ri(k,U,H)===0}function Sw(k,U,H){return Ri(k,U,H)!==0}function Xy(k,U,H){return Ri(k,U,H)>=0}function Zy(k,U,H){return Ri(k,U,H)<=0}function Zm(k,U,H,Te){var Fe;switch(U){case"===":typeof k=="object"&&(k=k.version),typeof H=="object"&&(H=H.version),Fe=k===H;break;case"!==":typeof k=="object"&&(k=k.version),typeof H=="object"&&(H=H.version),Fe=k!==H;break;case"":case"=":case"==":Fe=ke(k,H,Te);break;case"!=":Fe=Sw(k,H,Te);break;case">":Fe=Od(k,H,Te);break;case">=":Fe=Xy(k,H,Te);break;case"<":Fe=Ud(k,H,Te);break;case"<=":Fe=Zy(k,H,Te);break;default:throw new TypeError("Invalid operator: "+U)}return Fe}function Ar(k,U){if(k instanceof Ar){if(k.loose===U)return k;k=k.value}if(!(this instanceof Ar))return new Ar(k,U);o("comparator",k,U),this.loose=U,this.parse(k),this.semver===Nd?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}t.rcompareIdentifiers=function(k,U){return Na(U,k)},t.major=function(k,U){return new At(k,U).major},t.minor=function(k,U){return new At(k,U).minor},t.patch=function(k,U){return new At(k,U).patch},t.compare=Ri,t.compareLoose=function(k,U){return Ri(k,U,!0)},t.rcompare=function(k,U,H){return Ri(U,k,H)},t.sort=function(k,U){return k.sort((function(H,Te){return t.compare(H,Te,U)}))},t.rsort=function(k,U){return k.sort((function(H,Te){return t.rcompare(H,Te,U)}))},t.gt=Od,t.lt=Ud,t.eq=ke,t.neq=Sw,t.gte=Xy,t.lte=Zy,t.cmp=Zm,t.Comparator=Ar;var Nd={};function Cn(k,U){if(k instanceof Cn)return k.loose===U?k:new Cn(k.raw,U);if(k instanceof Ar)return new Cn(k.value,U);if(!(this instanceof Cn))return new Cn(k,U);if(this.loose=U,this.raw=k,this.set=k.split(/\s*\|\|\s*/).map((function(H){return this.parseRange(H.trim())}),this).filter((function(H){return H.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+k);this.format()}function Ho(k){return!k||k.toLowerCase()==="x"||k==="*"}function i0(k,U,H,Te,Fe,Zn,Ot,Yo,Ln,To,Ti,On,go){return((U=Ho(H)?"":Ho(Te)?">="+H+".0.0":Ho(Fe)?">="+H+"."+Te+".0":">="+U)+" "+(Yo=Ho(Ln)?"":Ho(To)?"<"+(+Ln+1)+".0.0":Ho(Ti)?"<"+Ln+"."+(+To+1)+".0":On?"<="+Ln+"."+To+"."+Ti+"-"+On:"<="+Yo)).trim()}function s0(k,U){for(var H=0;H<k.length;H++)if(!k[H].test(U))return!1;if(U.prerelease.length){for(H=0;H<k.length;H++)if(o(k[H].semver),k[H].semver!==Nd&&k[H].semver.prerelease.length>0){var Te=k[H].semver;if(Te.major===U.major&&Te.minor===U.minor&&Te.patch===U.patch)return!0}return!1}return!0}function eg(k,U,H){try{U=new Cn(U,H)}catch{return!1}return U.test(k)}function ev(k,U,H,Te){var Fe,Zn,Ot,Yo,Ln;switch(k=new At(k,Te),U=new Cn(U,Te),H){case">":Fe=Od,Zn=Zy,Ot=Ud,Yo=">",Ln=">=";break;case"<":Fe=Ud,Zn=Xy,Ot=Od,Yo="<",Ln="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(eg(k,U,Te))return!1;for(var To=0;To<U.set.length;++To){var Ti=U.set[To],On=null,go=null;if(Ti.forEach((function(Xo){Xo.semver===Nd&&(Xo=new Ar(">=0.0.0")),On=On||Xo,go=go||Xo,Fe(Xo.semver,On.semver,Te)?On=Xo:Ot(Xo.semver,go.semver,Te)&&(go=Xo)})),On.operator===Yo||On.operator===Ln||(!go.operator||go.operator===Yo)&&Zn(k,go.semver)||go.operator===Ln&&Ot(k,go.semver))return!1}return!0}Ar.prototype.parse=function(k){var U=this.loose?a[lt]:a[Lt],H=k.match(U);if(!H)throw new TypeError("Invalid comparator: "+k);this.operator=H[1],this.operator==="="&&(this.operator=""),H[2]?this.semver=new At(H[2],this.loose):this.semver=Nd},Ar.prototype.toString=function(){return this.value},Ar.prototype.test=function(k){return o("Comparator.test",k,this.loose),this.semver===Nd||(typeof k=="string"&&(k=new At(k,this.loose)),Zm(k,this.operator,this.semver,this.loose))},Ar.prototype.intersects=function(k,U){if(!(k instanceof Ar))throw new TypeError("a Comparator is required");var H;if(this.operator==="")return H=new Cn(k.value,U),eg(this.value,H,U);if(k.operator==="")return H=new Cn(this.value,U),eg(k.semver,H,U);var Te=!(this.operator!==">="&&this.operator!==">"||k.operator!==">="&&k.operator!==">"),Fe=!(this.operator!=="<="&&this.operator!=="<"||k.operator!=="<="&&k.operator!=="<"),Zn=this.semver.version===k.semver.version,Ot=!(this.operator!==">="&&this.operator!=="<="||k.operator!==">="&&k.operator!=="<="),Yo=Zm(this.semver,"<",k.semver,U)&&(this.operator===">="||this.operator===">")&&(k.operator==="<="||k.operator==="<"),Ln=Zm(this.semver,">",k.semver,U)&&(this.operator==="<="||this.operator==="<")&&(k.operator===">="||k.operator===">");return Te||Fe||Zn&&Ot||Yo||Ln},t.Range=Cn,Cn.prototype.format=function(){return this.range=this.set.map((function(k){return k.join(" ").trim()})).join("||").trim(),this.range},Cn.prototype.toString=function(){return this.range},Cn.prototype.parseRange=function(k){var U=this.loose;k=k.trim(),o("range",k,U);var H=U?a[Zi]:a[mo];k=k.replace(H,i0),o("hyphen replace",k),k=k.replace(a[zt],"$1$2$3"),o("comparator trim",k,a[zt]),k=(k=(k=k.replace(a[K],"$1~")).replace(a[dt],"$1^")).split(/\s+/).join(" ");var Te=U?a[lt]:a[Lt],Fe=k.split(" ").map((function(Zn){return(function(Ot,Yo){return o("comp",Ot),Ot=(function(Ln,To){return Ln.trim().split(/\s+/).map((function(Ti){return(function(On,go){o("caret",On,go);var Xo=go?a[et]:a[We];return On.replace(Xo,(function(Yr,$e,ut,jt,mn){var fo;return o("caret",On,Yr,$e,ut,jt,mn),Ho($e)?fo="":Ho(ut)?fo=">="+$e+".0.0 <"+(+$e+1)+".0.0":Ho(jt)?fo=$e==="0"?">="+$e+"."+ut+".0 <"+$e+"."+(+ut+1)+".0":">="+$e+"."+ut+".0 <"+(+$e+1)+".0.0":mn?(o("replaceCaret pr",mn),mn.charAt(0)!=="-"&&(mn="-"+mn),fo=$e==="0"?ut==="0"?">="+$e+"."+ut+"."+jt+mn+" <"+$e+"."+ut+"."+(+jt+1):">="+$e+"."+ut+"."+jt+mn+" <"+$e+"."+(+ut+1)+".0":">="+$e+"."+ut+"."+jt+mn+" <"+(+$e+1)+".0.0"):(o("no pr"),fo=$e==="0"?ut==="0"?">="+$e+"."+ut+"."+jt+" <"+$e+"."+ut+"."+(+jt+1):">="+$e+"."+ut+"."+jt+" <"+$e+"."+(+ut+1)+".0":">="+$e+"."+ut+"."+jt+" <"+(+$e+1)+".0.0"),o("caret return",fo),fo}))})(Ti,To)})).join(" ")})(Ot,Yo),o("caret",Ot),Ot=(function(Ln,To){return Ln.trim().split(/\s+/).map((function(Ti){return(function(On,go){var Xo=go?a[le]:a[V];return On.replace(Xo,(function(Yr,$e,ut,jt,mn){var fo;return o("tilde",On,Yr,$e,ut,jt,mn),Ho($e)?fo="":Ho(ut)?fo=">="+$e+".0.0 <"+(+$e+1)+".0.0":Ho(jt)?fo=">="+$e+"."+ut+".0 <"+$e+"."+(+ut+1)+".0":mn?(o("replaceTilde pr",mn),mn.charAt(0)!=="-"&&(mn="-"+mn),fo=">="+$e+"."+ut+"."+jt+mn+" <"+$e+"."+(+ut+1)+".0"):fo=">="+$e+"."+ut+"."+jt+" <"+$e+"."+(+ut+1)+".0",o("tilde return",fo),fo}))})(Ti,To)})).join(" ")})(Ot,Yo),o("tildes",Ot),Ot=(function(Ln,To){return o("replaceXRanges",Ln,To),Ln.split(/\s+/).map((function(Ti){return(function(On,go){On=On.trim();var Xo=go?a[de]:a[Wt];return On.replace(Xo,(function(Yr,$e,ut,jt,mn,fo){o("xRange",On,Yr,$e,ut,jt,mn,fo);var xw=Ho(ut),Fd=xw||Ho(jt),Hd=Fd||Ho(mn);return $e==="="&&Hd&&($e=""),xw?Yr=$e===">"||$e==="<"?"<0.0.0":"*":$e&&Hd?(Fd&&(jt=0),Hd&&(mn=0),$e===">"?($e=">=",Fd?(ut=+ut+1,jt=0,mn=0):Hd&&(jt=+jt+1,mn=0)):$e==="<="&&($e="<",Fd?ut=+ut+1:jt=+jt+1),Yr=$e+ut+"."+jt+"."+mn):Fd?Yr=">="+ut+".0.0 <"+(+ut+1)+".0.0":Hd&&(Yr=">="+ut+"."+jt+".0 <"+ut+"."+(+jt+1)+".0"),o("xRange return",Yr),Yr}))})(Ti,To)})).join(" ")})(Ot,Yo),o("xrange",Ot),Ot=(function(Ln,To){return o("replaceStars",Ln,To),Ln.trim().replace(a[Ua],"")})(Ot,Yo),o("stars",Ot),Ot})(Zn,U)})).join(" ").split(/\s+/);return this.loose&&(Fe=Fe.filter((function(Zn){return!!Zn.match(Te)}))),Fe=Fe.map((function(Zn){return new Ar(Zn,U)}))},Cn.prototype.intersects=function(k,U){if(!(k instanceof Cn))throw new TypeError("a Range is required");return this.set.some((function(H){return H.every((function(Te){return k.set.some((function(Fe){return Fe.every((function(Zn){return Te.intersects(Zn,U)}))}))}))}))},t.toComparators=function(k,U){return new Cn(k,U).set.map((function(H){return H.map((function(Te){return Te.value})).join(" ").trim().split(" ")}))},Cn.prototype.test=function(k){if(!k)return!1;typeof k=="string"&&(k=new At(k,this.loose));for(var U=0;U<this.set.length;U++)if(s0(this.set[U],k))return!0;return!1},t.satisfies=eg,t.maxSatisfying=function(k,U,H){var Te=null,Fe=null;try{var Zn=new Cn(U,H)}catch{return null}return k.forEach((function(Ot){Zn.test(Ot)&&(Te&&Fe.compare(Ot)!==-1||(Fe=new At(Te=Ot,H)))})),Te},t.minSatisfying=function(k,U,H){var Te=null,Fe=null;try{var Zn=new Cn(U,H)}catch{return null}return k.forEach((function(Ot){Zn.test(Ot)&&(Te&&Fe.compare(Ot)!==1||(Fe=new At(Te=Ot,H)))})),Te},t.validRange=function(k,U){try{return new Cn(k,U).range||"*"}catch{return null}},t.ltr=function(k,U,H){return ev(k,U,"<",H)},t.gtr=function(k,U,H){return ev(k,U,">",H)},t.outside=ev,t.prerelease=function(k,U){var H=Os(k,U);return H&&H.prerelease.length?H.prerelease:null},t.intersects=function(k,U,H){return k=new Cn(k,H),U=new Cn(U,H),k.intersects(U)},t.coerce=function(k){if(k instanceof At)return k;if(typeof k!="string")return null;var U=k.match(a[j]);return U==null?null:Os((U[1]||"0")+"."+(U[2]||"0")+"."+(U[3]||"0"))}}).call(this,e(1))},function(r,t){var e,n,o=r.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(I){if(e===setTimeout)return setTimeout(I,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(I,0);try{return e(I,0)}catch{try{return e.call(null,I,0)}catch{return e.call(this,I,0)}}}(function(){try{e=typeof setTimeout=="function"?setTimeout:i}catch{e=i}try{n=typeof clearTimeout=="function"?clearTimeout:s}catch{n=s}})();var l,c=[],u=!1,p=-1;function m(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&g())}function g(){if(!u){var I=a(m);u=!0;for(var x=c.length;x;){for(l=c,c=[];++p<x;)l&&l[p].run();p=-1,x=c.length}l=null,u=!1,(function(E){if(n===clearTimeout)return clearTimeout(E);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(E);try{n(E)}catch{try{return n.call(null,E)}catch{return n.call(this,E)}}})(I)}}function y(I,x){this.fun=I,this.array=x}function h(){}o.nextTick=function(I){var x=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)x[E-1]=arguments[E];c.push(new y(I,x)),c.length!==1||u||a(g)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(I){return[]},o.binding=function(I){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(I){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}])}));Nfe=ft.exports.SEMVER_SPEC_VERSION,Ffe=ft.exports.parse,fF=ft.exports.valid,Hfe=ft.exports.coerce,Wfe=ft.exports.clean,Vfe=ft.exports.inc,Bfe=ft.exports.major,qfe=ft.exports.minor,$fe=ft.exports.patch,zfe=ft.exports.prerelease,ps=ft.exports.gt,hF=ft.exports.gte,MI=ft.exports.lt,Gfe=ft.exports.lte,yF=ft.exports.eq,Kfe=ft.exports.neq,jfe=ft.exports.cmp,Qfe=ft.exports.compare,LI=ft.exports.rcompare,Jfe=ft.exports.compareIdentifiers,Yfe=ft.exports.rcompareIdentifiers,Xfe=ft.exports.compareBuild,Zfe=ft.exports.sort,ehe=ft.exports.rsort,the=ft.exports.diff,nhe=ft.exports.validRange,vF=ft.exports.satisfies,ohe=ft.exports.maxSatisfying,rhe=ft.exports.minSatisfying,ihe=ft.exports.minVersion,she=ft.exports.gtr,ahe=ft.exports.ltr,lhe=ft.exports.outside,che=ft.exports.intersects,dhe=ft.exports.SemVer,uhe=ft.exports.Comparator,phe=ft.exports.Range});function FT(r){return r instanceof NT?!0:r instanceof Error&&r.name===UT&&r.message===UT}var UT,NT,IF=v(()=>{UT="Offline";NT=class extends Error{constructor(){super(UT),this.name=this.message}}});var ghe,fhe,hhe,yhe,vhe,bF=v(()=>{ghe=new Uint32Array(10),fhe=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),hhe=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),yhe=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),vhe=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});function xF(...r){return function(t,e){for(let n=0,o=r.length;n<o;n++){let i=r[n](t,e);if(i)return i}return null}}function EF(r,t,e){if(!e||e.length<t.length)return null;let n;return r?n=$a(e,t):n=e.indexOf(t)===0,n?t.length>0?[{start:0,end:t.length}]:[]:null}function GK(r,t){if(r.length>t.length)return null;let e=t.toLowerCase().indexOf(r.toLowerCase());return e===-1?null:[{start:e,end:e+r.length}]}function KK(r,t){return r.length>t.length?null:HT(r.toLowerCase(),t.toLowerCase(),0,0)}function HT(r,t,e,n){if(e===r.length)return[];if(n===t.length)return null;if(r[e]===t[n]){let o=null;return(o=HT(r,t,e+1,n+1))?RF({start:n,end:n+1},o):null}return HT(r,t,e,n+1)}function VT(r){return 97<=r&&r<=122}function UI(r){return 65<=r&&r<=90}function BT(r){return 48<=r&&r<=57}function jK(r){return r===32||r===9||r===10||r===13}function wF(r){return VT(r)||UI(r)||BT(r)}function RF(r,t){return t.length===0?t=[r]:r.end===t[0].start?t[0].start=r.start:t.unshift(r),t}function TF(r,t){for(let e=t;e<r.length;e++){let n=r.charCodeAt(e);if(UI(n)||BT(n)||e>0&&!wF(r.charCodeAt(e-1)))return e}return r.length}function WT(r,t,e,n){if(e===r.length)return[];if(n===t.length)return null;if(r[e]!==t[n].toLowerCase())return null;{let o=null,i=n+1;for(o=WT(r,t,e+1,n+1);!o&&(i=TF(t,i))<t.length;)o=WT(r,t,e+1,i),i++;return o===null?null:RF({start:n,end:n+1},o)}}function JK(r){let t=0,e=0,n=0,o=0,i=0;for(let u=0;u<r.length;u++)i=r.charCodeAt(u),UI(i)&&t++,VT(i)&&e++,wF(i)&&n++,BT(i)&&o++;let s=t/r.length,a=e/r.length,l=n/r.length,c=o/r.length;return{upperPercent:s,lowerPercent:a,alphaPercent:l,numericPercent:c}}function YK(r){let{upperPercent:t,lowerPercent:e}=r;return e===0&&t>.6}function XK(r){let{upperPercent:t,lowerPercent:e,alphaPercent:n,numericPercent:o}=r;return e>.2&&t<.8&&n>.6&&o<.2}function ZK(r){let t=0,e=0,n=0,o=0;for(let i=0;i<r.length;i++)n=r.charCodeAt(i),UI(n)&&t++,VT(n)&&e++,jK(n)&&o++;return(t===0||e===0)&&o===0?r.length<=30:t<=5}function PF(r,t){if(!t||(t=t.trim(),t.length===0)||!ZK(r))return null;t.length>60&&(t=t.substring(0,60));let e=JK(t);if(!XK(e)){if(!YK(e))return null;t=t.toLowerCase()}let n=null,o=0;for(r=r.toLowerCase();o<t.length&&(n=WT(r,t,0,o))===null;)o=TF(t,o+1);return n}function qT(){let r=[],t=[];for(let e=0;e<=OI;e++)t[e]=0;for(let e=0;e<=OI;e++)r.push(t.slice(0));return r}function kF(r){let t=[];for(let e=0;e<=r;e++)t[e]=0;return t}var Rhe,CF,QK,The,Phe,khe,OI,Ahe,Dhe,_he,Mhe,Lhe,ej,SF,AF=v(()=>{ii();fn();bF();Mv();Tt();Rhe=EF.bind(void 0,!1),CF=EF.bind(void 0,!0);QK=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(r=>QK.add(r.charCodeAt(0)));The=xF(CF,PF,GK),Phe=xF(CF,PF,KK),khe=new ti(1e4),OI=128;Ahe=kF(2*OI),Dhe=kF(2*OI),_he=qT(),Mhe=qT(),Lhe=qT();(e=>{e.Default=[-100,0];function t(n){return!n||n.length===2&&n[0]===-100&&n[1]===0}e.isDefault=t})(ej||={});SF=class{constructor(t,e){this.firstMatchCanBeWeak=t;this.boostFullMatch=e}static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}}});function f(r,t){if(G(t)){let e=$T[t];if(e===void 0)throw new Error(`${r} references an unknown codicon: ${t}`);t=e}return $T[r]=t,{id:r}}function DF(){return $T}var $T,NI=v(()=>{Ie();$T=Object.create(null)});var _F,MF=v(()=>{NI();_F={add:f("add",6e4),plus:f("plus",6e4),gistNew:f("gist-new",6e4),repoCreate:f("repo-create",6e4),lightbulb:f("lightbulb",60001),lightBulb:f("light-bulb",60001),repo:f("repo",60002),repoDelete:f("repo-delete",60002),gistFork:f("gist-fork",60003),repoForked:f("repo-forked",60003),gitPullRequest:f("git-pull-request",60004),gitPullRequestAbandoned:f("git-pull-request-abandoned",60004),recordKeys:f("record-keys",60005),keyboard:f("keyboard",60005),tag:f("tag",60006),gitPullRequestLabel:f("git-pull-request-label",60006),tagAdd:f("tag-add",60006),tagRemove:f("tag-remove",60006),person:f("person",60007),personFollow:f("person-follow",60007),personOutline:f("person-outline",60007),personFilled:f("person-filled",60007),sourceControl:f("source-control",60008),mirror:f("mirror",60009),mirrorPublic:f("mirror-public",60009),star:f("star",60010),starAdd:f("star-add",60010),starDelete:f("star-delete",60010),starEmpty:f("star-empty",60010),comment:f("comment",60011),commentAdd:f("comment-add",60011),alert:f("alert",60012),warning:f("warning",60012),search:f("search",60013),searchSave:f("search-save",60013),logOut:f("log-out",60014),signOut:f("sign-out",60014),logIn:f("log-in",60015),signIn:f("sign-in",60015),eye:f("eye",60016),eyeUnwatch:f("eye-unwatch",60016),eyeWatch:f("eye-watch",60016),circleFilled:f("circle-filled",60017),primitiveDot:f("primitive-dot",60017),closeDirty:f("close-dirty",60017),debugBreakpoint:f("debug-breakpoint",60017),debugBreakpointDisabled:f("debug-breakpoint-disabled",60017),debugHint:f("debug-hint",60017),terminalDecorationSuccess:f("terminal-decoration-success",60017),primitiveSquare:f("primitive-square",60018),edit:f("edit",60019),pencil:f("pencil",60019),info:f("info",60020),issueOpened:f("issue-opened",60020),gistPrivate:f("gist-private",60021),gitForkPrivate:f("git-fork-private",60021),lock:f("lock",60021),mirrorPrivate:f("mirror-private",60021),close:f("close",60022),removeClose:f("remove-close",60022),x:f("x",60022),repoSync:f("repo-sync",60023),sync:f("sync",60023),clone:f("clone",60024),desktopDownload:f("desktop-download",60024),beaker:f("beaker",60025),microscope:f("microscope",60025),vm:f("vm",60026),deviceDesktop:f("device-desktop",60026),file:f("file",60027),more:f("more",60028),ellipsis:f("ellipsis",60028),kebabHorizontal:f("kebab-horizontal",60028),mailReply:f("mail-reply",60029),reply:f("reply",60029),organization:f("organization",60030),organizationFilled:f("organization-filled",60030),organizationOutline:f("organization-outline",60030),newFile:f("new-file",60031),fileAdd:f("file-add",60031),newFolder:f("new-folder",60032),fileDirectoryCreate:f("file-directory-create",60032),trash:f("trash",60033),trashcan:f("trashcan",60033),history:f("history",60034),clock:f("clock",60034),folder:f("folder",60035),fileDirectory:f("file-directory",60035),symbolFolder:f("symbol-folder",60035),logoGithub:f("logo-github",60036),markGithub:f("mark-github",60036),github:f("github",60036),terminal:f("terminal",60037),console:f("console",60037),repl:f("repl",60037),zap:f("zap",60038),symbolEvent:f("symbol-event",60038),error:f("error",60039),stop:f("stop",60039),variable:f("variable",60040),symbolVariable:f("symbol-variable",60040),array:f("array",60042),symbolArray:f("symbol-array",60042),symbolModule:f("symbol-module",60043),symbolPackage:f("symbol-package",60043),symbolNamespace:f("symbol-namespace",60043),symbolObject:f("symbol-object",60043),symbolMethod:f("symbol-method",60044),symbolFunction:f("symbol-function",60044),symbolConstructor:f("symbol-constructor",60044),symbolBoolean:f("symbol-boolean",60047),symbolNull:f("symbol-null",60047),symbolNumeric:f("symbol-numeric",60048),symbolNumber:f("symbol-number",60048),symbolStructure:f("symbol-structure",60049),symbolStruct:f("symbol-struct",60049),symbolParameter:f("symbol-parameter",60050),symbolTypeParameter:f("symbol-type-parameter",60050),symbolKey:f("symbol-key",60051),symbolText:f("symbol-text",60051),symbolReference:f("symbol-reference",60052),goToFile:f("go-to-file",60052),symbolEnum:f("symbol-enum",60053),symbolValue:f("symbol-value",60053),symbolRuler:f("symbol-ruler",60054),symbolUnit:f("symbol-unit",60054),activateBreakpoints:f("activate-breakpoints",60055),archive:f("archive",60056),arrowBoth:f("arrow-both",60057),arrowDown:f("arrow-down",60058),arrowLeft:f("arrow-left",60059),arrowRight:f("arrow-right",60060),arrowSmallDown:f("arrow-small-down",60061),arrowSmallLeft:f("arrow-small-left",60062),arrowSmallRight:f("arrow-small-right",60063),arrowSmallUp:f("arrow-small-up",60064),arrowUp:f("arrow-up",60065),bell:f("bell",60066),bold:f("bold",60067),book:f("book",60068),bookmark:f("bookmark",60069),debugBreakpointConditionalUnverified:f("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:f("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:f("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:f("debug-breakpoint-data-unverified",60072),debugBreakpointData:f("debug-breakpoint-data",60073),debugBreakpointDataDisabled:f("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:f("debug-breakpoint-log-unverified",60074),debugBreakpointLog:f("debug-breakpoint-log",60075),debugBreakpointLogDisabled:f("debug-breakpoint-log-disabled",60075),briefcase:f("briefcase",60076),broadcast:f("broadcast",60077),browser:f("browser",60078),bug:f("bug",60079),calendar:f("calendar",60080),caseSensitive:f("case-sensitive",60081),check:f("check",60082),checklist:f("checklist",60083),chevronDown:f("chevron-down",60084),chevronLeft:f("chevron-left",60085),chevronRight:f("chevron-right",60086),chevronUp:f("chevron-up",60087),chromeClose:f("chrome-close",60088),chromeMaximize:f("chrome-maximize",60089),chromeMinimize:f("chrome-minimize",60090),chromeRestore:f("chrome-restore",60091),circleOutline:f("circle-outline",60092),circle:f("circle",60092),debugBreakpointUnverified:f("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:f("terminal-decoration-incomplete",60092),circleSlash:f("circle-slash",60093),circuitBoard:f("circuit-board",60094),clearAll:f("clear-all",60095),clippy:f("clippy",60096),closeAll:f("close-all",60097),cloudDownload:f("cloud-download",60098),cloudUpload:f("cloud-upload",60099),code:f("code",60100),collapseAll:f("collapse-all",60101),colorMode:f("color-mode",60102),commentDiscussion:f("comment-discussion",60103),creditCard:f("credit-card",60105),dash:f("dash",60108),dashboard:f("dashboard",60109),database:f("database",60110),debugContinue:f("debug-continue",60111),debugDisconnect:f("debug-disconnect",60112),debugPause:f("debug-pause",60113),debugRestart:f("debug-restart",60114),debugStart:f("debug-start",60115),debugStepInto:f("debug-step-into",60116),debugStepOut:f("debug-step-out",60117),debugStepOver:f("debug-step-over",60118),debugStop:f("debug-stop",60119),debug:f("debug",60120),deviceCameraVideo:f("device-camera-video",60121),deviceCamera:f("device-camera",60122),deviceMobile:f("device-mobile",60123),diffAdded:f("diff-added",60124),diffIgnored:f("diff-ignored",60125),diffModified:f("diff-modified",60126),diffRemoved:f("diff-removed",60127),diffRenamed:f("diff-renamed",60128),diff:f("diff",60129),diffSidebyside:f("diff-sidebyside",60129),discard:f("discard",60130),editorLayout:f("editor-layout",60131),emptyWindow:f("empty-window",60132),exclude:f("exclude",60133),extensions:f("extensions",60134),eyeClosed:f("eye-closed",60135),fileBinary:f("file-binary",60136),fileCode:f("file-code",60137),fileMedia:f("file-media",60138),filePdf:f("file-pdf",60139),fileSubmodule:f("file-submodule",60140),fileSymlinkDirectory:f("file-symlink-directory",60141),fileSymlinkFile:f("file-symlink-file",60142),fileZip:f("file-zip",60143),files:f("files",60144),filter:f("filter",60145),flame:f("flame",60146),foldDown:f("fold-down",60147),foldUp:f("fold-up",60148),fold:f("fold",60149),folderActive:f("folder-active",60150),folderOpened:f("folder-opened",60151),gear:f("gear",60152),gift:f("gift",60153),gistSecret:f("gist-secret",60154),gist:f("gist",60155),gitCommit:f("git-commit",60156),gitCompare:f("git-compare",60157),compareChanges:f("compare-changes",60157),gitMerge:f("git-merge",60158),githubAction:f("github-action",60159),githubAlt:f("github-alt",60160),globe:f("globe",60161),grabber:f("grabber",60162),graph:f("graph",60163),gripper:f("gripper",60164),heart:f("heart",60165),home:f("home",60166),horizontalRule:f("horizontal-rule",60167),hubot:f("hubot",60168),inbox:f("inbox",60169),issueReopened:f("issue-reopened",60171),issues:f("issues",60172),italic:f("italic",60173),jersey:f("jersey",60174),json:f("json",60175),bracket:f("bracket",60175),kebabVertical:f("kebab-vertical",60176),key:f("key",60177),law:f("law",60178),lightbulbAutofix:f("lightbulb-autofix",60179),linkExternal:f("link-external",60180),link:f("link",60181),listOrdered:f("list-ordered",60182),listUnordered:f("list-unordered",60183),liveShare:f("live-share",60184),loading:f("loading",60185),location:f("location",60186),mailRead:f("mail-read",60187),mail:f("mail",60188),markdown:f("markdown",60189),megaphone:f("megaphone",60190),mention:f("mention",60191),milestone:f("milestone",60192),gitPullRequestMilestone:f("git-pull-request-milestone",60192),mortarBoard:f("mortar-board",60193),move:f("move",60194),multipleWindows:f("multiple-windows",60195),mute:f("mute",60196),noNewline:f("no-newline",60197),note:f("note",60198),octoface:f("octoface",60199),openPreview:f("open-preview",60200),package:f("package",60201),paintcan:f("paintcan",60202),pin:f("pin",60203),play:f("play",60204),run:f("run",60204),plug:f("plug",60205),preserveCase:f("preserve-case",60206),preview:f("preview",60207),project:f("project",60208),pulse:f("pulse",60209),question:f("question",60210),quote:f("quote",60211),radioTower:f("radio-tower",60212),reactions:f("reactions",60213),references:f("references",60214),refresh:f("refresh",60215),regex:f("regex",60216),remoteExplorer:f("remote-explorer",60217),remote:f("remote",60218),remove:f("remove",60219),replaceAll:f("replace-all",60220),replace:f("replace",60221),repoClone:f("repo-clone",60222),repoForcePush:f("repo-force-push",60223),repoPull:f("repo-pull",60224),repoPush:f("repo-push",60225),report:f("report",60226),requestChanges:f("request-changes",60227),rocket:f("rocket",60228),rootFolderOpened:f("root-folder-opened",60229),rootFolder:f("root-folder",60230),rss:f("rss",60231),ruby:f("ruby",60232),saveAll:f("save-all",60233),saveAs:f("save-as",60234),save:f("save",60235),screenFull:f("screen-full",60236),screenNormal:f("screen-normal",60237),searchStop:f("search-stop",60238),server:f("server",60240),settingsGear:f("settings-gear",60241),settings:f("settings",60242),shield:f("shield",60243),smiley:f("smiley",60244),sortPrecedence:f("sort-precedence",60245),splitHorizontal:f("split-horizontal",60246),splitVertical:f("split-vertical",60247),squirrel:f("squirrel",60248),starFull:f("star-full",60249),starHalf:f("star-half",60250),symbolClass:f("symbol-class",60251),symbolColor:f("symbol-color",60252),symbolConstant:f("symbol-constant",60253),symbolEnumMember:f("symbol-enum-member",60254),symbolField:f("symbol-field",60255),symbolFile:f("symbol-file",60256),symbolInterface:f("symbol-interface",60257),symbolKeyword:f("symbol-keyword",60258),symbolMisc:f("symbol-misc",60259),symbolOperator:f("symbol-operator",60260),symbolProperty:f("symbol-property",60261),wrench:f("wrench",60261),wrenchSubaction:f("wrench-subaction",60261),symbolSnippet:f("symbol-snippet",60262),tasklist:f("tasklist",60263),telescope:f("telescope",60264),textSize:f("text-size",60265),threeBars:f("three-bars",60266),thumbsdown:f("thumbsdown",60267),thumbsup:f("thumbsup",60268),tools:f("tools",60269),triangleDown:f("triangle-down",60270),triangleLeft:f("triangle-left",60271),triangleRight:f("triangle-right",60272),triangleUp:f("triangle-up",60273),twitter:f("twitter",60274),unfold:f("unfold",60275),unlock:f("unlock",60276),unmute:f("unmute",60277),unverified:f("unverified",60278),verified:f("verified",60279),versions:f("versions",60280),vmActive:f("vm-active",60281),vmOutline:f("vm-outline",60282),vmRunning:f("vm-running",60283),watch:f("watch",60284),whitespace:f("whitespace",60285),wholeWord:f("whole-word",60286),window:f("window",60287),wordWrap:f("word-wrap",60288),zoomIn:f("zoom-in",60289),zoomOut:f("zoom-out",60290),listFilter:f("list-filter",60291),listFlat:f("list-flat",60292),listSelection:f("list-selection",60293),selection:f("selection",60293),listTree:f("list-tree",60294),debugBreakpointFunctionUnverified:f("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:f("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:f("debug-breakpoint-function-disabled",60296),debugStackframeActive:f("debug-stackframe-active",60297),circleSmallFilled:f("circle-small-filled",60298),debugStackframeDot:f("debug-stackframe-dot",60298),terminalDecorationMark:f("terminal-decoration-mark",60298),debugStackframe:f("debug-stackframe",60299),debugStackframeFocused:f("debug-stackframe-focused",60299),debugBreakpointUnsupported:f("debug-breakpoint-unsupported",60300),symbolString:f("symbol-string",60301),debugReverseContinue:f("debug-reverse-continue",60302),debugStepBack:f("debug-step-back",60303),debugRestartFrame:f("debug-restart-frame",60304),debugAlt:f("debug-alt",60305),callIncoming:f("call-incoming",60306),callOutgoing:f("call-outgoing",60307),menu:f("menu",60308),expandAll:f("expand-all",60309),feedback:f("feedback",60310),gitPullRequestReviewer:f("git-pull-request-reviewer",60310),groupByRefType:f("group-by-ref-type",60311),ungroupByRefType:f("ungroup-by-ref-type",60312),account:f("account",60313),gitPullRequestAssignee:f("git-pull-request-assignee",60313),bellDot:f("bell-dot",60314),debugConsole:f("debug-console",60315),library:f("library",60316),output:f("output",60317),runAll:f("run-all",60318),syncIgnored:f("sync-ignored",60319),pinned:f("pinned",60320),githubInverted:f("github-inverted",60321),serverProcess:f("server-process",60322),serverEnvironment:f("server-environment",60323),pass:f("pass",60324),issueClosed:f("issue-closed",60324),stopCircle:f("stop-circle",60325),playCircle:f("play-circle",60326),record:f("record",60327),debugAltSmall:f("debug-alt-small",60328),vmConnect:f("vm-connect",60329),cloud:f("cloud",60330),merge:f("merge",60331),export:f("export",60332),graphLeft:f("graph-left",60333),magnet:f("magnet",60334),notebook:f("notebook",60335),redo:f("redo",60336),checkAll:f("check-all",60337),pinnedDirty:f("pinned-dirty",60338),passFilled:f("pass-filled",60339),circleLargeFilled:f("circle-large-filled",60340),circleLarge:f("circle-large",60341),circleLargeOutline:f("circle-large-outline",60341),combine:f("combine",60342),gather:f("gather",60342),table:f("table",60343),variableGroup:f("variable-group",60344),typeHierarchy:f("type-hierarchy",60345),typeHierarchySub:f("type-hierarchy-sub",60346),typeHierarchySuper:f("type-hierarchy-super",60347),gitPullRequestCreate:f("git-pull-request-create",60348),runAbove:f("run-above",60349),runBelow:f("run-below",60350),notebookTemplate:f("notebook-template",60351),debugRerun:f("debug-rerun",60352),workspaceTrusted:f("workspace-trusted",60353),workspaceUntrusted:f("workspace-untrusted",60354),workspaceUnknown:f("workspace-unknown",60355),terminalCmd:f("terminal-cmd",60356),terminalDebian:f("terminal-debian",60357),terminalLinux:f("terminal-linux",60358),terminalPowershell:f("terminal-powershell",60359),terminalTmux:f("terminal-tmux",60360),terminalUbuntu:f("terminal-ubuntu",60361),terminalBash:f("terminal-bash",60362),arrowSwap:f("arrow-swap",60363),copy:f("copy",60364),personAdd:f("person-add",60365),filterFilled:f("filter-filled",60366),wand:f("wand",60367),debugLineByLine:f("debug-line-by-line",60368),inspect:f("inspect",60369),layers:f("layers",60370),layersDot:f("layers-dot",60371),layersActive:f("layers-active",60372),compass:f("compass",60373),compassDot:f("compass-dot",60374),compassActive:f("compass-active",60375),azure:f("azure",60376),issueDraft:f("issue-draft",60377),gitPullRequestClosed:f("git-pull-request-closed",60378),gitPullRequestDraft:f("git-pull-request-draft",60379),debugAll:f("debug-all",60380),debugCoverage:f("debug-coverage",60381),runErrors:f("run-errors",60382),folderLibrary:f("folder-library",60383),debugContinueSmall:f("debug-continue-small",60384),beakerStop:f("beaker-stop",60385),graphLine:f("graph-line",60386),graphScatter:f("graph-scatter",60387),pieChart:f("pie-chart",60388),bracketDot:f("bracket-dot",60389),bracketError:f("bracket-error",60390),lockSmall:f("lock-small",60391),azureDevops:f("azure-devops",60392),verifiedFilled:f("verified-filled",60393),newline:f("newline",60394),layout:f("layout",60395),layoutActivitybarLeft:f("layout-activitybar-left",60396),layoutActivitybarRight:f("layout-activitybar-right",60397),layoutPanelLeft:f("layout-panel-left",60398),layoutPanelCenter:f("layout-panel-center",60399),layoutPanelJustify:f("layout-panel-justify",60400),layoutPanelRight:f("layout-panel-right",60401),layoutPanel:f("layout-panel",60402),layoutSidebarLeft:f("layout-sidebar-left",60403),layoutSidebarRight:f("layout-sidebar-right",60404),layoutStatusbar:f("layout-statusbar",60405),layoutMenubar:f("layout-menubar",60406),layoutCentered:f("layout-centered",60407),target:f("target",60408),indent:f("indent",60409),recordSmall:f("record-small",60410),errorSmall:f("error-small",60411),terminalDecorationError:f("terminal-decoration-error",60411),arrowCircleDown:f("arrow-circle-down",60412),arrowCircleLeft:f("arrow-circle-left",60413),arrowCircleRight:f("arrow-circle-right",60414),arrowCircleUp:f("arrow-circle-up",60415),layoutSidebarRightOff:f("layout-sidebar-right-off",60416),layoutPanelOff:f("layout-panel-off",60417),layoutSidebarLeftOff:f("layout-sidebar-left-off",60418),blank:f("blank",60419),heartFilled:f("heart-filled",60420),map:f("map",60421),mapHorizontal:f("map-horizontal",60421),foldHorizontal:f("fold-horizontal",60421),mapFilled:f("map-filled",60422),mapHorizontalFilled:f("map-horizontal-filled",60422),foldHorizontalFilled:f("fold-horizontal-filled",60422),circleSmall:f("circle-small",60423),bellSlash:f("bell-slash",60424),bellSlashDot:f("bell-slash-dot",60425),commentUnresolved:f("comment-unresolved",60426),gitPullRequestGoToChanges:f("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:f("git-pull-request-new-changes",60428),searchFuzzy:f("search-fuzzy",60429),commentDraft:f("comment-draft",60430),send:f("send",60431),sparkle:f("sparkle",60432),insert:f("insert",60433),mic:f("mic",60434),thumbsdownFilled:f("thumbsdown-filled",60435),thumbsupFilled:f("thumbsup-filled",60436),coffee:f("coffee",60437),snake:f("snake",60438),game:f("game",60439),vr:f("vr",60440),chip:f("chip",60441),piano:f("piano",60442),music:f("music",60443),micFilled:f("mic-filled",60444),repoFetch:f("repo-fetch",60445),copilot:f("copilot",60446),lightbulbSparkle:f("lightbulb-sparkle",60447),robot:f("robot",60448),sparkleFilled:f("sparkle-filled",60449),diffSingle:f("diff-single",60450),diffMultiple:f("diff-multiple",60451),surroundWith:f("surround-with",60452),share:f("share",60453),gitStash:f("git-stash",60454),gitStashApply:f("git-stash-apply",60455),gitStashPop:f("git-stash-pop",60456),vscode:f("vscode",60457),vscodeInsiders:f("vscode-insiders",60458),codeOss:f("code-oss",60459),runCoverage:f("run-coverage",60460),runAllCoverage:f("run-all-coverage",60461),coverage:f("coverage",60462),githubProject:f("github-project",60463),mapVertical:f("map-vertical",60464),foldVertical:f("fold-vertical",60464),mapVerticalFilled:f("map-vertical-filled",60465),foldVerticalFilled:f("fold-vertical-filled",60465),goToSearch:f("go-to-search",60466),percentage:f("percentage",60467),sortPercentage:f("sort-percentage",60467),attach:f("attach",60468),goToEditingSession:f("go-to-editing-session",60469),editSession:f("edit-session",60470),codeReview:f("code-review",60471),copilotWarning:f("copilot-warning",60472),python:f("python",60473),copilotLarge:f("copilot-large",60474),copilotWarningLarge:f("copilot-warning-large",60475),keyboardTab:f("keyboard-tab",60476),copilotBlocked:f("copilot-blocked",60477),copilotNotConnected:f("copilot-not-connected",60478),flag:f("flag",60479),lightbulbEmpty:f("lightbulb-empty",60480),symbolMethodArrow:f("symbol-method-arrow",60481),copilotUnavailable:f("copilot-unavailable",60482),repoPinned:f("repo-pinned",60483),keyboardTabAbove:f("keyboard-tab-above",60484),keyboardTabBelow:f("keyboard-tab-below",60485),gitPullRequestDone:f("git-pull-request-done",60486),mcp:f("mcp",60487),extensionsLarge:f("extensions-large",60488),layoutPanelDock:f("layout-panel-dock",60489),layoutSidebarLeftDock:f("layout-sidebar-left-dock",60490),layoutSidebarRightDock:f("layout-sidebar-right-dock",60491),copilotInProgress:f("copilot-in-progress",60492),copilotError:f("copilot-error",60493),copilotSuccess:f("copilot-success",60494),chatSparkle:f("chat-sparkle",60495),searchSparkle:f("search-sparkle",60496),editSparkle:f("edit-sparkle",60497),copilotSnooze:f("copilot-snooze",60498),sendToRemoteAgent:f("send-to-remote-agent",60499),commentDiscussionSparkle:f("comment-discussion-sparkle",60500),chatSparkleWarning:f("chat-sparkle-warning",60501),chatSparkleError:f("chat-sparkle-error",60502),collection:f("collection",60503),newCollection:f("new-collection",60504),thinking:f("thinking",60505),build:f("build",60506),commentDiscussionQuote:f("comment-discussion-quote",60507),cursor:f("cursor",60508),eraser:f("eraser",60509),fileText:f("file-text",60510),quotes:f("quotes",60512),rename:f("rename",60513),runWithDeps:f("run-with-deps",60514),debugConnected:f("debug-connected",60515),strikethrough:f("strikethrough",60516),openInProduct:f("open-in-product",60517),indexZero:f("index-zero",60518),agent:f("agent",60519),editCode:f("edit-code",60520),repoSelected:f("repo-selected",60521),skip:f("skip",60522),mergeInto:f("merge-into",60523),gitBranchChanges:f("git-branch-changes",60524),gitBranchStagedChanges:f("git-branch-staged-changes",60525),gitBranchConflicts:f("git-branch-conflicts",60526),gitBranch:f("git-branch",60527),gitBranchCreate:f("git-branch-create",60527),gitBranchDelete:f("git-branch-delete",60527),searchLarge:f("search-large",60528),terminalGitBash:f("terminal-git-bash",60529),windowActive:f("window-active",60530),forward:f("forward",60531),download:f("download",60532),clockface:f("clockface",60533),unarchive:f("unarchive",60534),sessionInProgress:f("session-in-progress",60535),collectionSmall:f("collection-small",60536),vmSmall:f("vm-small",60537),cloudSmall:f("cloud-small",60538),addSmall:f("add-small",60539),removeSmall:f("remove-small",60540),worktreeSmall:f("worktree-small",60541),worktree:f("worktree",60542),screenCut:f("screen-cut",60543),ask:f("ask",60544),openai:f("openai",60545),claude:f("claude",60546),openInWindow:f("open-in-window",60547),newSession:f("new-session",60548),terminalSecure:f("terminal-secure",60549),chatImport:f("chat-import",60550),chatExport:f("chat-export",60551),shareWindow:f("share-window",60552),circleSlashCompact:f("circle-slash-compact",60553),copilotCompact:f("copilot-compact",60554),folderOpenedCompact:f("folder-opened-compact",60555),folderCompact:f("folder-compact",60556),gearCompact:f("gear-compact",60557),gitBranchCompact:f("git-branch-compact",60558),libraryCompact:f("library-compact",60559),recordKeysCompact:f("record-keys-compact",60560),remoteCompact:f("remote-compact",60561),repoForkedCompact:f("repo-forked-compact",60562),repoCompact:f("repo-compact",60563),shieldCompact:f("shield-compact",60564),sparkleCompact:f("sparkle-compact",60565),symbolColorCompact:f("symbol-color-compact",60566),windowCompact:f("window-compact",60567),errorCompact:f("error-compact",60568),warningCompact:f("warning-compact",60569),passCompact:f("pass-compact",60570),important:f("important",60571),importantCompact:f("important-compact",60572),rocketCompact:f("rocket-compact",60573),unpin:f("unpin",60574),addCompact:f("add-compact",60575),attachCompact:f("attach-compact",60576),beakerCompact:f("beaker-compact",60577),checkCompact:f("check-compact",60578),checklistCompact:f("checklist-compact",60579),chevronDownCompact:f("chevron-down-compact",60580),chevronLeftCompact:f("chevron-left-compact",60581),chevronRightCompact:f("chevron-right-compact",60582),chevronUpCompact:f("chevron-up-compact",60583),circleFilledCompact:f("circle-filled-compact",60584),circleSmallFilledCompact:f("circle-small-filled-compact",60585),closeCompact:f("close-compact",60586),collapseAllCompact:f("collapse-all-compact",60587),commentCompact:f("comment-compact",60588),commentUnresolvedCompact:f("comment-unresolved-compact",60589),debugConnectedCompact:f("debug-connected-compact",60590),debugDisconnectCompact:f("debug-disconnect-compact",60591),editCompact:f("edit-compact",60592),fileMediaCompact:f("file-media-compact",60593),gitFetch:f("git-fetch",60594),lightbulbCompact:f("lightbulb-compact",60595),loadingCompact:f("loading-compact",60596),passFilledCompact:f("pass-filled-compact",60597),projectCompact:f("project-compact",60598),refreshCompact:f("refresh-compact",60599),searchCompact:f("search-compact",60600),sessionInProgressCompact:f("session-in-progress-compact",60601),syncCompact:f("sync-compact",60602),terminalCompact:f("terminal-compact",60603),vmPending:f("vm-pending",60604),worktreeCompact:f("worktree-compact",60605),developerTools:f("developer-tools",60606),cloudCompact:f("cloud-compact",60607),agentCompact:f("agent-compact",60608),askCompact:f("ask-compact",60609),settingsCompact:f("settings-compact",60610),vmCompact:f("vm-compact",60611),runCompact:f("run-compact",60612),gitPullRequestComment:f("git-pull-request-comment",60613),gitPullRequestError:f("git-pull-request-error",60614),rightPanelHide:f("right-panel-hide",60615),rightPanelShow:f("right-panel-show",60616),vscodeInsidersOutline:f("vscode-insiders-outline",60617),vscodeOutline:f("vscode-outline",60618),voiceMode:f("voice-mode",60619),voiceModeCompact:f("voice-mode-compact",60620),micDownload:f("mic-download",60621),micDownloadCompact:f("mic-download-compact",60622),voiceModeDownload:f("voice-mode-download",60623),voiceModeDownloadCompact:f("voice-mode-download-compact",60624),googleGemini:f("google-gemini",60625),kimi:f("kimi",60626),microsoft:f("microsoft",60627),fish1Happy:f("fish1-happy",60628),fish1Neutral:f("fish1-neutral",60629),fish1Sad:f("fish1-sad",60630),fish1VerySad:f("fish1-very-sad",60631),fish2Happy:f("fish2-happy",60632),fish2Neutral:f("fish2-neutral",60633),fish2Sad:f("fish2-sad",60634),fish2VerySad:f("fish2-very-sad",60635),fish3Happy:f("fish3-happy",60636),fish3Neutral:f("fish3-neutral",60637),fish3Sad:f("fish3-sad",60638),fish3VerySad:f("fish3-very-sad",60639),fish4Happy:f("fish4-happy",60640),fish4Neutral:f("fish4-neutral",60641),fish4Sad:f("fish4-sad",60642),fish4VerySad:f("fish4-very-sad",60643),personVoice:f("person-voice",60644),personVoiceCompact:f("person-voice-compact",60645),personVoiceFilled:f("person-voice-filled",60646),personVoiceFilledCompact:f("person-voice-filled-compact",60647),cloudDownloadCompact:f("cloud-download-compact",60648),cloudUploadCompact:f("cloud-upload-compact",60649),micCompact:f("mic-compact",60650),arrowUpCompact:f("arrow-up-compact",60651),xai:f("xai",60652),arrowCircleUpSparkle:f("arrow-circle-up-sparkle",60653),closeSmall:f("close-small",60654),bookCompact:f("book-compact",60655),micOff:f("mic-off",60656),micOffCompact:f("mic-off-compact",60657),copilotDot:f("copilot-dot",60658),copilotDotCompact:f("copilot-dot-compact",60659),layoutDensityCompact:f("layout-density-compact",60660),layoutDensityDefault:f("layout-density-default",60661),gripperCorner:f("gripper-corner",60662),meteredConnection:f("metered-connection",60663),reportQuestion:f("report-question",60664),trophy:f("trophy",60665)}});function zT(){return Object.values(ne)}var tj,ne,ms=v(()=>{NI();MF();tj={dialogError:f("dialog-error","error"),dialogWarning:f("dialog-warning","warning"),dialogInfo:f("dialog-info","info"),dialogClose:f("dialog-close","close"),treeItemExpanded:f("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:f("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:f("tree-filter-on-type-off","list-selection"),treeFilterClear:f("tree-filter-clear","close"),treeItemLoading:f("tree-item-loading","loading"),menuSelection:f("menu-selection","check"),menuSubmenu:f("menu-submenu","chevron-right"),menuBarMore:f("menubar-more","more"),scrollbarButtonLeft:f("scrollbar-button-left","triangle-left"),scrollbarButtonRight:f("scrollbar-button-right","triangle-right"),scrollbarButtonUp:f("scrollbar-button-up","triangle-up"),scrollbarButtonDown:f("scrollbar-button-down","triangle-down"),toolBarMore:f("toolbar-more","more"),quickInputBack:f("quick-input-back","arrow-left"),dropDownButton:f("drop-down-button",60084),symbolCustomColor:f("symbol-customcolor",60252),exportIcon:f("export",60332),workspaceUnspecified:f("workspace-unspecified",60355),newLine:f("newline",60394),thumbsDownFilled:f("thumbsdown-filled",60435),thumbsUpFilled:f("thumbsup-filled",60436),gitFetch:f("git-fetch",60445),lightbulbSparkleAutofix:f("lightbulb-sparkle-autofix",60447),debugBreakpointPending:f("debug-breakpoint-pending",60377),chatImport:f("chat-import",60550),chatExport:f("chat-export",60551),compare:f("compare",60666),gitBranchCheckout:f("git-branch-checkout",60667)},ne={..._F,...tj}});var LF,Zt,ra=v(()=>{ms();(t=>{function r(e){return!!e&&typeof e=="object"&&typeof e.id=="string"}t.isThemeColor=r})(LF||={});(x=>{x.iconNameSegment="[A-Za-z0-9]+",x.iconNameExpression="[A-Za-z0-9-]+",x.iconModifierExpression="~[A-Za-z]+",x.iconNameCharacter="[A-Za-z0-9~-]";let o=new RegExp(`^(${x.iconNameExpression})(${x.iconModifierExpression})?$`);function i(E){let T=o.exec(E.id);if(!T)return i(ne.error);let[,P,M]=T,X=["codicon","codicon-"+P];return M&&X.push("codicon-modifier-"+M.substring(1)),X}x.asClassNameArray=i;function s(E){return i(E).join(" ")}x.asClassName=s;function a(E){return"."+i(E).join(".")}x.asCSSSelector=a;function l(E){return!!E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color>"u"||LF.isThemeColor(E.color))}x.isThemeIcon=l;let c=new RegExp(`^\\$\\((${x.iconNameExpression}(?:${x.iconModifierExpression})?)\\)$`);function u(E){let T=c.exec(E);if(!T)return;let[,P]=T;return{id:P}}x.fromString=u;function p(E){return{id:E}}x.fromId=p;function m(E,T){let P=E.id,M=P.lastIndexOf("~");return M!==-1&&(P=P.substring(0,M)),T&&(P=`${P}~${T}`),{id:P}}x.modify=m;function g(E){let T=E.id.lastIndexOf("~");if(T!==-1)return E.id.substring(T+1)}x.getModifier=g;function y(E,T){return E.id===T.id&&E.color?.id===T.color?.id}x.isEqual=y;function h(E){return E?.id===ne.file.id}x.isFile=h;function I(E){return E?.id===ne.folder.id}x.isFolder=I})(Zt||={})});function KT(r){return r.replace(nj,(t,e)=>e?t:`\\${t}`)}var GT,nj,Jhe,Yhe,Xhe,OF=v(()=>{AF();Tt();ra();GT=new RegExp(`\\$\\(${Zt.iconNameExpression}(?:${Zt.iconModifierExpression})?\\)`,"g"),nj=new RegExp(`(\\\\)?${GT.source}`,"g");Jhe=new RegExp(`\\\\${GT.source}`,"g"),Yhe=new RegExp(`(\\s)?(\\\\)?${GT.source}(\\s)?`,"g"),Xhe=new RegExp(`\\$\\(${Zt.iconNameCharacter}+\\)`,"g")});function oj(r){return r.replace(/[\s\x00-\x1f\x7f]/g,t=>encodeURIComponent(t)).replace(/[\\()<>]/g,"\\$&")}function rj(r){return r.replace(/\r\n|[\r\n]/g," ").replace(/\0/g,"\uFFFD").replace(/[&\\"()\t]/g,t=>`&#${t.charCodeAt(0)};`)}function Ni(r){return r instanceof at?!0:r&&typeof r=="object"?typeof r.value=="string"&&(typeof r.isTrusted=="boolean"||typeof r.isTrusted=="object"||r.isTrusted===void 0)&&(typeof r.supportThemeIcons=="boolean"||r.supportThemeIcons===void 0)&&(typeof r.supportAlertSyntax=="boolean"||r.supportAlertSyntax===void 0):!1}function jT(r){return r.replace(/[\\`*_{}[\]()#+!~]/g,"\\$&").replace(/^([ \t]*)-/gm,"$1\\-")}function UF(r){return jT(KT(r.replace(/\s+/g," "))).replace(/[<>:.@]/g,"\\$&")}function ij(r,t){let e=r.match(/^`+/gm)?.reduce((o,i)=>o.length>i.length?o:i).length??0,n=e>=3?e+1:3;return[`${"`".repeat(n)}${t}`,r,`${"`".repeat(n)}`].join(`
`)}function cf(r){let t=Math.max(0,...(r.match(/`+/g)??[]).map(i=>i.length)),e="`".repeat(t+1),o=r.startsWith("`")||r.endsWith("`")?` ${r} `:r;return`${e}${o}${e}`}function QT(r){let t=[],e=r.split("|").map(o=>o.trim());r=e[0];let n=e[1];if(n){let o=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=o?o[1]:"",a=i?i[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&t.push(`width="${a}"`),c&&t.push(`height="${s}"`)}return{href:r,dimensions:t}}function FI(r,...t){return S.from({scheme:q.command,path:r,query:t.length?encodeURIComponent(JSON.stringify(t)):void 0})}var at,xr=v(()=>{xe();OF();Me();it();te();at=class r{static lift(t){let e=new r(t.value,t);return e.uris=t.uris,e.baseUri=t.baseUri?S.revive(t.baseUri):void 0,e}constructor(t="",e=!1){if(this.value=t,typeof this.value!="string")throw mt("value");typeof e=="boolean"?(this.isTrusted=e,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=e.isTrusted??void 0,this.supportThemeIcons=e.supportThemeIcons??!1,this.supportHtml=e.supportHtml??!1,this.supportAlertSyntax=e.supportAlertSyntax??!1)}appendText(t,e=0){return this.value+=jT(this.supportThemeIcons?KT(t):t).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,e===1?`\\
`:`
`),this}appendMarkdown(t){return this.value+=t,this}appendCodeblock(t,e){return this.value+=`
${ij(e,t)}
`,this}appendLink(t,e,n){return this.value+="[",this.value+=this._escape(e,"]"),this.value+="](",this.value+=oj(String(t)),n&&(this.value+=` "${rj(n)}"`),this.value+=")",this}_escape(t,e){let n="",o=0;for(let i of t)i===e&&o%2===0&&(n+="\\"),o=i==="\\"?o+1:0,n+=i;return o%2===1?n+"\\":n}}});function _e(r,t){return r.uuid&&t.uuid?r.uuid===t.uuid:r.id===t.id?!0:Qd(r.id,t.id)===0}function uf(r){let t=cj.exec(r);return t&&t[1]?[df(t[1]),t[2]]:[df(r),void 0]}function Mu(r,t){return`${r}.${t}`}function df(r){return r.toLowerCase()}function Mo(r,t){return df(Mu(r??PI,t))}function HI(r,t){let e=[],n=o=>{for(let i of e)if(i.some(s=>_e(t(s),t(o))))return i;return null};for(let o of r){let i=n(o);i?i.push(o):e.push([o])}return e}function NF(r){return{id:r.identifier.id,name:r.manifest.name,galleryId:null,publisherId:r.publisherId,publisherName:r.manifest.publisher,publisherDisplayName:r.publisherDisplayName,dependencies:r.manifest.extensionDependencies&&r.manifest.extensionDependencies.length>0}}function pf(r){return{id:new Sr(r.identifier.id),name:new Sr(r.name),extensionVersion:r.version,galleryId:r.identifier.uuid,publisherId:r.publisherId,publisherName:r.publisher,publisherDisplayName:r.publisherDisplayName,isPreReleaseVersion:r.properties.isPreReleaseVersion,dependencies:!!(r.properties.dependencies&&r.properties.dependencies.length>0),isSigned:r.isSigned,...r.telemetryData}}async function dj(r,t){if(!Ke)return!1;let e;try{e=(await r.readFile(S.file("/etc/os-release"))).value.toString()}catch{try{e=(await r.readFile(S.file("/usr/lib/os-release"))).value.toString()}catch(o){t.debug("Error while getting the os-release file.",ye(o))}}return!!e&&(e.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function WI(r,t){let e=await dj(r,t),n=AI(e?"alpine":ei,lv);return t.debug("ComputeTargetPlatform:",n),n}function FF(r,t){return uj(r,t)!==void 0}function uj(r,t){return t.find(({extensionOrPublisher:e})=>G(e)?Qd(r.id.split(".")[0],e)===0:_e(r,e))}function VI(r){return new at(r.origin==="policy"?d(4379,null):d(4378,null))}var lj,lo,cj,Eye,ui=v(()=>{Tt();ee();xr();_o();Yn();fe();te();xe();hr();Wr();Ie();lj=/^([^.]+\..+)-(\d+\.\d+\.\d+)(-(.+))?$/,lo=class r{constructor(t,e,n="undefined"){this.identifier=t;this.version=e;this.targetPlatform=n;this.id=t.id}static create(t){let e=t.manifest?t.manifest.version:t.version,n=t.manifest?t.targetPlatform:t.properties.targetPlatform;return new r(t.identifier,e,n)}static parse(t){let e=lj.exec(t);return e&&e[1]&&e[2]?new r({id:e[1]},e[2],e[4]||void 0):null}toString(){return`${this.id}-${this.version}${this.targetPlatform!=="undefined"?`-${this.targetPlatform}`:""}`}equals(t){return t instanceof r?_e(this,t)&&this.version===t.version&&this.targetPlatform===t.targetPlatform:!1}},cj=/^([^.]+\..+)@((prerelease)|(\d+\.\d+\.\d+(-.*)?))$/;Eye=new un("pprice.better-merge")});var BI,Qe,gs=v(()=>{Tt();BI=(o=>(o[o.Ignore=0]="Ignore",o[o.Info=1]="Info",o[o.Warning=2]="Warning",o[o.Error=3]="Error",o))(BI||{});(a=>{let r="error",t="warning",e="warn",n="info",o="ignore";function i(l){return l?Po(r,l)?3:Po(t,l)||Po(e,l)?2:Po(n,l)?1:0:0}a.fromValue=i;function s(l){switch(l){case 3:return r;case 2:return t;case 1:return n;default:return o}}a.toString=s})(BI||={});Qe=BI});function mj(r){return r=r.trim(),r==="*"||HF.test(r)}function YT(r){if(!mj(r))return null;if(r=r.trim(),r==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let t=r.match(HF);return t?{hasCaret:t[1]==="^",hasGreaterEquals:t[1]===">=",majorBase:t[2]==="x"?0:parseInt(t[2],10),majorMustEqual:t[2]!=="x",minorBase:t[4]==="x"?0:parseInt(t[4],10),minorMustEqual:t[4]!=="x",patchBase:t[6]==="x"?0:parseInt(t[6],10),patchMustEqual:t[6]!=="x",preRelease:t[8]||null}:null}function XT(r){if(!r)return null;let t=r.majorBase,e=r.majorMustEqual,n=r.minorBase,o=r.minorMustEqual,i=r.patchBase,s=r.patchMustEqual;r.hasCaret&&(t===0||(o=!1),s=!1);let a=0;if(r.preRelease){let l=pj.exec(r.preRelease);if(l){let[,c,u,p,m,g]=l;a=Date.UTC(Number(c),Number(u)-1,Number(p),Number(m)||0,Number(g)||0)}}return{majorBase:t,majorMustEqual:e,minorBase:n,minorMustEqual:o,patchBase:i,patchMustEqual:s,isMinimum:r.hasGreaterEquals,notBefore:a}}function gj(r,t,e){let n;typeof r=="string"?n=XT(YT(r)):n=r;let o;t instanceof Date?o=t.getTime():typeof t=="string"&&(o=new Date(t).getTime());let i;if(typeof e=="string"?i=XT(YT(e)):i=e,!n||!i)return!1;let s=n.majorBase,a=n.minorBase,l=n.patchBase,c=i.majorBase,u=i.minorBase,p=i.patchBase,m=i.notBefore,g=i.majorMustEqual,y=i.minorMustEqual,h=i.patchMustEqual;return i.isMinimum?s>c?!0:s<c?!1:a>u?!0:a<u||o&&o<m?!1:l>=p:(s===1&&c===0&&(!g||!y||!h)&&(c=1,u=0,p=0,g=!0,y=!1,h=!1),s<c?!1:s>c?!g:a<u?!1:a>u?!y:l<p?!1:l>p?!h:!(o&&o<m))}function WF(r,t,e,n,o){let i=[];if(typeof n.publisher<"u"&&typeof n.publisher!="string")return i.push([Qe.Error,d(4409,null)]),i;if(typeof n.name!="string")return i.push([Qe.Error,d(4408,null,"name")]),i;if(typeof n.version!="string")return i.push([Qe.Error,d(4410,null,"version")]),i;if(!n.engines)return i.push([Qe.Error,d(4401,null,"engines")]),i;if(typeof n.engines.vscode!="string")return i.push([Qe.Error,d(4402,null,"engines.vscode")]),i;if(typeof n.extensionDependencies<"u"&&!JT(n.extensionDependencies))return i.push([Qe.Error,d(4404,null,"extensionDependencies")]),i;if(typeof n.extensionAffinity<"u"&&!JT(n.extensionAffinity))return i.push([Qe.Error,d(4403,null,"extensionAffinity")]),i;if(typeof n.activationEvents<"u"){if(!JT(n.activationEvents))return i.push([Qe.Error,d(4397,null,"activationEvents")]),i;if(typeof n.main>"u"&&typeof n.browser>"u")return i.push([Qe.Error,d(4398,null,"activationEvents","main","browser")]),i}if(typeof n.extensionKind<"u"&&typeof n.main>"u"&&i.push([Qe.Warning,d(4405,null,"extensionKind")]),typeof n.main<"u"){if(typeof n.main!="string")return i.push([Qe.Error,d(4406,null,"main")]),i;{let l=ge(e,n.main);Bs(l,e)||i.push([Qe.Warning,d(4407,null,l.path,e.path)])}}if(typeof n.browser<"u"){if(typeof n.browser!="string")return i.push([Qe.Error,d(4399,null,"browser")]),i;{let l=ge(e,n.browser);Bs(l,e)||i.push([Qe.Warning,d(4400,null,l.path,e.path)])}}if(!fF(n.version))return i.push([Qe.Error,d(4411,null)]),i;let s=[];if(!fj(r,t,n,o,s))for(let l of s)i.push([Qe.Error,l]);return i}function fj(r,t,e,n,o){return n||typeof e.main>"u"&&typeof e.browser>"u"?!0:VF(r,t,e.engines.vscode,o)}function mf(r,t,e){return r==="*"||VF(t,e,r)}function VF(r,t,e,n=[]){let o=XT(YT(e));if(!o)return n.push(d(4415,null,e)),!1;if(o.majorBase===0){if(!o.majorMustEqual||!o.minorMustEqual)return n.push(d(4413,null,e)),!1}else if(!o.majorMustEqual)return n.push(d(4414,null,e)),!1;return gj(r,t,o)?!0:(n.push(d(4412,null,r,e)),!1)}function JT(r){if(!Array.isArray(r))return!1;for(let t=0,e=r.length;t<e;t++)if(typeof r[t]!="string")return!1;return!0}var HF,pj,qI=v(()=>{it();gs();ee();gl();HF=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,pj=/^-(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?$/});var Be,BF,Wn=v(()=>{Z();Be=A("productService"),BF="vscode://schemas/vscode-product"});function qF(r){return JSON.stringify(r,hj)}function $I(r){let t=JSON.parse(r);return t=en(t),t}function hj(r,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function en(r,t=0){if(!r||t>200)return r;if(typeof r=="object"){switch(r.$mid){case 1:return S.revive(r);case 2:return new RegExp(r.source,r.flags);case 17:return new Date(r.source)}if(r instanceof O||r instanceof Uint8Array)return r;if(Array.isArray(r))for(let e=0;e<r.length;++e)r[e]=en(r[e],t+1);else for(let e in r)Object.hasOwnProperty.call(r,e)&&(r[e]=en(r[e],t+1))}return r}var fs=v(()=>{Ve();te();Ka()});var qr,hs,$F,zI,ZT=v(()=>{Ue();ue();Q();fs();Ie();qr=class r extends D{constructor(e,n=Object.create(null)){super();this.database=e;this.options=n;this._onDidChangeStorage=this._register(new pc);this.onDidChangeStorage=this._onDidChangeStorage.event;this.state=0;this.cache=new Map;this.flushDelayer=this._register(new Or(r.DEFAULT_FLUSH_DELAY));this.pendingDeletes=new Set;this.pendingInserts=new Map;this.pendingClose=void 0;this.whenFlushedCallbacks=[];this.registerListeners()}static{this.DEFAULT_FLUSH_DELAY=100}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((n,o)=>this.acceptExternal(o,n)),e.deleted?.forEach(n=>this.acceptExternal(n,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,n){if(this.state===2)return;let o=!1;Kt(n)?o=this.cache.delete(e):this.cache.get(e)!==n&&(this.cache.set(e,n),o=!0),o&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===0&&(this.state=1,this.options.hint!==0&&(this.cache=await this.database.getItems()))}get(e,n){let o=this.cache.get(e);return Kt(o)?n:o}getBoolean(e,n){let o=this.get(e);return Kt(o)?n:o==="true"}getNumber(e,n){let o=this.get(e);return Kt(o)?n:parseInt(o,10)}getObject(e,n){let o=this.get(e);return Kt(o)?n:$I(o)}async set(e,n,o=!1){if(this.state===2)return;if(Kt(n))return this.delete(e,o);let i=ve(n)||Array.isArray(n)?qF(n):String(n);if(this.cache.get(e)!==i)return this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:o}),this.doFlush()}async delete(e,n=!1){if(!(this.state===2||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async optimize(){if(this.state!==2)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=2;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===2||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===1?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===1}},hs=class{constructor(){this.onDidChangeItemsExternal=F.None;this.items=new Map}async getItems(){return this.items}async updateItems(t){t.insert?.forEach((e,n)=>this.items.set(n,e)),t.delete?.forEach(e=>this.items.delete(e))}async optimize(){}async close(){}},$F="__$__migratedStorageMarker",zI=class r extends qr{constructor(){super(...arguments);this.migratedKeys=new Set;this.fallbackStorage=void 0;this.isFallbackStorageReadonly=!1}async init(){await super.init(),this.migratedKeys=this.loadMigratedKeys()}setFallbackStorage(e,n){this.fallbackStorage=e,this.isFallbackStorageReadonly=n}static{this.INTERNAL_KEY_PREFIX="__$__"}get(e,n){if(!e.startsWith(r.INTERNAL_KEY_PREFIX)&&!this.migratedKeys.has(e)&&$n(super.get(e))){this.migratedKeys.add(e);let o=this.fallbackStorage?.items.get(e);$n(o)||(this.set(e,o),this.isFallbackStorageReadonly||this.fallbackStorage?.delete(e),this.persistMigratedKeys())}return super.get(e,n)}loadMigratedKeys(){let e=super.get($F);if(e)try{return new Set(JSON.parse(e))}catch{}return new Set}persistMigratedKeys(){this.set($F,JSON.stringify([...this.migratedKeys]))}}});function GI(r){let t=r;return typeof t?.id=="string"&&S.isUri(t.uri)}function KI(r){let t=r;return typeof t?.id=="string"&&S.isUri(t.configPath)}function zF(r){let t=r;if(t?.uri)return{id:t.id,uri:S.revive(t.uri)};let e=r;if(e?.configPath)return{id:e.id,configPath:S.revive(e.configPath)};if(r?.id)return{id:r.id}}function Lu(r){let t=r;return!!(t&&typeof t=="object"&&S.isUri(t.uri)&&typeof t.name=="string"&&typeof t.toResource=="function")}function KF(r){return(typeof r=="string"?ki(r):xg(r))===yj}var fl,GF,yj,Xye,ia=v(()=>{ee();Oe();zg();it();te();Z();Me();fl=A("contextService");GF="code-workspace",yj=`.${GF}`,Xye=[{name:d(5100,null),extensions:[GF]}]});var Ye,co=v(()=>{Z();Ye=A("IUriIdentityService")});function QF(r){let t=r;return!!(t&&typeof t=="object"&&typeof t.id=="string"&&typeof t.isDefault=="boolean"&&typeof t.name=="string"&&S.isUri(t.location)&&S.isUri(t.globalStorageHome)&&S.isUri(t.settingsResource)&&S.isUri(t.keybindingsResource)&&S.isUri(t.tasksResource)&&S.isUri(t.snippetsHome)&&S.isUri(t.promptsHome)&&S.isUri(t.extensionsResource)&&S.isUri(t.mcpResource)&&S.isUri(t.languageModelsResource)&&S.isUri(t.agentPluginsHome))}function pi(r,t){return{id:r.id,isDefault:r.isDefault,name:r.name,icon:r.icon,location:S.revive(r.location).with({scheme:t}),globalStorageHome:S.revive(r.globalStorageHome).with({scheme:t}),settingsResource:S.revive(r.settingsResource).with({scheme:t}),keybindingsResource:S.revive(r.keybindingsResource).with({scheme:t}),tasksResource:S.revive(r.tasksResource).with({scheme:t}),snippetsHome:S.revive(r.snippetsHome).with({scheme:t}),promptsHome:S.revive(r.promptsHome).with({scheme:t}),extensionsResource:S.revive(r.extensionsResource).with({scheme:t}),mcpResource:S.revive(r.mcpResource).with({scheme:t}),languageModelsResource:S.revive(r.languageModelsResource).with({scheme:t}),agentPluginsHome:S.revive(r.agentPluginsHome),cacheHome:S.revive(r.cacheHome).with({scheme:t}),useDefaultFlags:r.useDefaultFlags,isTransient:r.isTransient,isInternal:r.isInternal,isAgentsWindowProfile:r.isAgentsWindowProfile,workspaces:r.workspaces?.map(e=>S.revive(e))}}function jI(r,t,e,n,o,i){let s=r===hl;return{id:r,name:t,location:e,isDefault:!1,icon:o?.icon,globalStorageHome:i&&o?.useDefaultFlags?.globalState?i.globalStorageHome:ge(e,"globalStorage"),settingsResource:i&&o?.useDefaultFlags?.settings?i.settingsResource:ge(e,"settings.json"),keybindingsResource:i&&o?.useDefaultFlags?.keybindings?i.keybindingsResource:ge(e,"keybindings.json"),tasksResource:i&&o?.useDefaultFlags?.tasks?i.tasksResource:ge(e,"tasks.json"),snippetsHome:i&&o?.useDefaultFlags?.snippets?i.snippetsHome:ge(e,"snippets"),promptsHome:i&&o?.useDefaultFlags?.prompts?i.promptsHome:ge(e,"prompts"),extensionsResource:i&&o?.useDefaultFlags?.extensions?i.extensionsResource:ge(e,"extensions.json"),mcpResource:i&&o?.useDefaultFlags?.mcp?i.mcpResource:ge(e,"mcp.json"),languageModelsResource:i&&o?.useDefaultFlags?.languageModels?i.languageModelsResource:ge(e,"chatLanguageModels.json"),agentPluginsHome:i?i.agentPluginsHome:ge(e,"agent-plugins"),cacheHome:ge(n,r),useDefaultFlags:o?.useDefaultFlags,isTransient:o?.transient,isInternal:s||o?.transient,isAgentsWindowProfile:s,workspaces:o?.workspaces}}var hl,vj,Bt,jF,Ou,xo=v(()=>{Mi();ue();Q();it();te();ee();Dn();st();Z();De();ia();co();Ue();Vt();Tt();Ie();hl="agents",vj={settings:!0,keybindings:!0,prompts:!0,mcp:!0,languageModels:!0,snippets:!0,tasks:!0,extensions:!0};Bt=A("IUserDataProfilesService");jF="builtin",Ou=class extends D{constructor(e,n,o,i){super();this.environmentService=e;this.fileService=n;this.uriIdentityService=o;this.logService=i;this._onDidChangeProfiles=this._register(new R);this.onDidChangeProfiles=this._onDidChangeProfiles.event;this._onWillCreateProfile=this._register(new R);this.onWillCreateProfile=this._onWillCreateProfile.event;this._onWillRemoveProfile=this._register(new R);this.onWillRemoveProfile=this._onWillRemoveProfile.event;this._onDidResetWorkspaces=this._register(new R);this.onDidResetWorkspaces=this._onDidResetWorkspaces.event;this.profileCreationPromises=new Map;this.transientProfilesObject={profiles:[],emptyWindows:new Map};this.profilesHome=ge(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=ge(this.environmentService.cacheHome,"CachedProfilesData")}static{this.PROFILES_KEY="userDataProfiles"}static{this.PROFILE_ASSOCIATIONS_KEY="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){let e=this.createDefaultProfile(),n=[e];try{for(let i of this.getStoredProfiles()){if(this.isInvalidProfile(i)){this.logService.warn("Skipping the invalid stored profile",i.location||i.name);continue}let s=xn(i.location);n.push(jI(s,i.name,i.location,this.profilesCacheHome,{icon:i.icon,useDefaultFlags:s===hl?vj:i.useDefaultFlags},e))}}catch(i){this.logService.error(i)}let o=new Map;if(n.length)try{let i=this.getStoredProfileAssociations();if(i.workspaces)for(let[s,a]of Object.entries(i.workspaces)){let l=S.parse(s),c=n.find(u=>u.id===a);if(c){let u=c.workspaces?c.workspaces.slice(0):[];u.push(l),c.workspaces=u}}if(i.emptyWindows)for(let[s,a]of Object.entries(i.emptyWindows)){let l=n.find(c=>c.id===a);l&&o.set(s,l)}}catch(i){this.logService.error(i)}this._profilesObject={profiles:n,emptyWindows:o}}return this._profilesObject}isInvalidProfile(e){return!e.name||!G(e.name)||!e.location}createDefaultProfile(){let e=jI("__default__profile__",d(5082,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){let n="Temp",o=new RegExp(`${yo(n)}\\s(\\d+)`),i=0;for(let a of this.profiles){let l=o.exec(a.name),c=l?parseInt(l[1]):0;i=c>i?c:i}let s=`${n} ${i+1}`;return this.createProfile(Fr(Ee()).toString(16),s,{transient:!0},e)}async createNamedProfile(e,n,o){return this.createProfile(Fr(Ee()).toString(16),e,n,o)}async createProfile(e,n,o,i){return await this.doCreateProfile(e,n,o,i)}async doCreateProfile(e,n,o,i){if(!G(n)||!n)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(n);return s||(s=(async()=>{try{if(this.profiles.find(p=>p.id===e||e!==hl&&!p.isTransient&&!o?.transient&&p.name===n))throw new Error(`Profile with ${n} name already exists`);let l=i?this.getWorkspace(i):void 0;S.isUri(l)&&(o={...o,workspaces:[l]});let c=jI(e,n,this.uriIdentityService.extUri.joinPath(this.profilesHome,...e===hl?[jF,e]:[e]),this.profilesCacheHome,e===hl?{}:o,this.defaultProfile);await this.fileService.createFolder(c.location);let u=[];return this._onWillCreateProfile.fire({profile:c,join(p){u.push(p)}}),await Pn.settled(u),l&&!S.isUri(l)&&this.updateEmptyWindowAssociation(l,c,!!c.isTransient),this.updateProfiles([c],[],[]),this.profiles.find(p=>p.id===c.id)??c}finally{this.profileCreationPromises.delete(n)}})(),this.profileCreationPromises.set(n,s)),s}async updateProfile(e,n){if(e.isAgentsWindowProfile)throw new Error("Cannot update agents window profile");let o=[];for(let s of this.profiles){let a;if(e.id===s.id)s.isDefault?n.workspaces&&(a=s,a.workspaces=n.workspaces):a=jI(s.id,n.name??s.name,s.location,this.profilesCacheHome,{icon:n.icon===null?void 0:n.icon??s.icon,transient:n.transient??s.isTransient,useDefaultFlags:n.useDefaultFlags??s.useDefaultFlags,workspaces:n.workspaces??s.workspaces},this.defaultProfile);else if(n.workspaces){let l=s.workspaces?.filter(c=>!n.workspaces?.some(u=>this.uriIdentityService.extUri.isEqual(c,u)));s.workspaces?.length!==l?.length&&(a=s,a.workspaces=l)}a&&o.push(a)}if(!o.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],o);let i=this.profiles.find(s=>s.id===e.id);if(!i)throw new Error(`Profile '${e.name}' was not updated`);return i}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");let n=this.profiles.find(i=>i.id===e.id);if(!n)throw new Error(`Profile '${e.name}' does not exist`);let o=[];this._onWillRemoveProfile.fire({profile:n,join(i){o.push(i)}});try{await Promise.allSettled(o)}catch(i){this.logService.error(i)}this.updateProfiles([],[n],[]);try{await this.fileService.del(n.cacheHome,{recursive:!0})}catch(i){wt(i)!==1&&this.logService.error(i)}}async setProfileForWorkspace(e,n){let o=this.profiles.find(s=>s.id===n.id);if(!o)throw new Error(`Profile '${n.name}' does not exist`);let i=this.getWorkspace(e);if(S.isUri(i)){let s=o.workspaces?[...o.workspaces]:[];s.some(a=>this.uriIdentityService.extUri.isEqual(a,i))||(s.push(i),await this.updateProfile(o,{workspaces:s}))}else this.updateEmptyWindowAssociation(i,o,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,n=!1){let o=this.getWorkspace(e);if(S.isUri(o)){let i=this.getProfileForWorkspace(e);i&&this.updateProfile(i,{workspaces:i.workspaces?.filter(s=>!this.uriIdentityService.extUri.isEqual(s,o))})}else this.updateEmptyWindowAssociation(o,void 0,n),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(let e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){try{if(await this.fileService.exists(this.profilesHome)){let e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(n=>n.isDirectory&&n.name!==jF&&this.profiles.every(o=>!this.uriIdentityService.extUri.isEqual(o.location,n.resource))).map(n=>this.fileService.del(n.resource,{recursive:!0})))}}catch(e){this.logService.error("Error deleting redundant profile folders",e)}try{let e=this.getStoredProfiles(),n=[];for(let o of this.getStoredProfiles())this.isInvalidProfile(o)?this.logService.warn(`Invalid user data profile found: ${o.name}`):n.push(o);e.length!==n.length&&this.saveStoredProfiles(n)}catch(e){this.logService.error("Error removing invalid stored profiles",e)}}async cleanUpTransientProfiles(){let e=this.transientProfilesObject.profiles.filter(n=>!this.isProfileAssociatedToWorkspace(n));await Promise.allSettled(e.map(n=>this.removeProfile(n)))}getProfileForWorkspace(e){let n=this.getWorkspace(e);return S.isUri(n)&&this.uriIdentityService.extUri.isEqual(n,this.environmentService.agentSessionsWorkspace)?this.profiles.find(o=>o.isAgentsWindowProfile):S.isUri(n)?this.profiles.find(o=>o.workspaces?.some(i=>this.uriIdentityService.extUri.isEqual(i,n))):this.profilesObject.emptyWindows.get(n)??this.transientProfilesObject.emptyWindows.get(n)}getWorkspace(e){return GI(e)?e.uri:KI(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(n=>this.uriIdentityService.extUri.isEqual(n.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(n=>this.uriIdentityService.extUri.isEqual(n.location,e.location)))}updateProfiles(e,n,o,i=!1){let s=[...this.profiles,...e],a=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];let l=[];for(let c of s){if(n.some(u=>c.id===u.id)){for(let u of[...this.profilesObject.emptyWindows.keys()])c.id===this.profilesObject.emptyWindows.get(u)?.id&&this.profilesObject.emptyWindows.delete(u);continue}if(!c.isDefault){c=o.find(p=>c.id===p.id)??c;let u=a.find(p=>c.id===p.id);if(c.isTransient)this.transientProfilesObject.profiles.push(c);else if(u){for(let[p,m]of this.transientProfilesObject.emptyWindows.entries())if(c.id===m.id){this.transientProfilesObject.emptyWindows.delete(p),this.profilesObject.emptyWindows.set(p,c);break}}}c.workspaces?.length===0&&(c.workspaces=void 0),l.push(c)}this.updateStoredProfiles(l),i||this.triggerProfilesChanges(e,n,o)}triggerProfilesChanges(e,n,o){this._onDidChangeProfiles.fire({added:e,removed:n,updated:o,all:this.profiles})}updateEmptyWindowAssociation(e,n,o){o=n?.isTransient?!0:o,o?n?this.transientProfilesObject.emptyWindows.set(e,n):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),n?this.profilesObject.emptyWindows.set(e,n):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){let n=[],o={},i={};for(let s of e)if(!s.isTransient&&(s.isDefault||n.push({location:s.location,name:s.name,icon:s.icon,useDefaultFlags:s.useDefaultFlags}),s.workspaces))for(let a of s.workspaces)o[a.toString()]=s.id;for(let[s,a]of this.profilesObject.emptyWindows.entries())i[s.toString()]=a.id;this.saveStoredProfileAssociations({workspaces:o,emptyWindows:i}),this.saveStoredProfiles(n),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}};Ou=w([b(0,Ut),b(1,Le),b(2,Ye),b(3,z)],Ou)});function bj(r){let t=r.get(QI);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}function Uu(r){return r.isDefault||!!r.useDefaultFlags?.globalState}async function Sj(r,t,e,n,o,i,s,a){let l=P=>{try{return JSON.parse(P)}catch{return P}},c=new Map,u=new Map;r.forEach((P,M)=>{c.set(M,P),u.set(M,l(P))});let p=new Map,m=new Map;t.forEach((P,M)=>{p.set(M,P),m.set(M,l(P))});let g=new Map,y=new Map;e.forEach((P,M)=>{g.set(M,P),y.set(M,l(P))});let h=new Map,I=new Map;n.forEach((P,M)=>{h.set(M,P),I.set(M,l(P))}),console.group(o!==s?`Storage: Application (path: ${o})`:`Storage: Application & Profile (path: ${o}, default profile)`);let x=[];c.forEach((P,M)=>{x.push({key:M,value:P})}),console.table(x),console.groupEnd(),console.log(u),console.group(`Storage: Application Shared (path: ${i})`);let E=[];if(p.forEach((P,M)=>{E.push({key:M,value:P})}),console.table(E),console.groupEnd(),console.log(m),o!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);let P=[];g.forEach((M,X)=>{P.push({key:X,value:M})}),console.table(P),console.groupEnd(),console.log(y)}console.group(`Storage: Workspace (path: ${a})`);let T=[];h.forEach((P,M)=>{T.push({key:M,value:P})}),console.table(T),console.groupEnd(),console.log(I)}var ff,QI,mi,gf,JI,gi=v(()=>{Ue();ue();Q();Xr();Ie();ZT();Z();xo();ff="__$__isNewStorageMarker",QI="__$__targetStorageMarker",mi=A("storageService");gf=class r extends D{constructor(e={flushInterval:r.DEFAULT_FLUSH_INTERVAL}){super();this._onDidChangeValue=this._register(new pc);this._onDidChangeTarget=this._register(new pc);this.onDidChangeTarget=this._onDidChangeTarget.event;this._onWillSaveState=this._register(new R);this.onWillSaveState=this._onWillSaveState.event;this.runFlushWhenIdle=this._register(new Kn);this._workspaceKeyTargets=void 0;this._profileKeyTargets=void 0;this._applicationKeyTargets=void 0;this._applicationSharedKeyTargets=void 0;this.flushWhenIdleScheduler=this._register(new nr(()=>this.doFlushWhenIdle(),e.flushInterval))}static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}onDidChangeValue(e,n,o){return F.filter(this._onDidChangeValue.event,i=>i.scope===e&&(n===void 0||i.key===n),o)}async readApplicationSharedValue(e){return this.get(e,-2)}async compareAndSwapApplicationSharedValue(e,n,o){let i=this.get(e,-2);return i!==n?{swapped:!1,currentValue:i}:(this.store(e,o,-2,1),{swapped:!0,currentValue:o})}doFlushWhenIdle(){this.runFlushWhenIdle.value=xR(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){hn([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{qt("code/willInitStorage");try{await this.doInitialize()}finally{qt("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,n){let{key:o,external:i}=n;if(o===QI){switch(e){case-2:this._applicationSharedKeyTargets=void 0;break;case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:o,target:this.getKeyTargets(e)[o],external:i})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,n,o){return this.getStorage(n)?.get(e,o)}getBoolean(e,n,o){return this.getStorage(n)?.getBoolean(e,o)}getNumber(e,n,o){return this.getStorage(n)?.getNumber(e,o)}getObject(e,n,o){return this.getStorage(n)?.getObject(e,o)}storeAll(e,n){this.withPausedEmitters(()=>{for(let o of e)this.store(o.key,o.value,o.scope,o.target,n)})}store(e,n,o,i,s=!1){if(Kt(n)){this.remove(e,o,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,o,i),this.getStorage(o)?.set(e,n,s)})}remove(e,n,o=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,n,void 0),this.getStorage(n)?.delete(e,o)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,n){let o=[],i=this.getKeyTargets(e);for(let s of Object.keys(i))i[s]===n&&o.push(s);return o}updateKeyTarget(e,n,o,i=!1){let s=this.getKeyTargets(n);typeof o=="number"?s[e]!==o&&(s[e]=o,this.getStorage(n)?.set(QI,JSON.stringify(s),i)):typeof s[e]=="number"&&(delete s[e],this.getStorage(n)?.set(QI,JSON.stringify(s),i))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}get applicationSharedKeyTargets(){return this._applicationSharedKeyTargets||(this._applicationSharedKeyTargets=this.loadKeyTargets(-2)),this._applicationSharedKeyTargets}getKeyTargets(e){switch(e){case-2:return this.applicationSharedKeyTargets;case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let n=this.getStorage(e);return n?bj(n):Object.create(null)}isNew(e){return this.getBoolean(ff,e)===!0}async flush(e=0){this._onWillSaveState.fire({reason:e});let n=this.getStorage(-1),o=this.getStorage(-2),i=this.getStorage(0),s=this.getStorage(1);switch(e){case 0:await Pn.settled([n?.whenFlushed()??Promise.resolve(),o?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case 1:await Pn.settled([n?.flush(0)??Promise.resolve(),o?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){let e=this.getStorage(-1)?.items??new Map,n=this.getStorage(-2)?.items??new Map,o=this.getStorage(0)?.items??new Map,i=this.getStorage(1)?.items??new Map;return Sj(e,n,o,i,this.getLogDetails(-1)??"",this.getLogDetails(-2)??"",this.getLogDetails(0)??"",this.getLogDetails(1)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,n){return this.emitWillSaveState(0),QF(e)?this.switchToProfile(e,n):this.switchToWorkspace(e,n)}canSwitchProfile(e,n){return!(e.id===n.id||Uu(n)&&Uu(e))}switchData(e,n,o){this.withPausedEmitters(()=>{let i=new Set;for(let[s,a]of e)i.add(s),n.get(s)!==a&&this.emitDidChangeValue(o,{key:s,external:!0});for(let[s]of n.items)i.has(s)||this.emitDidChangeValue(o,{key:s,external:!0})})}};JI=class extends gf{constructor(){super();this.applicationStorage=this._register(new qr(new hs,{hint:1}));this.applicationSharedStorage=this._register(new qr(new hs,{hint:1}));this.profileStorage=this._register(new qr(new hs,{hint:1}));this.workspaceStorage=this._register(new qr(new hs,{hint:1}));this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e))),this._register(this.applicationSharedStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-2,e)))}getStorage(e){switch(e){case-2:return this.applicationSharedStorage;case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case-2:return"inMemory (application-shared)";case-1:return"inMemory (application)";case 0:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}});async function JF(r,t,e){let n=e&&e.get("storage.serviceMachineId",-1)||null;if(n)return n;try{let i=(await t.readFile(r.serviceMachineIdResource)).value.toString();n=HR(i)?i:null}catch{n=null}if(!n){n=Ee();try{await t.writeFile(r.serviceMachineIdResource,O.fromString(n))}catch{}}return e?.store("storage.serviceMachineId",n,-1,1),n}var YF=v(()=>{Ve();Vt();gi()});async function XF(r,t,e,n,o,i,s){let a={"X-Market-Client-Id":`VSCode ${r}`,"User-Agent":`VSCode ${r} (${t.nameShort})`};if(t.extensionsGallery?.authorizationHeaderToken&&(a.Authorization=`Bearer ${t.extensionsGallery.authorizationHeaderToken}`),wI(t,e)&&tf(n)===3){let l=await JF(e,o,i);a["X-Market-User-Id"]=l,a["VSCode-SessionId"]=s.machineId||l}return a}var ZF=v(()=>{YF();_n();Wr()});function Fu(r,t){let[e,n]=t.split("/");for(let o of r.resources){let[i,s]=o.type.split("/");if(i===e){if(!n||s===n)return o.id;break}}}var ys,Lc=v(()=>{Z();ys=A("IExtensionGalleryManifestService")});function oP(r,t){let e=(r||[]).filter(n=>n.statisticName===t)[0];return e?e.value:0}function Aj(r){let t="Microsoft.VisualStudio.Code.Translation.";return r.files.filter(n=>n.assetType.indexOf(t)===0).reduce((n,o)=>{let i=Fi(r,o.assetType);return i&&n.push([o.assetType.substring(t.length),i]),n},[])}function Dj(r){if(r.properties){let t=r.properties.filter(o=>o.key===uo.Repository),e=new RegExp("((git|ssh|http(s)?)|(git@[\\w.]+))(:(//)?)([\\w.@:/\\-~]+)(.git)(/)?"),n=t.filter(o=>e.test(o.value))[0];return n?{uri:n.value,fallbackUri:n.value}:null}return Fi(r,uo.Repository)}function _j(r){return{uri:`${r.fallbackAssetUri}/${uo.VSIX}?redirect=true${r.targetPlatform?`&targetPlatform=${r.targetPlatform}`:""}`,fallbackUri:`${r.fallbackAssetUri}/${uo.VSIX}${r.targetPlatform?`?targetPlatform=${r.targetPlatform}`:""}`}}function Fi(r,t){return r.files.filter(n=>n.assetType===t)[0]?{uri:`${r.assetUri}/${t}${r.targetPlatform?`?targetPlatform=${r.targetPlatform}`:""}`,fallbackUri:`${r.fallbackAssetUri}/${t}${r.targetPlatform?`?targetPlatform=${r.targetPlatform}`:""}`}:null}function eH(r,t){let e=r.properties?r.properties.filter(o=>o.key===t):[],n=e.length>0&&e[0].value;return n?n.split(",").map(o=>df(o)):[]}function tb(r){let t=r.properties?r.properties.filter(e=>e.key===Hi.Engine):[];return t.length>0&&t[0].value||""}function Mj(r,t){r.properties=r.properties??[],r.properties.push({key:Hi.Engine,value:t})}function Bu(r){let t=r.properties?r.properties.filter(e=>e.key===Hi.PreRelease):[];return t.length>0&&t[0].value==="true"}function iH(r,t){return t.extensionProperties?.[r.toLowerCase()]?.hasPrereleaseVersion}function Lj(r,t){return t.extensionProperties?.[r.toLowerCase()]?.excludeVersionRange}function Oj(r){let t=r.properties?r.properties.filter(e=>e.key===Hi.Private):[];return t.length>0&&t[0].value==="true"}function Uj(r,t){if(Wu(r.flags,r.blocking))return{origin:tH(r.blocking?.origin),scope:"extension"};if(Wu(t.flags,t.blocking))return{origin:tH(t.blocking?.origin),scope:"version"}}function Wu(r,t){return!!t||Nj(r,Tj.Blocked)}function tH(r){return typeof r=="string"&&r.trim().toLowerCase()==="policy"?"policy":"service"}function Nj(r,t){return!!r&&r.split(",").some(e=>e.trim().toLowerCase()===t)}function Fj(r){let t=r.properties?r.properties.filter(e=>e.key===Hi.ExecutesCode):[];return t.length>0?t[0].value==="true":void 0}function sP(r){let t=r.properties?r.properties.filter(n=>n.key===Hi.EnabledApiProposals):[],e=t.length>0&&t[0].value||"";return e?e.split(","):[]}function Hj(r){let t=r.properties?r.properties.filter(n=>n.key===Hi.LocalizedLanguages):[],e=t.length>0&&t[0].value||"";return e?e.split(","):[]}function Wj(r){return r.properties?.find(t=>t.key===Hi.SponsorLink)?.value}function Vj(r){return r.properties?.find(t=>t.key===Hi.SupportLink)?.value}function Bj(r){return r.indexOf("preview")!==-1}function Oc(r){return r.targetPlatform?uF(r.targetPlatform):"undefined"}function XI(r){let t=rn(r.versions.map(Oc)),e=!!r.tags?.includes(lF),n=t.indexOf("web");return e?n===-1&&t.push("web"):n!==-1&&t.splice(n,1),t}function nH(r,t){for(let e=0;e<r.length;e++){let n=r[e];if(n.version===r[e-1]?.version){let o=e;if(Oc(n)===t)for(;o>0&&r[o-1].version===n.version;)o--;o!==e&&(r.splice(e,1),r.splice(o,0,n))}}return r}function qj(r,t,e){let n=[],o=-1,i=-1;for(let s of r){let a=Oc(s);if(!af(a,e,t)){n.push(s);continue}Bu(s)?o===-1?(o=n.length,n.push(s)):a===t&&n[o].version===s.version&&(n[o]=s):i===-1?(i=n.length,n.push(s)):a===t&&n[i].version===s.version&&(n[i]=s)}return n}function oH(r,t,e){r.telemetryData={index:t,querySource:e,queryActivityId:r.queryContext?.[eb]}}function rP(r,t,e){return(t?Fu(r,t):void 0)??Fu(r,e)}function iP(r,t,e,n,o,i){let s=r.versions[0],a={manifest:Fi(t,uo.Manifest),readme:Fi(t,uo.Details),changelog:Fi(t,uo.Changelog),license:Fi(t,uo.License),repository:Dj(t),download:_j(t),icon:Fi(t,uo.Icon),signature:Fi(t,uo.Signature),coreTranslations:Aj(t)},l=rP(n,r.linkType,"ExtensionDetailsViewUriTemplate"),c=rP(n,r.publisher.linkType,"PublisherViewUriTemplate"),u=rP(n,r.ratingLinkType,"ExtensionRatingViewUriTemplate"),p=Mo(r.publisher.publisherName,r.extensionName);return{type:"gallery",identifier:{id:p,uuid:r.extensionId},name:r.extensionName,version:t.version,displayName:r.displayName,publisherId:r.publisher.publisherId,publisher:r.publisher.publisherName,publisherDisplayName:r.publisher.displayName,publisherDomain:r.publisher.domain?{link:r.publisher.domain,verified:!!r.publisher.isDomainVerified}:void 0,publisherSponsorLink:Wj(s),description:r.shortDescription??"",installCount:oP(r.statistics,"install"),rating:oP(r.statistics,"averagerating"),ratingCount:oP(r.statistics,"ratingcount"),categories:r.categories||[],tags:r.tags||[],releaseDate:Date.parse(r.releaseDate),lastUpdated:Date.parse(r.lastUpdated),allTargetPlatforms:e,assets:a,properties:{dependencies:eH(t,Hi.Dependency),extensionPack:eH(t,Hi.ExtensionPack),engine:tb(t),enabledApiProposals:sP(t),localizedLanguages:Hj(t),targetPlatform:Oc(t),isPreReleaseVersion:Bu(t),executesCode:Fj(t)},hasPreReleaseVersion:iH(p,o)??Bu(s),hasReleaseVersion:!0,private:Oj(s),blockingInfo:Uj(r,t),preview:Bj(r.flags),isSigned:!!a.signature,queryContext:i,supportLink:Vj(s),detailsLink:l?Lr(l,{publisher:r.publisher.publisherName,name:r.extensionName}):void 0,publisherLink:c?Lr(c,{publisher:r.publisher.publisherName}):void 0,ratingLink:u?Lr(u,{publisher:r.publisher.publisherName,name:r.extensionName}):void 0}}var YI,eb,eP,tP,nP,uo,Hi,Tj,Pj,kj,Hu,Vu,ZI,yl,lP=v(()=>{Dt();Jt();gl();xe();fe();hr();Ie();te();IF();dn();Dn();_o();ui();Yn();qI();st();De();Wn();Ui();ZF();gi();_n();Vs();Tt();Lc();Wr();YI=bn?"web":AI(ei,lv),eb="X-Market-Search-Activity-Id",eP="Activityid",tP="Server",nP="X-Vss-E2eid",uo={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source",Signature:"Microsoft.VisualStudio.Services.VsixSignature"},Hi={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",PreRelease:"Microsoft.VisualStudio.Code.PreRelease",EnabledApiProposals:"Microsoft.VisualStudio.Code.EnabledApiProposals",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages",WebExtension:"Microsoft.VisualStudio.Code.WebExtension",SponsorLink:"Microsoft.VisualStudio.Code.SponsorLink",SupportLink:"Microsoft.VisualStudio.Services.Links.Support",ExecutesCode:"Microsoft.VisualStudio.Code.ExecutesCode",Private:"PrivateMarketplace"},Tj={Blocked:"blocked"},Pj=10,kj={pageNumber:1,pageSize:Pj,sortBy:"NoneOrRelevance",sortOrder:0,flags:[],criteria:[],assetTypes:[]},Hu=class r{constructor(t=kj){this.state=t}get pageNumber(){return this.state.pageNumber}get pageSize(){return this.state.pageSize}get sortBy(){return this.state.sortBy}get sortOrder(){return this.state.sortOrder}get flags(){return this.state.flags}get criteria(){return this.state.criteria}get assetTypes(){return this.state.assetTypes}get source(){return this.state.source}get searchText(){let t=this.state.criteria.filter(e=>e.filterType==="SearchText")[0];return t&&t.value?t.value:""}withPage(t,e=this.state.pageSize){return new r({...this.state,pageNumber:t,pageSize:e})}withFilter(t,...e){let n=[...this.state.criteria,...e.length?e.map(o=>({filterType:t,value:o})):[{filterType:t}]];return new r({...this.state,criteria:n})}withSortBy(t){return new r({...this.state,sortBy:t})}withSortOrder(t){return new r({...this.state,sortOrder:t})}withFlags(...t){return new r({...this.state,flags:rn(t)})}withAssetTypes(...t){return new r({...this.state,assetTypes:t})}withSource(t){return new r({...this.state,source:t})}};Vu=class{constructor(t,e,n,o,i,s,a,l,c,u){this.requestService=e;this.logService=n;this.environmentService=o;this.telemetryService=i;this.fileService=s;this.productService=a;this.configurationService=l;this.allowedExtensionsService=c;this.extensionGalleryManifestService=u;this.extensionsControlUrl=a.extensionsGallery?.controlUrl,this.unpkgResourceApi=a.extensionsGallery?.extensionUrlTemplate,this.commonHeadersPromise=XF(a.version,a,this.environmentService,this.configurationService,this.fileService,t,this.telemetryService)}isEnabled(){return this.extensionGalleryManifestService.extensionGalleryManifestStatus==="available"}async getExtensions(t,e,n){let o=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!o)throw new Error("No extension gallery service configured.");let i=Ae.isCancellationToken(e)?{}:e,s=Ae.isCancellationToken(e)?e:n,a=this.getResourceApi(o),l=a?await this.getExtensionsUsingResourceApi(t,i,a,o,s):await this.getExtensionsUsingQueryApi(t,i,o,s),c=l.map(p=>p.identifier.uuid),u=[];for(let p of t)p.uuid&&!c.includes(p.uuid)&&u.push({...p,uuid:void 0});if(u.length){this.telemetryService.publicLog2("galleryService:additionalQueryByName",{count:u.length});let p=await this.getExtensionsUsingQueryApi(u,i,o,s);l.push(...p)}return l}getResourceApi(t){let e=Fu(t,"ExtensionLatestVersionUriTemplate");if(e)return{uri:e,fallback:this.unpkgResourceApi}}async getExtensionsUsingQueryApi(t,e,n,o){let i=[],s=[],a=[],l=[],c=!0;for(let m of t)m.uuid?s.push(m.uuid):i.push(m.id),m.version?l.push({id:m.id,uuid:m.uuid,version:m.version}):a.push({id:m.id,uuid:m.uuid,includePreRelease:!!m.preRelease}),c=c&&!!m.hasPreRelease&&!m.preRelease;if(!s.length&&!i.length)return[];let u=new Hu().withPage(1,t.length);s.length&&(u=u.withFilter("ExtensionId",...s)),i.length&&(u=u.withFilter("ExtensionName",...i)),e.queryAllVersions&&(u=u.withFlags(...u.flags,"IncludeVersions")),e.source&&(u=u.withSource(e.source));let{extensions:p}=await this.queryGalleryExtensions(u,{targetPlatform:e.targetPlatform??YI,includePreRelease:a,versions:l,compatible:!!e.compatible,productVersion:e.productVersion??{version:this.productService.version,date:this.productService.date},includeBlockedVersions:e.includeBlockedVersions,isQueryForReleaseVersionFromPreReleaseVersion:c},n,o);return e.source&&p.forEach((m,g)=>oH(m,g,e.source)),p}async getExtensionsUsingResourceApi(t,e,n,o,i){let s=[],a=[],l=[];for(let c of t)sf.test(c.id)&&(c.version||!c.uuid?a.push(c):l.push(c));if(await Promise.all(l.map(async c=>{let u;try{u=await this.getLatestGalleryExtension(c,e,n,o,i),G(u)?u==="LATEST_IS_OUTDATED"?this.logService.debug(`Skipping query API fallback for extension ${c.id} because the latest gallery version is older than the current version`):(this.telemetryService.publicLog2("galleryService:fallbacktoquery",{extension:c.id,preRelease:!!c.preRelease,compatible:!!e.compatible,errorCode:u}),a.push(c)):s.push(u)}catch(p){if(p instanceof Vr)switch(p.code){case"Offline":case"Cancelled":case"Timeout":throw p}this.logService.error(`Error while getting the latest version for the extension ${c.id}.`,ye(p)),this.telemetryService.publicLog2("galleryService:fallbacktoquery",{extension:c.id,preRelease:!!c.preRelease,compatible:!!e.compatible,errorCode:p instanceof Vr?p.code:"Unknown"}),a.push(c)}})),a.length){let c=await this.getExtensionsUsingQueryApi(a,e,o,i);s.push(...c)}return s}async getLatestGalleryExtension(t,e,n,o,i){let s=await this.getLatestRawGalleryExtensionWithFallback(t,n,i);if(!s)return"NOT_FOUND";if(!Array.isArray(s.versions)||s.versions.some(c=>!Array.isArray(c.files)))return"INVALID_RESPONSE";let a=XI(s),l=await this.getValidRawGalleryExtensionVersionFromLatestVersions(s,s.versions,t,e,a);if(!l){if(t.currentVersion){let c=s.versions.length>0?s.versions[0].version:void 0;if(c&&MI(c,t.currentVersion))return"LATEST_IS_OUTDATED"}return"NOT_COMPATIBLE"}return iP(s,l,a,o,this.productService)}async getValidRawGalleryExtensionVersionFromLatestVersions(t,e,n,o,i){let s=o.targetPlatform??YI,a=qj(e,s,i),l=await this.getValidRawGalleryExtensionVersion(t,a,{targetPlatform:s,compatible:!!o.compatible,productVersion:o.productVersion??{version:this.productService.version,date:this.productService.date},version:n.preRelease?1:0},i);if(!n.preRelease)return l;let c=l,u=await this.getValidRawGalleryExtensionVersion(t,a,{targetPlatform:s,compatible:!!o.compatible,productVersion:o.productVersion??{version:this.productService.version,date:this.productService.date},version:0},i);if(c&&u)return ps(u.version,c.version)?u:c;if(o.compatible){if(u){let p=await this.getValidRawGalleryExtensionVersion(t,a,{targetPlatform:s,compatible:!1,productVersion:o.productVersion??{version:this.productService.version,date:this.productService.date},version:1},i);if(!p||ps(u.version,p.version))return u}return c}return c??u??null}async getCompatibleExtension(t,e,n,o={version:this.productService.version,date:this.productService.date}){return Au(t.allTargetPlatforms,n)?null:t.blockingInfo?.scope==="extension"||await this.isExtensionCompatible(t,e,n)?t:this.allowedExtensionsService.isAllowed({id:t.identifier.id,publisherDisplayName:t.publisherDisplayName})!==!0?null:(await this.getExtensions([{...t.identifier,preRelease:e,hasPreRelease:t.hasPreReleaseVersion}],{compatible:!0,productVersion:o,queryAllVersions:!0,targetPlatform:n},Ae.None))[0]??null}async isExtensionCompatible(t,e,n,o={version:this.productService.version,date:this.productService.date}){return this.isValidVersion({id:t.identifier.id,version:t.version,isPreReleaseVersion:t.properties.isPreReleaseVersion,targetPlatform:t.properties.targetPlatform,manifestAsset:t.assets.manifest,engine:t.properties.engine,enabledApiProposals:t.properties.enabledApiProposals,blocked:!!t.blockingInfo},{targetPlatform:n,compatible:!0,productVersion:o,version:e?2:0},t.publisherDisplayName,t.allTargetPlatforms)}async isValidVersion(t,{targetPlatform:e,compatible:n,productVersion:o,version:i},s,a){let l=iH(t.id,this.productService),c=Lj(t.id,this.productService);if(t.blocked||t.isPreReleaseVersion&&l===!1||c&&vF(t.version,c))return!1;if(G(i)){if(t.version!==i)return!1}else if((i===0||i===1)&&t.isPreReleaseVersion!==(i===1))return!1;return!(e&&!af(t.targetPlatform,a,e)||n&&(this.allowedExtensionsService.isAllowed({id:t.id,publisherDisplayName:s,version:t.version,prerelease:t.isPreReleaseVersion,targetPlatform:t.targetPlatform})!==!0||!await this.isEngineValid(t.id,t.version,t.engine,t.manifestAsset,o)))}async isEngineValid(t,e,n,o,i){if(!n)try{n=await this.getEngine(t,e,o)}catch(s){return this.logService.error(`Error while getting the engine for the version ${e}.`,ye(s)),!1}return n?mf(n,i.version,i.date):(this.logService.error(`Missing engine for the extension ${t} with version ${e}`),!1)}async getEngine(t,e,n){if(!n){this.logService.error(`Missing engine and manifest asset for the extension ${t} with version ${e}`);return}try{this.telemetryService.publicLog2("galleryService:engineFallback",{extension:t,extensionVersion:e});let o={"Accept-Encoding":"gzip"},i=await this.getAsset(t,n,uo.Manifest,e,"extensionGalleryService.engineVersion",{headers:o}),s=await us(i);if(!s){this.logService.error(`Manifest was not found for the extension ${t} with version ${e}`);return}return s.engines.vscode}catch(o){this.logService.error(`Error while getting the engine for the version ${e}.`,ye(o));return}}async query(t,e){let n=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!n)throw new Error("No extension gallery service configured.");let o=t.text||"",i=t.pageSize??50,s=new Hu().withPage(1,i);o?(o=o.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(p,m,g)=>(s=s.withFilter("Category",g||m),"")),o=o.replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(p,m,g)=>(s=s.withFilter("Tag",g||m),"")),o=o.replace(/\bfeatured(\s+|\b|$)/g,()=>(s=s.withFilter("Featured"),"")),o=o.trim(),o&&(o=o.length<200?o:o.substring(0,200),s=s.withFilter("SearchText",o)),n.capabilities.extensionQuery.sorting?.some(p=>p.name==="NoneOrRelevance")&&(s=s.withSortBy("NoneOrRelevance"))):n.capabilities.extensionQuery.sorting?.some(p=>p.name==="InstallCount")&&(s=s.withSortBy("InstallCount")),t.sortBy&&n.capabilities.extensionQuery.sorting?.some(p=>p.name===t.sortBy)&&(s=s.withSortBy(t.sortBy)),typeof t.sortOrder=="number"&&(s=s.withSortOrder(t.sortOrder)),t.source&&(s=s.withSource(t.source));let a=async(p,m)=>{let{extensions:g,total:y}=await this.queryGalleryExtensions(p,{targetPlatform:YI,compatible:!1,includePreRelease:!!t.includePreRelease,productVersion:t.productVersion??{version:this.productService.version,date:this.productService.date}},n,m),h=[],I;for(let x=0;x<g.length;x++){let E=g[x];oH(E,(p.pageNumber-1)*p.pageSize+x,t.source),_e(E.identifier,{id:this.productService.defaultChatAgent.extensionId})?I=E:h.push(E)}return I&&h.push(I),{extensions:h,total:y}},{extensions:l,total:c}=await a(s,e),u=async(p,m)=>{if(m.isCancellationRequested)throw new He;let{extensions:g}=await a(s.withPage(p+1),m);return g};return{firstPage:l,total:c,pageSize:s.pageSize,getPage:u}}async queryGalleryExtensions(t,e,n,o){let i=t.flags;t.flags.includes("IncludeLatestVersionOnly")&&t.flags.includes("IncludeVersions")&&(t=t.withFlags(...t.flags.filter(m=>m!=="IncludeVersions"))),!t.flags.includes("IncludeLatestVersionOnly")&&!t.flags.includes("IncludeVersions")&&(t=t.withFlags(...t.flags,"IncludeLatestVersionOnly")),(e.versions?.length||e.isQueryForReleaseVersionFromPreReleaseVersion)&&(t=t.withFlags(...t.flags.filter(m=>m!=="IncludeLatestVersionOnly"),"IncludeVersions")),t=t.withFlags(...t.flags,"IncludeAssetUri","IncludeCategoryAndTags","IncludeFiles","IncludeStatistics","IncludeVersionProperties");let{galleryExtensions:s,total:a,context:l}=await this.queryRawGalleryExtensions(t,n,o);if(!t.flags.includes("IncludeLatestVersionOnly")){let m=[];for(let g of s){let y=XI(g),h={id:Mo(g.publisher.publisherName,g.extensionName),uuid:g.extensionId},I=er(e.includePreRelease)?e.includePreRelease:!!e.includePreRelease.find(E=>_e(E,h))?.includePreRelease,x=await this.getValidRawGalleryExtensionVersion(g,g.versions,{compatible:e.compatible,targetPlatform:e.targetPlatform,productVersion:e.productVersion,version:e.versions?.find(E=>_e(E,h))?.version??(I?2:0),includeBlockedVersions:e.includeBlockedVersions},y);x&&m.push(iP(g,x,y,n,this.productService,l))}return{extensions:m,total:a}}let u=[],p=new Map;for(let m=0;m<s.length;m++){let g=s[m],y={id:Mo(g.publisher.publisherName,g.extensionName),uuid:g.extensionId},h=er(e.includePreRelease)?e.includePreRelease:!!e.includePreRelease.find(T=>_e(T,y))?.includePreRelease,I=XI(g);if(e.compatible&&(Au(I,e.targetPlatform)||this.allowedExtensionsService.isAllowed({id:y.id,publisherDisplayName:g.publisher.displayName})!==!0))continue;let x=await this.getValidRawGalleryExtensionVersion(g,g.versions,{compatible:e.compatible,targetPlatform:e.targetPlatform,productVersion:e.productVersion,version:e.versions?.find(T=>_e(T,y))?.version??(h?2:0),includeBlockedVersions:e.includeBlockedVersions},I),E=x?iP(g,x,I,n,this.productService,l):null;!E||E.properties.isPreReleaseVersion&&(!h||!E.hasReleaseVersion)||!E.properties.isPreReleaseVersion&&E.properties.targetPlatform!==e.targetPlatform&&E.hasPreReleaseVersion?p.set(g.extensionId,m):u.push([m,E])}if(p.size){let m=new no,g=new Hu().withFlags(...i.filter(h=>h!=="IncludeLatestVersionOnly"),"IncludeVersions").withPage(1,p.size).withFilter("ExtensionId",...p.keys()),{extensions:y}=await this.queryGalleryExtensions(g,e,n,o);this.telemetryService.publicLog2("galleryService:additionalQuery",{duration:m.elapsed(),count:p.size});for(let h of y){let I=p.get(h.identifier.uuid);u.push([I,h])}}return{extensions:u.sort((m,g)=>m[0]-g[0]).map(([,m])=>m),total:a}}async getValidRawGalleryExtensionVersion(t,e,n,o){let i={id:Mo(t.publisher.publisherName,t.extensionName),uuid:t.extensionId},s=nH(e,n.targetPlatform);if(n.compatible&&Au(o,n.targetPlatform))return null;let a=G(n.version)?n.version:void 0;for(let l=0;l<s.length;l++){let c=s[l];if(n.compatible&&await this.setEngineIfNotExists(i.id,c),await this.isValidVersion({id:i.id,version:c.version,isPreReleaseVersion:Bu(c),targetPlatform:Oc(c),engine:tb(c),manifestAsset:Fi(c,uo.Manifest),enabledApiProposals:sP(c),blocked:Wu(c.flags,c.blocking)},n,t.publisher.displayName,o))return c;if(a&&c.version===a)return n.includeBlockedVersions&&Wu(c.flags,c.blocking)?c:null}return a||n.compatible?null:s.find(l=>!Wu(l.flags,l.blocking))??null}async setEngineIfNotExists(t,e){if(!tb(e))try{let n=await this.getEngine(t,e.version,Fi(e,uo.Manifest));n&&Mj(e,n)}catch(n){this.logService.error(`Error while getting the engine for the version ${e.version}.`,ye(n))}}async queryRawGalleryExtensions(t,e,n){let o=Fu(e,"ExtensionQueryService");if(!o)throw new Error("No extension gallery query service configured.");t=t.withFlags(...t.flags,"ExcludeNonValidated").withFilter("Target","Microsoft.VisualStudio.Code");let i=e.capabilities.extensionQuery.flags?.find(m=>m.name==="Unpublished");i&&(t=t.withFilter("ExcludeWithFlags",String(i.value)));let s=JSON.stringify({filters:[{criteria:t.criteria.reduce((m,g)=>{let y=e.capabilities.extensionQuery.filtering?.find(h=>h.name===g.filterType);return y&&m.push({filterType:y.value,value:g.value}),m},[]),pageNumber:t.pageNumber,pageSize:t.pageSize,sortBy:e.capabilities.extensionQuery.sorting?.find(m=>m.name===t.sortBy)?.value,sortOrder:t.sortOrder}],assetTypes:t.assetTypes,flags:t.flags.reduce((m,g)=>{let y=e.capabilities.extensionQuery.flags?.find(h=>h.name===g);return y&&(m|=y.value),m},0)}),a={...await this.getRequestHeaders(o),"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":String(s.length)},l=new no,c,u,p=0;try{if(c=await this.requestService.request({type:"POST",url:o,data:s,headers:a,callSite:"extensionGalleryService.queryRawGalleryExtensions"},n),c.res.statusCode&&c.res.statusCode>=400&&c.res.statusCode<500)return{galleryExtensions:[],total:p};let m=await us(c);if(m){let g=m.results[0],y=g.extensions,h=g.resultMetadata&&g.resultMetadata.filter(I=>I.metadataType==="ResultCount")[0];return p=h&&h.metadataItems.filter(I=>I.name==="TotalCount")[0].count||0,{galleryExtensions:y,total:p,context:c.res.headers.activityid?{[eb]:c.res.headers.activityid}:{}}}return{galleryExtensions:[],total:p}}catch(m){if(on(m))throw u="Cancelled",m;{let g=ye(m);throw u=FT(m)?"Offline":g.startsWith("XHR timeout")?"Timeout":"Failed",new Vr(g,u)}}finally{this.telemetryService.publicLog2("galleryService:query",{filterTypes:t.criteria.map(m=>m.filterType),flags:t.flags,sortBy:t.sortBy,sortOrder:String(t.sortOrder),pageNumber:String(t.pageNumber),source:t.source,searchTextLength:t.searchText.length,requestBodySize:String(s.length),duration:l.elapsed(),success:!!c&&kc(c),responseBodySize:c?.res.headers["Content-Length"],statusCode:c?String(c.res.statusCode):void 0,errorCode:u,count:String(p),server:this.getHeaderValue(c?.res.headers,tP),activityId:this.getHeaderValue(c?.res.headers,eP),endToEndId:this.getHeaderValue(c?.res.headers,nP)})}}getHeaderValue(t,e){let n=t?.[e.toLowerCase()],o=Array.isArray(n)?n[0]:n;return o?new Sr(o):void 0}async getLatestRawGalleryExtensionWithFallback(t,e,n){let[o,i]=t.id.split("."),s;try{let a=S.parse(Lr(e.uri,{publisher:o,name:i}));return await this.getLatestRawGalleryExtension(t.id,a,n)}catch(a){if(a instanceof Vr)switch(s=a.code,a.code){case"Offline":case"Cancelled":case"Timeout":case"ClientError":throw a}else s="Unknown";if(!e.fallback)throw a}this.logService.error(`Error while getting the latest version for the extension ${t.id} from ${e.uri}. Trying the fallback ${e.fallback}`,s);try{let a=S.parse(Lr(e.fallback,{publisher:o,name:i}));return await this.getLatestRawGalleryExtension(t.id,a,n)}catch(a){throw s=a instanceof Vr?a.code:"Unknown",a}finally{this.telemetryService.publicLog2("galleryService:fallbacktounpkg",{extension:t.id,errorCode:s})}}async getLatestRawGalleryExtension(t,e,n){let o,i,s=new no;try{let a={...await this.getRequestHeaders(e.toString(!0)),"Content-Type":"application/json",Accept:"application/json;api-version=7.2-preview","Accept-Encoding":"gzip"};if(o=await this.requestService.request({type:"GET",url:e.toString(!0),headers:a,timeout:this.getRequestTimeout(),callSite:"extensionGalleryService.getLatestRawGalleryExtension"},n),o.res.statusCode===404)return i="NotFound",null;if(o.res.statusCode&&o.res.statusCode!==200)throw new Error("Unexpected HTTP response: "+o.res.statusCode);let l=await us(o);return l||(i="NoData"),l}catch(a){let l;throw on(a)?l="Cancelled":FT(a)?l="Offline":ye(a).startsWith("XHR timeout")?l="Timeout":o&&vN(o)?l="ClientError":o&&IN(o)?l="ServerError":l="Failed",i=l,new Vr(a,l)}finally{this.telemetryService.publicLog2("galleryService:getLatest",{extension:t,host:e.authority,duration:s.elapsed(),errorCode:i,statusCode:o?.res.statusCode&&o?.res.statusCode!==200?`${o.res.statusCode}`:void 0,server:this.getHeaderValue(o?.res.headers,tP),activityId:this.getHeaderValue(o?.res.headers,eP),endToEndId:this.getHeaderValue(o?.res.headers,nP)})}}async reportStatistic(t,e,n,o){if(bn){this.logService.info("ExtensionGalleryService#reportStatistic: Skipped in web");return}let i=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!i)return;let s=Fu(i,"ExtensionStatisticsUriTemplate");if(!s)return;let a=Lr(s,{publisher:t,name:e,version:n,statTypeName:o}),c={...await this.getRequestHeaders(a),Accept:"*/*;api-version=4.0-preview.1"};try{await this.requestService.request({type:"POST",url:a,headers:c,callSite:"extensionGalleryService.reportStatistic"},Ae.None)}catch{}}async download(t,e,n){this.logService.trace("ExtensionGalleryService#download",t.identifier.id);let o=pf(t),i=new Date().getTime(),s=n===2?"install":n===3?"update":"",a=s?{uri:`${t.assets.download.uri}${S.parse(t.assets.download.uri).query?"&":"?"}${s}=true`,fallbackUri:`${t.assets.download.fallbackUri}${S.parse(t.assets.download.fallbackUri).query?"&":"?"}${s}=true`}:t.assets.download,l=t.queryContext?.[eb],c=l&&typeof l=="string"?{[eb]:l}:void 0,u=await this.getAsset(t.identifier.id,a,uo.VSIX,t.version,"extensionGalleryService.download",c?{headers:c}:void 0);try{await this.fileService.writeFile(e,u.stream)}catch(p){try{await this.fileService.del(e)}catch(m){this.logService.warn(`Error while deleting the file ${e.toString()}`,ye(m))}throw new Vr(ye(p),"DownloadFailedWriting")}this.telemetryService.publicLog("galleryService:downloadVSIX",{...o,duration:new Date().getTime()-i})}async downloadSignatureArchive(t,e){if(!t.assets.signature)throw new Error("No signature asset found");this.logService.trace("ExtensionGalleryService#downloadSignatureArchive",t.identifier.id);let n=await this.getAsset(t.identifier.id,t.assets.signature,uo.Signature,t.version,"extensionGalleryService.signature");try{await this.fileService.writeFile(e,n.stream)}catch(o){try{await this.fileService.del(e)}catch(i){this.logService.warn(`Error while deleting the file ${e.toString()}`,ye(i))}throw new Vr(ye(o),"DownloadFailedWriting")}}async getReadme(t,e){if(t.assets.readme){let n=await this.getAsset(t.identifier.id,t.assets.readme,uo.Details,t.version,"extensionGalleryService.readme",{},e);return await ds(n)||""}return""}async getManifest(t,e){if(t.assets.manifest){let n=await this.getAsset(t.identifier.id,t.assets.manifest,uo.Manifest,t.version,"extensionGalleryService.manifest",{},e),o=await ds(n);return o?JSON.parse(o):null}return null}async getCoreTranslation(t,e){let n=t.assets.coreTranslations.filter(o=>o[0]===e.toUpperCase())[0];if(n){let o=await this.getAsset(t.identifier.id,n[1],n[0],t.version,"extensionGalleryService.coreTranslation"),i=await ds(o);return i?JSON.parse(i):null}return null}async getChangelog(t,e){if(t.assets.changelog){let n=await this.getAsset(t.identifier.id,t.assets.changelog,uo.Changelog,t.version,"extensionGalleryService.changelog",{},e);return await ds(n)||""}return""}async getAllVersions(t){return this.getVersions(t)}async getAllCompatibleVersions(t,e,n){return this.getVersions(t,{version:e?2:0,targetPlatform:n})}async getVersions(t,e){let n=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!n)throw new Error("No extension gallery service configured.");let o=new Hu().withFlags("IncludeVersions","IncludeCategoryAndTags","IncludeFiles","IncludeVersionProperties").withPage(1,1);t.uuid?o=o.withFilter("ExtensionId",t.uuid):o=o.withFilter("ExtensionName",t.id);let{galleryExtensions:i}=await this.queryRawGalleryExtensions(o,n,Ae.None);if(!i.length)return[];let s=XI(i[0]);if(e&&Au(s,e.targetPlatform))return[];let a=[],l={version:this.productService.version,date:this.productService.date};await Promise.all(i[0].versions.map(async p=>{try{await this.isValidVersion({id:t.id,version:p.version,isPreReleaseVersion:Bu(p),targetPlatform:Oc(p),engine:tb(p),manifestAsset:Fi(p,uo.Manifest),enabledApiProposals:sP(p),blocked:Wu(p.flags,p.blocking)},{compatible:!!e,productVersion:l,targetPlatform:e?.targetPlatform,version:e?.version??p.version},i[0].publisher.displayName,s)&&a.push(p)}catch{}}));let c=[],u=new Map;for(let p of nH(a,e?.targetPlatform??YI)){let m=u.get(p.version),g=m!==void 0?c[m]:void 0,y=Oc(p);g?g.targetPlatforms.push(y):(u.set(p.version,c.length),c.push({version:p.version,date:p.lastUpdated,isPreReleaseVersion:Bu(p),targetPlatforms:[y]}))}return c}async getRequestHeaders(t,e){let n=await this.commonHeadersPromise,o=await this.extensionGalleryManifestService.getAccessToken(t);return{...n,...e,...o?{Authorization:`Bearer ${o}`}:{}}}async getAsset(t,e,n,o,i,s={},a=Ae.None){s={...s,type:"GET"};let l=e.uri,c=e.fallbackUri,u={...s,headers:await this.getRequestHeaders(l,s.headers),url:l,timeout:this.getRequestTimeout(),callSite:i},p;try{if(p=await this.requestService.request(u,a),p.res.statusCode===200)return p;let m=await ds(p);throw new Error(`Expected 200, got back ${p.res.statusCode} instead.
${m}`)}catch(m){if(on(m))throw m;let g=ye(m);this.telemetryService.publicLog2("galleryService:cdnFallback",{extension:t,assetType:n,message:g,extensionVersion:o,server:this.getHeaderValue(p?.res.headers,tP),activityId:this.getHeaderValue(p?.res.headers,eP),endToEndId:this.getHeaderValue(p?.res.headers,nP)});let y={...s,headers:await this.getRequestHeaders(c,s.headers),url:c,timeout:this.getRequestTimeout(),callSite:`${i}.fallback`};return this.requestService.request(y,a)}}async getExtensionsControlManifest(){if(!await this.extensionGalleryManifestService.getExtensionGalleryManifest())throw new Error("No extension gallery service configured.");if(!this.extensionsControlUrl)return{malicious:[],deprecated:{},search:[],autoUpdate:{}};let e=await this.extensionGalleryManifestService.getAccessToken(this.extensionsControlUrl),n=await this.requestService.request({type:"GET",url:this.extensionsControlUrl,headers:e?{Authorization:`Bearer ${e}`}:void 0,timeout:this.getRequestTimeout(),callSite:"extensionGalleryService.getExtensionsControlManifest"},Ae.None);if(n.res.statusCode!==200)throw new Error("Could not get extensions report.");let o=await us(n),i=[],s={},a=[],l=o?.autoUpdate??{};if(o){for(let c of o.malicious){if(!G(c))continue;let u=sf.test(c)?{id:c}:c;i.push({extensionOrPublisher:u,learnMoreLink:o.learnMoreLinks?.[c]})}if(o.migrateToPreRelease)for(let[c,u]of Object.entries(o.migrateToPreRelease))(!u.engine||mf(u.engine,this.productService.version,this.productService.date))&&(s[c.toLowerCase()]={disallowInstall:!0,extension:{id:u.id,displayName:u.displayName,autoMigrate:{storage:!!u.migrateStorage},preRelease:!0}});if(o.deprecated)for(let[c,u]of Object.entries(o.deprecated))u&&(s[c.toLowerCase()]=er(u)?{}:u);if(o.search)for(let c of o.search)a.push(c)}return s[this.productService.defaultChatAgent.extensionId.toLowerCase()]={disallowInstall:!0,extension:{id:this.productService.defaultChatAgent.chatExtensionId,displayName:"GitHub Copilot Chat",autoMigrate:{storage:!1,donotDisable:!0},preRelease:this.productService.quality!=="stable"}},{malicious:i,deprecated:s,search:a,autoUpdate:l}}getRequestTimeout(){let t=this.configurationService.getValue(mF);return to(t)&&t>=0?t:6e4}};Vu=w([b(1,ao),b(2,z),b(3,Ut),b(4,Mt),b(5,Le),b(6,Be),b(7,bt),b(8,Br),b(9,ys)],Vu);ZI=class extends Vu{constructor(t,e,n,o,i,s,a,l,c,u){super(t,e,n,o,i,s,a,l,c,u)}};ZI=w([b(0,mi),b(1,ao),b(2,z),b(3,Ut),b(4,Mt),b(5,Le),b(6,Be),b(7,bt),b(8,Br),b(9,ys)],ZI);yl=class extends Vu{constructor(t,e,n,o,i,s,a,l,c){super(void 0,t,e,n,o,i,s,a,l,c)}};yl=w([b(0,ao),b(1,z),b(2,Ut),b(3,Mt),b(4,Le),b(5,Be),b(6,bt),b(7,Br),b(8,ys)],yl)});import{createWriteStream as sH,promises as cP}from"fs";import{Readable as $j,Transform as zj}from"stream";function Kj(r){let t=r.externalFileAttributes>>16||33188;return[448,56,7].map(e=>t&e).reduce((e,n)=>e+n,t&61440)}function uP(r){if(r instanceof Uc)return r;let t;return Gj.test(r.message)&&(t="CorruptZip"),new Uc(t,r)}function jj(r,t,e,n,o,i){let s=It(t),a=$(n,s);if(!a.startsWith(n))return Promise.reject(new Error(d(156,null,t)));let l=$(n,t),c,u=i.onCancellationRequested(()=>{c?.destroy()});return Promise.resolve(cP.mkdir(a,{recursive:!0})).then(()=>new Promise((p,m)=>{if(i.isCancellationRequested){p();return}try{c=sH(l,{mode:e}),c.once("close",()=>p()),c.once("error",m),r.once("error",m),r.pipe(c)}catch(g){m(g)}})).finally(()=>u.dispose())}function Qj(r,t,e,n){let o=or(()=>Promise.resolve()),i=0,s=n.onCancellationRequested(()=>{o.cancel(),r.close()});return new Promise((a,l)=>{let c=new Zd,u=p=>{p.isCancellationRequested||(i++,r.readEntry())};r.once("error",l),r.once("close",()=>o.then(()=>{n.isCancellationRequested||r.entryCount===i?a():l(new Uc("Incomplete",new Error(d(155,null,i,r.entryCount))))},l)),r.readEntry(),r.on("entry",p=>{if(n.isCancellationRequested)return;if(!e.sourcePathRegex.test(p.fileName)){u(n);return}let m=p.fileName.replace(e.sourcePathRegex,"");if(/\/$/.test(m)){let h=$(t,m);o=or(I=>cP.mkdir(h,{recursive:!0}).then(()=>u(I)).then(void 0,l));return}let g=lH(r,p),y=Kj(p);o=or(h=>c.queue(()=>g.then(I=>jj(I,m,y,t,e,h).then(()=>u(h)))).then(null,l))})}).finally(()=>s.dispose())}async function aH(r,t=!1){let{open:e}=await import("yauzl");return new Promise((n,o)=>{e(r,t?{lazyEntries:!0}:void 0,(i,s)=>{i?o(uP(i)):n(hg(s))})})}function lH(r,t){return new Promise((e,n)=>{r.openReadStream(t,(o,i)=>{o?n(uP(o)):e(hg(i))})})}async function cH(r,t,e){let n=e?.token??Ae.None;if(n.isCancellationRequested)throw new He;let{ZipFile:o}=await import("yazl");if(n.isCancellationRequested)throw new He;let i=new o,s=sH(r),a=new Promise(g=>s.once("close",g)),l=new Set,c=0,u=()=>{},p=new Promise((g,y)=>{u=y,i.outputStream.once("error",y),s.once("error",y),s.once("finish",()=>g(r))});p.catch(()=>{});let m=n.onCancellationRequested(()=>{u(new He);for(let g of l)g.destroy();s.destroy()});i.outputStream.pipe(s);try{for(let g of t){if(n.isCancellationRequested)throw new He;if(g.contents!==void 0){let y=typeof g.contents=="string"?Buffer.from(g.contents,"utf8"):g.contents;i.addBuffer(y,g.path,{compress:g.compress}),c+=y.byteLength,e?.onProgress?.(c,g.path)}else if(g.localPath)if(g.localPathSize===void 0&&!g.skipSourceErrors&&!e?.onProgress&&!e?.token)i.addFile(g.localPath,g.path,{compress:g.compress});else{let y;try{y=await cP.open(g.localPath,"r")}catch(I){if(g.skipSourceErrors){e?.onSourceError?.(g.path,I instanceof Error?I:new Error(String(I)));continue}throw I}let h=!1;try{let I;try{let x=(await y.stat()).size;I=g.localPathSize===void 0?x:Math.min(g.localPathSize,x)}catch(x){if(g.skipSourceErrors){e?.onSourceError?.(g.path,x instanceof Error?x:new Error(String(x)));continue}throw x}if(I===0)i.addBuffer(Buffer.alloc(0),g.path);else{let x=y.createReadStream({start:0,end:I-1}),E=new Promise(T=>x.once("close",T));if(x.once("error",T=>i.outputStream.emit("error",T)),l.add(x),x.once("close",()=>l.delete(x)),e?.onProgress){let T=new zj({transform(P,M,X){c+=P.byteLength,e.onProgress?.(c,g.path),X(null,P)}});l.add(T),T.once("close",()=>l.delete(T)),i.addReadStream(x.pipe(T),g.path,{size:I,compress:g.compress})}else i.addReadStream(x,g.path,{size:I,compress:g.compress});h=!0,(e?.onProgress||e?.token)&&await Promise.race([E,p])}}finally{h||await y.close()}}}return i.end(),await p}finally{m.dispose();let g=[...l].map(y=>y.closed?Promise.resolve():new Promise(h=>y.once("close",h)));for(let y of l)y.destroy();i.outputStream instanceof $j&&i.outputStream.destroy(),s.destroy(),await Promise.all([...g,a])}}function dH(r,t,e={},n){let o=new RegExp(e.sourcePath?`^${e.sourcePath}`:""),i=aH(r,!0);return e.overwrite&&(i=i.then(s=>Ce.rm(t).then(()=>s))),i.then(s=>Qj(s,t,{sourcePathRegex:o},n))}function Jj(r,t){return aH(r).then(e=>new Promise((n,o)=>{e.once("error",i=>o(uP(i))),e.on("entry",i=>{i.fileName===t&&lH(e,i).then(s=>n(s),s=>o(s))}),e.once("close",()=>o(new Error(d(157,null,t))))}))}function nb(r,t){return Jj(r,t).then(e=>new Promise((n,o)=>{let i=[];e.once("error",o),e.on("data",s=>i.push(s)),e.on("end",()=>n(Buffer.concat(i)))}))}var dP,Gj,Uc,ob=v(()=>{Ue();Jt();xe();Oe();Ie();vo();ee();dP="end of central directory record signature not found",Gj=new RegExp(dP),Uc=class extends Error{constructor(t,e){let n=e.message;t==="CorruptZip"&&(n=`Corrupt ZIP: ${n}`),super(n),this.type=t,this.cause=e}}});var qu,rb=v(()=>{Z();qu=A("downloadService")});function pn(r,t){if(r instanceof Nt)return r;let e;return r instanceof Vr?e=new Nt(r.message,r.code==="DownloadFailedWriting"?"DownloadFailedWriting":"Gallery"):e=new Nt(r.message,on(r)?"Cancelled":t??"Internal"),e.stack=r.stack,e}function pP(r,t,{extensionData:e,verificationStatus:n,duration:o,error:i,source:s,durationSinceUpdate:a}){r.publicLog(t,{...e,source:s,duration:o,durationSinceUpdate:a,success:!i,errorcode:i?.code,verificationStatus:n==="Success"?"Verified":n??"Unverified"})}var $u,zu,hf,yf=v(()=>{Dt();Ue();Jt();xe();ue();Q();fn();fe();te();ee();_o();ui();Yn();De();Wn();_n();co();xo();xr();$u=class extends D{constructor(e,n){super();this.productService=e;this.allowedExtensionsService=n;this.preferPreReleases=this.productService.quality!=="stable"}async canInstall(e){if(e.blockingInfo)return VI(e.blockingInfo);let n=this.allowedExtensionsService.isAllowed({id:e.identifier.id,publisherDisplayName:e.publisherDisplayName});if(n!==!0)return new at(d(4314,null,n.value));if(!await this.isExtensionPlatformCompatible(e)){let o=bn?"https://aka.ms/vscode-web-extensions-guide":"https://aka.ms/vscode-platform-specific-extensions";return new at().appendMarkdown(d(4308,null,UF(e.displayName??e.identifier.id),this.productService.nameLong,OT(await this.getTargetPlatform()))).appendMarkdown(` [${d(4309,null)}](${o})`)}return!0}async isExtensionPlatformCompatible(e){let n=await this.getTargetPlatform();return e.allTargetPlatforms.some(o=>af(o,e.allTargetPlatforms,n))}};$u=w([b(0,Be),b(1,Br)],$u);zu=class extends $u{constructor(e,n,o,i,s,a,l){super(s,a);this.galleryService=e;this.telemetryService=n;this.uriIdentityService=o;this.logService=i;this.userDataProfilesService=l;this.lastReportTimestamp=0;this.installingExtensions=new Map;this.uninstallingExtensions=new Map;this._onInstallExtension=this._register(new R);this._onDidInstallExtensions=this._register(new R);this._onUninstallExtension=this._register(new R);this._onDidUninstallExtension=this._register(new R);this._onDidUpdateExtensionMetadata=this._register(new R);this.participants=[];this._register(se(()=>{this.installingExtensions.forEach(({task:c})=>c.cancel()),this.uninstallingExtensions.forEach(c=>c.cancel()),this.installingExtensions.clear(),this.uninstallingExtensions.clear()}))}get onInstallExtension(){return this._onInstallExtension.event}get onDidInstallExtensions(){return this._onDidInstallExtensions.event}get onUninstallExtension(){return this._onUninstallExtension.event}get onDidUninstallExtension(){return this._onDidUninstallExtension.event}get onDidUpdateExtensionMetadata(){return this._onDidUpdateExtensionMetadata.event}async installFromGallery(e,n={}){try{let o=await this.installGalleryExtensions([{extension:e,options:n}]),i=o.find(({identifier:a})=>_e(a,e.identifier));if(i?.local)return i.local;if(i?.error)throw i.error;let s=o[0];if(s?.local)return s.local;throw s?.error?s.error:new Nt(`Unknown error while installing extension ${e.identifier.id}`,"Unknown")}catch(o){throw pn(o)}}async installGalleryExtensions(e){if(!this.galleryService.isEnabled())throw new Nt(d(4311,null),"NotAllowed");let n=[],o=[];return await Promise.allSettled(e.map(async({extension:i,options:s})=>{try{let a=await this.checkAndGetCompatibleVersion(i,!!s?.installGivenVersion,!!s?.installPreReleaseVersion,s.productVersion??{version:this.productService.version,date:this.productService.date});o.push({...a,options:s})}catch(a){n.push({identifier:i.identifier,operation:2,source:i,error:a,profileLocation:s.profileLocation??this.getCurrentExtensionsManifestLocation()})}})),o.length&&n.push(...await this.installExtensions(o)),n}async uninstall(e,n){return this.logService.trace("ExtensionManagementService#uninstall",e.identifier.id),this.uninstallExtensions([{extension:e,options:n}])}async toggleApplicationScope(e,n){if(_T(e.manifest)||e.isBuiltin)return e;if(e.isApplicationScoped){let o=await this.updateMetadata(e,{isApplicationScoped:!1},this.userDataProfilesService.defaultProfile.extensionsResource);this.uriIdentityService.extUri.isEqual(n,this.userDataProfilesService.defaultProfile.extensionsResource)||(o=await this.copyExtension(e,this.userDataProfilesService.defaultProfile.extensionsResource,n));for(let i of this.userDataProfilesService.profiles){let s=(await this.getInstalled(1,i.extensionsResource)).find(a=>_e(a.identifier,e.identifier));s?this._onDidUpdateExtensionMetadata.fire({local:s,profileLocation:i.extensionsResource}):this._onDidUninstallExtension.fire({identifier:e.identifier,profileLocation:i.extensionsResource})}return o}else{let o=this.uriIdentityService.extUri.isEqual(n,this.userDataProfilesService.defaultProfile.extensionsResource)?await this.updateMetadata(e,{isApplicationScoped:!0},this.userDataProfilesService.defaultProfile.extensionsResource):await this.copyExtension(e,n,this.userDataProfilesService.defaultProfile.extensionsResource,{isApplicationScoped:!0});return this._onDidInstallExtensions.fire([{identifier:o.identifier,operation:2,local:o,profileLocation:this.userDataProfilesService.defaultProfile.extensionsResource,applicationScoped:!0}]),o}}getExtensionsControlManifest(){let e=new Date().getTime();return(!this.extensionsControlManifest||e-this.lastReportTimestamp>1e3*60*5)&&(this.extensionsControlManifest=this.updateControlCache(),this.lastReportTimestamp=e),this.extensionsControlManifest}registerParticipant(e){this.participants.push(e)}async resetPinnedStateForAllUserExtensions(e){try{await this.joinAllSettled(this.userDataProfilesService.profiles.map(async n=>{let o=await this.getInstalled(1,n.extensionsResource);await this.joinAllSettled(o.map(async i=>{i.pinned!==e&&await this.updateMetadata(i,{pinned:e},n.extensionsResource)}))}))}catch(n){throw this.logService.error("Error while resetting pinned state for all user extensions",ye(n)),n}}async installExtensions(e){let n=new Map,o=new Map,i=[],s=(c,u)=>`${lo.create(c).toString()}-${u.toString()}`,a=(c,u,p,m)=>{let g;if(!S.isUri(u)){if(o.has(`${u.identifier.id.toLowerCase()}-${p.profileLocation.toString()}`))return;let I=this.installingExtensions.get(s(u,p.profileLocation));if(I){if(m&&this.canWaitForTask(m,I.task)){let x=I.task.identifier;this.logService.info("Waiting for already requested installing extension",x.id,m.identifier.id,p.profileLocation.toString()),I.waitingTasks.push(m);let E=F.toPromise(F.filter(this.onDidInstallExtensions,T=>T.some(P=>_e(P.identifier,x)))).then(T=>{this.logService.info("Finished waiting for already requested installing extension",x.id,m.identifier.id,p.profileLocation.toString());let P=T.find(M=>_e(M.identifier,x));if(!P?.local)throw new Error(`Extension ${x.id} is not installed`);return P.local});i.push(E),E.catch(()=>{})}return}g=this.uninstallingExtensions.get(this.getUninstallExtensionTaskKey(u.identifier,p.profileLocation))}let y=this.createInstallExtensionTask(c,u,p),h=`${Mo(c.publisher,c.name)}-${p.profileLocation.toString()}`;o.set(h,{task:y,root:m,uninstallTaskToWaitFor:g}),this._onInstallExtension.fire({identifier:y.identifier,source:u,profileLocation:p.profileLocation}),this.logService.info("Installing extension:",y.identifier.id,p),S.isUri(u)||this.installingExtensions.set(s(u,p.profileLocation),{task:y,waitingTasks:[]})};try{let c=await this.getInstalled(0);for(let{manifest:p,extension:m,options:g}of e){let y=Mo(p.publisher,p.name),h=c.some(P=>_e(P.identifier,{id:y})),I=g.isBuiltin||h,x=g.isApplicationScoped||I||_T(p),E={...g,isBuiltin:I,isApplicationScoped:x,profileLocation:x?this.userDataProfilesService.defaultProfile.extensionsResource:g.profileLocation??this.getCurrentExtensionsManifestLocation(),productVersion:g.productVersion??{version:this.productService.version,date:this.productService.date}},T=S.isUri(m)?void 0:this.installingExtensions.get(s(m,E.profileLocation));if(T){let P=T.task;this.logService.info("Extension is already requested to install",P.identifier.id,E.profileLocation.toString());let M=`${P.identifier.id.toLowerCase()}-${E.profileLocation.toString()}`,X=P.waitUntilTaskIsFinished().then(N=>(n.set(M,{local:N,identifier:P.identifier,operation:P.operation,source:P.source,context:E.context,profileLocation:E.profileLocation,applicationScoped:N.isApplicationScoped}),N),N=>{throw n.set(M,{error:pn(N),identifier:P.identifier,operation:P.operation,source:P.source,context:E.context,profileLocation:E.profileLocation}),N});i.push(X),X.catch(()=>{})}else a(p,m,E,void 0)}await Promise.all([...o.values()].map(async({task:p})=>{if(p.options.donotIncludePackAndDependencies)this.logService.info("Installing the extension without checking dependencies and pack",p.identifier.id);else try{let m=this.preferPreReleases;p.options.installPreReleaseVersion?m=!0:!S.isUri(p.source)&&p.source.hasPreReleaseVersion&&(m=!1);let g=await this.getInstalled(void 0,p.options.profileLocation,p.options.productVersion),y=await this.getAllDepsAndPackExtensions(p.identifier,p.manifest,m,p.options.productVersion,g),h={...p.options,pinned:!1,installGivenVersion:!1,context:{...p.options.context,[cF]:!0}};for(let{gallery:I,manifest:x}of rn(y,({gallery:E})=>E.identifier.id)){let E=g.find(T=>_e(T.identifier,I.identifier));E&&E.isApplicationScoped===!!h.isApplicationScoped||a(x,I,h,p)}}catch(m){if(S.isUri(p.source))ac(p.manifest.extensionDependencies)&&this.logService.warn("Cannot install dependencies of extension:",p.identifier.id,m.message),ac(p.manifest.extensionPack)&&this.logService.warn("Cannot install packed extensions of extension:",p.identifier.id,m.message);else throw this.logService.error("Error while preparing to install dependencies and extension packs of the extension:",p.identifier.id),m}}));let u=await this.getOtherProfilesToUpdateExtension([...o.values()].map(({task:p})=>p));for(let[p,m]of u)a(m.manifest,m.source,{...m.options,profileLocation:p},void 0);await this.joinAllSettled([...o.entries()].map(async([p,{task:m,uninstallTaskToWaitFor:g}])=>{let y=new Date().getTime(),h;try{if(g){this.logService.info("Waiting for existing uninstall task to complete before installing",m.identifier.id);try{await g.waitUntilTaskIsFinished(),this.logService.info("Finished waiting for uninstall task, proceeding with install",m.identifier.id)}catch(I){this.logService.info("Uninstall task failed, proceeding with install anyway",m.identifier.id,ye(I))}}h=await m.run(),await this.joinAllSettled(this.participants.map(I=>I.postInstall(h,m.source,m.options,Ae.None)),"PostInstall")}catch(I){let x=pn(I);throw S.isUri(m.source)||pP(this.telemetryService,m.operation===3?"extensionGallery:update":"extensionGallery:install",{extensionData:pf(m.source),error:x,source:m.options.context?.[LT]}),n.set(p,{error:x,identifier:m.identifier,operation:m.operation,source:m.source,context:m.options.context,profileLocation:m.options.profileLocation,applicationScoped:m.options.isApplicationScoped}),this.logService.error("Error while installing the extension",m.identifier.id,ye(x),m.options.profileLocation.toString()),x}if(!S.isUri(m.source)){let I=m.operation===3,x=I?void 0:(new Date().getTime()-m.source.lastUpdated)/1e3;pP(this.telemetryService,I?"extensionGallery:update":"extensionGallery:install",{extensionData:pf(m.source),verificationStatus:m.verificationStatus,duration:new Date().getTime()-y,durationSinceUpdate:x,source:m.options.context?.[LT]})}n.set(p,{local:h,identifier:m.identifier,operation:m.operation,source:m.source,context:m.options.context,profileLocation:m.options.profileLocation,applicationScoped:h.isApplicationScoped})})),i.length&&await this.joinAllSettled(i)}catch(c){let u=(g,y,h)=>{let I=[];g.manifest.extensionDependencies?.length&&I.push(...g.manifest.extensionDependencies),g.manifest.extensionPack?.length&&I.push(...g.manifest.extensionPack);for(let x of I){if(h.includes(x.toLowerCase()))continue;h.push(x.toLowerCase());let E=n.get(`${x.toLowerCase()}-${y.toString()}`);E?.local&&(h=u(E.local,y,h))}return h},p=g=>({identifier:g.identifier,operation:2,source:g.source,context:g.options.context,profileLocation:g.options.profileLocation,error:c}),m=[];for(let[g,{task:y,root:h}]of o){let I=n.get(g);I?I.local&&h&&!n.get(`${h.identifier.id.toLowerCase()}-${y.options.profileLocation.toString()}`)?.local&&(m.push(this.createUninstallExtensionTask(I.local,{versionOnly:!0,profileLocation:y.options.profileLocation})),n.set(g,p(y))):(y.cancel(),n.set(g,p(y)))}for(let[g,{task:y}]of o){let h=n.get(g);if(!h?.local||y.options.donotIncludePackAndDependencies)continue;u(h.local,y.options.profileLocation,[h.local.identifier.id.toLowerCase()]).slice(1).some(x=>o.has(`${x.toLowerCase()}-${y.options.profileLocation.toString()}`)&&!n.get(`${x.toLowerCase()}-${y.options.profileLocation.toString()}`)?.local)&&(m.push(this.createUninstallExtensionTask(h.local,{versionOnly:!0,profileLocation:y.options.profileLocation})),n.set(g,p(y)))}m.length&&await Promise.allSettled(m.map(async g=>{try{await g.run(),this.logService.info("Rollback: Uninstalled extension",g.extension.identifier.id)}catch(y){this.logService.warn("Rollback: Error while uninstalling extension",g.extension.identifier.id,ye(y))}}))}finally{for(let{task:c}of o.values())c.source&&!S.isUri(c.source)&&this.installingExtensions.delete(s(c.source,c.options.profileLocation))}let l=[...n.values()];for(let c of l)c.local&&this.logService.info("Extension installed successfully:",c.identifier.id,c.profileLocation.toString());return this._onDidInstallExtensions.fire(l),l}async getOtherProfilesToUpdateExtension(e){let n=[],o=new je;for(let i of e)if(!(i.operation!==3||i.options.isApplicationScoped||i.options.pinned||i.options.installGivenVersion||S.isUri(i.source)))for(let s of this.userDataProfilesService.profiles){if(this.uriIdentityService.extUri.isEqual(s.extensionsResource,i.options.profileLocation))continue;let a=o.get(s.extensionsResource);a||(a=await this.getInstalled(1,s.extensionsResource),o.set(s.extensionsResource,a));let l=a.find(c=>_e(c.identifier,i.identifier));l&&!l.pinned&&n.push([s.extensionsResource,i])}return n}canWaitForTask(e,n){for(let[,{task:o,waitingTasks:i}]of this.installingExtensions.entries())if(o===e&&(i.includes(n)||i.some(s=>this.canWaitForTask(s,n)))||o===n&&i[0]&&!this.canWaitForTask(e,i[0]))return!1;return!0}async joinAllSettled(e,n){let o=[],i=[],s=await Promise.allSettled(e);for(let l of s)l.status==="fulfilled"?o.push(l.value):i.push(pn(l.reason,n));if(!i.length)return o;if(i.length===1)throw i[0];let a=new Nt("","Unknown");for(let l of i)a=new Nt(a.message?`${a.message}, ${l.message}`:l.message,l.code!=="Unknown"&&l.code!=="Internal"?l.code:a.code);throw a}async getAllDepsAndPackExtensions(e,n,o,i,s){if(!this.galleryService.isEnabled())return[];let a=[],l=[],c=async(u,p)=>{a.push(u);let m=p.extensionDependencies?p.extensionDependencies.filter(y=>!s.some(h=>_e(h.identifier,{id:y}))):[],g=[...m];if(p.extensionPack){let y=s.find(h=>_e(h.identifier,u));for(let h of p.extensionPack)y&&y.manifest.extensionPack&&y.manifest.extensionPack.some(I=>_e({id:I},{id:h}))||g.every(I=>!_e({id:I},{id:h}))&&g.push(h)}if(g.length){let y=g.filter(h=>a.every(I=>!_e(I,{id:h})));if(y.length){let h=await this.galleryService.getExtensions(y.map(I=>({id:I,preRelease:o})),Ae.None);for(let I of h){if(a.find(T=>_e(T,I.identifier)))continue;let x=m.some(T=>_e({id:T},I.identifier)),E;try{E=await this.checkAndGetCompatibleVersion(I,!1,o,i)}catch(T){if(x)throw T;this.logService.info("Skipping the packed extension as it cannot be installed",I.identifier.id,ye(T));continue}l.push({gallery:E.extension,manifest:E.manifest}),await c(E.extension.identifier,E.manifest)}}}};return await c(e,n),l}async checkAndGetCompatibleVersion(e,n,o,i){let s,a=await this.getExtensionsControlManifest();if(FF(e.identifier,a.malicious))throw new Nt(d(4310,null,e.identifier.id),"Malicious");let l=a.deprecated[e.identifier.id.toLowerCase()];if(l?.extension?.autoMigrate){if(this.logService.info(`The '${e.identifier.id}' extension is deprecated, fetching the compatible '${l.extension.id}' extension instead.`),s=(await this.galleryService.getExtensions([{id:l.extension.id,preRelease:l.extension.preRelease}],{targetPlatform:await this.getTargetPlatform(),compatible:!0,productVersion:i},Ae.None))[0],!s)throw new Nt(d(4316,null,e.identifier.id,l.extension.id),"Deprecated")}else{if(e.blockingInfo)throw new Nt(VI(e.blockingInfo).value,"NotAllowed");if(await this.canInstall(e)!==!0){let u=await this.getTargetPlatform();throw new Nt(d(4308,null,e.identifier.id,this.productService.nameLong,OT(u)),"IncompatibleTargetPlatform")}if(s=await this.getCompatibleVersion(e,n,o,i),!s)throw!o&&e.hasPreReleaseVersion&&e.properties.isPreReleaseVersion&&(await this.galleryService.getExtensions([e.identifier],Ae.None))[0]?new Nt(d(4317,null,e.displayName??e.identifier.id),"ReleaseVersionNotFound"):new Nt(d(4315,null,e.identifier.id,this.productService.nameLong,this.productService.version),"Incompatible")}if(s.blockingInfo)throw new Nt(VI(s.blockingInfo).value,"NotAllowed");this.logService.info("Getting Manifest...",s.identifier.id);let c=await this.galleryService.getManifest(s,Ae.None);if(c===null)throw new Nt(`Missing manifest for extension ${s.identifier.id}`,"Invalid");if(c.version!==s.version)throw new Nt(`Cannot install '${s.identifier.id}' extension because of version mismatch in Marketplace`,"Invalid");return{extension:s,manifest:c}}async getCompatibleVersion(e,n,o,i){let s=await this.getTargetPlatform(),a=null;return!n&&e.hasPreReleaseVersion&&e.properties.isPreReleaseVersion!==o&&(a=(await this.galleryService.getExtensions([{...e.identifier,preRelease:o}],{targetPlatform:s,compatible:!0,productVersion:i},Ae.None))[0]||null),!a&&await this.galleryService.isExtensionCompatible(e,o,s,i)&&(a=e),a||(n?a=(await this.galleryService.getExtensions([{...e.identifier,version:e.version}],{targetPlatform:s,compatible:!0,productVersion:i},Ae.None))[0]||null:a=await this.galleryService.getCompatibleExtension(e,o,s,i)),a}getUninstallExtensionTaskKey(e,n,o){return`${e.id.toLowerCase()}${o?`-${o}`:""}@${n.toString()}`}async uninstallExtensions(e){let n=(m,g)=>this.getUninstallExtensionTaskKey(m.identifier,g.profileLocation,g.versionOnly?m.manifest.version:void 0),o=(m,g)=>{let y;for(let{task:I}of this.installingExtensions.values())if(!(I.source instanceof S)&&_e(I.identifier,m.identifier)&&this.uriIdentityService.extUri.isEqual(I.options.profileLocation,g.profileLocation)){y=I;break}let h=this.createUninstallExtensionTask(m,g);this.uninstallingExtensions.set(n(h.extension,g),h),this.logService.info("Uninstalling extension from the profile:",`${m.identifier.id}@${m.manifest.version}`,g.profileLocation.toString()),this._onUninstallExtension.fire({identifier:m.identifier,profileLocation:g.profileLocation,applicationScoped:m.isApplicationScoped}),s.push({task:h,installTaskToWaitFor:y})},i=(m,g,y)=>{y?this.logService.error("Failed to uninstall extension from the profile:",`${m.identifier.id}@${m.manifest.version}`,g.profileLocation.toString(),y.message):this.logService.info("Successfully uninstalled extension from the profile",`${m.identifier.id}@${m.manifest.version}`,g.profileLocation.toString()),pP(this.telemetryService,"extensionGallery:uninstall",{extensionData:NF(m),error:y}),this._onDidUninstallExtension.fire({identifier:m.identifier,error:y?.code,profileLocation:g.profileLocation,applicationScoped:m.isApplicationScoped})},s=[],a=[],l=[],c=[],u=new je,p=async m=>{let g=u.get(m);return g||u.set(m,g=await this.getInstalled(1,m)),g};for(let{extension:m,options:g}of e){let y={...g,profileLocation:m.isApplicationScoped?this.userDataProfilesService.defaultProfile.extensionsResource:g?.profileLocation??this.getCurrentExtensionsManifestLocation()},h=this.uninstallingExtensions.get(n(m,y));if(h?(this.logService.info("Extensions is already requested to uninstall",m.identifier.id),l.push(h.waitUntilTaskIsFinished())):o(m,y),y.remove||m.isApplicationScoped){y.remove&&c.push(m);for(let I of this.userDataProfilesService.profiles){if(this.uriIdentityService.extUri.isEqual(I.extensionsResource,y.profileLocation))continue;let E=(await p(I.extensionsResource)).find(T=>_e(T.identifier,m.identifier));if(E){let T={...y,profileLocation:I.extensionsResource},P=this.uninstallingExtensions.get(n(E,T));P?(this.logService.info("Extensions is already requested to uninstall",E.identifier.id),l.push(P.waitUntilTaskIsFinished())):o(E,T)}}}}try{for(let{task:m}of s.slice(0)){let g=await p(m.options.profileLocation);if(m.options.donotIncludePack)this.logService.info("Uninstalling the extension without including packed extension",`${m.extension.identifier.id}@${m.extension.manifest.version}`);else{let y=this.getAllPackExtensionsToUninstall(m.extension,g);for(let h of y)this.uninstallingExtensions.has(n(h,m.options))?this.logService.info("Extensions is already requested to uninstall",h.identifier.id):o(h,m.options)}m.options.donotCheckDependents?this.logService.info("Uninstalling the extension without checking dependents",`${m.extension.identifier.id}@${m.extension.manifest.version}`):this.checkForDependents(s.map(({task:y})=>y.extension),g,m.extension)}await this.joinAllSettled(s.map(async({task:m,installTaskToWaitFor:g})=>{try{if(g){this.logService.info("Waiting for existing install task to complete before uninstalling",m.extension.identifier.id);try{await g.waitUntilTaskIsFinished(),this.logService.info("Finished waiting for install task, proceeding with uninstall",m.extension.identifier.id)}catch(y){this.logService.info("Install task failed, proceeding with uninstall anyway",m.extension.identifier.id,ye(y))}}if(await m.run(),await this.joinAllSettled(this.participants.map(y=>y.postUninstall(m.extension,m.options,Ae.None))),m.extension.identifier.uuid&&!bn)try{await this.galleryService.reportStatistic(m.extension.manifest.publisher,m.extension.manifest.name,m.extension.manifest.version,"uninstall")}catch{}}catch(y){let h=pn(y);throw i(m.extension,m.options,h),h}finally{a.push(m)}})),l.length&&await this.joinAllSettled(l);for(let{task:m}of s)i(m.extension,m.options);c.length&&await this.joinAllSettled(c.map(m=>this.deleteExtension(m)))}catch(m){let g=pn(m);for(let{task:y}of s){try{y.cancel()}catch{}a.includes(y)||i(y.extension,y.options,g)}throw g}finally{for(let{task:m}of s)this.uninstallingExtensions.delete(n(m.extension,m.options))||this.logService.warn("Uninstallation task is not found in the cache",m.extension.identifier.id)}}checkForDependents(e,n,o){for(let i of e){let s=this.getDependents(i,n);if(s.length){let a=s.filter(l=>!e.some(c=>_e(c.identifier,l.identifier)));if(a.length)throw new Error(this.getDependentsErrorMessage(i,a,o))}}}getDependentsErrorMessage(e,n,o){return o===e?n.length===1?d(4318,null,o.manifest.displayName||o.manifest.name,n[0].manifest.displayName||n[0].manifest.name):n.length===2?d(4320,null,o.manifest.displayName||o.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name):d(4312,null,o.manifest.displayName||o.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name):n.length===1?d(4319,null,o.manifest.displayName||o.manifest.name,e.manifest.displayName||e.manifest.name,n[0].manifest.displayName||n[0].manifest.name):n.length===2?d(4321,null,o.manifest.displayName||o.manifest.name,e.manifest.displayName||e.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name):d(4313,null,o.manifest.displayName||o.manifest.name,e.manifest.displayName||e.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name)}getAllPackExtensionsToUninstall(e,n,o=[]){if(o.indexOf(e)!==-1)return[];if(_e(e.identifier,{id:this.productService.defaultChatAgent.extensionId}))return[];o.push(e);let i=e.manifest.extensionPack?e.manifest.extensionPack:[];if(i.length){let s=n.filter(l=>!l.isBuiltin&&i.some(c=>_e({id:c},l.identifier))),a=[];for(let l of s)a.push(...this.getAllPackExtensionsToUninstall(l,n,o));return[...s,...a]}return[]}getDependents(e,n){return n.filter(o=>o.manifest.extensionDependencies&&o.manifest.extensionDependencies.some(i=>_e({id:i},e.identifier)))}async updateControlCache(){try{return this.logService.trace("ExtensionManagementService.updateControlCache"),await this.galleryService.getExtensionsControlManifest()}catch(e){return this.logService.trace("ExtensionManagementService.refreshControlCache - failed to get extension control manifest",ye(e)),{malicious:[],deprecated:{},search:[]}}}};zu=w([b(0,So),b(1,Mt),b(2,Ye),b(3,z),b(4,Be),b(5,Br),b(6,Bt)],zu);hf=class{constructor(){this.barrier=new Ur}async waitUntilTaskIsFinished(){return await this.barrier.wait(),this.cancellablePromise}run(){return this.cancellablePromise||(this.cancellablePromise=or(t=>this.doRun(t))),this.barrier.open(),this.cancellablePromise}cancel(){this.cancellablePromise||(this.cancellablePromise=or(t=>new Promise((e,n)=>{let o=t.onCancellationRequested(()=>{o.dispose(),n(new He)})})),this.barrier.open()),this.cancellablePromise.cancel()}}});function uH(r){let t=r;return ve(t)&&pF(t.identifier)&&(Yj(t.location)||G(t.location)&&!!t.location)&&($n(t.relativeLocation)||G(t.relativeLocation))&&!!t.version&&G(t.version)}function Yj(r){if(!r)return!1;let t=r;return typeof t?.path=="string"&&typeof t?.scheme=="string"}var Fc,Cr,Gu,Hc=v(()=>{Ue();Ve();Q();ue();fn();te();_o();ui();st();Z();De();xo();co();Ie();xe();Fc=class extends Error{constructor(e,n){super(e);this.code=n}},Cr=A("IExtensionsProfileScannerService"),Gu=class extends D{constructor(e,n,o,i,s){super();this.extensionsLocation=e;this.fileService=n;this.userDataProfilesService=o;this.uriIdentityService=i;this.logService=s;this._onAddExtensions=this._register(new R);this.onAddExtensions=this._onAddExtensions.event;this._onDidAddExtensions=this._register(new R);this.onDidAddExtensions=this._onDidAddExtensions.event;this._onRemoveExtensions=this._register(new R);this.onRemoveExtensions=this._onRemoveExtensions.event;this._onDidRemoveExtensions=this._register(new R);this.onDidRemoveExtensions=this._onDidRemoveExtensions.event;this.resourcesAccessQueueMap=new je}scanProfileExtensions(e,n){return this.withProfileExtensions(e,void 0,n)}async addExtensionsToProfile(e,n,o){let i=[],s=[];try{return await this.withProfileExtensions(n,a=>{let l=[];if(o)l.push(...a);else for(let c of a)e.some(([u])=>_e(u.identifier,c.identifier)&&u.manifest.version!==c.version)?i.push(c):l.push(c);for(let[c,u]of e){let p=l.findIndex(g=>_e(g.identifier,c.identifier)&&g.version===c.manifest.version),m={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:u};p===-1?(s.push(m),l.push(m)):l.splice(p,1,m)}return s.length&&this._onAddExtensions.fire({extensions:s,profileLocation:n}),i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:n}),l}),s.length&&this._onDidAddExtensions.fire({extensions:s,profileLocation:n}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:n}),s}catch(a){throw s.length&&this._onDidAddExtensions.fire({extensions:s,error:a,profileLocation:n}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:a,profileLocation:n}),a}}async updateMetadata(e,n){let o=[];return await this.withProfileExtensions(n,i=>{let s=[];for(let a of i){let l=e.find(([c])=>_e({id:c.identifier.id},{id:a.identifier.id})&&c.manifest.version===a.version);l&&(a.metadata={...a.metadata,...l[1]},o.push(a)),s.push(a)}return s}),o}async removeExtensionsFromProfile(e,n){let o=[];try{await this.withProfileExtensions(n,i=>{let s=[];for(let a of i)e.some(l=>_e(a.identifier,l))?o.push(a):s.push(a);return o.length&&this._onRemoveExtensions.fire({extensions:o,profileLocation:n}),s}),o.length&&this._onDidRemoveExtensions.fire({extensions:o,profileLocation:n})}catch(i){throw o.length&&this._onDidRemoveExtensions.fire({extensions:o,error:i,profileLocation:n}),i}}async withProfileExtensions(e,n,o){return this.getResourceAccessQueue(e).queue(async()=>{let i=[],s;try{let a=await this.fileService.readFile(e);s=JSON.parse(a.value.toString().trim()||"[]")}catch(a){if(wt(a)!==1)throw a;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(s=await this.migrateFromOldDefaultProfileExtensionsLocation()),!s&&o?.bailOutWhenFileNotFound)throw new Fc(ye(a),"ERROR_PROFILE_NOT_FOUND")}if(s){Array.isArray(s)||this.throwInvalidConentError(e);let a=!1;for(let l of s){uH(l)||this.throwInvalidConentError(e);let c;if(G(l.relativeLocation)&&l.relativeLocation)c=this.resolveExtensionLocation(l.relativeLocation);else if(G(l.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${l.location}`);continue}else{c=S.revive(l.location);let p=this.toRelativePath(c);p&&(a=!0,l.relativeLocation=p)}$n(l.metadata?.hasPreReleaseVersion)&&l.metadata?.preRelease&&(a=!0,l.metadata.hasPreReleaseVersion=!0);let u=l.metadata?.id??l.identifier.uuid;i.push({identifier:u?{id:l.identifier.id,uuid:u}:{id:l.identifier.id},location:c,version:l.version,metadata:l.metadata})}a&&await this.fileService.writeFile(e,O.fromString(JSON.stringify(s)))}if(n){i=n(i);let a=i.map(l=>({identifier:l.identifier,version:l.version,location:l.location.toJSON(),relativeLocation:this.toRelativePath(l.location),metadata:l.metadata}));await this.fileService.writeFile(e,O.fromString(JSON.stringify(a)))}return i})}throwInvalidConentError(e){throw new Fc(`Invalid extensions content in ${e.toString()}`,"ERROR_INVALID_CONTENT")}toRelativePath(e){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(e),this.extensionsLocation)?this.uriIdentityService.extUri.basename(e):void 0}resolveExtensionLocation(e){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,e)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{let e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),n=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions"),o;try{o=(await this.fileService.readFile(e)).value.toString()}catch(s){if(wt(s)===1)return;throw s}this.logService.info("Migrating extensions from old default profile location",e.toString());let i;try{let s=JSON.parse(o);Array.isArray(s)&&s.every(a=>uH(a))?i=s:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",s)}catch(s){this.logService.error(s)}if(i)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,O.fromString(JSON.stringify(i)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(s){if(wt(s)===3)this.logService.info("Migration from old default profile location to new location is done by another window",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString());else throw s}try{await this.fileService.del(e)}catch(s){wt(s)!==1&&this.logService.error(s)}try{await this.fileService.del(n)}catch(s){wt(s)!==1&&this.logService.error(s)}return i})()),this._migrationPromise}getResourceAccessQueue(e){let n=this.resourcesAccessQueueMap.get(e);return n||(n=new Nr,this.resourcesAccessQueueMap.set(e,n)),n}};Gu=w([b(1,Le),b(2,Bt),b(3,Ye),b(4,z)],Gu)});function Wc(r){switch(r){case 1:return d(126,null);case 2:return d(125,null);case 3:return d(127,null);case 4:return d(128,null);case 5:return d(122,null);case 6:return d(123,null);case 7:return d(120,null);case 8:return d(121,null);case 9:return d(124,null);default:return""}}var fP=v(()=>{ee();qo()});function pH(r,t,e,n){try{Xj(r,t,e,n)}catch(o){r.error(o?.message??o)}return t}function Xj(r,t,e,n){let o=(i,s,a)=>{let l=i[s];if(G(l)){let c=l,u=c.length;if(u>1&&c[0]==="%"&&c[u-1]==="%"){let p=c.substr(1,u-2),m=e[p];m===void 0&&n&&(m=n[p]);let g=typeof m=="string"?m:m?.message,y=n?.[p],h=typeof y=="string"?y:y?.message;if(!g){h||r.warn(`[${t.name}]: ${d(4380,null,p)}`);return}if(a&&(s==="title"||s==="category")&&h&&h!==g){let I={value:g,original:h};i[s]=I}else i[s]=g}}else if(ve(l))for(let c in l)l.hasOwnProperty(c)&&(c==="commands"?o(l,c,!0):o(l,c,a));else if(Array.isArray(l))for(let c=0;c<l.length;c++)o(l,c,a)};for(let i in t)t.hasOwnProperty(i)&&o(t,i)}var mH=v(()=>{Ie();ee()});function fH(r,t){let e=new Set;for(let n of r.builtInExtensionsEnabledWithAutoUpdates){let o=n.toLowerCase();t.skipBuiltinExtensions?.some(i=>i.toLowerCase()===o)||e.add(o)}return e}function vf(r,t){let e=Mu(r.manifest.publisher,r.manifest.name);return{id:e,identifier:new un(e),isBuiltin:r.type===0,isUserBuiltin:r.type===1&&r.isBuiltin,isUnderDevelopment:t,extensionLocation:r.location,uuid:r.identifier.uuid,targetPlatform:r.targetPlatform,publisherDisplayName:r.publisherDisplayName,preRelease:r.preRelease,...r.manifest}}var gH,sa,Ku,Vc,ju,Qu,Ju=v(()=>{Dt();Ue();Xt();Ve();xe();qo();fP();Q();fn();Me();Oe();fe();it();gl();gs();te();ee();Dn();ui();Yn();qI();st();Z();De();Wn();ue();fs();Hc();xo();co();mH();(t=>{function r(e,n){if(e===n)return!0;let o=Object.keys(e),i=new Set;for(let s of Object.keys(n))i.add(s);if(o.length!==i.size)return!1;for(let s of o){if(e[s]!==n[s])return!1;i.delete(s)}return i.size===0}t.equals=r})(gH||={});sa=A("IExtensionsScannerService"),Ku=class extends D{constructor(e,n,o,i,s,a,l,c,u,p,m,g){super();this.systemExtensionsLocation=e;this.userExtensionsLocation=n;this.extensionsControlLocation=o;this.userDataProfilesService=s;this.extensionsProfileScannerService=a;this.fileService=l;this.logService=c;this.environmentService=u;this.productService=p;this.uriIdentityService=m;this.instantiationService=g;this._onDidChangeCache=this._register(new R);this.onDidChangeCache=this._onDidChangeCache.event;this.initializeDefaultProfileExtensionsPromise=void 0;this.systemExtensionsCachedScanner=this._register(this.instantiationService.createInstance(Qu,i)),this.userExtensionsCachedScanner=this._register(this.instantiationService.createInstance(Qu,i)),this.extensionsScanner=this._register(this.instantiationService.createInstance(ju)),this._register(this.systemExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(0))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(1)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=WI(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,n){let[o,i]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(n)]);return this.dedupExtensions(o,i,[],await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){let n=[];n.push(this.scanDefaultSystemExtensions(e.language)),n.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));let[o,i]=await Promise.all(n),s=[...o,...i];if(this.environmentService.skipBuiltinExtensions?.length){let a=new Set(this.environmentService.skipBuiltinExtensions.map(l=>l.toLowerCase()));s=s.filter(l=>!a.has(l.identifier.id.toLowerCase()))}return this.applyScanOptions(s,0,{pickLatest:!1})}async scanUserExtensions(e){this.logService.trace("Started scanning user extensions",e.profileLocation);let n=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,o=await this.createExtensionScannerInput(e.profileLocation,!0,1,e.language,!0,n,e.productVersion??this.getProductVersion()),i=e.useCache&&!o.devMode?this.userExtensionsCachedScanner:this.extensionsScanner,s;try{s=await i.scanExtensions(o)}catch(a){if(a instanceof Fc&&a.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions(),s=await i.scanExtensions(o);else throw a}return s=await this.applyScanOptions(s,1,{includeInvalid:e.includeInvalid,pickLatest:!0}),this.logService.trace("Scanned user extensions:",s.length),s}async scanAllUserExtensions(e={includeInvalid:!0,includeAllVersions:!0}){let n=await this.createExtensionScannerInput(this.userExtensionsLocation,!1,1,void 0,!0,void 0,this.getProductVersion()),o=await this.extensionsScanner.scanExtensions(n);return this.applyScanOptions(o,1,{includeAllVersions:e.includeAllVersions,includeInvalid:e.includeInvalid})}async scanExtensionsUnderDevelopment(e,n){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){let o=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(i=>i.scheme===q.file).map(async i=>{let s=await this.createExtensionScannerInput(i,!1,1,n.language,!1,void 0,this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(s)).map(l=>(l.type=e.find(c=>_e(c.identifier,l.identifier))?.type??l.type,this.extensionsScanner.validate(l,s)))}))).flat();return this.applyScanOptions(o,"development",{includeInvalid:n.includeInvalid,pickLatest:!0})}return[]}async scanExistingExtension(e,n,o){let i=await this.createExtensionScannerInput(e,!1,n,o.language,!0,void 0,this.getProductVersion()),s=await this.extensionsScanner.scanExtension(i);return!s||!o.includeInvalid&&!s.isValid?null:s}async scanOneOrMultipleExtensions(e,n,o){let i=await this.createExtensionScannerInput(e,!1,n,o.language,!0,void 0,this.getProductVersion()),s=await this.extensionsScanner.scanOneOrMultipleExtensions(i);return this.applyScanOptions(s,n,{includeInvalid:o.includeInvalid,pickLatest:!0})}async scanMultipleExtensions(e,n,o){let i=[];return await Promise.all(e.map(async s=>{let a=await this.scanOneOrMultipleExtensions(s,n,o);i.push(...a)})),this.applyScanOptions(i,n,{includeInvalid:o.includeInvalid,pickLatest:!0})}async updateManifestMetadata(e,n){let o=ge(e,"package.json"),i=(await this.fileService.readFile(o)).value.toString(),s=JSON.parse(i);s.__metadata={...s.__metadata,...n},await this.fileService.writeFile(ge(e,"package.json"),O.fromString(JSON.stringify(s,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Fc&&e.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions();else throw e}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());let e=await this.scanAllUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(n=>[n,n.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,O.fromString(JSON.stringify([])))}catch(n){wt(n)!==1&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),ye(n))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,n,o={}){return o.includeAllVersions||(e=this.dedupExtensions(n===0?e:void 0,n===1?e:void 0,n==="development"?e:void 0,await this.getTargetPlatform(),!!o.pickLatest)),o.includeInvalid||(e=e.filter(i=>i.isValid)),e.sort((i,s)=>{let a=Ze(i.location.fsPath),l=Ze(s.location.fsPath);return a<l?-1:a>l?1:0})}dedupExtensions(e,n,o,i,s){let a=(u,p,m)=>{if(!m&&!(u.isBuiltin||p.isBuiltin)){if(u.metadata?.isApplicationScoped&&!p.metadata?.isApplicationScoped)return!1;if(!u.metadata?.isApplicationScoped&&p.metadata?.isApplicationScoped)return!0}if(u.isValid&&!p.isValid)return!1;if(u.isValid===p.isValid){if(s&&ps(u.manifest.version,p.manifest.version))return this.logService.debug(`Skipping extension ${p.location.path} with lower version ${p.manifest.version} in favour of ${u.location.path} with version ${u.manifest.version}`),!1;if(yF(u.manifest.version,p.manifest.version)){if(u.type===0)return this.logService.debug(`Skipping extension ${p.location.path} in favour of system extension ${u.location.path} with same version`),!1;if(u.targetPlatform===i)return this.logService.debug(`Skipping extension ${p.location.path} from different target platform ${p.targetPlatform}`),!1}}return m?this.logService.warn(`Overwriting user extension ${u.location.path} with ${p.location.path}.`):this.logService.debug(`Overwriting user extension ${u.location.path} with ${p.location.path}.`),!0},l=new _c;e?.forEach(u=>{let p=l.get(u.identifier.id);(!p||a(p,u,!1))&&l.set(u.identifier.id,u)});let c=fH(this.productService,this.environmentService);return n?.forEach(u=>{let p=l.get(u.identifier.id);if(!p&&e&&u.type===0){this.logService.debug(`Skipping obsolete system extension ${u.location.path}.`);return}if(c.has(u.identifier.id.toLowerCase())&&!u.forceAutoUpdate){this.logService.info(`Skipping user installed builtin extension ${u.identifier.id} with version ${u.manifest.version} because it is not allowed to in the current product quality ${this.productService.quality}`);return}(!p||a(p,u,!1))&&l.set(u.identifier.id,u)}),o?.forEach(u=>{let p=l.get(u.identifier.id);(!p||a(p,u,!0))&&l.set(u.identifier.id,u),l.set(u.identifier.id,u)}),[...l.values()]}async scanDefaultSystemExtensions(e){this.logService.trace("Started scanning system extensions");let n=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,0,e,!0,void 0,this.getProductVersion()),i=await(n.devMode?this.extensionsScanner:this.systemExtensionsCachedScanner).scanExtensions(n);return this.logService.trace("Scanned system extensions:",i.length),i}async scanDevSystemExtensions(e,n){let o=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!o?.length)return[];this.logService.trace("Started scanning dev system extensions");let i=n?await this.getBuiltInExtensionControl():{},s=[],a=S.file(Fn($(Pt.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(let c of o){let u=i[c.name]||"marketplace";switch(u){case"disabled":break;case"marketplace":s.push(ge(a,c.name));break;default:s.push(S.file(u));break}}let l=await Promise.all(s.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",l.length),Zo(l)}async getBuiltInExtensionControl(){try{let e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,n,o,i,s,a,l){let c=await this.getTranslations(i??Un),u=await this.getMtime(e),p=n&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,m=p?await this.getMtime(p):void 0;return new Vc(e,u,p,m,n,a,o,s,l.version,l.date,this.productService.commit,!this.environmentService.isBuilt,i,c)}async getMtime(e){try{let n=await this.fileService.stat(e);if(typeof n.mtime=="number")return n.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};Ku=w([b(4,Bt),b(5,Cr),b(6,Le),b(7,z),b(8,Ut),b(9,Be),b(10,Ye),b(11,Hn)],Ku);Vc=class{constructor(t,e,n,o,i,s,a,l,c,u,p,m,g,y){this.location=t;this.mtime=e;this.applicationExtensionslocation=n;this.applicationExtensionslocationMtime=o;this.profile=i;this.profileScanOptions=s;this.type=a;this.validate=l;this.productVersion=c;this.productDate=u;this.productCommit=p;this.devMode=m;this.language=g;this.translations=y}static createNlsConfiguration(t){return{language:t.language,pseudo:t.language==="pseudo",devMode:t.devMode,translations:t.translations}}static equals(t,e){return Tn(t.location,e.location)&&t.mtime===e.mtime&&Tn(t.applicationExtensionslocation,e.applicationExtensionslocation)&&t.applicationExtensionslocationMtime===e.applicationExtensionslocationMtime&&t.profile===e.profile&&Ge(t.profileScanOptions,e.profileScanOptions)&&t.type===e.type&&t.validate===e.validate&&t.productVersion===e.productVersion&&t.productDate===e.productDate&&t.productCommit===e.productCommit&&t.devMode===e.devMode&&t.language===e.language&&gH.equals(t.translations,e.translations)}},ju=class extends D{constructor(e,n,o,i,s,a){super();this.extensionsProfileScannerService=e;this.uriIdentityService=n;this.fileService=o;this.logService=a;this.productQuality=i.quality,this.productBuiltInExtensionsEnabledWithAutoUpdates=fH(i,s)}async scanExtensions(e){return e.profile?this.scanExtensionsFromProfile(e):this.scanExtensionsFromLocation(e)}async scanExtensionsFromLocation(e){let n=await this.fileService.resolve(e.location);if(!n.children?.length)return[];let o=await Promise.all(n.children.map(async i=>{if(!i.isDirectory||e.type===1&&xn(i.resource).indexOf(".")===0)return null;let s=new Vc(i.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(s)}));return Zo(o).sort((i,s)=>i.location.path<s.location.path?-1:1)}async scanExtensionsFromProfile(e){let n=await this.scanExtensionsFromProfileResource(e.location,()=>!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){n=n.filter(i=>!i.metadata?.isApplicationScoped);let o=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,i=>!!i.metadata?.isBuiltin||!!i.metadata?.isApplicationScoped,e);n.push(...o)}return n}async scanExtensionsFromProfileResource(e,n,o){let i=await this.extensionsProfileScannerService.scanProfileExtensions(e,o.profileScanOptions);if(!i.length)return[];let s=await Promise.all(i.map(async a=>{if(n(a)){let l=new Vc(a.location,o.mtime,o.applicationExtensionslocation,o.applicationExtensionslocationMtime,o.profile,o.profileScanOptions,o.type,o.validate,o.productVersion,o.productDate,o.productCommit,o.devMode,o.language,o.translations);return this.scanExtension(l,a)}return null}));return Zo(s)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(ge(e.location,"package.json"))){let n=await this.scanExtension(e);return n?[n]:[]}else return await this.scanExtensions(e)}catch(n){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,ye(n)),[]}}async scanExtension(e,n){let o=[],i=!0,s;try{s=await this.scanExtensionManifest(e.location)}catch(g){if(n){o.push([Qe.Error,ye(g)]),i=!1;let[y,h]=n.identifier.id.split(".");s={name:h,publisher:y,version:n.version,engines:{vscode:""}}}else return e.type!==0&&this.logService.error(g),null}s.publisher||(s.publisher=PI);let a;n?a={...n.metadata,size:s.__metadata?.size}:s.__metadata&&(a={installedTimestamp:s.__metadata.installedTimestamp,size:s.__metadata.size,targetPlatform:s.__metadata.targetPlatform}),delete s.__metadata;let l=Mo(s.publisher,s.name),c=a?.id?{id:l,uuid:a.id}:{id:l},u=a?.isSystem?0:e.type,p=u===0||!!a?.isBuiltin;try{s=await this.translateManifest(e.location,s,Vc.createNlsConfiguration(e))}catch(g){this.logService.warn("Failed to translate manifest",ye(g))}let m={type:u,identifier:c,manifest:s,location:e.location,isBuiltin:p,targetPlatform:a?.targetPlatform??"undefined",publisherDisplayName:a?.publisherDisplayName,metadata:a,isValid:i,validations:o,preRelease:!!a?.preRelease,forceAutoUpdate:this.productBuiltInExtensionsEnabledWithAutoUpdates.has(l.toLowerCase())&&this.productQuality==="stable"};return e.validate&&(m=this.validate(m,e)),s.enabledApiProposals&&(s.originalEnabledApiProposals=s.enabledApiProposals,s.enabledApiProposals=aF([...s.enabledApiProposals])),m}validate(e,n){let o=e.isValid,i=WF(n.productVersion,n.productDate,n.location,e.manifest,e.isBuiltin);for(let[s,a]of i)s===Qe.Error&&(o=!1,this.logService.error(this.formatMessage(n.location,a)));return e.isValid=o,e.validations=[...e.validations,...i],e}async scanExtensionManifest(e){let n=ge(e,"package.json"),o;try{o=(await this.fileService.readFile(n)).value.toString()}catch(s){throw wt(s)!==1&&this.logService.error(this.formatMessage(e,d(4381,null,n.path,s.message))),s}let i;try{i=JSON.parse(o)}catch(s){let a=[];bo(o,a);for(let l of a)this.logService.error(this.formatMessage(e,d(4383,null,n.path,l.offset,l.length,Wc(l.error))));throw s}if(al(i)!=="object"){let s=this.formatMessage(e,d(4384,null,n.path));throw this.logService.error(s),new Error(s)}return i}async translateManifest(e,n,o){let i=await this.getLocalizedMessages(e,n,o);if(i)try{let s=[],a=await this.resolveOriginalMessageBundle(i.default,s);if(s.length>0)return s.forEach(c=>{this.logService.error(this.formatMessage(e,d(4385,null,i.default?.path,Wc(c.error))))}),n;if(al(i)!=="object")return this.logService.error(this.formatMessage(e,d(4382,null,i.default?.path))),n;let l=i.values||Object.create(null);return pH(this.logService,n,l,a)}catch{}return n}async getLocalizedMessages(e,n,o){let i=ge(e,"package.nls.json"),s=(u,p)=>{p.forEach(m=>{this.logService.error(this.formatMessage(e,d(4385,null,u?.path,Wc(m.error))))})},a=u=>{this.logService.error(this.formatMessage(e,d(4382,null,u?.path)))},l=`${n.publisher}.${n.name}`,c=o.translations[l];if(c)try{let u=S.file(c),p=(await this.fileService.readFile(u)).value.toString(),m=[],g=bo(p,m);return m.length>0?(s(u,m),{values:void 0,default:i}):al(g)!=="object"?(a(u),{values:void 0,default:i}):{values:g.contents?g.contents.package:void 0,default:i}}catch{return{values:void 0,default:i}}else{if(!await this.fileService.exists(i))return;let p;try{p=await this.findMessageBundles(e,o)}catch{return}if(!p.localized)return{values:void 0,default:p.original};try{let m=(await this.fileService.readFile(p.localized)).value.toString(),g=[],y=bo(m,g);return g.length>0?(s(p.localized,g),{values:void 0,default:p.original}):al(y)!=="object"?(a(p.localized),{values:void 0,default:p.original}):{values:y,default:p.original}}catch{return{values:void 0,default:p.original}}}}async resolveOriginalMessageBundle(e,n){if(e)try{let o=(await this.fileService.readFile(e)).value.toString();return bo(o,n)}catch{}}findMessageBundles(e,n){return new Promise((o,i)=>{let s=a=>{let l=ge(e,`package.nls.${a}.json`);this.fileService.exists(l).then(c=>{c&&o({localized:l,original:ge(e,"package.nls.json")});let u=a.lastIndexOf("-");u===-1?o({localized:ge(e,"package.nls.json"),original:null}):(a=a.substring(0,u),s(a))})};if(n.devMode||n.pseudo||!n.language)return o({localized:ge(e,"package.nls.json"),original:null});s(n.language)})}formatMessage(e,n){return`[${e.path}]: ${n}`}};ju=w([b(0,Cr),b(1,Ye),b(2,Le),b(3,Be),b(4,Ut),b(5,z)],ju);Qu=class extends ju{constructor(e,n,o,i,s,a,l,c){super(o,i,s,a,l,c);this.currentProfile=e;this.userDataProfilesService=n;this.pendingValidations=new je;this.cacheValidatorThrottler=this._register(new Or(3e3));this._onDidChangeCache=this._register(new R);this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){let n=this.getCacheFile(e),o=await this.readExtensionCache(n);if(o&&o.input&&Vc.equals(o.input,e))return this.logService.debug("Using cached extensions scan result",e.type===0?"system":"user",e.location.toString()),this.pendingValidations.set(n,e),this.cacheValidatorThrottler.trigger(()=>this.validatePendingCaches()),o.result.map(s=>(s.location=S.revive(s.location),s));let i=await super.scanExtensions(e);return await this.writeExtensionCache(n,{input:e,result:i}),i}async readExtensionCache(e){try{let n=await this.fileService.readFile(e),o=JSON.parse(n.value.toString());return{result:o.result,input:en(o.input)}}catch(n){wt(n)!==1&&this.logService.debug("Error while reading the extension cache file:",e.path,ye(n))}return null}async writeExtensionCache(e,n){try{await this.fileService.writeFile(e,O.fromString(JSON.stringify(n)))}catch(o){this.logService.debug("Error while writing the extension cache file:",e.path,ye(o))}}async validatePendingCaches(){let e=[...this.pendingValidations.entries()];this.pendingValidations.clear(),await Promise.all(e.map(([n,o])=>this.validateCache(n,o)))}async validateCache(e,n){let o=await this.readExtensionCache(e);if(!o)return;let i=o.result,s=JSON.parse(JSON.stringify(await super.scanExtensions(n)));if(!Ge(s,i))try{this.logService.info("Invalidating Cache",i,s),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(a){this.logService.error(a)}}getCacheFile(e){let n=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(n.cacheHome,iF(e.type,e.language))}getProfile(e){return e.type===0?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(n=>this.uriIdentityService.extUri.isEqual(e.location,n.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};Qu=w([b(1,Bt),b(2,Cr),b(3,Ye),b(4,Le),b(5,Be),b(6,Ut),b(7,z)],Qu)});function If(r){let t="Extract";return r instanceof Uc&&(r.type==="CorruptZip"?t="CorruptZip":r.type==="Incomplete"&&(t="IncompleteZip")),pn(r,t)}async function ib(r){let t;try{t=await nb(r,"extension/package.json")}catch(e){throw If(e)}try{return JSON.parse(t.toString("utf8"))}catch{throw new Nt(d(4396,null),"Invalid")}}var hP=v(()=>{ob();ee();yf();_o()});var Yu,vl,sb=v(()=>{xe();Ie();Z();De();_n();_o();Yu=A("IExtensionSignatureVerificationService"),vl=class{constructor(t,e){this.logService=t;this.telemetryService=e}vsceSign(){return this.moduleLoadingPromise||(this.moduleLoadingPromise=this.resolveVsceSign()),this.moduleLoadingPromise}async resolveVsceSign(){return import("@vscode/vsce-sign")}async verify(t,e,n,o,i){let s;try{s=await this.vsceSign()}catch(u){this.logService.error("Could not load vsce-sign module",ye(u)),this.logService.info(`Extension signature verification is not done: ${t}`);return}let a=new Date().getTime(),l;try{this.logService.trace(`Verifying extension signature for ${t}...`),l=await s.verify(n,o,this.logService.getLevel()===1)}catch(u){l={code:"UnknownError",didExecute:!1,output:ye(u)}}let c=new Date().getTime()-a;return this.logService.info(`Extension signature verification result for ${t}: ${l.code}. ${oi(l.internalCode)?`Internal Code: ${l.internalCode}. `:""}Executed: ${l.didExecute}. Duration: ${c}ms.`),this.logService.trace(`Extension signature verification output for ${t}:
${l.output}`),this.telemetryService.publicLog2("extensionsignature:verification",{extensionId:t,extensionVersion:e,code:l.code,internalCode:l.internalCode,duration:c,didExecute:l.didExecute,clientTargetPlatform:i}),{code:l.code}}};vl=w([b(0,z),b(1,Mt)],vl)});var aa,hH=v(()=>{Ue();xe();Q();Me();it();gl();Vt();vo();ob();Dn();yf();_o();ui();hP();sb();st();De();_n();co();aa=class extends D{constructor(e,n,o,i,s,a,l){super();this.fileService=n;this.extensionGalleryService=o;this.extensionSignatureVerificationService=i;this.telemetryService=s;this.uriIdentityService=a;this.logService=l;this.extensionsDownloadDir=e.extensionsDownloadLocation,this.extensionsTrashDir=a.extUri.joinPath(e.extensionsDownloadLocation,".trash"),this.cache=20,this.cleanUpPromise=this.cleanUp()}static{this.SignatureArchiveExtension=".sigzip"}async download(e,n,o,i){await this.cleanUpPromise;let s=await this.downloadVSIX(e,n);if(!o)return{location:s,verificationStatus:void 0};if(!e.isSigned)return{location:s,verificationStatus:"NotSigned"};let a;try{a=await this.downloadSignatureArchive(e);let l=(await this.extensionSignatureVerificationService.verify(e.identifier.id,e.version,s.fsPath,a.fsPath,i))?.code;if(l==="PackageIsInvalidZip"||l==="SignatureArchiveIsInvalidZip"){try{await this.delete(s)}catch(c){this.logService.error(c)}throw new Nt(dP,"CorruptZip")}return{location:s,verificationStatus:l}}catch(l){try{await this.delete(s)}catch(c){this.logService.error(c)}throw l}finally{if(a)try{await this.delete(a)}catch(l){this.logService.error(l)}}}async downloadVSIX(e,n){try{let o=ge(this.extensionsDownloadDir,this.getName(e)),i=await this.doDownload(e,"vsix",async()=>{await this.downloadFile(e,o,s=>this.extensionGalleryService.download(e,s,n));try{await this.validate(o.fsPath,"extension/package.json")}catch(s){try{await this.fileService.del(o)}catch(a){this.logService.warn(`Error while deleting: ${o.path}`,ye(a))}throw s}},2);return i>1&&this.telemetryService.publicLog2("extensiongallery:downloadvsix:retry",{extensionId:e.identifier.id,attempts:i}),o}catch(o){throw pn(o,"Download")}}async downloadSignatureArchive(e){try{let n=ge(this.extensionsDownloadDir,`${this.getName(e)}${aa.SignatureArchiveExtension}`),o=await this.doDownload(e,"sigzip",async()=>{await this.extensionGalleryService.downloadSignatureArchive(e,n);try{await this.validate(n.fsPath,".signature.p7s")}catch(i){try{await this.fileService.del(n)}catch(s){this.logService.warn(`Error while deleting: ${n.path}`,ye(s))}throw i}},2);return o>1&&this.telemetryService.publicLog2("extensiongallery:downloadsigzip:retry",{extensionId:e.identifier.id,attempts:o}),n}catch(n){throw pn(n,"DownloadSignature")}}async downloadFile(e,n,o){if(await this.fileService.exists(n))return;if(n.scheme!==q.file){await o(n);return}let i=ge(this.extensionsDownloadDir,`.${Ee()}`);try{await o(i)}catch(s){try{await this.fileService.del(i)}catch{}throw s}try{await Ce.rename(i.fsPath,n.fsPath,120*1e3)}catch(s){try{await this.fileService.del(i)}catch{}let a=!1;try{a=await this.fileService.exists(n)}catch{}if(a)this.logService.info("Rename failed because the file was downloaded by another source. So ignoring renaming.",e.identifier.id,n.path);else throw this.logService.info(`Rename failed because of ${ye(s)}. Deleted the file from downloaded location`,i.path),s}}async doDownload(e,n,o,i){let s=1;for(;;)try{return await o(),s}catch(a){if(s++>i)throw a;this.logService.warn(`Failed downloading ${n}. ${ye(a)}. Retry again...`,e.identifier.id)}}async validate(e,n){try{await nb(e,n)}catch(o){throw If(o)}}async delete(e){await this.cleanUpPromise;let n=this.uriIdentityService.extUri.relativePath(this.extensionsDownloadDir,e);n?await this.fileService.move(e,this.uriIdentityService.extUri.joinPath(this.extensionsTrashDir,n),!0):await this.fileService.del(e)}async cleanUp(){try{if(!await this.fileService.exists(this.extensionsDownloadDir)){this.logService.trace("Extension VSIX downloads cache dir does not exist");return}try{await this.fileService.del(this.extensionsTrashDir,{recursive:!0})}catch(n){wt(n)!==1&&this.logService.error(n)}let e=await this.fileService.resolve(this.extensionsDownloadDir,{resolveMetadata:!0});if(e.children){let n=[],o=[],i=[];for(let l of e.children)if(l.name.endsWith(aa.SignatureArchiveExtension))i.push(l.resource);else{let c=lo.parse(l.name);c&&o.push([c,l])}let s=HI(o,([l])=>l),a=[];for(let l of s)l.sort((c,u)=>LI(c[0].version,u[0].version)),n.push(...l.slice(1).map(c=>c[1].resource)),a.push(l[0][1]);a.sort((l,c)=>l.mtime-c.mtime),n.push(...a.slice(0,Math.max(0,a.length-this.cache)).map(l=>l.resource)),n.push(...i),await Pn.settled(n.map(l=>(this.logService.trace("Deleting from cache",l.path),this.fileService.del(l))))}}catch(e){this.logService.error(e)}}getName(e){return lo.create(e).toString().toLowerCase()}};aa=w([b(0,An),b(1,Le),b(2,So),b(3,Yu),b(4,Mt),b(5,Ye),b(6,z)],aa)});import{fork as Zj}from"child_process";var Xu,yH=v(()=>{Ue();$s();ue();Q();Me();Oe();vo();De();xo();Xu=class extends D{constructor(e,n){super();this.userDataProfilesService=e;this.logService=n;this.processesLimiter=new Eg(5)}async postUninstall(e){let n=this.parseScript(e,"uninstall");n&&(this.logService.info(e.identifier.id,e.manifest.version,"Running post uninstall script"),await this.processesLimiter.queue(async()=>{try{await this.runLifecycleHook(n.script,"uninstall",n.args,!0,e),this.logService.info("Finished running post uninstall script",e.identifier.id,e.manifest.version)}catch(o){this.logService.error("Failed to run post uninstall script",e.identifier.id,e.manifest.version),this.logService.error(o)}}));try{await Ce.rm(this.getExtensionStoragePath(e))}catch(o){this.logService.error("Error while removing extension storage path",e.identifier.id),this.logService.error(o)}}parseScript(e,n){let o=`vscode:${n}`;if(e.location.scheme===q.file&&e.manifest&&e.manifest.scripts&&typeof e.manifest.scripts[o]=="string"){let i=e.manifest.scripts[o].split(" ");return i.length<2||i[0]!=="node"||!i[1]?(this.logService.warn(e.identifier.id,e.manifest.version,`${o} should be a node script`),null):{script:$(e.location.fsPath,i[1]),args:i.slice(2)||[]}}return null}runLifecycleHook(e,n,o,i,s){return new Promise((a,l)=>{let c=this.start(e,n,o,s),u,p=m=>{u&&(clearTimeout(u),u=null),m?l(m):a(void 0)};c.on("error",m=>{p(rr(m)||"Unknown")}),c.on("exit",(m,g)=>{p(m?`post-${n} process exited with code ${m}`:void 0)}),i&&(u=setTimeout(()=>{u=null,c.kill(),l("timed out")},5e3))})}start(e,n,o,i){let s={silent:!0,execArgv:void 0},a=Zj(e,[`--type=extension-post-${n}`,...o],s);a.stdout.setEncoding("utf8"),a.stderr.setEncoding("utf8");let l=F.fromNodeEventEmitter(a.stdout,"data"),c=F.fromNodeEventEmitter(a.stderr,"data");this._register(l(m=>this.logService.info(i.identifier.id,i.manifest.version,`post-${n}`,m))),this._register(c(m=>this.logService.error(i.identifier.id,i.manifest.version,`post-${n}`,m)));let u=F.any(F.map(l,m=>({data:`%c${m}`,format:[""]}),this._store),F.map(c,m=>({data:`%c${m}`,format:["color: red"]}),this._store));return F.debounce(u,(m,g)=>m?{data:m.data+g.data,format:[...m.format,...g.format]}:{data:g.data,format:g.format},100,void 0,void 0,void 0,this._store)(m=>{console.group(i.identifier.id),console.log(m.data,...m.format),console.groupEnd()}),a}getExtensionStoragePath(e){return $(this.userDataProfilesService.defaultProfile.globalStorageHome.fsPath,e.identifier.id.toLowerCase())}};Xu=w([b(0,Bt),b(1,z)],Xu)});var ab,vH=v(()=>{Q();Yn();st();ab=class extends D{constructor(e,n,o,i,s){super();this.userDataProfilesService=e;this.fileService=n;this.uriIdentityService=o;this.logService=s;this._register(i.onDidInstallExtensions(a=>this.onDidInstallExtensions(a))),this._register(i.onDidUninstallExtension(a=>this.onDidUnInstallExtension(a)))}onDidInstallExtensions(e){for(let n of e)n.local&&this.invalidate(n.profileLocation)}onDidUnInstallExtension(e){e.error||this.invalidate(e.profileLocation)}async invalidate(e){if(e)for(let n of this.userDataProfilesService.profiles)this.uriIdentityService.extUri.isEqual(n.extensionsResource,e)&&await this.deleteUserCacheFiles(n);else await this.deleteUserCacheFiles(this.userDataProfilesService.defaultProfile)}async deleteUserCacheFiles(e){try{let n=await this.fileService.resolve(e.cacheHome),o=this.uriIdentityService.extUri.ignorePathCasing(e.cacheHome);await Promise.all((n.children??[]).filter(i=>!i.isDirectory&&sF(i.name,1,o)).map(i=>this.fileService.del(i.resource)))}catch(n){wt(n)!==1&&this.logService.error(n)}}}});var lb,IH=v(()=>{xe();ue();Q();fn();ui();Yn();st();lb=class extends D{constructor(e,n,o,i,s,a,l){super();this.extensionManagementService=e;this.extensionsScannerService=n;this.userDataProfilesService=o;this.extensionsProfileScannerService=i;this.uriIdentityService=s;this.fileService=a;this.logService=l;this._onDidChangeExtensionsByAnotherSource=this._register(new R);this.onDidChangeExtensionsByAnotherSource=this._onDidChangeExtensionsByAnotherSource.event;this.allExtensions=new Map;this.extensionsProfileWatchDisposables=this._register(new Wo);this.initialize().then(null,c=>l.error("Error while initializing Extensions Watcher",ye(c)))}async initialize(){await this.extensionsScannerService.initializeDefaultProfileExtensions(),await this.onDidChangeProfiles(this.userDataProfilesService.profiles),this.registerListeners(),await this.deleteExtensionsNotInProfiles()}registerListeners(){this._register(this.userDataProfilesService.onDidChangeProfiles(e=>this.onDidChangeProfiles(e.added))),this._register(this.extensionsProfileScannerService.onAddExtensions(e=>this.onAddExtensions(e))),this._register(this.extensionsProfileScannerService.onDidAddExtensions(e=>this.onDidAddExtensions(e))),this._register(this.extensionsProfileScannerService.onRemoveExtensions(e=>this.onRemoveExtensions(e))),this._register(this.extensionsProfileScannerService.onDidRemoveExtensions(e=>this.onDidRemoveExtensions(e))),this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e)))}async onDidChangeProfiles(e){try{e.length&&await Promise.all(e.map(n=>(this.extensionsProfileWatchDisposables.set(n.id,Sv(this.fileService.watch(this.uriIdentityService.extUri.dirname(n.extensionsResource)),this.fileService.watch(n.extensionsResource))),this.populateExtensionsFromProfile(n.extensionsResource))))}catch(n){throw this.logService.error(n),n}}async onAddExtensions(e){for(let n of e.extensions)this.addExtensionWithKey(this.getKey(n.identifier,n.version),e.profileLocation)}async onDidAddExtensions(e){for(let n of e.extensions){let o=this.getKey(n.identifier,n.version);e.error?this.removeExtensionWithKey(o,e.profileLocation):this.addExtensionWithKey(o,e.profileLocation)}}async onRemoveExtensions(e){for(let n of e.extensions)this.removeExtensionWithKey(this.getKey(n.identifier,n.version),e.profileLocation)}async onDidRemoveExtensions(e){let n=[],o=[];for(let i of e.extensions){let s=this.getKey(i.identifier,i.version);e.error?this.addExtensionWithKey(s,e.profileLocation):(this.removeExtensionWithKey(s,e.profileLocation),this.allExtensions.has(s)||(this.logService.debug("Extension is removed from all profiles",i.identifier.id,i.version),o.push(this.extensionManagementService.scanInstalledExtensionAtLocation(i.location).then(a=>{a?n.push(a):this.logService.info("Extension not found at the location",i.location.toString())},a=>this.logService.error(a)))))}try{await Promise.all(o),n.length&&await this.deleteExtensionsNotInProfiles(n)}catch(i){this.logService.error(i)}}onDidFilesChange(e){for(let n of this.userDataProfilesService.profiles)e.contains(n.extensionsResource,0,1)&&this.onDidExtensionsProfileChange(n.extensionsResource)}async onDidExtensionsProfileChange(e){let n=[],o=[],i=await this.extensionsProfileScannerService.scanProfileExtensions(e),s=new Set,a=new Set;for(let[l,c]of this.allExtensions)c.has(e)&&a.add(l);for(let l of i){let c=this.getKey(l.identifier,l.version);s.add(c),a.has(c)||(n.push(l.identifier),this.addExtensionWithKey(c,e))}for(let l of a)if(!s.has(l)){let c=this.fromKey(l);c&&(o.push(c.identifier),this.removeExtensionWithKey(l,e))}(n.length||o.length)&&this._onDidChangeExtensionsByAnotherSource.fire({added:n.length?{extensions:n,profileLocation:e}:void 0,removed:o.length?{extensions:o,profileLocation:e}:void 0})}async populateExtensionsFromProfile(e){let n=await this.extensionsProfileScannerService.scanProfileExtensions(e);for(let o of n)this.addExtensionWithKey(this.getKey(o.identifier,o.version),e)}async deleteExtensionsNotInProfiles(e){e||(e=(await this.extensionManagementService.scanAllUserInstalledExtensions()).filter(o=>!this.allExtensions.has(this.getKey(o.identifier,o.manifest.version)))),e.length&&await this.extensionManagementService.deleteExtensions(...e)}addExtensionWithKey(e,n){let o=this.allExtensions.get(e);o||this.allExtensions.set(e,o=new Ws(i=>this.uriIdentityService.extUri.getComparisonKey(i))),o.add(n)}removeExtensionWithKey(e,n){let o=this.allExtensions.get(e);o&&o.delete(n),o?.size||this.allExtensions.delete(e)}getKey(e,n){return`${un.toKey(e.id)}@${n}`}fromKey(e){let[n,o]=uf(e);return o?{identifier:{id:n},version:o}:void 0}}});import*as bH from"fs";var xf,yP,Il,bf,Sf,vP,IP=v(()=>{Ue();Ve();xe();ue();Mi();Q();fn();Me();Oe();it();gl();Ie();te();Vt();vo();ob();ee();rb();Dn();yf();_o();ui();Hc();Ju();hH();yH();hP();vH();IH();Yn();qI();st();Z();De();Wn();_n();co();xo();dn();Lc();xf=Du,yP=".vsctmp",Il=class extends zu{constructor(e,n,o,i,s,a,l,c,u,p,m,g,y,h,I){super(e,n,h,o,g,y,I);this.environmentService=i;this.extensionsScannerService=s;this.extensionsProfileScannerService=a;this.downloadService=l;this.instantiationService=c;this.fileService=u;this.configurationService=p;this.extensionGalleryManifestService=m;this.extractingGalleryExtensions=new Map;this.knownDirectories=new Ws;let x=this._register(c.createInstance(Xu));this.extensionsScanner=this._register(c.createInstance(bf,T=>x.postUninstall(T))),this.manifestCache=this._register(new ab(I,u,h,this,this.logService)),this.extensionsDownloader=this._register(c.createInstance(aa));let E=this._register(new lb(this,this.extensionsScannerService,I,a,h,u,o));this._register(E.onDidChangeExtensionsByAnotherSource(T=>this.onDidChangeExtensionsFromAnotherSource(T))),this.watchForExtensionsNotInstalledBySystem()}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=WI(this.fileService,this.logService)),this._targetPlatformPromise}async zip(e){this.logService.trace("ExtensionManagementService#zip",e.identifier.id);let n=await this.collectFiles(e),o=await cH(ge(this.extensionsDownloader.extensionsDownloadDir,Ee()).fsPath,n);return S.file(o)}async getManifest(e){let{location:n,cleanup:o}=await this.downloadVsix(e),i=Sn(n.fsPath);try{return await ib(i)}finally{await o()}}getInstalled(e,n=this.userDataProfilesService.defaultProfile.extensionsResource,o={version:this.productService.version,date:this.productService.date},i){return this.extensionsScanner.scanExtensions(e??null,n,o,i)}scanAllUserInstalledExtensions(){return this.extensionsScanner.scanAllUserExtensions()}scanInstalledExtensionAtLocation(e){return this.extensionsScanner.scanUserExtensionAtLocation(e)}async install(e,n={}){this.logService.trace("ExtensionManagementService#install",e.toString());let{location:o,cleanup:i}=await this.downloadVsix(e);try{let s=await ib(Sn(o.fsPath)),a=Mo(s.publisher,s.name);if(s.engines&&s.engines.vscode&&!mf(s.engines.vscode,this.productService.version,this.productService.date))throw new Error(d(4390,null,a,this.productService.version));let l=this.allowedExtensionsService.isAllowed({id:a,version:s.version,publisherDisplayName:void 0});if(l!==!0)throw new Error(d(4392,null,l.value));let u=(await this.installExtensions([{manifest:s,extension:o,options:n}])).find(({identifier:p})=>_e(p,{id:a}));if(u?.local)return u.local;throw u?.error?u.error:pn(new Error(`Unknown error while installing extension ${a}`))}finally{await i()}}async installFromLocation(e,n){this.logService.trace("ExtensionManagementService#installFromLocation",e.toString());let o=await this.extensionsScanner.scanUserExtensionAtLocation(e);if(!o||!o.manifest.name||!o.manifest.version)throw new Error(`Cannot find a valid extension from the location ${e.toString()}`);return await this.addExtensionsToProfile([[o,{source:"resource"}]],n),this.logService.info("Successfully installed extension",o.identifier.id,n.toString()),o}async installExtensionsFromProfile(e,n,o){this.logService.trace("ExtensionManagementService#installExtensionsFromProfile",e,n.toString(),o.toString());let i=(await this.getInstalled(1,n)).filter(s=>e.some(a=>_e(a,s.identifier)));if(i.length){let s=await Promise.all(i.map(a=>this.extensionsScanner.scanMetadata(a,n)));await this.addExtensionsToProfile(i.map((a,l)=>[a,s[l]]),o),this.logService.info("Successfully installed extensions",i.map(a=>a.identifier.id),o.toString())}return i}async updateMetadata(e,n,o){return this.logService.trace("ExtensionManagementService#updateMetadata",e.identifier.id),n.isPreReleaseVersion&&(n.preRelease=!0,n.hasPreReleaseVersion=!0),n.isMachineScoped===!1&&(n.isMachineScoped=void 0),n.isBuiltin===!1&&(n.isBuiltin=void 0),n.pinned===!1&&(n.pinned=void 0),e=await this.extensionsScanner.updateMetadata(e,n,o),this.manifestCache.invalidate(o),this._onDidUpdateExtensionMetadata.fire({local:e,profileLocation:o}),e}deleteExtension(e){return this.extensionsScanner.deleteExtension(e,"remove")}copyExtension(e,n,o,i){return this.extensionsScanner.copyExtension(e,n,o,i)}moveExtension(e,n,o,i){return this.extensionsScanner.moveExtension(e,n,o,i)}removeExtension(e,n){return this.extensionsScanner.removeExtension(e.identifier,n)}copyExtensions(e,n){return this.extensionsScanner.copyExtensions(e,n,{version:this.productService.version,date:this.productService.date})}deleteExtensions(...e){return this.extensionsScanner.setExtensionsForRemoval(...e)}async cleanUp(){this.logService.trace("ExtensionManagementService#cleanUp");try{await this.extensionsScanner.cleanUp()}catch(e){this.logService.error(e)}}async download(e,n,o){let{location:i}=await this.downloadExtension(e,n,!o);return i}async downloadVsix(e){if(e.scheme===q.file)return{location:e,async cleanup(){}};this.logService.trace("Downloading extension from",e.toString());let n=ge(this.extensionsDownloader.extensionsDownloadDir,Ee());return await this.downloadService.download(e,n,"extensionManagement.downloadVsix"),this.logService.info("Downloaded extension to",n.toString()),{location:n,cleanup:async()=>{try{await this.fileService.del(n)}catch(i){this.logService.error(i)}}}}getCurrentExtensionsManifestLocation(){return this.userDataProfilesService.defaultProfile.extensionsResource}createInstallExtensionTask(e,n,o){let i=n instanceof S?new lo({id:Mo(e.publisher,e.name)},e.version):lo.create(n);return this.instantiationService.createInstance(Sf,i,e,n,o,(s,a)=>{if(n instanceof S)return this.extractVSIX(i,n,o,a);let l=this.extractingGalleryExtensions.get(i.toString());return l||(this.extractingGalleryExtensions.set(i.toString(),l=this.downloadAndExtractGalleryExtension(i,n,s,o,a)),l.finally(()=>this.extractingGalleryExtensions.delete(i.toString()))),l},this.extensionsScanner)}createUninstallExtensionTask(e,n){return new vP(e,n,this.extensionsProfileScannerService)}async downloadAndExtractGalleryExtension(e,n,o,i,s){let{verificationStatus:a,location:l}=await this.downloadExtension(n,o,!i.donotVerifySignature,i.context?.[dF]);try{if(s.isCancellationRequested)throw new He;let c=await ib(l.fsPath);if(!new lo(n.identifier,n.version).equals(new lo({id:Mo(c.publisher,c.name)},c.version)))throw new Nt(d(4391,null,n.identifier.id),"Invalid");let u=await this.extensionsScanner.extractUserExtension(e,l.fsPath,!1,s);if(a!=="Success"&&this.environmentService.isBuilt)try{await this.extensionsDownloader.delete(l)}catch(p){this.logService.warn("Error while deleting the downloaded file",l.toString(),ye(p))}return{local:u,verificationStatus:a}}catch(c){try{await this.extensionsDownloader.delete(l)}catch(u){this.logService.warn("Error while deleting the downloaded file",l.toString(),ye(u))}throw pn(c)}}async downloadExtension(e,n,o,i){o&&(o=!1);let{location:s,verificationStatus:a}=await this.extensionsDownloader.download(e,n,o,i),l=gF(e.private,await this.extensionGalleryManifestService.getExtensionGalleryManifest());if(a!=="Success"&&!(a==="NotSigned"&&!l)&&o&&this.environmentService.isBuilt&&await this.getTargetPlatform()!=="linux-armhf"){try{await this.extensionsDownloader.delete(s)}catch(c){this.logService.warn("Error while deleting the downloaded file",s.toString(),ye(c))}if(!a)throw new Nt(d(4395,null),"SignatureVerificationInternal");switch(a){case"PackageIntegrityCheckFailed":case"SignatureIsInvalid":case"SignatureManifestIsInvalid":case"SignatureIntegrityCheckFailed":case"EntryIsMissing":case"EntryIsTampered":case"Untrusted":case"CertificateRevoked":case"SignatureIsNotValid":case"SignatureArchiveHasTooManyEntries":case"NotSigned":throw new Nt(d(4394,null,a),"SignatureVerificationFailed")}throw new Nt(d(4394,null,a),"SignatureVerificationInternal")}return{location:s,verificationStatus:a}}async extractVSIX(e,n,o,i){return{local:await this.extensionsScanner.extractUserExtension(e,Sn(n.fsPath),er(o.keepExisting)?!o.keepExisting:!0,i)}}async collectFiles(e){let n=async i=>{let s=await Ce.readdir(i);s=s.map(c=>$(i,c));let a=await Promise.all(s.map(c=>bH.promises.stat(c))),l=Promise.resolve([]);return a.forEach((c,u)=>{let p=s[u];c.isFile()&&(l=l.then(m=>[...m,p])),c.isDirectory()&&(l=l.then(m=>n(p).then(g=>[...m,...g])))}),l};return(await n(e.location.fsPath)).map(i=>({path:`extension/${Hs(e.location.fsPath,i)}`,localPath:i}))}async onDidChangeExtensionsFromAnotherSource({added:e,removed:n}){if(n){let o=e&&this.uriIdentityService.extUri.isEqual(n.profileLocation,e.profileLocation)?n.extensions.filter(i=>e.extensions.every(s=>!_e(s,i))):n.extensions;for(let i of o)this.logService.info("Extensions removed from another source",i.id,n.profileLocation.toString()),this._onDidUninstallExtension.fire({identifier:i,profileLocation:n.profileLocation})}if(e){let i=(await this.getInstalled(1,e.profileLocation)).filter(s=>e.extensions.some(a=>_e(a,s.identifier)));this._onDidInstallExtensions.fire(i.map(s=>(this.logService.info("Extensions added from another source",s.identifier.id,e.profileLocation.toString()),{identifier:s.identifier,local:s,profileLocation:e.profileLocation,operation:1})))}}async watchForExtensionsNotInstalledBySystem(){this._register(this.extensionsScanner.onExtract(n=>this.knownDirectories.add(n)));let e=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation);for(let n of e.children??[])n.isDirectory&&this.knownDirectories.add(n.resource);this._register(this.fileService.watch(this.extensionsScannerService.userExtensionsLocation)),this._register(this.fileService.onDidFilesChange(n=>this.onDidFilesChange(n)))}async onDidFilesChange(e){if(!e.affects(this.extensionsScannerService.userExtensionsLocation,1))return;let n=[];for(let o of e.rawAdded){if(this.knownDirectories.has(o)||!this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(o),this.extensionsScannerService.userExtensionsLocation)||this.uriIdentityService.extUri.isEqual(o,this.uriIdentityService.extUri.joinPath(this.extensionsScannerService.userExtensionsLocation,".obsolete"))||this.uriIdentityService.extUri.basename(o).startsWith(".")||this.uriIdentityService.extUri.basename(o).endsWith(yP))continue;try{if(!(await this.fileService.stat(o)).isDirectory)continue}catch(s){wt(s)!==1&&this.logService.error(s);continue}let i=await this.extensionsScanner.scanUserExtensionAtLocation(o);i&&i.installedTimestamp===void 0&&(this.knownDirectories.add(o),n.push(i))}n.length&&(await this.addExtensionsToProfile(n.map(o=>[o,void 0]),this.userDataProfilesService.defaultProfile.extensionsResource),this.logService.info("Added extensions to default profile from external source",n.map(o=>o.identifier.id)))}async addExtensionsToProfile(e,n){let o=e.map(i=>i[0]);await this.extensionsScanner.unsetExtensionsForRemoval(...o.map(i=>lo.create(i))),await this.extensionsProfileScannerService.addExtensionsToProfile(e,n),this._onDidInstallExtensions.fire(o.map(i=>({local:i,identifier:i.identifier,operation:1,profileLocation:n})))}};Il=w([b(0,So),b(1,Mt),b(2,z),b(3,An),b(4,sa),b(5,Cr),b(6,qu),b(7,Hn),b(8,Le),b(9,bt),b(10,ys),b(11,Be),b(12,Br),b(13,Ye),b(14,Bt)],Il);bf=class extends D{constructor(e,n,o,i,s,a,l,c,u,p){super();this.beforeRemovingExtension=e;this.environmentService=n;this.fileService=o;this.extensionsScannerService=i;this.extensionsProfileScannerService=s;this.uriIdentityService=a;this.telemetryService=l;this.productService=c;this.userDataProfilesService=u;this.logService=p;this._onExtract=this._register(new R);this.onExtract=this._onExtract.event;this.scanAllExtensionPromise=new je;this.scanUserExtensionsPromise=new je;this.obsoletedResource=ge(this.extensionsScannerService.userExtensionsLocation,".obsolete"),this.obsoleteFileLimiter=new Nr}async cleanUp(){await this.removeTemporarilyDeletedFolders(),await this.removeStaleAutoUpdateBuiltinExtensions(),await this.deleteExtensionsMarkedForRemoval(),await this.initializeExtensionSize()}async scanExtensions(e,n,o,i){try{let s=n.with({query:i}),a={includeInvalid:!0,profileLocation:n,productVersion:o,language:i},l=[];if(e===null||e===0){let c=this.scanAllExtensionPromise.get(s);c||(c=this.extensionsScannerService.scanAllExtensions({language:i},a).finally(()=>this.scanAllExtensionPromise.delete(s)),this.scanAllExtensionPromise.set(s,c)),l.push(...await c)}else if(e===1){let c=this.scanUserExtensionsPromise.get(s);c||(c=this.extensionsScannerService.scanUserExtensions(a).finally(()=>this.scanUserExtensionsPromise.delete(s)),this.scanUserExtensionsPromise.set(s,c)),l.push(...await c)}return l=e!==null?l.filter(c=>c.type===e):l,await Promise.all(l.map(c=>this.toLocalExtension(c)))}catch(s){throw pn(s,"Scanning")}}async scanAllUserExtensions(){try{let e=await this.extensionsScannerService.scanAllUserExtensions();return await Promise.all(e.map(n=>this.toLocalExtension(n)))}catch(e){throw pn(e,"Scanning")}}async scanUserExtensionAtLocation(e){try{let n=await this.extensionsScannerService.scanExistingExtension(e,1,{includeInvalid:!0});if(n)return await this.toLocalExtension(n)}catch(n){this.logService.error(n)}return null}async extractUserExtension(e,n,o,i){let s=e.toString(),a=S.file($(this.extensionsScannerService.userExtensionsLocation.fsPath,`.${Ee()}`)),l=S.file($(this.extensionsScannerService.userExtensionsLocation.fsPath,s));if(await this.fileService.exists(l)){if(!o)try{return await this.scanLocalExtension(l,1)}catch(c){this.logService.warn(`Error while scanning the existing extension at ${l.path}. Deleting the existing extension and extracting it.`,ye(c))}try{await this.deleteExtensionFromLocation(e.id,l,"removeExisting")}catch{throw new Nt(d(4389,null,l.fsPath,e.id),"Delete")}}try{if(i.isCancellationRequested)throw new He;try{this.logService.trace(`Started extracting the extension from ${n} to ${l.fsPath}`),await dH(n,a.fsPath,{sourcePath:"extension",overwrite:!0},i),this.logService.info(`Extracted extension to ${l}:`,e.id)}catch(u){throw If(u)}let c={installedTimestamp:Date.now(),targetPlatform:e.targetPlatform};try{c.size=await DI(a,this.fileService)}catch(u){this.logService.warn(`Error while getting the size of the extracted extension : ${a.fsPath}`,ye(u))}try{await this.extensionsScannerService.updateManifestMetadata(a,c)}catch(u){throw this.telemetryService.publicLog2("extension:extract",{extensionId:e.id,code:`${wt(u)}`}),pn(u,"UpdateMetadata")}if(i.isCancellationRequested)throw new He;try{this.logService.trace(`Started renaming the extension from ${a.fsPath} to ${l.fsPath}`),await this.rename(a.fsPath,l.fsPath),this.logService.info("Renamed to",l.fsPath)}catch(u){if(u.code==="ENOTEMPTY"){this.logService.info("Rename failed because extension was installed by another source. So ignoring renaming.",e.id);try{await this.fileService.del(a,{recursive:!0})}catch{}}else throw this.logService.info(`Rename failed because of ${ye(u)}. Deleted from extracted location`,a),u}this._onExtract.fire(l)}catch(c){try{await this.fileService.del(a,{recursive:!0})}catch{}throw c}return this.scanLocalExtension(l,1)}async scanMetadata(e,n){return(await this.getScannedExtension(e,n))?.metadata}async getScannedExtension(e,n){return(await this.extensionsProfileScannerService.scanProfileExtensions(n)).find(i=>_e(i.identifier,e.identifier))}async updateMetadata(e,n,o){try{await this.extensionsProfileScannerService.updateMetadata([[e,n]],o)}catch(i){throw this.telemetryService.publicLog2("extension:extract",{extensionId:e.identifier.id,code:`${wt(i)}`,isProfile:!!o}),pn(i,"UpdateMetadata")}return this.scanLocalExtension(e.location,e.type,o)}async setExtensionsForRemoval(...e){let n=[];for(let i of e)await this.fileService.exists(i.location)&&n.push(i);let o=n.map(i=>lo.create(i));await this.withRemovedExtensions(i=>o.forEach(s=>{i[s.toString()]=!0,this.logService.info("Marked extension as removed",s.toString())}))}async unsetExtensionsForRemoval(...e){try{let n=[];return await this.withRemovedExtensions(o=>e.forEach(i=>{o[i.toString()]?(n.push(!0),delete o[i.toString()]):n.push(!1)})),n}catch(n){throw pn(n,"UnsetRemoved")}}async deleteExtension(e,n){this.uriIdentityService.extUri.isEqualOrParent(e.location,this.extensionsScannerService.userExtensionsLocation)&&(await this.deleteExtensionFromLocation(e.identifier.id,e.location,n),await this.unsetExtensionsForRemoval(lo.create(e)))}async copyExtension(e,n,o,i){let s=await this.getScannedExtension(e,n),a=await this.getScannedExtension(e,o);if(i={...s?.metadata,...i},a)if(this.uriIdentityService.extUri.isEqual(a.location,e.location))await this.extensionsProfileScannerService.updateMetadata([[e,{...a.metadata,...i}]],o);else{let l=await this.scanLocalExtension(a.location,e.type,o);await this.extensionsProfileScannerService.removeExtensionsFromProfile([l.identifier],o),await this.extensionsProfileScannerService.addExtensionsToProfile([[e,{...a.metadata,...i}]],o)}else await this.extensionsProfileScannerService.addExtensionsToProfile([[e,i]],o);return this.scanLocalExtension(e.location,e.type,o)}async moveExtension(e,n,o,i){let s=await this.getScannedExtension(e,n),a=await this.getScannedExtension(e,o);if(i={...s?.metadata,...i},a)if(this.uriIdentityService.extUri.isEqual(a.location,e.location))await this.extensionsProfileScannerService.updateMetadata([[e,{...a.metadata,...i}]],o);else{let l=await this.scanLocalExtension(a.location,e.type,o);await this.removeExtension(l.identifier,o),await this.extensionsProfileScannerService.addExtensionsToProfile([[e,{...a.metadata,...i}]],o)}else await this.extensionsProfileScannerService.addExtensionsToProfile([[e,i]],o),s&&await this.removeExtension(s.identifier,n);return this.scanLocalExtension(e.location,e.type,o)}async removeExtension(e,n){await this.extensionsProfileScannerService.removeExtensionsFromProfile([e],n)}async copyExtensions(e,n,o){let i=await this.scanExtensions(1,e,o),s=await Promise.all(i.filter(a=>!a.isApplicationScoped).map(async a=>[a,await this.scanMetadata(a,e)]));await this.extensionsProfileScannerService.addExtensionsToProfile(s,n)}async deleteExtensionFromLocation(e,n,o){this.logService.trace(`Deleting ${o} extension from disk`,e,n.fsPath);let i=this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(n),`${this.uriIdentityService.extUri.basename(n)}.${Fr(Ee()).toString(16)}${yP}`);await this.rename(n.fsPath,i.fsPath),await this.fileService.del(i,{recursive:!0}),this.logService.info(`Deleted ${o} extension from disk`,e,n.fsPath)}withRemovedExtensions(e){return this.obsoleteFileLimiter.queue(async()=>{let n;try{n=(await this.fileService.readFile(this.obsoletedResource,"utf8")).value.toString()}catch(i){if(wt(i)!==1)throw i}let o={};if(n)try{o=JSON.parse(n)}catch{}if(e)if(e(o),Object.keys(o).length)await this.fileService.writeFile(this.obsoletedResource,O.fromString(JSON.stringify(o)));else try{await this.fileService.del(this.obsoletedResource)}catch(i){if(wt(i)!==1)throw i}return o})}async rename(e,n){try{await Ce.rename(e,n,120*1e3)}catch(o){throw pn(o,"Rename")}}async scanLocalExtension(e,n,o){try{if(o){let s=(await this.extensionsScannerService.scanUserExtensions({profileLocation:o})).find(a=>this.uriIdentityService.extUri.isEqual(a.location,e));if(s)return await this.toLocalExtension(s)}else{let i=await this.extensionsScannerService.scanExistingExtension(e,n,{includeInvalid:!0});if(i)return await this.toLocalExtension(i)}throw new Nt(d(4388,null,e.path),"ScanningExtension")}catch(i){throw pn(i,"ScanningExtension")}}async toLocalExtension(e){let n;try{n=await this.fileService.resolve(e.location)}catch{}let o,i;return n?.children&&(o=n.children.find(({name:s})=>/^readme(\.txt|\.md|)$/i.test(s))?.resource,i=n.children.find(({name:s})=>/^changelog(\.txt|\.md|)$/i.test(s))?.resource),{identifier:e.identifier,type:e.type,isBuiltin:e.isBuiltin||!!e.metadata?.isBuiltin,location:e.location,manifest:e.manifest,targetPlatform:e.targetPlatform,validations:e.validations,isValid:e.isValid,readmeUrl:o,changelogUrl:i,publisherDisplayName:e.metadata?.publisherDisplayName,publisherId:e.metadata?.publisherId||null,isApplicationScoped:!!e.metadata?.isApplicationScoped,isMachineScoped:!!e.metadata?.isMachineScoped,isPreReleaseVersion:!!e.metadata?.isPreReleaseVersion,hasPreReleaseVersion:!!e.metadata?.hasPreReleaseVersion,preRelease:e.preRelease,installedTimestamp:e.metadata?.installedTimestamp,updated:!!e.metadata?.updated,pinned:!!e.metadata?.pinned,forceAutoUpdate:e.forceAutoUpdate,private:!!e.metadata?.private,isWorkspaceScoped:!1,source:e.metadata?.source??(e.identifier.uuid?"gallery":"vsix"),size:e.metadata?.size??0}}async initializeExtensionSize(){let e=await this.extensionsScannerService.scanAllUserExtensions();await Promise.all(e.map(async n=>{if(oi(n.metadata?.installedTimestamp)&&$n(n.metadata?.size)){let o=await DI(n.location,this.fileService);await this.extensionsScannerService.updateManifestMetadata(n.location,{size:o})}}))}async removeStaleAutoUpdateBuiltinExtensions(){if(this.environmentService.extensionTestsLocationURI)return;let e=await this.extensionsScannerService.scanSystemExtensions({}),o=(await this.extensionsScannerService.scanAllUserExtensions()).filter(i=>{if(!this.productService.builtInExtensionsEnabledWithAutoUpdates.some(a=>a.toLowerCase()===i.identifier.id.toLowerCase()))return!1;let s=e.find(a=>_e(a.identifier,i.identifier));return s&&MI(i.manifest.version,s.manifest.version)});o.length&&(this.logService.info("Removing stale auto-update builtin extensions:",o.map(i=>`${i.identifier.id}@${i.manifest.version}`).join(", ")),await this.extensionsProfileScannerService.removeExtensionsFromProfile(o.map(i=>i.identifier),this.userDataProfilesService.defaultProfile.extensionsResource),await Promise.allSettled(o.map(i=>this.deleteExtension(i,"stale auto-update builtin"))))}async deleteExtensionsMarkedForRemoval(){let e;try{e=await this.withRemovedExtensions()}catch(s){throw pn(s,"ReadRemoved")}if(Object.keys(e).length===0){this.logService.debug("No extensions are marked as removed.");return}this.logService.debug("Deleting extensions marked as removed:",Object.keys(e));let n=await this.scanAllUserExtensions(),o=new Set;for(let s of n)e[lo.create(s).toString()]||o.add(s.identifier.id.toLowerCase());try{let s=HI(n,a=>a.identifier);await Pn.settled(s.map(async a=>{let l=a.sort((c,u)=>LI(c.manifest.version,u.manifest.version))[0];o.has(l.identifier.id.toLowerCase())||await this.beforeRemovingExtension(l)}))}catch(s){this.logService.error(s)}let i=n.filter(s=>s.installedTimestamp&&e[lo.create(s).toString()]);await Promise.allSettled(i.map(s=>this.deleteExtension(s,"marked for removal")))}async removeTemporarilyDeletedFolders(){this.logService.trace("ExtensionManagementService#removeTempDeleteFolders");let e;try{e=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation)}catch(n){wt(n)!==1&&this.logService.error(n);return}if(e?.children)try{await Promise.allSettled(e.children.map(async n=>{if(!(!n.isDirectory||!n.name.endsWith(yP))){this.logService.trace("Deleting the temporarily deleted folder",n.resource.toString());try{await this.fileService.del(n.resource,{recursive:!0}),this.logService.trace("Deleted the temporarily deleted folder",n.resource.toString())}catch(o){wt(o)!==1&&this.logService.error(o)}}}))}catch{}}};bf=w([b(1,Ut),b(2,Le),b(3,sa),b(4,Cr),b(5,Ye),b(6,Mt),b(7,Be),b(8,Bt),b(9,z)],bf);Sf=class extends hf{constructor(e,n,o,i,s,a,l,c,u,p,m,g,y){super();this.extensionKey=e;this.manifest=n;this.source=o;this.options=i;this.extractExtensionFn=s;this.extensionsScanner=a;this.uriIdentityService=l;this.galleryService=c;this.userDataProfilesService=u;this.extensionsScannerService=p;this.extensionsProfileScannerService=m;this.productService=g;this.logService=y;this._operation=2;this.identifier=this.extensionKey.identifier}get operation(){return this.options.operation??this._operation}get verificationStatus(){return this._verificationStatus}async doRun(e){let o=(await this.extensionsScanner.scanExtensions(1,this.options.profileLocation,this.options.productVersion)).find(u=>_e(u.identifier,this.identifier));o&&(this._operation=3);let s=(await this.extensionsScanner.scanExtensions(0,this.options.profileLocation,this.options.productVersion)).find(u=>_e(u.identifier,this.identifier));if(s){if(!s.forceAutoUpdate)throw new Nt(d(4386,null,s.identifier.id,this.productService.quality),"Incompatible");if(ps(s.manifest.version,this.manifest.version))throw new Nt(d(4387,null,s.identifier.id,s.manifest.version,this.manifest.version),"Incompatible")}let a={isApplicationScoped:this.options.isApplicationScoped||o?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||o?.isMachineScoped,isBuiltin:this.options.isBuiltin||o?.isBuiltin,isSystem:o?.type===0?!0:void 0,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:this.options.pinned??o?.pinned,source:this.source instanceof S?"vsix":"gallery"},l;if(this.source instanceof S){if(o&&this.extensionKey.equals(new lo(o.identifier,o.manifest.version)))try{await this.extensionsScanner.deleteExtension(o,"existing")}catch{throw new Error(d(4393,null,this.manifest.displayName||this.manifest.name))}let u=await this.unsetIfRemoved(this.extensionKey);if(u)try{await this.extensionsScanner.deleteExtension(u,"existing")}catch{throw new Error(d(4393,null,this.manifest.displayName||this.manifest.name))}}else{if(a.id=this.source.identifier.uuid,a.publisherId=this.source.publisherId,a.publisherDisplayName=this.source.publisherDisplayName,a.targetPlatform=this.source.properties.targetPlatform,a.updated=!!o,a.private=this.source.private,a.isPreReleaseVersion=this.source.properties.isPreReleaseVersion,a.hasPreReleaseVersion=o?.hasPreReleaseVersion||this.source.properties.isPreReleaseVersion,a.preRelease=er(this.options.preRelease)?this.options.preRelease:this.options.installPreReleaseVersion||this.source.properties.isPreReleaseVersion||o?.preRelease,o&&o.type!==0&&o.manifest.version===this.source.version)return this.extensionsScanner.updateMetadata(o,a,this.options.profileLocation);l=await this.unsetIfRemoved(this.extensionKey)}if(e.isCancellationRequested)throw pn(new He);if(!l){let u=await this.extractExtensionFn(this.operation,e);l=u.local,this._verificationStatus=u.verificationStatus}if(this.uriIdentityService.extUri.isEqual(this.userDataProfilesService.defaultProfile.extensionsResource,this.options.profileLocation))try{await this.extensionsScannerService.initializeDefaultProfileExtensions()}catch(u){throw pn(u,"IntializeDefaultProfile")}if(e.isCancellationRequested)throw pn(new He);try{await this.extensionsProfileScannerService.addExtensionsToProfile([[l,a]],this.options.profileLocation,!l.isValid)}catch(u){throw pn(u,"AddToProfile")}let c=await this.extensionsScanner.scanLocalExtension(l.location,1,this.options.profileLocation);if(!c)throw new Nt("Cannot find the installed extension","InstalledExtensionNotFound");return this.source instanceof S&&this.updateMetadata(l,e),c}async unsetIfRemoved(e){let[n]=await this.extensionsScanner.unsetExtensionsForRemoval(e);if(n)return this.logService.info("Removed the extension from removed list:",e.id),(await this.extensionsScanner.scanAllUserExtensions()).find(i=>lo.create(i).equals(e))}async updateMetadata(e,n){try{let[o]=await this.galleryService.getExtensions([{id:e.identifier.id,version:e.manifest.version}],n);if(o||([o]=await this.galleryService.getExtensions([{id:e.identifier.id}],n)),o){let i={id:o.identifier.uuid,publisherDisplayName:o.publisherDisplayName,publisherId:o.publisherId,isPreReleaseVersion:o.properties.isPreReleaseVersion,hasPreReleaseVersion:e.hasPreReleaseVersion||o.properties.isPreReleaseVersion,preRelease:o.properties.isPreReleaseVersion||this.options.installPreReleaseVersion};await this.extensionsScanner.updateMetadata(e,i,this.options.profileLocation)}}catch{}}};Sf=w([b(6,Ye),b(7,So),b(8,Bt),b(9,sa),b(10,Cr),b(11,Be),b(12,z)],Sf);vP=class extends hf{constructor(e,n,o){super();this.extension=e;this.options=n;this.extensionsProfileScannerService=o}doRun(e){return this.extensionsProfileScannerService.removeExtensionsFromProfile([this.extension.identifier],this.options.profileLocation)}}});var bP,Cf,SH=v(()=>{bP=class{constructor(t,e){this.key=t;this.data=e;this.incoming=new Map;this.outgoing=new Map}},Cf=class{constructor(t){this._hashFn=t;this._nodes=new Map}roots(){let t=[];for(let e of this._nodes.values())e.outgoing.size===0&&t.push(e);return t}insertEdge(t,e){let n=this.lookupOrInsertNode(t),o=this.lookupOrInsertNode(e);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(t){let e=this._hashFn(t);this._nodes.delete(e);for(let n of this._nodes.values())n.outgoing.delete(e),n.incoming.delete(e)}lookupOrInsertNode(t){let e=this._hashFn(t),n=this._nodes.get(e);return n||(n=new bP(e,t),this._nodes.set(e,n)),n}lookup(t){return this._nodes.get(this._hashFn(t))}isEmpty(){return this._nodes.size===0}toString(){let t=[];for(let[e,n]of this._nodes)t.push(`${e}
(-> incoming)[${[...n.incoming.keys()].join(", ")}]
(outgoing ->)[${[...n.outgoing.keys()].join(",")}]
`);return t.join(`
`)}findCycleSlow(){for(let[t,e]of this._nodes){let n=new Set([t]),o=this._findCycle(e,n);if(o)return o}}_findCycle(t,e){for(let[n,o]of t.outgoing){if(e.has(n))return[...e,n].join(" -> ");e.add(n);let i=this._findCycle(o,e);if(i)return i;e.delete(n)}}}});var eQ,db,Zu,Ef,SP=v(()=>{Ue();xe();Q();Hg();SH();Z();Gv();xv();eQ=!1,db=class extends Error{constructor(t){super("cyclic dependency between services"),this.message=t.findCycleSlow()??`UNABLE to detect cycle, dumping graph:
${t.toString()}`}},Zu=class r{constructor(t=new sl,e=!1,n,o=eQ){this._services=t;this._strict=e;this._parent=n;this._enableTracing=o;this._isDisposed=!1;this._servicesToMaybeDispose=new Set;this._children=new Set;this._activeInstantiations=new Set;this._services.set(Hn,this),this._globalGraph=o?n?._globalGraph??new Cf(i=>i):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,hn(this._children),this._children.clear();for(let t of this._servicesToMaybeDispose)bv(t)&&t.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(t,e){this._throwIfDisposed();let n=this,o=new class extends r{dispose(){n._children.delete(o),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(o),e?.add(o),o}invokeFunction(t,...e){this._throwIfDisposed();let n=Ef.traceInvocation(this._enableTracing,t),o=!1;try{return t({get:s=>{if(o)throw fv("service accessor is only valid during the invocation of its target method");let a=this._getOrCreateServiceInstance(s,n);return a||this._throwIfStrict(`[invokeFunction] unknown service '${s}'`,!1),a}},...e)}finally{o=!0,n.stop()}}createInstance(t,...e){this._throwIfDisposed();let n,o;return t instanceof ht?(n=Ef.traceCreation(this._enableTracing,t.ctor),o=this._createInstance(t.ctor,t.staticArguments.concat(e),n)):(n=Ef.traceCreation(this._enableTracing,t),o=this._createInstance(t,e,n)),n.stop(),o}_createInstance(t,e=[],n){let o=_i.getServiceDependencies(t).sort((a,l)=>a.index-l.index),i=[];for(let a of o){let l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${t.name} depends on UNKNOWN service ${a.id}.`,!1),i.push(l)}let s=o.length>0?o[0].index:e.length;if(e.length!==s){console.trace(`[createInstance] First service dependency of ${t.name} at position ${s+1} conflicts with ${e.length} static arguments`);let a=s-e.length;a>0?e=e.concat(new Array(a)):e=e.slice(0,s)}return Reflect.construct(t,e.concat(i))}_setCreatedServiceInstance(t,e){if(this._services.get(t)instanceof ht)this._services.set(t,e);else if(this._parent)this._parent._setCreatedServiceInstance(t,e);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(t){let e=this._services.get(t);return!e&&this._parent?this._parent._getServiceInstanceOrDescriptor(t):e}_getOrCreateServiceInstance(t,e){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(t));let n=this._getServiceInstanceOrDescriptor(t);return n instanceof ht?this._safeCreateAndCacheServiceInstance(t,n,e.branch(t,!0)):(e.branch(t,!1),n)}_safeCreateAndCacheServiceInstance(t,e,n){if(this._activeInstantiations.has(t))throw new Error(`illegal state - RECURSIVELY instantiating service '${t}'`);this._activeInstantiations.add(t);try{return this._createAndCacheServiceInstance(t,e,n)}finally{this._activeInstantiations.delete(t)}}_createAndCacheServiceInstance(t,e,n){let o=new Cf(l=>l.id.toString()),i=0,s=[{id:t,desc:e,_trace:n}],a=new Set;for(;s.length;){let l=s.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),o.lookupOrInsertNode(l),i++>1e3)throw new db(o);for(let c of _i.getServiceDependencies(l.desc.ctor)){let u=this._getServiceInstanceOrDescriptor(c.id);if(u||this._throwIfStrict(`[createInstance] ${t} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),u instanceof ht){let p={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,p),s.push(p)}}}}for(;;){let l=o.roots();if(l.length===0){if(!o.isEmpty())throw new db(o);break}for(let{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof ht){let p=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,p)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(t)}_createServiceInstanceWithOwner(t,e,n=[],o,i){if(this._services.get(t)instanceof ht)return this._createServiceInstance(t,e,n,o,i,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(t,e,n,o,i);throw new Error(`illegalState - creating UNKNOWN service instance ${e.name}`)}_createServiceInstance(t,e,n=[],o,i,s){if(o){let a=new r(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(t);let l=new Map,c=new Dv(()=>{let u=a._createInstance(e,n,i);for(let[p,m]of l){let g=u[p];if(typeof g=="function")for(let y of m)y.disposable=g.apply(u,y.listener)}return l.clear(),s.add(u),u});return new Proxy(Object.create(null),{get(u,p){if(!c.isInitialized&&typeof p=="string"&&(p.startsWith("onDid")||p.startsWith("onWill"))){let y=l.get(p);return y||(y=new qa,l.set(p,y)),(I,x,E)=>{if(c.isInitialized)return c.value[p](I,x,E);{let T={listener:[I,x,E],disposable:void 0},P=y.push(T);return se(()=>{P(),T.disposable?.dispose()})}}}if(p in u)return u[p];let m=c.value,g=m[p];return typeof g!="function"||(g=g.bind(m),u[p]=g),g},set(u,p,m){return c.value[p]=m,!0},getPrototypeOf(u){return e.prototype}})}else{let a=this._createInstance(e,n,i);return s.add(a),a}}_throwIfStrict(t,e){if(e&&console.warn(t),this._strict)throw new Error(t)}},Ef=class r{constructor(t,e){this.type=t;this.name=e;this._start=Date.now();this._dep=[]}static{this.all=new Set}static{this._None=new class extends r{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(t,e){return t?new r(2,e.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):r._None}static traceCreation(t,e){return t?new r(1,e.name):r._None}static{this._totals=0}branch(t,e){let n=new r(3,t.toString());return this._dep.push([t,e,n]),n}stop(){let t=Date.now()-this._start;r._totals+=t;let e=!1;function n(i,s){let a=[],l=new Array(i+1).join(" ");for(let[c,u,p]of s._dep)if(u&&p){e=!0,a.push(`${l}CREATES -> ${c}`);let m=n(i+1,p);m&&a.push(m)}else a.push(`${l}uses -> ${c}`);return a.join(`
`)}let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${r._totals.toFixed(2)}ms)`];(t>2||e)&&r.all.add(o.join(`
`))}}});async function pb(r,t,e,n,o,i){let s;try{await tQ(r,t,e,n,o,i)}catch(a){s=a}finally{s&&o.errorTransformer&&(s=o.errorTransformer(s)),typeof s<"u"&&e.error(s),e.end()}}async function tQ(r,t,e,n,o,i){xP(i);let s=await r.open(t,{create:!1});try{xP(i);let a=0,l=0,c=o&&typeof o.length=="number"?o.length:void 0,u=O.alloc(Math.min(o.bufferSize,typeof c=="number"?c:o.bufferSize)),p=o&&typeof o.position=="number"?o.position:0,m=0;do l=await r.read(s,p,u.buffer,m,u.byteLength-m),p+=l,m+=l,a+=l,typeof c=="number"&&(c-=l),m===u.byteLength&&(await e.write(n(u)),u=O.alloc(Math.min(o.bufferSize,typeof c=="number"?c:o.bufferSize)),m=0);while(l>0&&(typeof c!="number"||c>0)&&xP(i)&&nQ(a,o));m>0&&e.write(n(u.slice(0,m)))}catch(a){throw ta(a)}finally{await r.close(s)}}function xP(r){if(r.isCancellationRequested)throw pg();return!0}function nQ(r,t){if(typeof t?.limits?.size=="number"&&r>t.limits.size)throw Do(d(4466,null),"EntryTooLarge");return!0}var CP=v(()=>{Ve();xe();ee();st()});var vs,wP=v(()=>{Dt();Ue();Ve();Jt();ue();Mi();ri();Q();zg();Me();Xr();it();Xa();ee();st();CP();De();xe();vs=class extends D{constructor(e){super();this.logService=e;this.BUFFER_SIZE=256*1024;this._onDidChangeFileSystemProviderRegistrations=this._register(new R);this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event;this._onWillActivateFileSystemProvider=this._register(new R);this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event;this._onDidChangeFileSystemProviderCapabilities=this._register(new R);this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event;this.provider=new Map;this._onDidRunOperation=this._register(new R);this.onDidRunOperation=this._onDidRunOperation.event;this.internalOnDidFilesChange=this._register(new R);this._onDidUncorrelatedFilesChange=this._register(new R);this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event;this._onDidWatchError=this._register(new R);this.onDidWatchError=this._onDidWatchError.event;this.activeWatchers=new Map;this.writeQueue=this._register(new eu)}registerProvider(e,n){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);qt(`code/registerFilesystem/${e}`);let o=new re;return this.provider.set(e,n),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:n}),o.add(n.onDidChangeFile(i=>{let s=new lI(i,!this.isPathCaseSensitive(n));this.internalOnDidFilesChange.fire(s),s.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(s)})),typeof n.onDidWatchError=="function"&&o.add(n.onDidWatchError(i=>this._onDidWatchError.fire(new Error(i)))),o.add(n.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:n,scheme:e}))),se(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:n}),this.provider.delete(e),hn(o)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){let n=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(o){n.push(o)}}),!this.provider.has(e)&&await Pn.settled(n)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,n){let o=this.provider.get(e.scheme);return!!(o&&o.capabilities&n)}listCapabilities(){return sn.map(this.provider,([e,n])=>({scheme:e,capabilities:n.capabilities}))}async withProvider(e){if(!JO(e))throw new kn(d(4455,null,this.resourceForError(e)),8);await this.activateProvider(e.scheme);let n=this.provider.get(e.scheme);if(!n){let o=new eo;throw o.message=d(4457,null,e.toString()),o}return n}async withReadProvider(e){let n=await this.withProvider(e);if(ea(n)||Hr(n)||cI(n))return n;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){let n=await this.withProvider(e);if(ea(n)||Hr(n))return n;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,n){try{return await this.doResolveFile(e,n)}catch(o){throw cl(o)==="EntryNotFound"?new kn(d(4452,null,this.resourceForError(e)),1):ta(o)}}async doResolveFile(e,n){let o=await this.withProvider(e),i=this.isPathCaseSensitive(o),s=n?.resolveTo,a=n?.resolveSingleChildDescendants,l=n?.resolveMetadata,c=await o.stat(e),u;return this.toFileStat(o,e,c,void 0,!!l,(p,m)=>(u||(u=Li.forUris(()=>!i),u.set(e,!0),s&&u.fill(!0,s)),u.get(p.resource)||u.findSuperstr(p.resource.with({query:null,fragment:null}))?!0:p.isDirectory&&a?m===1:!1))}async toFileStat(e,n,o,i,s,a){let{providerExtUri:l}=this.getExtUri(e),c={resource:n,name:l.basename(n),isFile:(o.type&1)!==0,isDirectory:(o.type&2)!==0,isSymbolicLink:(o.type&64)!==0,mtime:o.mtime,ctime:o.ctime,size:o.size,readonly:!!((o.permissions??0)&1)||!!(e.capabilities&2048),locked:!!((o.permissions??0)&2),executable:!!((o.permissions??0)&4),etag:sT({mtime:o.mtime,size:o.size}),children:void 0};if(c.isDirectory&&a(c,i)){try{let u=await e.readdir(n),p=await Pn.settled(u.map(async([m,g])=>{try{let y=l.joinPath(n,m),h=s?await e.stat(y):{type:g};return await this.toFileStat(e,y,h,u.length,s,a)}catch(y){return this.logService.trace(y),null}}));c.children=Zo(p)}catch(u){this.logService.trace(u),c.children=[]}return c}return c}async resolveAll(e){return Pn.settled(e.map(async n=>{try{return{stat:await this.doResolveFile(n.resource,n.options),success:!0}}catch(o){return wt(o)!==1&&this.logService.trace(o),{stat:void 0,success:!1}}}))}async stat(e){let n=await this.withProvider(e),o=await n.stat(e);return this.toFileStat(n,e,o,void 0,!0,()=>!1)}async realpath(e){let n=await this.withProvider(e);if(aN(n)){let o=await n.realpath(e);return e.with({path:o})}}async exists(e){let n=await this.withProvider(e);try{return!!await n.stat(e)}catch{return!1}}async canCreateFile(e,n){try{await this.doValidateCreateFile(e,n)}catch(o){return o}return!0}async doValidateCreateFile(e,n){if(!n?.overwrite&&await this.exists(e))throw new kn(d(4448,null,this.resourceForError(e)),3,n)}async createFile(e,n=O.fromString(""),o){await this.doValidateCreateFile(e,o);let i=await this.writeFile(e,n);return this._onDidRunOperation.fire(new Zs(e,0,i)),i}async writeFile(e,n,o){let i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:s}=this.getExtUri(i),a=o;if(rT(i)&&!a?.atomic){let l=i.enforceAtomicWriteFile?.(e);l&&(a={...o,atomic:l})}try{let{stat:l,buffer:c}=await this.validateWriteFile(i,e,n,a);l||await this.mkdirp(i,s.dirname(e)),c||(c=await this.peekBufferForWriting(i,n)),!ea(i)||Hr(i)&&c instanceof O||Hr(i)&&rT(i)&&a?.atomic?await this.doWriteUnbuffered(i,e,a,c):await this.doWriteBuffered(i,e,a,c instanceof O?xU(c):c),this._onDidRunOperation.fire(new Zs(e,4))}catch(l){throw new kn(d(4447,null,this.resourceForError(e),ta(l).toString()),wt(l),a)}return this.resolve(e,{resolveMetadata:!0})}async peekBufferForWriting(e,n){let o;if(Hr(e)&&!(n instanceof O))if(kg(n)){let i=await fU(n,3);i.ended?o=O.concat(i.buffer):o=i}else o=gU(n,i=>O.concat(i),3);else o=n;return o}async validateWriteFile(e,n,o,i){let s=!!i?.unlock;if(s&&!(e.capabilities&8192))throw new Error(d(4465,null,this.resourceForError(n)));if(i?.append&&!iN(e))throw new kn(d(4444,null,this.resourceForError(n)),6);if(!!i?.atomic){if(!(e.capabilities&32768))throw new Error(d(4463,null,this.resourceForError(n)));if(!(e.capabilities&2))throw new Error(d(4464,null,this.resourceForError(n)));if(s)throw new Error(d(4462,null,this.resourceForError(n)))}let l;try{l=await e.stat(n)}catch{return Object.create(null)}if((l.type&2)!==0)throw new kn(d(4450,null,this.resourceForError(n)),0,i);this.throwIfFileIsReadonly(n,l);let c;if(typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==uI&&typeof l.mtime=="number"&&typeof l.size=="number"&&i.mtime<l.mtime&&i.etag!==sT({mtime:i.mtime,size:l.size})){if(c=await this.peekBufferForWriting(e,o),c instanceof O&&c.byteLength===l.size)try{let{value:u}=await this.readFile(n,{limits:{size:l.size}});if(c.equals(u))return{stat:l,buffer:c}}catch{}throw new kn(d(4451,null),3,i)}return{stat:l,buffer:c}}async readFile(e,n,o){let i=await this.withReadProvider(e);return n?.atomic?this.doReadFileAtomic(i,e,n,o):this.doReadFile(i,e,n,o)}async doReadFileAtomic(e,n,o,i){return new Promise((s,a)=>{this.writeQueue.queueFor(n,async()=>{try{let l=await this.doReadFile(e,n,o,i);s(l)}catch(l){a(l)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,n,o,i){let s=await this.doReadFileStream(e,n,{...o,preferUnbuffered:!0},i);return{...s,value:await Ir(s.value)}}async readFileStream(e,n,o){let i=await this.withReadProvider(e);return this.doReadFileStream(i,e,n,o)}async doReadFileStream(e,n,o,i){let s=new _t(i),a=o;dI(e)&&e.enforceAtomicReadFile?.(n)&&(a={...o,atomic:!0});let l=this.validateReadFile(n,a).then(u=>u,u=>{throw s.dispose(!0),u}),c;try{return typeof a?.etag=="string"&&a.etag!==uI&&await l,a?.atomic&&dI(e)||!(ea(e)||cI(e))||Hr(e)&&a?.preferUnbuffered?c=this.readFileUnbuffered(e,n,a):cI(e)?c=this.readFileStreamed(e,n,s.token,a):c=this.readFileBuffered(e,n,s.token,a),c.on("end",()=>s.dispose()),c.on("error",()=>s.dispose()),{...await l,value:c}}catch(u){throw s.dispose(!0),c&&await Fv(c),this.restoreReadError(u,n,a)}}restoreReadError(e,n,o){let i=d(4445,null,this.resourceForError(n),ta(e).toString());return e instanceof vu?new vu(i,e.stat,o):e instanceof yu?new yu(i,e.fileOperationResult,e.size,e.options):new kn(i,wt(e),o)}readFileStreamed(e,n,o,i=Object.create(null)){let s=e.readFileStream(n,i,o);return Hv(s,{data:a=>a instanceof O?a:O.wrap(a),error:a=>this.restoreReadError(a,n,i)},a=>O.concat(a))}readFileBuffered(e,n,o,i=Object.create(null)){let s=wU();return pb(e,n,s,a=>a,{...i,bufferSize:this.BUFFER_SIZE,errorTransformer:a=>this.restoreReadError(a,n,i)},o),s}readFileUnbuffered(e,n,o){let i=zs(s=>O.concat(s));return(async()=>{try{let s;o?.atomic&&dI(e)?s=await e.readFile(n,{atomic:!0}):s=await e.readFile(n),typeof o?.position=="number"&&(s=s.slice(o.position)),typeof o?.length=="number"&&(s=s.slice(0,o.length)),this.validateReadFileLimits(n,s.byteLength,o),i.end(O.wrap(s))}catch(s){i.error(s),i.end()}})(),i}async validateReadFile(e,n){let o=await this.resolve(e,{resolveMetadata:!0});if(o.isDirectory)throw new kn(d(4449,null,this.resourceForError(e)),0,n);if(typeof n?.etag=="string"&&n.etag!==uI&&n.etag===o.etag)throw new vu(d(4453,null),o,n);return this.validateReadFileLimits(e,o.size,n),o}validateReadFileLimits(e,n,o){if(typeof o?.limits?.size=="number"&&n>o.limits.size)throw new yu(d(4454,null,this.resourceForError(e)),7,n,o)}async canMove(e,n,o){return this.doCanMoveCopy(e,n,"move",o)}async canCopy(e,n,o){return this.doCanMoveCopy(e,n,"copy",o)}async doCanMoveCopy(e,n,o,i){if(e.toString()!==n.toString())try{let s=o==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),a=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n);await this.doValidateMoveCopy(s,e,a,n,o,i)}catch(s){return s}return!0}async move(e,n,o,i){let s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),a=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n),l=await this.doMoveCopy(s,e,a,n,"move",!!o,i?.atomic),c=await this.resolve(n,{resolveMetadata:!0});return this._onDidRunOperation.fire(new Zs(e,l==="move"?2:3,c)),c}async copy(e,n,o){let i=await this.withReadProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n),a=await this.doMoveCopy(i,e,s,n,"copy",!!o),l=await this.resolve(n,{resolveMetadata:!0});return this._onDidRunOperation.fire(new Zs(e,a==="copy"?3:2,l)),l}async doMoveCopy(e,n,o,i,s,a,l=!1){if(n.toString()===i.toString())return s;if(l&&e!==o)throw new Error(d(4435,null));let c=l&&cN(e)?e:void 0;if(l&&!c)throw new Error(d(4438,null));let{exists:u,isSameResourceWithDifferentPathCase:p,targetStat:m}=await this.doValidateMoveCopy(e,n,o,i,s,a,l);if(l){if(!((await e.stat(n)).type&1))throw new Error(d(4436,null));if(m&&!(m.type&1))throw new Error(d(4437,null))}u&&!p&&a&&!l&&await this.del(i,{recursive:!0});let{providerExtUri:g}=this.getExtUri(o);if((!l||!g.isEqual(g.dirname(n),g.dirname(i)))&&await this.mkdirp(o,g.dirname(i)),s==="copy"){if(e===o&&oT(e))await e.copy(n,i,{overwrite:a});else{let y=await this.resolve(n);y.isDirectory?await this.doCopyFolder(e,y,o,i):await this.doCopyFile(e,n,o,i)}return s}else return e===o?(c?await c.renameFileAtomic(n,i,{overwrite:a}):await e.rename(n,i,{overwrite:a}),s):(await this.doMoveCopy(e,n,o,i,"copy",a),await this.del(n,{recursive:!0}),"copy")}async doCopyFile(e,n,o,i){if(ea(e)&&ea(o))return this.doPipeBuffered(e,n,o,i);if(ea(e)&&Hr(o))return this.doPipeBufferedToUnbuffered(e,n,o,i);if(Hr(e)&&ea(o))return this.doPipeUnbufferedToBuffered(e,n,o,i);if(Hr(e)&&Hr(o))return this.doPipeUnbuffered(e,n,o,i)}async doCopyFolder(e,n,o,i){await o.mkdir(i),Array.isArray(n.children)&&await Pn.settled(n.children.map(async s=>{let a=this.getExtUri(o).providerExtUri.joinPath(i,s.name);return s.isDirectory?this.doCopyFolder(e,await this.resolve(s.resource),o,a):this.doCopyFile(e,s.resource,o,a)}))}async doValidateMoveCopy(e,n,o,i,s,a,l=!1){let c=!1;if(e===o){let{providerExtUri:m,isPathCaseSensitive:g}=this.getExtUri(e);if(g||(c=m.isEqual(n,i)),c&&s==="copy")throw new Error(d(4458,null,this.resourceForError(n),this.resourceForError(i)));if(!c&&m.isEqualOrParent(i,n))throw new Error(d(4459,null,this.resourceForError(n),this.resourceForError(i)))}let u;if(l)try{u=await o.stat(i)}catch(m){if(cl(m)!=="EntryNotFound")throw m}let p=l?!!u:await this.exists(i);if(p&&!c){if(!a)throw new kn(d(4460,null,this.resourceForError(n),this.resourceForError(i)),4);if(e===o){let{providerExtUri:m}=this.getExtUri(e);if(m.isEqualOrParent(n,i))throw new Error(d(4461,null,this.resourceForError(n),this.resourceForError(i)))}}return{exists:p,isSameResourceWithDifferentPathCase:c,targetStat:u}}getExtUri(e){let n=this.isPathCaseSensitive(e);return{providerExtUri:n?gt:fR,isPathCaseSensitive:n}}isPathCaseSensitive(e){return!!(e.capabilities&1024)}async createFolder(e){let n=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(n,e);let o=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new Zs(e,0,o)),o}async mkdirp(e,n){let o=[],{providerExtUri:i}=this.getExtUri(e);for(;!i.isEqual(n,i.dirname(n));)try{if(((await e.stat(n)).type&2)===0)throw new Error(d(4456,null,this.resourceForError(n)));break}catch(s){if(cl(s)!=="EntryNotFound")throw s;o.push(i.basename(n)),n=i.dirname(n)}for(let s=o.length-1;s>=0;s--){n=i.joinPath(n,o[s]);try{await e.mkdir(n)}catch(a){if(cl(a)!=="EntryExists")throw a}}}async canDelete(e,n){try{await this.doValidateDelete(e,n)}catch(o){return o}return!0}async doValidateDelete(e,n){let o=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),i=!!n?.useTrash;if(i&&!(o.capabilities&4096))throw new Error(d(4443,null,this.resourceForError(e)));let s=n?.atomic;if(s&&!(o.capabilities&65536))throw new Error(d(4439,null,this.resourceForError(e)));if(i&&s)throw new Error(d(4442,null,this.resourceForError(e)));let a;try{a=await o.stat(e)}catch{}if(a)this.throwIfFileIsReadonly(e,a);else throw new kn(d(4441,null,this.resourceForError(e)),1);if(!!!n?.recursive){let c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(d(4440,null,this.resourceForError(e)))}return o}async del(e,n){let o=await this.doValidateDelete(e,n),i=n;if(lN(o)&&!i?.atomic){let c=o.enforceAtomicDelete?.(e);c&&(i={...n,atomic:c})}let s=!!i?.useTrash,a=!!i?.recursive,l=i?.atomic??!1;await o.delete(e,{recursive:a,useTrash:s,atomic:l}),this._onDidRunOperation.fire(new Zs(e,1))}async cloneFile(e,n){let o=await this.withProvider(e),i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n);if(!(o===i&&this.getExtUri(o).providerExtUri.isEqual(e,n)))return o===i&&sN(o)?o.cloneFile(e,n):(await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),o===i&&oT(o)?this.writeQueue.queueFor(e,()=>o.copy(e,n,{overwrite:!0}),this.getExtUri(o).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(o,e,i,n),this.getExtUri(o).providerExtUri))}static{this.WATCHER_CORRELATION_IDS=0}createWatcher(e,n){return this.watch(e,{...n,correlationId:vs.WATCHER_CORRELATION_IDS++})}watch(e,n={recursive:!1,excludes:[]}){let o=new re,i=!1,s=()=>{i=!0};o.add(se(()=>s())),(async()=>{try{let l=await this.doWatch(e,n);i?hn(l):s=()=>hn(l)}catch(l){this.logService.error(l)}})();let a=n.correlationId;if(typeof a=="number"){let l=o.add(new R);return o.add(this.internalOnDidFilesChange.event(u=>{u.correlates(a)&&l.fire(u)})),{onDidChange:l.event,dispose:()=>o.dispose()}}return o}async doWatch(e,n){let o=await this.withProvider(e),i=Fr([this.getExtUri(o).providerExtUri.getComparisonKey(e),n]),s=this.activeWatchers.get(i);return s||(s={count:0,disposable:o.watch(e,n)},this.activeWatchers.set(i,s)),s.count+=1,se(()=>{s&&(s.count--,s.count===0&&(hn(s.disposable),this.activeWatchers.delete(i)))})}dispose(){super.dispose();for(let[,e]of this.activeWatchers)hn(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,n,o,i){return this.writeQueue.queueFor(n,async()=>{let s=await e.open(n,{create:!0,unlock:o?.unlock??!1,append:o?.append??!1});try{kg(i)||Nv(i)?await this.doWriteStreamBufferedQueued(e,s,i):await this.doWriteReadableBufferedQueued(e,s,i)}catch(a){throw ta(a)}finally{await e.close(s)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,n,o){let i=0,s;if(Nv(o)){if(o.buffer.length>0){let a=O.concat(o.buffer);await this.doWriteBuffer(e,n,a,a.byteLength,i,0),i+=a.byteLength}if(o.ended)return;s=o.stream}else s=o;return new Promise((a,l)=>{let c=Promise.resolve(),u=!1,p,m=g=>{u=!0,p??=g,c.then(()=>p?l(p):a(),y=>l(p??y))};Ya(s,{onData:g=>{u||(s.pause(),c=c.then(async()=>{await this.doWriteBuffer(e,n,g,g.byteLength,i,0),i+=g.byteLength,setTimeout(()=>{u||s.resume()})}),c.catch(m))},onError:m,onEnd:m})})}async doWriteReadableBufferedQueued(e,n,o){let i=0,s;for(;(s=o.read())!==null;)await this.doWriteBuffer(e,n,s,s.byteLength,i,0),i+=s.byteLength}async doWriteBuffer(e,n,o,i,s,a){let l=0;for(;l<i;){let c=await e.write(n,s+l,o.buffer,a+l,i-l);l+=c}}async doWriteUnbuffered(e,n,o,i){return this.writeQueue.queueFor(n,()=>this.doWriteUnbufferedQueued(e,n,o,i),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,n,o,i){let s;i instanceof O?s=i:kg(i)?s=await Ir(i):Nv(i)?s=await CU(i):s=SU(i),await e.writeFile(n,s.buffer,{create:!0,overwrite:!0,unlock:o?.unlock??!1,atomic:o?.atomic??!1,append:o?.append??!1})}async doPipeBuffered(e,n,o,i){return this.writeQueue.queueFor(i,()=>this.doPipeBufferedQueued(e,n,o,i),this.getExtUri(o).providerExtUri)}async doPipeBufferedQueued(e,n,o,i){let s,a;try{s=await e.open(n,{create:!1}),a=await o.open(i,{create:!0,unlock:!1});let l=O.alloc(this.BUFFER_SIZE),c=0,u=0,p=0;do p=await e.read(s,c,l.buffer,u,l.byteLength-u),await this.doWriteBuffer(o,a,l,p,c,u),c+=p,u+=p,u===l.byteLength&&(u=0);while(p>0)}catch(l){throw ta(l)}finally{await Pn.settled([typeof s=="number"?e.close(s):Promise.resolve(),typeof a=="number"?o.close(a):Promise.resolve()])}}async doPipeUnbuffered(e,n,o,i){return this.writeQueue.queueFor(i,()=>this.doPipeUnbufferedQueued(e,n,o,i),this.getExtUri(o).providerExtUri)}async doPipeUnbufferedQueued(e,n,o,i){return o.writeFile(i,await e.readFile(n),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,n,o,i){return this.writeQueue.queueFor(i,()=>this.doPipeUnbufferedToBufferedQueued(e,n,o,i),this.getExtUri(o).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,n,o,i){let s=await o.open(i,{create:!0,unlock:!1});try{let a=await e.readFile(n);await this.doWriteBuffer(o,s,O.wrap(a),a.byteLength,0,0)}catch(a){throw ta(a)}finally{await o.close(s)}}async doPipeBufferedToUnbuffered(e,n,o,i){let s=await Ir(this.readFileBuffered(e,n,Ae.None));await this.doWriteUnbuffered(o,i,void 0,s)}throwIfFileSystemIsReadonly(e,n){if(e.capabilities&2048)throw new kn(d(4446,null,this.resourceForError(n)),6);return e}throwIfFileIsReadonly(e,n){if((n.permissions??0)&1)throw new kn(d(4446,null,this.resourceForError(e)),6)}resourceForError(e){return e.scheme===q.file?e.fsPath:e.toString(!0)}};vs=w([b(0,z)],vs)});function EH(r,t){switch(r){case 0:return"";case 1:return`${gb}*?`;default:return`(?:${mb}|${gb}+${mb}${t?`|${mb}${gb}+`:""})*?`}}function wH(r,t){if(!r)return[];let e=[],n=!1,o=!1,i="";for(let s of r){switch(s){case t:if(!n&&!o){e.push(i),i="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}i+=s}return i&&e.push(i),e}function AH(r){if(!r)return"";let t="",e=wH(r,CH);if(e.every(n=>n===ep))t=".*";else{let n=!1;e.forEach((o,i)=>{if(o===ep){if(n)return;t+=EH(2,i===e.length-1)}else{let s=!1,a="",l=!1,c="";for(let u of o){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let p;u==="-"?p=u:(u==="^"||u==="!")&&!c?p="^":u===CH?p="":p=yo(u),c+=p;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{let m=`(?:${wH(a,",").map(g=>AH(g)).join("|")})`;t+=m,s=!1,a="";break}case"]":{t+="["+c+"]",l=!1,c="";break}case"?":t+=gb;continue;case"*":t+=EH(1);continue;default:t+=yo(u)}}i<e.length-1&&(e[i+1]!==ep||i+2<e.length)&&(t+=mb)}n=o===ep})}return t}function TP(r,t,e){if(!r)return Is;let n;typeof r!="string"?n=r.pattern:n=r,n=n.trim();let o=t.ignoreCase??!1,i={...t,equals:o?Po:(c,u)=>c===u,endsWith:o?DO:(c,u)=>c.endsWith(u),isEqualOrParent:(c,u)=>tr(c,u,t.ignoreCase??!Ke)},s=`${e===void 0?`default:${o?n.toLowerCase():n}`:`custom:${e}`}_${!!t.trimForExclusions}_${o}`,a=RH.get(s);if(a)return PH(a,r,i);let l;return iQ.test(n)?a=uQ(n.substring(4),n,i):(l=sQ.exec(RP(n,i)))?a=pQ(l[1],n,i):(t.trimForExclusions?lQ:aQ).test(n)?a=mQ(n,i):(l=cQ.exec(RP(n,i)))?a=kH(l[1].substring(1),n,!0,i):(l=dQ.exec(RP(n,i)))?a=kH(l[1],n,!1,i):a=gQ(n,i),RH.set(s,a),PH(a,r,i)}function PH(r,t,e){if(typeof t=="string")return r;let n=function(o,i){return e.isEqualOrParent(o,t.base)?r(oR(o.substring(t.base.length),wn),i):null};return n.allBasenames=r.allBasenames,n.allPaths=r.allPaths,n.basenames=r.basenames,n.patterns=r.patterns,n}function RP(r,t){return t.trimForExclusions&&r.endsWith("/**")?r.substring(0,r.length-2):r}function uQ(r,t,e){return function(n,o){return typeof n=="string"&&e.endsWith(n,r)?t:null}}function pQ(r,t,e){let n=`/${r}`,o=`\\${r}`,i=function(a,l){return typeof a!="string"?null:l?e.equals(l,r)?t:null:e.equals(a,r)||e.endsWith(a,n)||e.endsWith(a,o)?t:null},s=[r];return i.basenames=s,i.patterns=[t],i.allBasenames=s,i}function mQ(r,t){let e=_H(r.slice(1,-1).split(",").map(a=>TP(a,t)).filter(a=>a!==Is),r,t.ignoreCase),n=e.length;if(!n)return Is;if(n===1)return e[0];let o=function(a,l){for(let c=0,u=e.length;c<u;c++)if(e[c](a,l))return r;return null},i=e.find(a=>!!a.allBasenames);i&&(o.allBasenames=i.allBasenames);let s=e.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function kH(r,t,e,n){let o=wn===ze.sep,i=o?r:r.replace(rQ,wn),s=wn+i,a=ze.sep+r,l;return e?l=function(c,u){return typeof c=="string"&&(n.equals(c,i)||n.endsWith(c,s)||!o&&(n.equals(c,r)||n.endsWith(c,a)))?t:null}:l=function(c,u){return typeof c=="string"&&(n.equals(c,i)||!o&&n.equals(c,r))?t:null},l.allPaths=[(e?"*/":"./")+r],l}function gQ(r,t){try{let e=new RegExp(`^${AH(r)}$`,t.ignoreCase?"i":void 0);return function(n){return e.lastIndex=0,typeof n=="string"&&e.test(n)?r:null}}catch{return Is}}function PP(r,t={}){if(!r)return TH;if(typeof r=="string"||DH(r)){let e=TP(r,t);if(e===Is)return TH;let n=function(o,i){return!!e(o,i)};return e.allBasenames&&(n.allBasenames=e.allBasenames),e.allPaths&&(n.allPaths=e.allPaths),n}return fQ(r,t)}function DH(r){let t=r;return t?typeof t.base=="string"&&typeof t.pattern=="string":!1}function fQ(r,t){let e=_H(Object.getOwnPropertyNames(r).map(a=>hQ(a,r[a],t)).filter(a=>a!==Is),void 0,t.ignoreCase),n=e.length;if(!n)return Is;if(!e.some(a=>!!a.requiresSiblings)){if(n===1)return e[0];let a=function(u,p){let m;for(let g=0,y=e.length;g<y;g++){let h=e[g](u,p);if(typeof h=="string")return h;wg(h)&&(m||(m=[]),m.push(h))}return m?(async()=>{for(let g of m){let y=await g;if(typeof y=="string")return y}return null})():null},l=e.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);let c=e.reduce((u,p)=>p.allPaths?u.concat(p.allPaths):u,[]);return c.length&&(a.allPaths=c),a}let o=function(a,l,c){let u,p;for(let m=0,g=e.length;m<g;m++){let y=e[m];y.requiresSiblings&&c&&(l||(l=Ze(a)),u||(u=l.substring(0,l.length-ki(a).length)));let h=y(a,l,u,c);if(typeof h=="string")return h;wg(h)&&(p||(p=[]),p.push(h))}return p?(async()=>{for(let m of p){let g=await m;if(typeof g=="string")return g}return null})():null},i=e.find(a=>!!a.allBasenames);i&&(o.allBasenames=i.allBasenames);let s=e.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(o.allPaths=s),o}function hQ(r,t,e){if(t===!1)return Is;let n=TP(r,e,r);if(n===Is)return Is;if(typeof t=="boolean")return n;if(t){let o=t.when;if(typeof o=="string"){let i=(s,a,l,c)=>{if(!c||!n(s,a))return null;let u=o.replace("$(basename)",()=>l),p=c(u);return wg(p)?p.then(m=>m?r:null):p?r:null};return i.requiresSiblings=!0,i}}return n}function _H(r,t,e){let n=r.filter(l=>!!l.basenames);if(n.length<2)return r;let o=n.reduce((l,c)=>{let u=c.basenames;return u?l.concat(u):l},[]),i;if(t){i=[];for(let l=0,c=o.length;l<c;l++)i.push(t)}else i=n.reduce((l,c)=>{let u=c.patterns;return u?l.concat(u):l},[]);let s=function(l,c){if(typeof l!="string")return null;if(!c){let p;for(p=l.length;p>0;p--){let m=l.charCodeAt(p-1);if(m===47||m===92)break}c=l.substring(p)}let u=e?o.findIndex(p=>Po(p,c)):o.indexOf(c);return u!==-1?i[u]:null};s.basenames=o,s.patterns=i,s.allBasenames=o;let a=r.filter(l=>!l.basenames);return a.push(s),a}function kP(r,t){return Gt(r,t,(e,n)=>typeof e=="string"&&typeof n=="string"?e===n:typeof e!="string"&&typeof n!="string"?e.base===n.base&&e.pattern===n.pattern:!1)}var ep,CH,mb,gb,rQ,iQ,sQ,aQ,lQ,cQ,dQ,RH,TH,Is,fb=v(()=>{Dt();Ue();ii();si();fn();Oe();fe();Tt();ep="**",CH="/",mb="[/\\\\]",gb="[^/\\\\]",rQ=/\//g;iQ=/^\*\*\/\*\.[\w\.-]+$/,sQ=/^\*\*\/([\w\.-]+)\/?$/,aQ=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,lQ=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,cQ=/^\*\*((\/[\w\.-]+)+)\/?$/,dQ=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,RH=new ti(1e4),TH=function(){return!1},Is=function(){return null}});function Ib(r){return typeof r.correlationId=="number"}function MH(r){return r.recursive===!0}function bb(r){return r.map(t=>({type:t.type,resource:S.revive(t.resource),cId:t.cId}))}function LH(r){let t=new AP;for(let e of r)t.processEvent(e);return t.coalesce()}function vQ(r,t){return typeof t=="string"&&!t.startsWith(ep)&&!Gn(t)?{base:r,pattern:t}:t}function DP(r,t,e){let n=[];for(let o of t)n.push(PP(vQ(r,o),{ignoreCase:e}));return n}function OH(r,t){if(typeof t=="number")switch(r.type){case 1:return(t&4)===0;case 2:return(t&8)===0;case 0:return(t&2)===0}return!1}function UH(r){if(typeof r=="number"){let t=[];return r&4&&t.push("Added"),r&8&&t.push("Deleted"),r&2&&t.push("Updated"),t.length===0?"<all>":`[${t.join(", ")}]`}return"<none>"}var hb,yb,vb,AP,Bc=v(()=>{fb();Q();Oe();fe();te();st();hb=class r extends D{constructor(e,n,o,i){super();this.onFileChanges=e;this.onLogMessage=n;this.verboseLogging=o;this.options=i;this.watcherDisposables=this._register(new Kn);this.requests=void 0;this.restartCounter=0}static{this.MAX_RESTARTS=5}init(){let e=new re;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(n=>this.onFileChanges(n))),e.add(this.watcher.onDidLogMessage(n=>this.onLogMessage(n))),e.add(this.watcher.onDidError(n=>this.onError(n.error,n.request)))}onError(e,n){this.canRestart(e,n)?this.restartCounter<r.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${e}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${e}`):this.error(e)}canRestart(e,n){return!(!this.options.restartOnError||n||e.indexOf("No space left on device")!==-1||e.indexOf("EMFILE")!==-1)}restart(e){this.restartCounter++,this.init(),this.watch(e)}async watch(e){this.requests=e,await this.watcher?.watch(e)}async setVerboseLogging(e){this.verboseLogging=e,await this.watcher?.setVerboseLogging(e)}error(e){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${e}`})}trace(e){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${e}`})}dispose(){return this.watcher=void 0,super.dispose()}},yb=class extends hb{constructor(t,e,n){super(t,e,n,{type:"node.js",restartOnError:!1})}},vb=class extends hb{constructor(t,e,n){super(t,e,n,{type:"universal",restartOnError:!0})}};AP=class{constructor(){this.coalesced=new Set;this.mapPathToChange=new Map}toKey(t){return Ke?t.resource.fsPath:t.resource.fsPath.toLowerCase()}processEvent(t){let e=this.mapPathToChange.get(this.toKey(t)),n=!1;if(e){let o=e.type,i=t.type;e.resource.fsPath!==t.resource.fsPath&&(t.type===2||t.type===1)?n=!0:o===1&&i===2?(this.mapPathToChange.delete(this.toKey(t)),this.coalesced.delete(e)):o===2&&i===1?e.type=0:o===1&&i===0||(e.type=i)}else n=!0;n&&(this.coalesced.add(t),this.mapPathToChange.set(this.toKey(t),t))}coalesce(){let t=[],e=[];return Array.from(this.coalesced).filter(n=>n.type!==2?(t.push(n),!1):!0).sort((n,o)=>n.resource.fsPath.length-o.resource.fsPath.length).filter(n=>e.some(o=>dN(n.resource.fsPath,o,!Ke))?!1:(e.push(n.resource.fsPath),!0)).concat(t)}}});var Sb,NH=v(()=>{Dt();Ue();xe();ue();si();Q();Oe();Bc();De();Sb=class extends D{constructor(e,n){super();this.logService=e;this.options=n;this._onDidChangeFile=this._register(new R);this.onDidChangeFile=this._onDidChangeFile.event;this._onDidWatchError=this._register(new R);this.onDidWatchError=this._onDidWatchError.event;this.universalWatchRequests=[];this.universalWatchRequestDelayer=this._register(new Or(this.getRefreshWatchersDelay(this.universalWatchRequests.length)));this.nonRecursiveWatchRequests=[];this.nonRecursiveWatchRequestDelayer=this._register(new Or(this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)))}watch(e,n){return n.recursive||this.options?.watcher?.forceUniversal?this.watchUniversal(e,n):this.watchNonRecursive(e,n)}getRefreshWatchersDelay(e){return e>200?500:0}watchUniversal(e,n){let o=this.toWatchRequest(e,n),i=zw(this.universalWatchRequests,o);return this.refreshUniversalWatchers(),se(()=>{i(),this.refreshUniversalWatchers()})}toWatchRequest(e,n){let o={path:this.toWatchPath(e),excludes:n.excludes,includes:n.includes,recursive:n.recursive,filter:n.filter,correlationId:n.correlationId};if(MH(o)){let i=this.options?.watcher?.recursive?.usePolling;i===!0?o.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3:Array.isArray(i)&&i.includes(o.path)&&(o.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3)}return o}refreshUniversalWatchers(){this.universalWatchRequestDelayer.trigger(()=>this.doRefreshUniversalWatchers(),this.getRefreshWatchersDelay(this.universalWatchRequests.length)).catch(e=>pt(e))}doRefreshUniversalWatchers(){return this.universalWatcher||(this.universalWatcher=this._register(this.createUniversalWatcher(e=>this._onDidChangeFile.fire(bb(e)),e=>this.onWatcherLogMessage(e),this.logService.getLevel()===1)),this._register(this.logService.onDidChangeLogLevel(()=>{this.universalWatcher?.setVerboseLogging(this.logService.getLevel()===1)}))),this.universalWatcher.watch(this.universalWatchRequests)}watchNonRecursive(e,n){let o={path:this.toWatchPath(e),excludes:n.excludes,includes:n.includes,recursive:!1,filter:n.filter,correlationId:n.correlationId},i=zw(this.nonRecursiveWatchRequests,o);return this.refreshNonRecursiveWatchers(),se(()=>{i(),this.refreshNonRecursiveWatchers()})}refreshNonRecursiveWatchers(){this.nonRecursiveWatchRequestDelayer.trigger(()=>this.doRefreshNonRecursiveWatchers(),this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)).catch(e=>pt(e))}doRefreshNonRecursiveWatchers(){return this.nonRecursiveWatcher||(this.nonRecursiveWatcher=this._register(this.createNonRecursiveWatcher(e=>this._onDidChangeFile.fire(bb(e)),e=>this.onWatcherLogMessage(e),this.logService.getLevel()===1)),this._register(this.logService.onDidChangeLogLevel(()=>{this.nonRecursiveWatcher?.setVerboseLogging(this.logService.getLevel()===1)}))),this.nonRecursiveWatcher.watch(this.nonRecursiveWatchRequests)}onWatcherLogMessage(e){e.type==="error"&&this._onDidWatchError.fire(e.message),this.logWatcherMessage(e)}logWatcherMessage(e){this.logService[e.type](e.message)}toFilePath(e){return Fn(e.fsPath)}toWatchPath(e){let n=this.toFilePath(e);return NO(n)}}});var FH=v(()=>{Ie();Q();Jt()});function ct(r,t,e){let n=null,o=null;if(typeof e.value=="function"?(n="value",o=e.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof e.get=="function"&&(n="get",o=e.get),!o)throw new Error("not supported");let i=`$memoize$${t}`;e[n]=function(...s){return this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,s)}),this[i]}}var xb=v(()=>{FH()});function op(r){switch(r){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}function Cb(r){switch(r){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}function tp(r){let t=0;for(let e=0;;e+=7){let n=r.read(1);if(t|=(n.buffer[0]&127)<<e,!(n.buffer[0]&128))return t}}function np(r,t){if(t===0){r.write(IQ);return}let e=0;for(let o=t;o!==0;o=o>>>7)e++;let n=O.alloc(e);for(let o=0;t!==0;o++)n.buffer[o]=t&127,t=t>>>7,t>0&&(n.buffer[o]|=128);r.write(n)}function bl(r){let t=O.alloc(1);return t.writeUInt8(r,0),t}function Rf(r,t){if(typeof t>"u")r.write(qc.Undefined);else if(typeof t=="string"){let e=O.fromString(t);r.write(qc.String),np(r,e.byteLength),r.write(e)}else if(O.isNativeBuffer(t)){let e=O.wrap(t);r.write(qc.Buffer),np(r,e.byteLength),r.write(e)}else if(t instanceof O)r.write(qc.VSBuffer),np(r,t.byteLength),r.write(t);else if(Array.isArray(t)){r.write(qc.Array),np(r,t.length);for(let e of t)Rf(r,e)}else if(typeof t=="number"&&(t|0)===t)r.write(qc.Uint),np(r,t);else{let e=O.fromString(JSON.stringify(t));r.write(qc.Object),np(r,e.byteLength),r.write(e)}}function ip(r){switch(r.read(1).readUInt8(0)){case 0:return;case 1:return r.read(tp(r)).toString();case 2:return r.read(tp(r)).buffer;case 3:return r.read(tp(r));case 4:{let e=tp(r),n=[];for(let o=0;o<e;o++)n.push(ip(r));return n}case 5:return JSON.parse(r.read(tp(r)).toString());case 6:return tp(r)}}function HH(r){return{call(t,e,n){return r.then(o=>o.call(t,e,n))},listen(t,e){let n=new yg;return r.then(o=>n.input=o.listen(t,e),()=>n.dispose()),n.event}}}function WH(r){let t=!1;return{call(e,n,o){return t?r.call(e,n,o):ko(0).then(()=>t=!0).then(()=>r.call(e,n,o))},listen(e,n){if(t)return r.listen(e,n);let o=new yg;return ko(0).then(()=>t=!0).then(()=>o.input=r.listen(e,n)),o.event}}}var IQ,wf,Eb,qc,wb,rp,Tf,Rb,Er,la=v(()=>{Dt();Ue();Ve();Jt();xb();xe();ue();mg();Q();fs();Tt();Ie();IQ=bl(0);wf=class{constructor(t){this.buffer=t;this.pos=0}read(t){let e=this.buffer.slice(this.pos,this.pos+t);return this.pos+=e.byteLength,e}},Eb=class{constructor(){this.buffers=[]}get buffer(){return O.concat(this.buffers)}write(t){this.buffers.push(t)}dispose(){this.buffers.length=0}};qc={Undefined:bl(0),String:bl(1),Buffer:bl(2),VSBuffer:bl(3),Array:bl(4),Object:bl(5),Uint:bl(6)};wb=class{constructor(t,e,n=null,o=1e3){this.protocol=t;this.ctx=e;this.logger=n;this.timeoutDelay=o;this.channels=new Map;this.activeRequests=new Map;this.pendingRequests=new Map;this.protocolListener=this.protocol.onMessage(i=>this.onRawMessage(i)),this.sendResponse({type:200})}registerChannel(t,e){this.channels.set(t,e),setTimeout(()=>this.flushPendingRequests(t),0)}sendResponse(t){switch(t.type){case 200:{let e=this.send([t.type]);this.logger?.logOutgoing(e,0,1,Cb(t.type));return}case 201:case 202:case 204:case 203:{let e=this.send([t.type,t.id],t.data);this.logger?.logOutgoing(e,t.id,1,Cb(t.type),t.data);return}}}send(t,e=void 0){let n=new Eb;try{return Rf(n,t),Rf(n,e),this.sendBuffer(n.buffer)}finally{n.dispose()}}sendBuffer(t){try{return this.protocol.send(t),t.byteLength}catch{return 0}}onRawMessage(t){let e=new wf(t),n=ip(e),o=ip(e),i=n[0];switch(i){case 100:return this.logger?.logIncoming(t.byteLength,n[1],1,`${op(i)}: ${n[2]}.${n[3]}`,o),this.onPromise({type:i,id:n[1],channelName:n[2],name:n[3],arg:o});case 102:return this.logger?.logIncoming(t.byteLength,n[1],1,`${op(i)}: ${n[2]}.${n[3]}`,o),this.onEventListen({type:i,id:n[1],channelName:n[2],name:n[3],arg:o});case 101:return this.logger?.logIncoming(t.byteLength,n[1],1,`${op(i)}`),this.disposeActiveRequest({type:i,id:n[1]});case 103:return this.logger?.logIncoming(t.byteLength,n[1],1,`${op(i)}`),this.disposeActiveRequest({type:i,id:n[1]})}}onPromise(t){let e=this.channels.get(t.channelName);if(!e){this.collectPendingRequest(t);return}let n=new _t,o;try{o=e.call(this.ctx,t.name,t.arg,n.token)}catch(a){o=Promise.reject(a)}let i=t.id;o.then(a=>{this.sendResponse({id:i,data:a,type:201})},a=>{a instanceof Error?this.sendResponse({id:i,data:{message:a.message,name:a.name,stack:a.stack?a.stack.split(`
`):void 0},type:202}):this.sendResponse({id:i,data:a,type:203})}).finally(()=>{s.dispose(),this.activeRequests.delete(t.id)});let s=se(()=>n.cancel());this.activeRequests.set(t.id,s)}onEventListen(t){let e=this.channels.get(t.channelName);if(!e){this.collectPendingRequest(t);return}let n=t.id,i=e.listen(this.ctx,t.name,t.arg)(s=>this.sendResponse({id:n,data:s,type:204}));this.activeRequests.set(t.id,i)}disposeActiveRequest(t){let e=this.activeRequests.get(t.id);e&&(e.dispose(),this.activeRequests.delete(t.id))}collectPendingRequest(t){let e=this.pendingRequests.get(t.channelName);e||(e=[],this.pendingRequests.set(t.channelName,e));let n=setTimeout(()=>{console.error(`Unknown channel: ${t.channelName}`),t.type===100&&this.sendResponse({id:t.id,data:{name:"Unknown channel",message:`Channel name '${t.channelName}' timed out after ${this.timeoutDelay}ms`,stack:void 0},type:202})},this.timeoutDelay);e.push({request:t,timeoutTimer:n})}flushPendingRequests(t){let e=this.pendingRequests.get(t);if(e){for(let n of e)switch(clearTimeout(n.timeoutTimer),n.request.type){case 100:this.onPromise(n.request);break;case 102:this.onEventListen(n.request);break}this.pendingRequests.delete(t)}}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),hn(this.activeRequests.values()),this.activeRequests.clear()}},rp=class{constructor(t,e=null){this.protocol=t;this.isDisposed=!1;this.state=0;this.activeRequests=new Set;this.handlers=new Map;this.lastRequestId=0;this._onDidInitialize=new R;this.onDidInitialize=this._onDidInitialize.event;this.protocolListener=this.protocol.onMessage(n=>this.onBuffer(n)),this.logger=e}getChannel(t){let e=this;return{call(n,o,i){return e.isDisposed?Promise.reject(new He):e.requestPromise(t,n,o,i)},listen(n,o){return e.isDisposed?F.None:e.requestEvent(t,n,o)}}}requestPromise(t,e,n,o=Ae.None){let i=this.lastRequestId++,a={id:i,type:100,channelName:t,name:e,arg:n};if(o.isCancellationRequested)return Promise.reject(new He);let l,c;return new Promise((p,m)=>{if(o.isCancellationRequested)return m(new He);let g=()=>{let I=x=>{switch(x.type){case 201:this.handlers.delete(i),p(x.data);break;case 202:{this.handlers.delete(i);let E=new Error(x.data.message);E.stack=Array.isArray(x.data.stack)?x.data.stack.join(`
`):x.data.stack,E.name=x.data.name,m(E);break}case 203:this.handlers.delete(i),m(x.data);break}};this.handlers.set(i,I);try{this.sendRequest(a)}catch(x){this.handlers.delete(i),m(x)}},y=null;this.state===1?g():(y=or(I=>this.whenInitialized()),y.then(()=>{y=null,g()},()=>{}));let h=()=>{y?(y.cancel(),y=null):this.sendRequest({id:i,type:101}),m(new He)};l=o.onCancellationRequested(h),c={dispose:sc(()=>{h(),l.dispose()})},this.activeRequests.add(c)}).finally(()=>{l?.dispose(),this.activeRequests.delete(c)})}requestEvent(t,e,n){let o=this.lastRequestId++,s={id:o,type:102,channelName:t,name:e,arg:n},a=null,l=new R({onWillAddFirstListener:()=>{let c=p=>l.fire(p.data);this.handlers.set(o,c);let u=()=>{this.activeRequests.add(l),this.sendRequest(s)};this.state===1?u():(a=or(p=>this.whenInitialized()),a.then(()=>{a=null,u()},()=>{}))},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(l),this.sendRequest({id:o,type:103})),this.handlers.delete(o)}});return l.event}sendRequest(t){switch(t.type){case 100:case 102:{let e=this.send([t.type,t.id,t.channelName,t.name],t.arg);this.logger?.logOutgoing(e,t.id,0,`${op(t.type)}: ${t.channelName}.${t.name}`,t.arg);return}case 101:case 103:{let e=this.send([t.type,t.id]);this.logger?.logOutgoing(e,t.id,0,op(t.type));return}}}send(t,e=void 0){let n=new Eb;try{return Rf(n,t),Rf(n,e),this.sendBuffer(n.buffer)}finally{n.dispose()}}sendBuffer(t){try{return this.protocol.send(t),t.byteLength}catch{return 0}}onBuffer(t){let e=new wf(t),n=ip(e),o=ip(e),i=n[0];switch(i){case 200:return this.logger?.logIncoming(t.byteLength,0,0,Cb(i)),this.onResponse({type:n[0]});case 201:case 202:case 204:case 203:return this.logger?.logIncoming(t.byteLength,n[1],0,Cb(i),o),this.onResponse({type:n[0],id:n[1],data:o})}}onResponse(t){if(t.type===200){this.state=1,this._onDidInitialize.fire();return}this.handlers.get(t.id)?.(t)}get onDidInitializePromise(){return F.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===1?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),hn(this.activeRequests.values()),this.activeRequests.clear(),this._onDidInitialize.dispose()}};w([ct],rp.prototype,"onDidInitializePromise",1);Tf=class{constructor(t,e,n){this.channels=new Map;this._connections=new Set;this._onDidAddConnection=new R;this.onDidAddConnection=this._onDidAddConnection.event;this._onDidRemoveConnection=new R;this.onDidRemoveConnection=this._onDidRemoveConnection.event;this.disposables=new re;this.disposables.add(t(({protocol:o,onDidClientDisconnect:i})=>{let s=F.once(o.onMessage),a=new re,l=s(c=>{let u=new wf(c),p=ip(u),m=new wb(o,p,e,n),g=new rp(o,e);this.channels.forEach((h,I)=>m.registerChannel(I,h));let y={channelServer:m,channelClient:g,ctx:p};this._connections.add(y),this._onDidAddConnection.fire(y),a.add(i(()=>{m.dispose(),g.dispose(),this._connections.delete(y),this._onDidRemoveConnection.fire(y),this.disposables.delete(a),a.dispose()}))});a.add(l),this.disposables.add(a)}))}get connections(){let t=[];return this._connections.forEach(e=>t.push(e)),t}getChannel(t,e){let n=this;return{call(o,i,s){let a;if($d(e)){let c=eO(n.connections.filter(e));a=c?Promise.resolve(c):F.toPromise(F.filter(n.onDidAddConnection,e))}else a=e.routeCall(n,o,i);let l=a.then(c=>c.channelClient.getChannel(t));return HH(l).call(o,i,s)},listen(o,i){if($d(e))return n.getMulticastEvent(t,e,o,i);let s=e.routeEvent(n,o,i).then(a=>a.channelClient.getChannel(t));return HH(s).listen(o,i)}}}getMulticastEvent(t,e,n,o){let i=this,s,a=new R({onWillAddFirstListener:()=>{s=new re;let l=new Cv,c=new Map,u=m=>{let y=m.channelClient.getChannel(t).listen(n,o),h=l.add(y);c.set(m,h)},p=m=>{let g=c.get(m);g&&(g.dispose(),c.delete(m))};i.connections.filter(e).forEach(u),F.filter(i.onDidAddConnection,e)(u,void 0,s),i.onDidRemoveConnection(p,void 0,s),l.event(a.fire,a,s),s.add(l)},onDidRemoveLastListener:()=>{s?.dispose(),s=void 0}});return i.disposables.add(a),a.event}registerChannel(t,e){this.channels.set(t,e);for(let n of this._connections)n.channelServer.registerChannel(t,e)}dispose(){this.disposables.dispose();for(let t of this._connections)t.channelClient.dispose(),t.channelServer.dispose();this._connections.clear(),this.channels.clear(),this._onDidAddConnection.dispose(),this._onDidRemoveConnection.dispose()}};Rb=class{constructor(t){this.fn=t}routeCall(t){return this.route(t)}routeEvent(t){return this.route(t)}async route(t){for(let e of t.connections)if(await Promise.resolve(this.fn(e.ctx)))return Promise.resolve(e);return await F.toPromise(t.onDidAddConnection),await this.route(t)}};(o=>{function r(i,s,a){let l=i,c=a?.disableMarshalling,u=a?.unbufferedEvents?new Set(a.unbufferedEvents):void 0,p=new Map;for(let m in l)e(m)&&!u?.has(m)&&p.set(m,F.buffer(l[m],m,!0,void 0,s));return new class{listen(m,g,y){let h=p.get(g);if(h)return h;let I=l[g];if(typeof I=="function"){if(n(g))return I.call(l,y);if(e(g))return u?.has(g)?l[g]:(p.set(g,F.buffer(l[g],g,!0,void 0,s)),p.get(g))}throw new eo(`Event not found: ${g}`)}call(m,g,y){let h=l[g];if(typeof h=="function"){if(!c&&Array.isArray(y))for(let x=0;x<y.length;x++)y[x]=en(y[x]);let I=h.apply(l,y);return I instanceof Promise||(I=Promise.resolve(I)),I}throw new eo(`Method not found: ${g}`)}}}o.fromService=r;function t(i,s){let a=s?.disableMarshalling;return new Proxy({},{get(l,c){if(typeof c=="string")return s?.properties?.has(c)?s.properties.get(c):c==="then"?void 0:n(c)?function(u){return i.listen(c,u)}:e(c)?i.listen(c):async function(...u){let p;s&&!Kt(s.context)?p=[s.context,...u]:p=u;let m=await i.call(c,p);return a?m:en(m)};throw new eo(`Property not found: ${String(c)}`)}})}o.toService=t;function e(i){return i[0]==="o"&&i[1]==="n"&&iR(i.charCodeAt(2))}function n(i){return/^onDynamic/.test(i)&&iR(i.charCodeAt(9))}})(Er||={})});function VH(r){let t=r;return t&&typeof t.type=="string"&&typeof t.severity=="string"}function bQ(r){let t=[],e;try{let n=JSON.parse(r.arguments),o=n[n.length-1];o&&o.__$stack&&(n.pop(),e=o.__$stack),t.push(...n)}catch{t.push("Unable to log remote console arguments",r.arguments)}return{args:t,stack:e}}function SQ(r){if(!r)return r;let t=r.indexOf(`
`);return t===-1?r:r.substring(0,t)}function BH(r,t){let{args:e,stack:n}=bQ(r),o=typeof e[0]=="string"&&e.length===1,i=SQ(n);i&&(i=`(${i.trim()})`);let s=[];if(typeof e[0]=="string"?i&&o?s=[`%c[${t}] %c${e[0]} %c${i}`,sp("blue"),sp(""),sp("grey")]:s=[`%c[${t}] %c${e[0]}`,sp("blue"),sp(""),...e.slice(1)]:s=[`%c[${t}]%`,sp("blue"),...e],i&&!o&&s.push(i),typeof console[r.severity]!="function")throw new Error("Unknown console method");console[r.severity].apply(console,s)}function sp(r){return`color: ${r}`}var qH=v(()=>{te()});import{fork as xQ}from"child_process";var Sl,Tb=v(()=>{Ue();Ve();Jt();qH();xe();ue();Q();Xt();Jg();Ru();la();Sl=class{constructor(t,e){this.modulePath=t;this.options=e;this.activeRequests=new Set;this.channels=new Map;this._onDidProcessExit=new R;this.onDidProcessExit=this._onDidProcessExit.event;let n=e.timeout||6e4;this.disposeDelayer=new Cg(n),this.child=null,this._client=null}getChannel(t){let e=this;return{call(n,o,i){return e.requestPromise(t,n,o,i)},listen(n,o){return e.requestEvent(t,n,o)}}}requestPromise(t,e,n,o=Ae.None){if(!this.disposeDelayer)return Promise.reject(new Error("disposed"));if(o.isCancellationRequested)return Promise.reject(pg());this.disposeDelayer.cancel();let i=this.getCachedChannel(t),s=or(u=>i.call(e,n,u)),a=o.onCancellationRequested(()=>s.cancel()),l=se(()=>s.cancel());this.activeRequests.add(l);let c=()=>{a.dispose(),this.activeRequests.delete(l),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())};return s.then(c,c),s}requestEvent(t,e,n){if(!this.disposeDelayer)return F.None;this.disposeDelayer.cancel();let o,i=new R({onWillAddFirstListener:()=>{o=this.getCachedChannel(t).listen(e,n)(i.fire,i),this.activeRequests.add(o)},onDidRemoveLastListener:()=>{this.activeRequests.delete(o),o.dispose(),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}});return i.event}get client(){if(!this._client){let t=this.options.args||[],e=Object.create(null);e.env={...ci(process.env),VSCODE_PARENT_PID:String(process.pid)},this.options.env&&(e.env={...e.env,...this.options.env}),this.options.freshExecArgv&&(e.execArgv=[]),typeof this.options.debug=="number"&&(e.execArgv=["--nolazy","--inspect="+this.options.debug]),typeof this.options.debugBrk=="number"&&(e.execArgv=["--nolazy","--inspect-brk="+this.options.debugBrk]),e.execArgv===void 0&&(e.execArgv=process.execArgv.filter(p=>!/^--inspect(-brk)?=/.test(p)).filter(p=>!p.startsWith("--vscode-"))),wu(e.env),this.child=xQ(this.modulePath,t,e);let n=new R,i=F.fromNodeEventEmitter(this.child,"message",p=>p)(p=>{if(VH(p)){BH(p,`IPC Library: ${this.options.serverName}`);return}n.fire(O.wrap(Buffer.from(p,"base64")))}),s=this.options.useQueue?PN(this.child):this.child,a=p=>this.child?.connected&&s.send(p.buffer.toString("base64")),l=n.event,c={send:a,onMessage:l};this._client=new rp(c);let u=()=>this.disposeClient();process.once("exit",u),this.child.on("error",p=>console.warn('IPC "'+this.options.serverName+'" errored with '+p)),this.child.on("exit",(p,m)=>{process.removeListener("exit",u),i.dispose(),this.activeRequests.forEach(g=>hn(g)),this.activeRequests.clear(),p!==0&&m!=="SIGTERM"&&console.warn('IPC "'+this.options.serverName+'" crashed with exit code '+p+" and signal "+m),this.disposeDelayer?.cancel(),this.disposeClient(),this._onDidProcessExit.fire({code:p,signal:m})})}return this._client}getCachedChannel(t){let e=this.channels.get(t);return e||(e=this.client.getChannel(t),this.channels.set(t,e)),e}disposeClient(){this._client&&(this.child&&(this.child.kill(),this.child=null),this._client=null,this.channels.clear())}dispose(){this._onDidProcessExit.dispose(),this.disposeDelayer?.cancel(),this.disposeDelayer=void 0,this.disposeClient(),this.activeRequests.clear()}}});var Pb,$H=v(()=>{Me();la();Tb();Bc();Pb=class extends vb{constructor(t,e,n){super(t,e,n),this.init()}createWatcher(t){let e=t.add(new Sl(Pt.asFileUri("bootstrap-fork").fsPath,{serverName:"File Watcher",args:["--type=fileWatcher"],env:{VSCODE_ESM_ENTRYPOINT:"vs/platform/files/node/watcher/watcherMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"}}));return t.add(e.onDidProcessExit(({code:n,signal:o})=>this.onError(`terminated by itself with code ${n}, signal: ${o} (ETERM)`))),Er.toService(WH(e.getChannel("watcher")))}}});import{watchFile as CQ,unwatchFile as EQ}from"fs";var kb,zH=v(()=>{Q();Bc();ue();st();te();Ue();Mi();xe();kb=class extends D{constructor(){super();this._onDidChangeFile=this._register(new R);this.onDidChangeFile=this._onDidChangeFile.event;this._onDidLogMessage=this._register(new R);this.onDidLogMessage=this._onDidLogMessage.event;this._onDidWatchFail=this._register(new R);this.onDidWatchFail=this._onDidWatchFail.event;this.correlatedWatchRequests=new Map;this.nonCorrelatedWatchRequests=new Map;this.suspendedWatchRequests=this._register(new Wo);this.suspendedWatchRequestsWithPolling=new Set;this.updateWatchersDelayer=this._register(new Or(this.getUpdateWatchersDelay()));this.suspendedWatchRequestPollingInterval=5007;this.joinWatch=new jn;this.verboseLogging=!1;this._register(this.onDidWatchFail(e=>this.suspendWatchRequest({id:this.computeId(e),correlationId:this.isCorrelated(e)?e.correlationId:void 0,path:e.path})))}isCorrelated(e){return Ib(e)}computeId(e){return this.isCorrelated(e)?e.correlationId:Fr(e)}async watch(e){this.joinWatch.isSettled||this.joinWatch.complete(),this.joinWatch=new jn;try{this.correlatedWatchRequests.clear(),this.nonCorrelatedWatchRequests.clear();for(let n of e)this.isCorrelated(n)?this.correlatedWatchRequests.set(n.correlationId,n):this.nonCorrelatedWatchRequests.set(this.computeId(n),n);for(let[n]of this.suspendedWatchRequests)!this.nonCorrelatedWatchRequests.has(n)&&!this.correlatedWatchRequests.has(n)&&(this.suspendedWatchRequests.deleteAndDispose(n),this.suspendedWatchRequestsWithPolling.delete(n));return await this.updateWatchers(!1)}finally{this.joinWatch.complete()}}updateWatchers(e){let n=[];for(let[o,i]of[...this.nonCorrelatedWatchRequests,...this.correlatedWatchRequests])this.suspendedWatchRequests.has(o)||n.push(i);return this.updateWatchersDelayer.trigger(()=>this.doWatch(n),e?this.getUpdateWatchersDelay():0).catch(o=>pt(o))}getUpdateWatchersDelay(){return 800}isSuspended(e){let n=this.computeId(e);return this.suspendedWatchRequestsWithPolling.has(n)?"polling":this.suspendedWatchRequests.has(n)}async suspendWatchRequest(e){if(this.suspendedWatchRequests.has(e.id))return;let n=new re;this.suspendedWatchRequests.set(e.id,n),await this.joinWatch.p,!n.isDisposed&&(this.monitorSuspendedWatchRequest(e,n),this.updateWatchers(!0))}resumeWatchRequest(e){this.suspendedWatchRequests.deleteAndDispose(e.id),this.suspendedWatchRequestsWithPolling.delete(e.id),this.updateWatchers(!1)}monitorSuspendedWatchRequest(e,n){this.doMonitorWithExistingWatcher(e,n)?(this.trace(`reusing an existing recursive watcher to monitor ${e.path}`),this.suspendedWatchRequestsWithPolling.delete(e.id)):(this.doMonitorWithNodeJS(e,n),this.suspendedWatchRequestsWithPolling.add(e.id))}doMonitorWithExistingWatcher(e,n){let o=this.recursiveWatcher?.subscribe(e.path,(i,s)=>{n.isDisposed||(i?this.monitorSuspendedWatchRequest(e,n):s?.type===1&&this.onMonitoredPathAdded(e))});return o?(n.add(o),!0):!1}doMonitorWithNodeJS(e,n){let o=!1,i=(s,a)=>{if(n.isDisposed)return;let l=this.isPathNotFound(s),c=this.isPathNotFound(a),u=o;o=l,!l&&(c||u)&&this.onMonitoredPathAdded(e)};this.trace(`starting fs.watchFile() on ${e.path} (correlationId: ${e.correlationId})`);try{CQ(e.path,{persistent:!1,interval:this.suspendedWatchRequestPollingInterval},i)}catch(s){this.warn(`fs.watchFile() failed with error ${s} on path ${e.path} (correlationId: ${e.correlationId})`)}n.add(se(()=>{this.trace(`stopping fs.watchFile() on ${e.path} (correlationId: ${e.correlationId})`);try{EQ(e.path,i)}catch(s){this.warn(`fs.unwatchFile() failed with error ${s} on path ${e.path} (correlationId: ${e.correlationId})`)}}))}onMonitoredPathAdded(e){this.trace(`detected ${e.path} exists again, resuming watcher (correlationId: ${e.correlationId})`);let n={resource:S.file(e.path),type:1,cId:e.correlationId};this._onDidChangeFile.fire([n]),this.traceEvent(n,e),this.resumeWatchRequest(e)}isPathNotFound(e){return e.ctimeMs===0&&e.ino===0}async stop(){this.suspendedWatchRequests.clearAndDisposeAll(),this.suspendedWatchRequestsWithPolling.clear()}traceEvent(e,n){if(this.verboseLogging){let o=` >> normalized ${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`;this.traceWithCorrelation(o,n)}}traceWithCorrelation(e,n){this.verboseLogging&&this.trace(`${e}${typeof n.correlationId=="number"?` <${n.correlationId}> `:""}`)}requestToString(e){return`${e.path} (excludes: ${e.excludes.length>0?e.excludes:"<none>"}, includes: ${e.includes&&e.includes.length>0?JSON.stringify(e.includes):"<all>"}, filter: ${UH(e.filter)}, correlationId: ${typeof e.correlationId=="number"?e.correlationId:"<none>"})`}async setVerboseLogging(e){this.verboseLogging=e}}});import{watch as wQ,promises as RQ}from"fs";var Ab,GH=v(()=>{Ue();Jt();si();Q();Mv();Oe();fe();it();te();vo();st();Bc();ns();Ab=class r extends D{constructor(e,n,o,i,s,a){super();this.request=e;this.recursiveWatcher=n;this.onDidFilesChange=o;this.onDidWatchFail=i;this.onLogMessage=s;this.verboseLogging=a;this.throttledFileChangesEmitter=this._register(new tu({maxWorkChunkSize:100,throttleDelay:200,maxBufferedWork:1e4},e=>this.onDidFilesChange(e)));this.fileChangesAggregator=this._register(new Av(e=>this.handleFileChanges(e),r.FILE_CHANGES_HANDLER_DELAY));this.cts=new _t;this.realPath=new Yt(async()=>{let e=this.request.path;try{e=await Ce.realpath(this.request.path),this.request.path!==e&&this.trace(`correcting a path to watch that seems to be a symbolic link (original: ${this.request.path}, real: ${e})`)}catch{}return e});this._isReusingRecursiveWatcher=!1;this.didFail=!1;let l=!Ke;this.excludes=DP(this.request.path,this.request.excludes,l),this.includes=this.request.includes?DP(this.request.path,this.request.includes,l):void 0,this.filter=Ib(this.request)?this.request.filter:void 0,this.ready=this.watch()}static{this.FILE_DELETE_HANDLER_DELAY=100}static{this.FILE_CHANGES_HANDLER_DELAY=75}get isReusingRecursiveWatcher(){return this._isReusingRecursiveWatcher}get failed(){return this.didFail}async watch(){try{let e=await RQ.stat(this.request.path);if(this.cts.token.isCancellationRequested)return;await gO(this.doWatch(e.isDirectory()),this._store)}catch(e){e.code!=="ENOENT"?this.error(e):this.trace(`ignoring a path for watching who's stat info failed to resolve: ${this.request.path} (error: ${e})`),this.notifyWatchFailed()}}notifyWatchFailed(){this.didFail=!0,this.onDidWatchFail?.()}async doWatch(e){let n=new Kn;try{return await this.doWatchGeneration(e,n),n}catch(o){throw n.dispose(),o}}async doWatchGeneration(e,n){let o=new re;if(n.value=o,n.value!==o){o.dispose();return}this.doWatchWithExistingWatcher(e,o,n)?(this.trace(`reusing an existing recursive watcher for ${this.request.path}`),this._isReusingRecursiveWatcher=!0):(this._isReusingRecursiveWatcher=!1,await this.doWatchWithNodeJS(e,o,n))}doWatchWithExistingWatcher(e,n,o){if(e)return!1;let i=S.file(this.request.path),s=this.recursiveWatcher?.subscribe(this.request.path,async(a,l)=>{n.isDisposed||(a?await this.doWatchGeneration(e,o):l&&(typeof l.cId=="number"||typeof this.request.correlationId=="number")&&this.onFileChange({resource:i,type:l.type,cId:this.request.correlationId},!0))});return s?(n.add(s),!0):!1}async doWatchWithNodeJS(e,n,o){let i=await this.realPath.value;if(this.cts.token.isCancellationRequested||n.isDisposed)return;if(vt&&tr(i,"/Volumes/",!0)){this.error(`Refusing to watch ${i} for changes using fs.watch() for possibly being a network share where watching is unreliable and unstable.`);return}let s=new _t(this.cts.token);n.add(se(()=>s.dispose(!0)));let a=new re;n.add(a);try{let l=S.file(this.request.path),c=Ze(i),u=wQ(i);a.add(se(()=>{u.removeAllListeners(),u.close()})),this.trace(`Started watching: '${i}'`);let p=new Set;if(e)try{for(let g of await Ce.readdir(i))p.add(g)}catch(g){this.error(g)}if(s.token.isCancellationRequested)return;let m=new Map;a.add(se(()=>{for(let[,g]of m)g.dispose();m.clear()})),u.on("error",(g,y)=>{s.token.isCancellationRequested||(this.error(`Failed to watch ${i} for changes using fs.watch() (${g}, ${y})`),this.notifyWatchFailed())}),u.on("change",(g,y)=>{if(s.token.isCancellationRequested)return;this.verboseLogging&&this.traceWithCorrelation(`[raw] ["${g}"] ${y}`);let h="";if(y&&(h=y.toString(),vt&&(h=Rg(h))),!(!h||g!=="change"&&g!=="rename"))if(e)if(g==="rename"){let I=Gn(h)&&Ga(Ze(h),c,!Ke),x=m.get(h);if(I&&x)return;x?.dispose();let E=setTimeout(async()=>{if(m.delete(h),I){o.clear();let M=await Ce.exists(i);if(this.cts.token.isCancellationRequested)return;M?await this.doWatchGeneration(!0,o):this.onWatchedPathDeleted(l);return}if(Ga(h,c,!Ke)&&!await Ce.exists(i)){o.clear(),this.onWatchedPathDeleted(l);return}if(s.token.isCancellationRequested)return;let T=await this.existsChildStrictCase($(i,h));if(s.token.isCancellationRequested)return;let P;T?p.has(h)?P=0:(P=1,p.add(h)):(p.delete(h),P=2),this.onFileChange({resource:ge(l,h),type:P,cId:this.request.correlationId})},r.FILE_DELETE_HANDLER_DELAY);m.set(h,se(()=>clearTimeout(E)))}else{let I;p.has(h)?I=0:(I=1,p.add(h)),this.onFileChange({resource:ge(l,h),type:I,cId:this.request.correlationId})}else if(g==="rename"||!Ga(h,c,!Ke)){let I=setTimeout(async()=>{let x=await Ce.exists(i);s.token.isCancellationRequested||(x?(o.clear(),this.onFileChange({resource:l,type:0,cId:this.request.correlationId},!0),await this.doWatchGeneration(!1,o)):(o.clear(),this.onWatchedPathDeleted(l)))},r.FILE_DELETE_HANDLER_DELAY);a.clear(),a.add(se(()=>clearTimeout(I)))}else this.onFileChange({resource:l,type:0,cId:this.request.correlationId},!0)})}catch(l){if(s.token.isCancellationRequested)return;this.error(`Failed to watch ${i} for changes using fs.watch() (${l.toString()})`),this.notifyWatchFailed()}}onWatchedPathDeleted(e){this.warn("Watcher shutdown because watched path got deleted"),this.onFileChange({resource:e,type:2,cId:this.request.correlationId},!0),this.fileChangesAggregator.flush(),this.notifyWatchFailed()}onFileChange(e,n=!1){this.cts.token.isCancellationRequested||(this.verboseLogging&&this.traceWithCorrelation(`${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`),!n&&this.excludes.some(o=>o(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (excluded) ${e.resource.fsPath}`):!n&&this.includes&&this.includes.length>0&&!this.includes.some(o=>o(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (not included) ${e.resource.fsPath}`):this.fileChangesAggregator.work(e))}handleFileChanges(e){let n=LH(e),o=[];for(let s of n){if(OH(s,this.filter)){this.verboseLogging&&this.traceWithCorrelation(` >> ignored (filtered) ${s.resource.fsPath}`);continue}o.push(s)}if(o.length===0)return;if(this.verboseLogging)for(let s of o)this.traceWithCorrelation(` >> normalized ${s.type===1?"[ADDED]":s.type===2?"[DELETED]":"[CHANGED]"} ${s.resource.fsPath}`);this.throttledFileChangesEmitter.work(o)?this.throttledFileChangesEmitter.pending>0&&this.trace(`started throttling events due to large amount of file change events at once (pending: ${this.throttledFileChangesEmitter.pending}, most recent change: ${o[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`):this.warn(`started ignoring events due to too many file change events at once (incoming: ${o.length}, most recent change: ${o[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`)}async existsChildStrictCase(e){if(Ke)return Ce.exists(e);try{let n=Ze(e);return(await Ce.readdir(It(e))).some(i=>i===n)}catch(n){return this.trace(n),!1}}setVerboseLogging(e){this.verboseLogging=e}error(e){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"error",message:`[File Watcher (node.js)] ${e}`})}warn(e){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"warn",message:`[File Watcher (node.js)] ${e}`})}trace(e){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.onLogMessage?.({type:"trace",message:`[File Watcher (node.js)] ${e}`})}traceWithCorrelation(e){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.trace(`${e}${typeof this.request.correlationId=="number"?` <${this.request.correlationId}> `:""}`)}dispose(){this.cts.dispose(!0),super.dispose()}}});var Db,KH=v(()=>{ue();fb();zH();fe();GH();Ue();Q();Db=class extends kb{constructor(e){super();this.recursiveWatcher=e;this.onDidError=F.None;this._watchers=new Map;this.worker=this._register(new Kn)}get watchers(){return this._watchers.values()}async doWatch(e){e=this.removeDuplicateRequests(e);let n=[],o=new Set(Array.from(this.watchers));for(let i of e){let s=this._watchers.get(this.requestToWatcherKey(i));s&&kP(s.request.excludes,i.excludes)&&kP(s.request.includes,i.includes)?o.delete(s):n.push(i)}n.length&&this.trace(`Request to start watching: ${n.map(i=>this.requestToString(i)).join(",")}`),o.size&&this.trace(`Request to stop watching: ${Array.from(o).map(i=>this.requestToString(i.request)).join(",")}`),this.worker.clear();for(let i of o)this.stopWatching(i);this.createWatchWorker().work(n)}createWatchWorker(){return this.worker.value=new tu({maxWorkChunkSize:100,throttleDelay:100,maxBufferedWork:Number.MAX_VALUE},e=>{for(let n of e)this.startWatching(n)}),this.worker.value}requestToWatcherKey(e){return typeof e.correlationId=="number"?e.correlationId:this.pathToWatcherKey(e.path)}pathToWatcherKey(e){return Ke?e:e.toLowerCase()}startWatching(e){let n=new Ab(e,this.recursiveWatcher,i=>this._onDidChangeFile.fire(i),()=>this._onDidWatchFail.fire(e),i=>this._onDidLogMessage.fire(i),this.verboseLogging),o={request:e,instance:n};this._watchers.set(this.requestToWatcherKey(e),o)}async stop(){await super.stop();for(let e of this.watchers)this.stopWatching(e)}stopWatching(e){this.trace("stopping file watcher",e),this._watchers.delete(this.requestToWatcherKey(e.request)),e.instance.dispose()}removeDuplicateRequests(e){let n=new Map;for(let o of e){let i=n.get(o.correlationId);i||(i=new Map,n.set(o.correlationId,i));let s=this.pathToWatcherKey(o.path);i.has(s)&&this.trace(`ignoring a request for watching who's path is already watched: ${this.requestToString(o)}`),i.set(s,o)}return Array.from(n.values()).flatMap(o=>Array.from(o.values()))}async setVerboseLogging(e){super.setVerboseLogging(e);for(let n of this.watchers)n.instance.setVerboseLogging(e)}trace(e,n){this.verboseLogging&&this._onDidLogMessage.fire({type:"trace",message:this.toMessage(e,n)})}warn(e){this._onDidLogMessage.fire({type:"warn",message:this.toMessage(e)})}toMessage(e,n){return n?`[File Watcher (node.js)] ${e} (${this.requestToString(n.request)})`:`[File Watcher (node.js)] ${e}`}}});var _b,jH=v(()=>{Bc();KH();_b=class extends yb{constructor(t,e,n){super(t,e,n),this.init()}createWatcher(t){return t.add(new Db(void 0))}}});import{constants as Pf,promises as ap}from"fs";var bs,kf=v(()=>{Ue();fn();Ve();ue();si();Q();Oe();fe();it();Xa();vo();ee();st();CP();NH();$H();jH();bs=class r extends Sb{constructor(){super(...arguments);this.onDidChangeCapabilities=F.None;this.resourceLocks=new je(e=>Qa.getComparisonKey(e));this.mapHandleToPos=new Map;this.mapHandleToLock=new Map;this.writeHandles=new Map}static{this.TRACE_LOG_RESOURCE_LOCKS=!1}static{this.FOLDER_RENAME_RETRY_TIMEOUT=1e3}get capabilities(){return this._capabilities||(this._capabilities=2088990,Ke&&(this._capabilities|=1024)),this._capabilities}async stat(e){try{let{stat:n,symbolicLink:o}=await Ao.stat(this.toFilePath(e)),i;return(n.mode&128)===0&&(i=2),(n.mode&Pf.S_IXUSR||n.mode&Pf.S_IXGRP||n.mode&Pf.S_IXOTH)&&(i=(i??0)|4),{type:this.toType(n,o),ctime:n.birthtime.getTime(),mtime:n.mtime.getTime(),size:n.size,permissions:i}}catch(n){throw this.toFileSystemProviderError(n)}}async statIgnoreError(e){try{return await this.stat(e)}catch{return}}async realpath(e,n){let o=this.toFilePath(e);try{return await Ce.realpath(o,n)}catch(i){throw this.toFileSystemProviderError(i)}}async readdir(e){try{let n=await Ce.readdir(this.toFilePath(e),{withFileTypes:!0}),o=[];return await Promise.all(n.map(async i=>{try{let s;i.isSymbolicLink()?s=(await this.stat(ge(e,i.name))).type:s=this.toType(i),o.push([i.name,s])}catch(s){this.logService.trace(s)}})),o}catch(n){throw this.toFileSystemProviderError(n)}}toType(e,n){let o;return n?.dangling?o=0:e.isFile()?o=1:e.isDirectory()?o=2:o=0,n&&(o|=64),o}async createResourceLock(e){let n=this.toFilePath(e);this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${n})`);let o;for(;o=this.resourceLocks.get(e);)this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${n})`),await o.wait();let i=new Ur;return this.resourceLocks.set(e,i),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${n})`),se(()=>{this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${n})`),this.resourceLocks.get(e)===i&&(this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${n})`),this.resourceLocks.delete(e)),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${n})`),i.open()})}async readFile(e,n){let o;try{n?.atomic&&(this.traceLock(`[Disk FileSystemProvider]: atomic read operation started (${this.toFilePath(e)})`),o=await this.createResourceLock(e));let i=this.toFilePath(e),s=await this.openFileForRead(i);try{return await Ce.readFile(s)}finally{await Ce.close(s)}}catch(i){throw this.toFileSystemProviderError(i)}finally{o?.dispose()}}traceLock(e){r.TRACE_LOG_RESOURCE_LOCKS&&this.logService.trace(e)}readFileStream(e,n,o){let i=zs(s=>O.concat(s.map(a=>O.wrap(a))).buffer);return pb(this,e,i,s=>s.buffer,{...n,bufferSize:256*1024},o),i}async writeFile(e,n,o){return o?.atomic!==!1&&o?.atomic?.postfix&&await this.canWriteFileAtomic(e)?this.doWriteFileAtomic(e,ge(Xd(e),`${xn(e)}${o.atomic.postfix}`),n,o):this.doWriteFile(e,n,o)}async canWriteFileAtomic(e){try{let n=this.toFilePath(e),{symbolicLink:o}=await Ao.stat(n);if(o)return!1}catch{}return!0}async doWriteFileAtomic(e,n,o,i){let s=new re;try{s.add(await this.createResourceLock(e)),s.add(await this.createResourceLock(n)),await this.doWriteFile(n,o,{...i,create:!0,overwrite:!0},!0);try{await this.rename(n,e,{overwrite:!0})}catch(a){try{await this.delete(n,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw a}}finally{s.dispose()}}async doWriteFile(e,n,o,i){let s;try{let a=this.toFilePath(e);if(!o.create||!o.overwrite){if(await Ce.exists(a)){if(!o.overwrite)throw Do(d(4471,null),"EntryExists")}else if(!o.create)throw Do(d(4475,null),"EntryNotFound")}s=await this.open(e,{create:!0,append:o.append,unlock:o.unlock},i),await this.write(s,0,n,0,n.byteLength)}catch(a){throw await this.toFileSystemProviderWriteError(e,a)}finally{typeof s=="number"&&await this.close(s)}}static{this.canFlush=!0}static configureFlushOnWrite(e){r.canFlush=e}async openFileForRead(e){let n=await Ce.open(e,oe?"r":Pf.O_RDONLY|Pf.O_NONBLOCK);try{let o=await Ce.fstat(n);if(o.isDirectory())throw Do(d(4472,null),"EntryIsADirectory");if(!o.isFile())throw Do(d(4476,null),"Unavailable");return n}catch(o){try{await Ce.close(n)}catch(i){this.logService.trace(i)}throw o}}async open(e,n,o){let i=this.toFilePath(e),s;Pc(n)&&!o&&(s=await this.createResourceLock(e));let a;try{if(Pc(n)&&n.unlock)try{let{stat:l}=await Ao.stat(i);l.mode&128||await ap.chmod(i,l.mode|128)}catch(l){l.code!=="ENOENT"&&this.logService.trace(l)}if(oe&&Pc(n)&&!n.append)try{a=await Ce.open(i,"r+"),await Ce.ftruncate(a,0)}catch(l){if(l.code!=="ENOENT"&&this.logService.trace(l),typeof a=="number"){try{await Ce.close(a)}catch(c){this.logService.trace(c)}a=void 0}}typeof a!="number"&&(Pc(n)?a=await Ce.open(i,n.append?"a":"w"):a=await this.openFileForRead(i))}catch(l){throw s?.dispose(),Pc(n)?await this.toFileSystemProviderWriteError(e,l):this.toFileSystemProviderError(l)}if(this.mapHandleToPos.set(a,0),Pc(n)&&this.writeHandles.set(a,e),s){let l=this.mapHandleToLock.get(a);this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${a} (${i})`),this.mapHandleToLock.set(a,s),l&&(this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${a} (${i})`),l.dispose())}return a}async close(e){let n=this.mapHandleToLock.get(e);try{if(this.mapHandleToPos.delete(e),this.writeHandles.delete(e)&&r.canFlush)try{await Ce.fdatasync(e)}catch(o){r.configureFlushOnWrite(!1),this.logService.error(o)}return await Ce.close(e)}catch(o){throw this.toFileSystemProviderError(o)}finally{n&&(this.mapHandleToLock.get(e)===n&&(this.traceLock(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${e}`),this.mapHandleToLock.delete(e)),this.traceLock(`[Disk FileSystemProvider]: close() - disposing lock for handle ${e}`),n.dispose())}}async read(e,n,o,i,s){let a=this.normalizePos(e,n),l=null;try{l=(await Ce.read(e,o,i,s,a)).bytesRead}catch(c){throw this.toFileSystemProviderError(c)}finally{this.updatePos(e,a,l)}return l}normalizePos(e,n){return n===this.mapHandleToPos.get(e)?null:n}updatePos(e,n,o){let i=this.mapHandleToPos.get(e);typeof i=="number"&&(typeof n=="number"||(typeof o=="number"?this.mapHandleToPos.set(e,i+o):this.mapHandleToPos.delete(e)))}async write(e,n,o,i,s){return tU(()=>this.doWrite(e,n,o,i,s),100,3)}async doWrite(e,n,o,i,s){let a=this.normalizePos(e,n),l=null;try{l=(await Ce.write(e,o,i,s,a)).bytesWritten}catch(c){throw await this.toFileSystemProviderWriteError(this.writeHandles.get(e),c)}finally{this.updatePos(e,a,l)}return l}async mkdir(e){try{await ap.mkdir(this.toFilePath(e))}catch(n){throw this.toFileSystemProviderError(n)}}async delete(e,n){try{let o=this.toFilePath(e);if(n.recursive){let i;n?.atomic!==!1&&n.atomic.postfix&&(i=$(It(o),`${Ze(o)}${n.atomic.postfix}`)),await Ce.rm(o,1,i)}else try{await ap.unlink(o)}catch(i){if(i.code==="EPERM"||i.code==="EISDIR"){let s=!1;try{let{stat:a,symbolicLink:l}=await Ao.stat(o);s=a.isDirectory()&&!l}catch{}if(s)await ap.rmdir(o);else throw i}else throw i}}catch(o){throw this.toFileSystemProviderError(o)}}async rename(e,n,o){return this.doRename(e,n,o,!1)}async renameFileAtomic(e,n,o){return this.doRename(e,n,o,!0)}async doRename(e,n,o,i){let s=this.toFilePath(e),a=this.toFilePath(n);if(s!==a)try{let c=((await this.validateMoveCopy(e,n,"move",o.overwrite,i)).type&2)!==0;i?await Ce.renameAtomic(s,a):await Ce.rename(s,a,c&&!o.overwrite?r.FOLDER_RENAME_RETRY_TIMEOUT:void 0)}catch(l){if(oe&&(l.code==="EPERM"||l.code==="EACCES"||l.code==="EBUSY")){let c=Ga(It(s),It(a),!0)?d(4479,null,Ze(s),Ze(a),l.toString()):d(4478,null,Ze(s),Ze(It(a)),l.toString());l=Do(c,l.code==="EBUSY"?"Unknown":"NoPermissions")}else(l.code==="EINVAL"||l.code==="EBUSY"||l.code==="ENAMETOOLONG")&&(l=new Error(d(4477,null,Ze(s),Ze(It(a)),l.toString())));throw this.toFileSystemProviderError(l)}}async copy(e,n,o){let i=this.toFilePath(e),s=this.toFilePath(n);if(i!==s)try{await this.validateMoveCopy(e,n,"copy",o.overwrite),await Ce.copy(i,s,{preserveSymlinks:!0})}catch(a){throw(a.code==="EINVAL"||a.code==="EBUSY"||a.code==="ENAMETOOLONG")&&(a=new Error(d(4469,null,Ze(i),Ze(It(s)),a.toString()))),this.toFileSystemProviderError(a)}}async validateMoveCopy(e,n,o,i,s=!1){let a=this.toFilePath(e),l=this.toFilePath(n),c=s?await this.stat(e):await this.statIgnoreError(e);if(!c)throw Do(d(4474,null),"EntryNotFound");if(s&&!(c.type&1))throw Do(d(4467,null),"Unavailable");let u=!1;if(this.capabilities&1024||(u=Ga(a,l,!0)),u){if(o==="copy")throw Do(d(4470,null),"EntryExists");if(o==="move")return c}let m;if(s)try{m=await this.stat(n)}catch(g){if(cl(g)!=="EntryNotFound")throw g}else m=await this.statIgnoreError(n);if(!m)return c;if(s&&!(m.type&1))throw Do(d(4468,null),"Unavailable");if(!i)throw Do(d(4473,null),"EntryExists");return(c.type&1)!==0&&(m.type&1)!==0||await this.delete(n,{recursive:!0,useTrash:!1,atomic:!1}),c}async cloneFile(e,n){return this.doCloneFile(e,n,!1)}async doCloneFile(e,n,o){let i=this.toFilePath(e),s=this.toFilePath(n),a=!!(this.capabilities&1024);if(Ga(i,s,!a))return;let l=new re;try{l.add(await this.createResourceLock(e)),l.add(await this.createResourceLock(n)),o&&await ap.mkdir(It(s),{recursive:!0}),await ap.copyFile(i,s)}catch(c){if(c.code==="ENOENT"&&!o)return this.doCloneFile(e,n,!0);throw this.toFileSystemProviderError(c)}finally{l.dispose()}}createUniversalWatcher(e,n,o){return new Pb(i=>e(i),i=>n(i),o)}createNonRecursiveWatcher(e,n,o){return new _b(i=>e(i),i=>n(i),o)}toFileSystemProviderError(e){if(e instanceof hu)return e;let n=e,o;switch(e.code){case"ENOENT":o="EntryNotFound";break;case"EISDIR":o="EntryIsADirectory";break;case"ENOTDIR":o="EntryNotADirectory";break;case"EEXIST":o="EntryExists";break;case"EPERM":case"EACCES":o="NoPermissions";break;case"ERR_UNC_HOST_NOT_ALLOWED":n=`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,o="Unknown";break;default:o="Unknown"}return Do(n,o)}async toFileSystemProviderWriteError(e,n){let o=this.toFileSystemProviderError(n);if(e&&o.code==="NoPermissions")try{let{stat:i}=await Ao.stat(this.toFilePath(e));i.mode&128||(o=Do(n,"EntryWriteLocked"))}catch(i){this.logService.trace(i)}return o}}});function QH(r){return r.getFullYear()+"-"+String(r.getMonth()+1).padStart(2,"0")+"-"+String(r.getDate()).padStart(2,"0")+"T"+String(r.getHours()).padStart(2,"0")+":"+String(r.getMinutes()).padStart(2,"0")+":"+String(r.getSeconds()).padStart(2,"0")+"."+(r.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}var TQ,PQ,_P,bke,Ske,xke,Af,Mb=v(()=>{ee();ns();fe();TQ=60,PQ=TQ*60,_P=PQ*24,bke=_P*7,Ske=_P*30,xke=_P*365;Af={DateTimeFormat(r,t){return new Yt(()=>{try{return new Intl.DateTimeFormat(r,t)}catch{return new Intl.DateTimeFormat(void 0,t)}})},Collator(r,t){return new Yt(()=>{try{return new Intl.Collator(r,t)}catch{return new Intl.Collator(void 0,t)}})},Segmenter(r,t){return new Yt(()=>{try{return new Intl.Segmenter(r,t)}catch{return new Intl.Segmenter(void 0,t)}})},Locale(r,t){return new Yt(()=>{try{return new Intl.Locale(r,t)}catch{return new Intl.Locale(Pi,t)}})},NumberFormat(r,t){return new Yt(()=>{try{return new Intl.NumberFormat(r,t)}catch{return new Intl.NumberFormat(void 0,t)}})}}});function kQ(r,t){return Lb(r["inspect-extensions"],r["inspect-brk-extensions"],5870,t,r.debugId,r.extensionEnvironment)}function Lb(r,t,e,n,o,i){let a=Number(t||r)||(n?null:e),l=a?!!t:!1,c;if(i)try{c=JSON.parse(i)}catch{}return{port:a,break:l,debugId:o,env:c}}var JH,xt,YH=v(()=>{Mb();xb();Me();Oe();hr();it();te();JH=/^([^.]+\..+)[:=](.+)$/,xt=class{constructor(t,e,n){this._args=t;this.paths=e;this.productService=n}get appRoot(){return It(Pt.asFileUri("").fsPath)}get userHome(){return S.file(this.paths.homeDir)}get userDataPath(){return this.paths.userDataDir}get appSettingsHome(){return S.file($(this.userDataPath,"User"))}get tmpDir(){return S.file(this.paths.tmpDir)}get cacheHome(){return S.file(this.userDataPath)}get stateResource(){return ge(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:q.vscodeUserData})}get userDataSyncHome(){return ge(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){let t=QH(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=$(this.userDataPath,"logs",t)}return S.file(this.args.logsPath)}get sync(){return this.args.sync}get workspaceStorageHome(){return ge(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return ge(this.appSettingsHome,"History")}get keyboardLayoutResource(){return ge(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){let t=Qt.VSCODE_PORTABLE;return t?S.file($(t,"argv.json")):ge(this.appSettingsHome,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return S.file($(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){let t=this.args["builtin-extensions-dir"];return t?Sn(t):Fn($(Pt.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){let t=this.args["extensions-download-dir"];return t?S.file(Sn(t)):S.file($(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){let t=this.args["extensions-dir"];if(t)return Sn(t);let e=Qt.VSCODE_EXTENSIONS;if(e)return e;let n=Qt.VSCODE_PORTABLE;return n?$(n,"extensions"):ge(this.userHome,this.productService.dataFolderName,"extensions").fsPath}get appSharedDataHome(){let t=this.args["shared-data-dir"];if(t)return S.file(Sn(t));let e=Qt.VSCODE_PORTABLE;return e?S.file($(e,"shared-data")):ge(this.userHome,this.productService.sharedDataFolderName)}get extensionDevelopmentLocationURI(){let t=this.args.extensionDevelopmentPath;if(Array.isArray(t))return t.map(e=>/^[^:/?#]+?:\/\//.test(e)?S.parse(e):S.file(Fn(e)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(t=>t==="ui"||t==="workspace"||t==="web"?t:"workspace")}get extensionTestsLocationURI(){let t=this.args.extensionTestsPath;if(t)return/^[^:/?#]+?:\/\//.test(t)?S.parse(t):S.file(Fn(t))}get disableExtensions(){if(this.args["disable-extensions"])return!0;let t=this.args["disable-extension"];if(t){if(typeof t=="string")return[t];if(Array.isArray(t)&&t.length>0)return t}return!1}get skipBuiltinExtensions(){let t=Qt.VSCODE_SKIP_BUILTIN_EXTENSIONS;return t?t.split(",").map(e=>e.trim()).filter(e=>e):[]}get debugExtensionHost(){return kQ(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!Qt.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(t=>!JH.test(t))}get extensionLogLevel(){let t=[];for(let e of this.args.log||[]){let n=JH.exec(e);n?.[1]&&n[2]&&t.push([n[1],n[2]])}return t.length?t:void 0}get serviceMachineIdResource(){return ge(S.file(this.userDataPath),"machineid")}get crashReporterId(){return this.args["crash-reporter-id"]}get crashReporterDirectory(){return this.args["crash-reporter-directory"]}get disableTelemetry(){return!!this.args["disable-telemetry"]}get disableExperiments(){return!!this.args["disable-experiments"]}get disableWorkspaceTrust(){return!!this.args["disable-workspace-trust"]}get useInMemorySecretStorage(){return!!this.args["use-inmemory-secretstorage"]}get policyFile(){if(this.args["__enable-file-policy"]){let t=Qt.VSCODE_PORTABLE;return t?S.file($(t,"policy.json")):ge(this.userHome,this.productService.dataFolderName,"policy.json")}}get agentSessionsWorkspace(){return ge(this.appSettingsHome,"agent-sessions.code-workspace")}get editSessionId(){return this.args.editSessionId}get exportPolicyData(){return this.args["export-policy-data"]}get exportDefaultKeybindings(){return this.args["export-default-keybindings"]}get continueOn(){return this.args.continueOn}set continueOn(t){this.args.continueOn=t}get args(){return this._args}};w([ct],xt.prototype,"appRoot",1),w([ct],xt.prototype,"userHome",1),w([ct],xt.prototype,"userDataPath",1),w([ct],xt.prototype,"appSettingsHome",1),w([ct],xt.prototype,"tmpDir",1),w([ct],xt.prototype,"cacheHome",1),w([ct],xt.prototype,"stateResource",1),w([ct],xt.prototype,"userRoamingDataHome",1),w([ct],xt.prototype,"userDataSyncHome",1),w([ct],xt.prototype,"sync",1),w([ct],xt.prototype,"workspaceStorageHome",1),w([ct],xt.prototype,"localHistoryHome",1),w([ct],xt.prototype,"keyboardLayoutResource",1),w([ct],xt.prototype,"argvResource",1),w([ct],xt.prototype,"isExtensionDevelopment",1),w([ct],xt.prototype,"untitledWorkspacesHome",1),w([ct],xt.prototype,"builtinExtensionsPath",1),w([ct],xt.prototype,"extensionsDownloadLocation",1),w([ct],xt.prototype,"extensionsPath",1),w([ct],xt.prototype,"appSharedDataHome",1),w([ct],xt.prototype,"extensionDevelopmentLocationURI",1),w([ct],xt.prototype,"extensionDevelopmentKind",1),w([ct],xt.prototype,"extensionTestsLocationURI",1),w([ct],xt.prototype,"debugExtensionHost",1),w([ct],xt.prototype,"logLevel",1),w([ct],xt.prototype,"extensionLogLevel",1),w([ct],xt.prototype,"serviceMachineIdResource",1),w([ct],xt.prototype,"disableTelemetry",1),w([ct],xt.prototype,"disableExperiments",1),w([ct],xt.prototype,"disableWorkspaceTrust",1),w([ct],xt.prototype,"useInMemorySecretStorage",1),w([ct],xt.prototype,"policyFile",1),w([ct],xt.prototype,"agentSessionsWorkspace",1)});import{homedir as XH}from"os";import{resolve as AQ,isAbsolute as DQ,join as lp}from"path";function ZH(r,t){let e=MQ(r,t),n=[e];return DQ(e)||n.unshift(_Q),AQ(...n)}function MQ(r,t){process.env.VSCODE_DEV&&(t="code-oss-dev");let e=process.env.VSCODE_PORTABLE;if(e)return lp(e,"user-data");let n=process.env.VSCODE_APPDATA;if(n)return lp(n,t);let o=r["user-data-dir"];return o||LQ(t)}function LQ(r){let t;switch(process.platform){case"win32":if(t=process.env.APPDATA,!t){let e=process.env.USERPROFILE;if(typeof e!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");t=lp(e,"AppData","Roaming")}break;case"darwin":t=lp(XH(),"Library","Application Support");break;case"linux":t=process.env.XDG_CONFIG_HOME||lp(XH(),".config");break;default:throw new Error("Platform not supported")}return lp(t,r)}var _Q,e2=v(()=>{_Q=process.env.VSCODE_CWD||process.cwd()});import{homedir as OQ,tmpdir as UQ}from"os";function t2(r,t){return Lb(r["inspect-ptyhost"],r["inspect-brk-ptyhost"],5877,t,r.extensionEnvironment)}function n2(r,t){return Lb(r["inspect-agenthost"],r["inspect-brk-agenthost"],5878,t,r.extensionEnvironment)}var Ob,Ub=v(()=>{YH();e2();Ob=class extends xt{constructor(t,e){let n=OQ();super(t,{homeDir:n,tmpDir:UQ(),userDataDir:ZH(t,e.nameShort)},e)}}});function xl(){return MP||(MP=O.alloc(0)),MP}function o2(r){switch(r){case 0:return"None";case 1:return"Regular";case 2:return"Control";case 3:return"Ack";case 5:return"Disconnect";case 6:return"ReplayRequest";case 7:return"PauseWriting";case 8:return"ResumeWriting";case 9:return"KeepAlive"}}var NP,MP,Df,fi,Nb,Fb,$c,LP,OP,UP,_f,Cl=v(()=>{Ve();ue();Q();la();(s=>{s.enableDiagnostics=!1,s.records=[];let e=new WeakMap,n=0;function o(a,l){if(!e.has(a)){let c=String(++n);e.set(a,c)}return e.get(a)}function i(a,l,c,u){}s.traceSocketEvent=i})(NP||={});MP=null;Df=class{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(t){this._chunks.push(t),this._totalLength+=t.byteLength}read(t){return this._read(t,!0)}peek(t){return this._read(t,!1)}_read(t,e){if(t===0)return xl();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let s=this._chunks[0];return e&&(this._chunks.shift(),this._totalLength-=t),s}if(this._chunks[0].byteLength>t){let s=this._chunks[0].slice(0,t);return e&&(this._chunks[0]=this._chunks[0].slice(t),this._totalLength-=t),s}let n=O.alloc(t),o=0,i=0;for(;t>0;){let s=this._chunks[i];if(s.byteLength>t){let a=s.slice(0,t);n.set(a,o),o+=t,e&&(this._chunks[i]=s.slice(t),this._totalLength-=t),t-=t}else n.set(s,o),o+=s.byteLength,e?(this._chunks.shift(),this._totalLength-=s.byteLength):i++,t-=s.byteLength}return n}};fi=class{constructor(t,e,n,o){this.type=t;this.id=e;this.ack=n;this.data=o;this.writtenTime=0}get size(){return this.data.byteLength}},Nb=class extends D{constructor(e){super();this._onMessage=this._register(new R);this.onMessage=this._onMessage.event;this._state={readHead:!0,readLen:13,messageType:0,id:0,ack:0};this._socket=e,this._isDisposed=!1,this._incomingData=new Df,this._register(this._socket.onData(n=>this.acceptChunk(n))),this.lastReadTime=Date.now()}acceptChunk(e){if(!(!e||e.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){let n=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=n.readUInt32BE(9),this._state.messageType=n.readUInt8(0),this._state.id=n.readUInt32BE(1),this._state.ack=n.readUInt32BE(5),this._socket.traceSocketEvent("protocolHeaderRead",{messageType:o2(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{let o=this._state.messageType,i=this._state.id,s=this._state.ack;if(this._state.readHead=!0,this._state.readLen=13,this._state.messageType=0,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent("protocolMessageRead",n),this._onMessage.fire(new fi(o,i,s,n)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}},Fb=class{constructor(t){this._writeNowTimeout=null;this._isDisposed=!1,this._isPaused=!1,this._socket=t,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){try{this.flush()}catch{}this._isDisposed=!0}drain(){return this.flush(),this._socket.drain()}flush(){this._writeNow()}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this._scheduleWriting()}write(t){if(this._isDisposed)return;t.writtenTime=Date.now(),this.lastWriteTime=Date.now();let e=O.alloc(13);e.writeUInt8(t.type,0),e.writeUInt32BE(t.id,1),e.writeUInt32BE(t.ack,5),e.writeUInt32BE(t.data.byteLength,9),this._socket.traceSocketEvent("protocolHeaderWrite",{messageType:o2(t.type),id:t.id,ack:t.ack,messageSize:t.data.byteLength}),this._socket.traceSocketEvent("protocolMessageWrite",t.data),this._writeSoon(e,t.data)}_bufferAdd(t,e){let n=this._totalLength===0;return this._data.push(t,e),this._totalLength+=t.byteLength+e.byteLength,n}_bufferTake(){let t=O.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,t}_writeSoon(t,e){this._bufferAdd(t,e)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;let t=this._bufferTake();this._socket.traceSocketEvent("protocolWrite",{byteLength:t.byteLength}),this._socket.write(t)}},$c=class{constructor(){this._hasListeners=!1;this._isDeliveringMessages=!1;this._bufferedMessages=[];this._emitter=new R({onWillAddFirstListener:()=>{this._hasListeners=!0,queueMicrotask(()=>this._deliverMessages())},onDidRemoveLastListener:()=>{this._hasListeners=!1}}),this.event=this._emitter.event}_deliverMessages(){if(!this._isDeliveringMessages){for(this._isDeliveringMessages=!0;this._hasListeners&&this._bufferedMessages.length>0;)this._emitter.fire(this._bufferedMessages.shift());this._isDeliveringMessages=!1}}fire(t){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(t):this._emitter.fire(t):this._bufferedMessages.push(t)}flushBuffer(){this._bufferedMessages=[]}},LP=class{constructor(t){this.data=t,this.next=null}},OP=class{constructor(){this._first=null,this._last=null}length(){let t=0,e=this._first;for(;e;)e=e.next,t++;return t}peek(){return this._first?this._first.data:null}toArray(){let t=[],e=0,n=this._first;for(;n;)t[e++]=n.data,n=n.next;return t}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(t){let e=new LP(t);if(!this._first){this._first=e,this._last=e;return}this._last.next=e,this._last=e}},UP=class r{static{this._HISTORY_LENGTH=10}static{this._INSTANCE=null}static getInstance(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.lastRuns=[];let t=Date.now();for(let e=0;e<r._HISTORY_LENGTH;e++)this.lastRuns[e]=t-1e3*e;setInterval(()=>{for(let e=r._HISTORY_LENGTH;e>=1;e--)this.lastRuns[e]=this.lastRuns[e-1];this.lastRuns[0]=Date.now()},1e3)}load(){let t=Date.now(),e=(1+r._HISTORY_LENGTH)*1e3,n=0;for(let o=0;o<r._HISTORY_LENGTH;o++)t-this.lastRuns[o]<=e&&n++;return 1-n/r._HISTORY_LENGTH}hasHighLoad(){return this.load()>=.5}},_f=class{constructor(t){this._onControlMessage=new $c;this.onControlMessage=this._onControlMessage.event;this._onMessage=new $c;this.onMessage=this._onMessage.event;this._onDidDispose=new $c;this.onDidDispose=this._onDidDispose.event;this._onSocketClose=new $c;this.onSocketClose=this._onSocketClose.event;this._onSocketTimeout=new $c;this.onSocketTimeout=this._onSocketTimeout.event;this._loadEstimator=t.loadEstimator??UP.getInstance(),this._shouldSendKeepAlive=t.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new OP,this._outgoingMsgId=0,this._outgoingAckId=0,this._outgoingAckTimeout=null,this._incomingMsgId=0,this._incomingAckId=0,this._incomingMsgLastTime=0,this._incomingAckTimeout=null,this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socketDisposables=new re,this._socket=t.socket,this._socketWriter=this._socketDisposables.add(new Fb(this._socket)),this._socketReader=this._socketDisposables.add(new Nb(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(e=>this._receiveMessage(e))),this._socketDisposables.add(this._socket.onClose(e=>this._onSocketClose.fire(e))),t.initialChunk&&this._socketReader.acceptChunk(t.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},5e3):this._keepAliveInterval=null}get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._socketDisposables.dispose()}drain(){return this._socketWriter.drain()}sendDisconnect(){if(!this._didSendDisconnect){this._didSendDisconnect=!0;let t=new fi(5,0,0,xl());this._socketWriter.write(t),this._socketWriter.flush()}}sendPause(){let t=new fi(7,0,0,xl());this._socketWriter.write(t)}sendResume(){let t=new fi(8,0,0,xl());this._socketWriter.write(t)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(t,e){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new re,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=t,this._socketWriter=this._socketDisposables.add(new Fb(this._socket)),this._socketReader=this._socketDisposables.add(new Nb(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(n=>this._receiveMessage(n))),this._socketDisposables.add(this._socket.onClose(n=>this._onSocketClose.fire(n))),this._socketReader.acceptChunk(e)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;let t=new fi(3,0,this._incomingAckId,xl());this._socketWriter.write(t);let e=this._outgoingUnackMsg.toArray();for(let n=0,o=e.length;n<o;n++)this._socketWriter.write(e[n]);this._recvAckCheck()}acceptDisconnect(){this._onDidDispose.fire()}_receiveMessage(t){if(t.ack>this._outgoingAckId){this._outgoingAckId=t.ack;do{let e=this._outgoingUnackMsg.peek();if(e&&e.id<=t.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(t.type){case 0:break;case 1:{if(t.id>this._incomingMsgId)if(t.id!==this._incomingMsgId+1){let e=Date.now();e-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=e,this._socketWriter.write(new fi(6,0,0,xl())))}else this._incomingMsgId=t.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(t.data);break}case 2:{this._onControlMessage.fire(t.data);break}case 3:break;case 5:{this._onDidDispose.fire();break}case 6:{let e=this._outgoingUnackMsg.toArray();for(let n=0,o=e.length;n<o;n++)this._socketWriter.write(e[n]);this._recvAckCheck();break}case 7:{this._socketWriter.pause();break}case 8:{this._socketWriter.resume();break}case 9:break}}readEntireBuffer(){return this._socketReader.readEntireBuffer()}flush(){this._socketWriter.flush()}send(t){let e=++this._outgoingMsgId;this._incomingAckId=this._incomingMsgId;let n=new fi(1,e,this._incomingAckId,t);this._outgoingUnackMsg.push(n),this._isReconnecting||(this._socketWriter.write(n),this._recvAckCheck())}sendControl(t){let e=new fi(2,0,0,t);this._socketWriter.write(e)}_sendAckCheck(){if(this._incomingMsgId<=this._incomingAckId||this._incomingAckTimeout)return;let t=Date.now()-this._incomingMsgLastTime;if(t>=2e3){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},2e3-t+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;let t=this._outgoingUnackMsg.peek(),e=Date.now()-t.writtenTime,n=Date.now()-this._socketReader.lastReadTime,o=Date.now()-this._lastSocketTimeoutTime;if(e>=2e4&&n>=2e4&&o>=2e4&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({reason:"unacknowledgedMessage",unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:e,timeSinceLastReceivedSomeData:n});return}let i=Math.max(2e4-e,2e4-n,2e4-o,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},i)}_keepAliveTimeoutCheck(){if(this._isReconnecting)return;let t=Date.now(),e=t-this._socketReader.lastReadTime,n=t-this._lastSocketTimeoutTime;if(e>=2e4&&n>=2e4&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=t;let o=this._outgoingUnackMsg.length(),i=this._outgoingUnackMsg.peek();this._onSocketTimeout.fire({reason:"keepAlive",unacknowledgedMsgCount:o,timeSinceOldestUnacknowledgedMsg:i?t-i.writtenTime:void 0,timeSinceLastReceivedSomeData:e})}}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;let t=new fi(3,0,this._incomingAckId,xl());this._socketWriter.write(t)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;let t=new fi(9,0,this._incomingAckId,xl());this._socketWriter.write(t),this._keepAliveTimeoutCheck()}}});function Hb(r){let t={...r};return typeof t["connection-token"]<"u"&&(t["connection-token"]="<redacted>"),typeof t["agent-host-bridge-connection-token"]<"u"&&(t["agent-host-bridge-connection-token"]="<redacted>"),t}function NQ(r,t){if(typeof r!="string"||r.trim().length===0)return console.log(`[reconnection-grace-time] No CLI argument provided, using default: ${t}ms (${Math.floor(t/1e3)}s)`),t;let e=Number(r);if(!isFinite(e)||e<0)return console.log(`[reconnection-grace-time] Invalid value '${r}', using default: ${t}ms (${Math.floor(t/1e3)}s)`),t;let n=Math.floor(e*1e3);return!isFinite(n)||n>Number.MAX_SAFE_INTEGER?(console.log(`[reconnection-grace-time] Value too large '${r}', using default: ${t}ms (${Math.floor(t/1e3)}s)`),t):(console.log(`[reconnection-grace-time] Parsed CLI argument: ${e}s -> ${n}ms`),n)}var HP,WP,El,Ss,zc=v(()=>{ee();Ub();Yg();Z();Dn();xb();te();it();Oe();Cl();HP="VSCODE_AGENT_HOST_BRIDGE_CONNECTION_TOKEN";WP={"disable-update-check":{type:"boolean"},auth:{type:"string"},"disable-file-downloads":{type:"boolean"},"disable-file-uploads":{type:"boolean"},"disable-file-cache":{type:"boolean"},"disable-getting-started-override":{type:"boolean"},locale:{type:"string"},"link-protection-trusted-domains":{type:"string[]"},"app-name":{type:"string"},host:{type:"string",cat:"o",args:"ip-address",description:d(5114,null)},port:{type:"string",cat:"o",args:"port | port range",description:d(5115,null)},"socket-path":{type:"string",cat:"o",args:"path",description:d(5119,null)},"server-base-path":{type:"string",cat:"o",args:"path",description:d(5117,null)},"connection-token":{type:"string",cat:"o",args:"token",deprecates:["connectionToken"],description:d(5109,null)},"connection-token-file":{type:"string",cat:"o",args:"path",deprecates:["connection-secret","connectionTokenFile"],description:d(5110,null)},"without-connection-token":{type:"boolean",cat:"o",description:d(5122,null)},"disable-websocket-compression":{type:"boolean"},"print-startup-performance":{type:"boolean"},"print-ip-address":{type:"boolean"},"accept-server-license-terms":{type:"boolean",cat:"o",description:d(5102,null)},"server-data-dir":{type:"string",cat:"o",description:d(5118,null)},"telemetry-level":{type:"string",cat:"o",args:"level",description:d(5121,null)},"user-data-dir":$t["user-data-dir"],"enable-smoke-test-driver":$t["enable-smoke-test-driver"],"disable-telemetry":$t["disable-telemetry"],"disable-experiments":$t["disable-experiments"],"disable-workspace-trust":$t["disable-workspace-trust"],"file-watcher-polling":{type:"string",deprecates:["fileWatcherPolling"]},"enable-remote-storage":{type:"boolean",cat:"o",description:d(5113,null)},log:$t.log,logsPath:$t.logsPath,"force-disable-user-env":$t["force-disable-user-env"],"enable-proposed-api":$t["enable-proposed-api"],folder:{type:"string",deprecationMessage:"No longer supported. Folder needs to be provided in the browser URL or with `default-folder`."},workspace:{type:"string",deprecationMessage:"No longer supported. Workspace needs to be provided in the browser URL or with `default-workspace`."},"default-folder":{type:"string",description:d(5111,null)},"default-workspace":{type:"string",description:d(5112,null)},"enable-sync":{type:"boolean"},"github-auth":{type:"string"},"use-test-resolver":{type:"boolean"},"extensions-dir":$t["extensions-dir"],"extensions-download-dir":$t["extensions-download-dir"],"builtin-extensions-dir":$t["builtin-extensions-dir"],"install-extension":$t["install-extension"],"install-builtin-extension":$t["install-builtin-extension"],"update-extensions":$t["update-extensions"],"uninstall-extension":$t["uninstall-extension"],"list-extensions":$t["list-extensions"],"locate-extension":$t["locate-extension"],"show-versions":$t["show-versions"],category:$t.category,force:$t.force,"do-not-sync":$t["do-not-sync"],"do-not-include-pack-dependencies":$t["do-not-include-pack-dependencies"],"pre-release":$t["pre-release"],"start-server":{type:"boolean",cat:"e",description:d(5120,null)},"enable-remote-auto-shutdown":{type:"boolean"},"remote-auto-shutdown-without-delay":{type:"boolean"},"inspect-ptyhost":{type:"string",allowEmptyValue:!0},"agent-host-port":{type:"string",cat:"o",args:"port",description:d(5108,null)},"agent-host-path":{type:"string",cat:"o",args:"path",description:d(5107,null)},"agent-host-bridge-port":{type:"string",cat:"o",args:"port",description:d(5106,null)},"agent-host-bridge-path":{type:"string",cat:"o",args:"path",description:d(5105,null)},"agent-host-bridge-host":{type:"string",cat:"o",args:"host",description:d(5104,null)},"agent-host-bridge-connection-token":{type:"string",cat:"o",args:"token",description:d(5103,null)},"use-host-proxy":{type:"boolean"},"without-browser-env-var":{type:"boolean"},"reconnection-grace-time":{type:"string",cat:"o",args:"seconds",description:d(5116,null)},help:$t.help,version:$t.version,"locate-shell-integration-path":$t["locate-shell-integration-path"],compatibility:{type:"string"},_:$t._},El=Ut,Ss=class extends Ob{get userRoamingDataHome(){return this.appSettingsHome}get machineSettingsResource(){return ge(S.file($(this.userDataPath,"Machine")),"settings.json")}get mcpResource(){return ge(S.file($(this.userDataPath,"User")),"mcp.json")}get args(){return super.args}get reconnectionGraceTime(){return NQ(this.args["reconnection-grace-time"],108e5)}};w([ct],Ss.prototype,"userRoamingDataHome",1),w([ct],Ss.prototype,"machineSettingsResource",1),w([ct],Ss.prototype,"mcpResource",1),w([ct],Ss.prototype,"reconnectionGraceTime",1)});var FQ,r2,wl,VP=v(()=>{Jt();xe();Me();it();gl();te();ee();_o();ui();Yn();Wn();FQ=r=>d(4364,null,r),r2=d(4377,null,"ms-dotnettools.csharp"),wl=class{constructor(t,e,n,o,i){this.extensionsForceVersionByQuality=t;this.logger=e;this.extensionManagementService=n;this.extensionGalleryService=o;this.productService=i;this.extensionsForceVersionByQuality=this.extensionsForceVersionByQuality.map(s=>s.toLowerCase())}get location(){}async listExtensions(t,e,n){let o=await this.extensionManagementService.getInstalled(1,n),i=kI.map(a=>a.toLowerCase());if(e&&e!==""){if(i.indexOf(e.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}o=o.filter(a=>a.manifest.categories?a.manifest.categories.map(c=>c.toLowerCase()).indexOf(e.toLowerCase())>-1:!1)}else if(e===""){this.logger.info("Possible Categories: "),i.forEach(a=>{this.logger.info(a)});return}this.location&&this.logger.info(d(4363,null,this.location)),o=o.sort((a,l)=>a.identifier.id.localeCompare(l.identifier.id));let s;for(let a of o)s!==a.identifier.id&&(s=a.identifier.id,this.logger.info(t?`${s}@${a.manifest.version}`:s))}async installExtensions(t,e,n,o){let i=[];try{t.length&&this.logger.info(this.location?d(4362,null,this.location):d(4361,null));let s=[],a=[],l=(u,p,m)=>{this.extensionsForceVersionByQuality?.some(g=>g===u.toLowerCase())&&(p=this.productService.quality!=="stable"?"prerelease":void 0),a.push({id:u,version:p!=="prerelease"?p:void 0,installOptions:{...n,isBuiltin:m,installPreReleaseVersion:p==="prerelease"||n.installPreReleaseVersion}})};for(let u of t)if(u instanceof S)s.push({vsix:u,installOptions:n});else{let[p,m]=uf(u);l(p,m,!1)}for(let u of e)if(u instanceof S)s.push({vsix:u,installOptions:{...n,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{let[p,m]=uf(u);l(p,m,!0)}let c=await this.extensionManagementService.getInstalled(void 0,n.profileLocation);if(s.length&&await Promise.all(s.map(async({vsix:u,installOptions:p})=>{try{await this.installVSIX(u,p,o,c)}catch(m){this.logger.error(m),i.push(u.toString())}})),a.length){let u=await this.installGalleryExtensions(a,c,o);i.push(...u)}}catch(s){throw this.logger.error(d(4351,null,ye(s))),s}if(i.length)throw new Error(d(4356,null,i.join(", ")))}async updateExtensions(t){let e=await this.extensionManagementService.getInstalled(1,t),n=[];for(let a of e)a.identifier.uuid&&n.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(d(4375,null,n.length));let o=await this.extensionGalleryService.getExtensions(n,{compatible:!0},Ae.None),i=[];for(let a of o)for(let l of e)_e(l.identifier,a.identifier)&&ps(a.version,l.manifest.version)&&i.push({extension:a,options:{operation:3,installPreReleaseVersion:l.preRelease,profileLocation:t,isApplicationScoped:l.isApplicationScoped}});if(!i.length){this.logger.info(d(4374,null));return}this.logger.info(d(4373,null,i.map(a=>a.extension.identifier.id).join(", ")));let s=await this.extensionManagementService.installGalleryExtensions(i);for(let a of s)a.error?this.logger.error(d(4353,null,a.identifier.id,ye(a.error))):this.logger.info(d(4370,null,a.identifier.id,a.local?.manifest.version))}async installGalleryExtensions(t,e,n){if(t=t.filter(a=>{let{id:l,version:c,installOptions:u}=a,p=e.find(m=>_e(m.identifier,{id:l}));if(p){let m=this.validateBuiltinExtensionEnabledWithAutoUpdates(p);if(m)return this.logger.info(m),!1;if(!n&&(!c||c==="prerelease"&&p.preRelease))return this.logger.info(d(4347,null,l,p.manifest.version,l)),!1;if(c&&p.manifest.version===c)return this.logger.info(d(4346,null,`${l}@${c}`)),!1;p.preRelease&&c!=="prerelease"&&(u.preRelease=!1)}return!0}),!t.length)return[];let o=[],i=[],s=await this.getGalleryExtensions(t);if(await Promise.all(t.map(async({id:a,version:l,installOptions:c})=>{let u=s.get(a.toLowerCase());if(!u){this.logger.error(`${FQ(l?`${a}@${l}`:a)}
${r2}`),o.push(a);return}try{let m=await this.extensionGalleryService.getManifest(u,Ae.None);if(m&&!this.validateExtensionKind(m))return}catch(m){this.logger.error(m.message||m.stack||m),o.push(a);return}let p=e.find(m=>_e(m.identifier,u.identifier));if(p){if(u.version===p.manifest.version){this.logger.info(d(4346,null,l?`${a}@${l}`:a));return}this.logger.info(d(4376,null,a,u.version))}c.isBuiltin?this.logger.info(l?d(4359,null,a,l):d(4358,null,a)):this.logger.info(l?d(4360,null,a,l):d(4357,null,a)),i.push({extension:u,options:{...c,installGivenVersion:!!l,isApplicationScoped:c.isApplicationScoped||p?.isApplicationScoped}})})),i.length){let a=await this.extensionManagementService.installGalleryExtensions(i);for(let l of a)l.error?(this.logger.error(d(4352,null,l.identifier.id,ye(l.error))),o.push(l.identifier.id)):this.logger.info(d(4367,null,l.identifier.id,l.local?.manifest.version))}return o}async installVSIX(t,e,n,o){let i=await this.extensionManagementService.getManifest(t);if(!i)throw new Error("Invalid vsix");if(await this.validateVSIX(i,n,e.profileLocation,o))try{await this.extensionManagementService.install(t,{...e,installGivenVersion:!0}),this.logger.info(d(4371,null,xn(t)))}catch(a){if(on(a))this.logger.info(d(4350,null,xn(t)));else throw a}}async getGalleryExtensions(t){let e=new Map,n=t.some(s=>s.installOptions.installPreReleaseVersion),o=await this.extensionManagementService.getTargetPlatform(),i=[];for(let s of t)sf.test(s.id)&&i.push({...s,preRelease:n});if(i.length){let s=await this.extensionGalleryService.getExtensions(i,{targetPlatform:o},Ae.None);for(let a of s)e.set(a.identifier.id.toLowerCase(),a)}return e}validateExtensionKind(t){return!0}async validateVSIX(t,e,n,o){let i={id:Mo(t.publisher,t.name)},s=o.find(a=>_e(i,a.identifier));if(s){let a=this.validateBuiltinExtensionEnabledWithAutoUpdates(s);if(a)return this.logger.info(a),!1;if(!e&&ps(s.manifest.version,t.version))return this.logger.info(d(4354,null,s.identifier.id,s.manifest.version,t.version)),!1}return this.validateExtensionKind(t)}async uninstallExtensions(t,e,n){let o=async s=>{if(s instanceof S){let a=await this.extensionManagementService.getManifest(s);return Mu(a.publisher,a.name)}return s},i=[];for(let s of t){let a=await o(s),c=(await this.extensionManagementService.getInstalled(void 0,n)).filter(u=>_e(u.identifier,{id:a}));if(!c.length)throw new Error(`${this.notInstalled(a)}
${r2}`);if(c.some(u=>u.type===0)){this.logger.info(d(4348,null,a));return}if(!e&&c.some(u=>u.isBuiltin)){this.logger.info(d(4355,null,a));return}this.logger.info(d(4372,null,a));for(let u of c)await this.extensionManagementService.uninstall(u,{profileLocation:n}),i.push(u);this.location?this.logger.info(d(4369,null,a,this.location)):this.logger.info(d(4368,null,a))}}async locateExtension(t){let e=await this.extensionManagementService.getInstalled();t.forEach(n=>{e.forEach(o=>{if(o.identifier.id===n&&o.location.scheme===q.file){this.logger.info(o.location.fsPath);return}})})}notInstalled(t){return this.location?d(4366,null,t,this.location):d(4365,null,t)}validateBuiltinExtensionEnabledWithAutoUpdates(t){if(t.isBuiltin&&this.productService.builtInExtensionsEnabledWithAutoUpdates.some(e=>e.toLowerCase()===t.identifier.id.toLowerCase())&&!t.forceAutoUpdate)return d(4349,null,t.identifier.id,this.productService.quality)}};wl=w([b(2,Du),b(3,So),b(4,Be)],wl)});function HQ(r){return r.tags.find(t=>t.startsWith("lp-"))?.split("lp-")[1]}var dp,cp,Wb=v(()=>{Jt();Q();fe();ee();_o();Z();dp=A("languagePackService"),cp=class extends D{constructor(e){super();this.extensionGalleryService=e}async getAvailableLanguages(){let e=new _t;setTimeout(()=>e.cancel(),1e3);let n;try{n=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}let i=n.firstPage.filter(s=>s.properties.localizedLanguages?.length&&s.tags.some(a=>a.startsWith("lp-"))).map(s=>{let a=s.properties.localizedLanguages?.[0],l=HQ(s);return{...this.createQuickPickItem(l,a,s),extensionId:s.identifier.id,galleryExtension:s}});return i.push(this.createQuickPickItem("en","English")),i}createQuickPickItem(e,n,o){let i=n??e,s;if(i!==e&&(s=`(${e})`),e.toLowerCase()===Un.toLowerCase()&&(s??="",s+=d(4490,null)),o?.installCount){s??="";let a=o.installCount,l;a>1e6?l=`${Math.floor(a/1e5)/10}M`:a>1e3?l=`${Math.floor(a/1e3)}K`:l=String(a),s+=` $(cloud-download) ${l}`}return{id:e,label:i,description:s}}};cp=w([b(0,So)],cp)});import*as i2 from"fs";import{createHash as WQ}from"crypto";function VQ(r){if(typeof r.languageId!="string"||!Array.isArray(r.translations)||r.translations.length===0)return!1;for(let t of r.translations)if(typeof t.id!="string"||typeof t.path!="string")return!1;return!(r.languageName&&typeof r.languageName!="string"||r.localizedLanguageName&&typeof r.localizedLanguageName!="string")}var Rl,Mf,BP=v(()=>{Dt();Ue();Q();Me();Oe();vo();Dn();_o();ui();De();Wb();te();Rl=class extends cp{constructor(e,n,o,i){super(o);this.extensionManagementService=e;this.logService=i;this.cache=this._register(new Mf(n,i)),this.extensionManagementService.registerParticipant({postInstall:async s=>this.postInstallExtension(s),postUninstall:async s=>this.postUninstallExtension(s)})}async getBuiltInExtensionTranslationsUri(e,n){let i=(await this.cache.getLanguagePacks())[n];if(!i){this.logService.warn(`No language pack found for ${n}`);return}let s=i.translations[e];return s?S.file(s):void 0}async getInstalledLanguages(){let e=await this.cache.getLanguagePacks(),n=Object.keys(e).map(o=>{let i=e[o];return{...this.createQuickPickItem(o,i.label),extensionId:i.extensions[0].extensionIdentifier.id}});return n.push(this.createQuickPickItem("en","English")),n.sort((o,i)=>o.label.localeCompare(i.label)),n}async postInstallExtension(e){e&&e.manifest&&e.manifest.contributes&&e.manifest.contributes.localizations&&e.manifest.contributes.localizations.length&&(this.logService.info("Adding language packs from the extension",e.identifier.id),await this.update())}async postUninstallExtension(e){let n=await this.cache.getLanguagePacks();Object.keys(n).some(o=>n[o]&&n[o].extensions.some(i=>_e(i.extensionIdentifier,e.identifier)))&&(this.logService.info("Removing language packs from the extension",e.identifier.id),await this.update())}async update(){let[e,n]=await Promise.all([this.cache.getLanguagePacks(),this.extensionManagementService.getInstalled()]),o=await this.cache.update(n);return!Gt(Object.keys(e),Object.keys(o))}};Rl=w([b(0,Du),b(1,An),b(2,So),b(3,z)],Rl);Mf=class extends D{constructor(e,n){super();this.logService=n;this.languagePacks={};this.languagePacksFilePath=$(e.userDataPath,"languagepacks.json"),this.languagePacksFileLimiter=new Nr}getLanguagePacks(){return this.languagePacksFileLimiter.size||!this.initializedCache?this.withLanguagePacks().then(()=>this.languagePacks):Promise.resolve(this.languagePacks)}update(e){return this.withLanguagePacks(n=>{Object.keys(n).forEach(o=>delete n[o]),this.createLanguagePacksFromExtensions(n,...e)}).then(()=>this.languagePacks)}createLanguagePacksFromExtensions(e,...n){for(let o of n)o&&o.manifest&&o.manifest.contributes&&o.manifest.contributes.localizations&&o.manifest.contributes.localizations.length&&this.createLanguagePacksFromExtension(e,o);Object.keys(e).forEach(o=>this.updateHash(e[o]))}createLanguagePacksFromExtension(e,n){let o=n.identifier,i=n.manifest.contributes&&n.manifest.contributes.localizations?n.manifest.contributes.localizations:[];for(let s of i)if(n.location.scheme===q.file&&VQ(s)){let a=e[s.languageId];a||(a={hash:"",extensions:[],translations:{},label:s.localizedLanguageName??s.languageName},e[s.languageId]=a);let l=a.extensions.filter(c=>_e(c.extensionIdentifier,o))[0];l?l.version=n.manifest.version:a.extensions.push({extensionIdentifier:o,version:n.manifest.version});for(let c of s.translations)a.translations[c.id]=$(n.location.fsPath,c.path)}}updateHash(e){if(e){let n=WQ("md5");for(let o of e.extensions)n.update(o.extensionIdentifier.uuid||o.extensionIdentifier.id).update(o.version);e.hash=n.digest("hex")}}withLanguagePacks(e=()=>null){return this.languagePacksFileLimiter.queue(()=>{let n=null;return i2.promises.readFile(this.languagePacksFilePath,"utf8").then(void 0,o=>o.code==="ENOENT"?Promise.resolve("{}"):Promise.reject(o)).then(o=>{try{return JSON.parse(o)}catch{return{}}}).then(o=>(n=e(o),o)).then(o=>{for(let s of Object.keys(o))o[s]||delete o[s];this.languagePacks=o,this.initializedCache=!0;let i=JSON.stringify(this.languagePacks);return this.logService.debug("Writing language packs",i),Ce.writeFile(this.languagePacksFilePath,i)}).then(()=>n,o=>this.logService.error(o))})}};Mf=w([b(0,An),b(1,z)],Mf)});var up,s2=v(()=>{Jt();Me();st();Ui();up=class{constructor(t,e){this.requestService=t;this.fileService=e}async download(t,e,n,o=Ae.None){if(t.scheme===q.file||t.scheme===q.vscodeRemote){await this.fileService.copy(t,e);return}let i={type:"GET",url:t.toString(!0),callSite:n},s=await this.requestService.request(i,o);if(s.res.statusCode===200)await this.fileService.writeFile(e,s.stream);else{let a=await ds(s);throw new Error(`Expected 200, got back ${s.res.statusCode} instead.
${a}`)}}};up=w([b(0,ao),b(1,Le)],up)});function hi(r,t,e){t instanceof ht||(t=new ht(t,[],!!e)),BQ.push([r,t])}var BQ,Gc=v(()=>{Hg();BQ=[]});var Vb,ca,qP=v(()=>{co();te();Gc();st();it();ue();Q();Dt();Vb=class r{constructor(t){this.uri=t;this.time=r._clock++}static{this._clock=0}touch(){return this.time=r._clock++,this}},ca=class{constructor(t){this._fileService=t;this._dispooables=new re;this._limit=2**16;let e=new Map,n=o=>{let i=e.get(o.scheme);return i===void 0&&(i=t.hasProvider(o)&&!this._fileService.hasCapability(o,1024),e.set(o.scheme,i)),i};this._dispooables.add(F.any(t.onDidChangeFileSystemProviderRegistrations,t.onDidChangeFileSystemProviderCapabilities)(o=>{if(e.get(o.scheme)===void 0)return;e.delete(o.scheme);let s=n(S.from({scheme:o.scheme}));if(s!==s)for(let[a,l]of this._canonicalUris.entries())l.uri.scheme===o.scheme&&this._canonicalUris.delete(a)})),this.extUri=new vc(n),this._canonicalUris=new Map}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(t){this._fileService.hasProvider(t)&&(t=hR(t));let e=this.extUri.getComparisonKey(t,!0),n=this._canonicalUris.get(e);return n?n.touch().uri.with({fragment:t.fragment}):(this._canonicalUris.set(e,new Vb(t)),this._checkTrim(),t)}_checkTrim(){if(this._canonicalUris.size<this._limit)return;Vb._clock=1;let t=[...this._canonicalUris.values()].map(n=>n.time),e=hv(Math.floor(t.length/2),t,(n,o)=>n-o);for(let[n,o]of this._canonicalUris.entries())o.time<=e?this._canonicalUris.delete(n):o.time=0}};ca=w([b(0,Le)],ca);hi(Ye,ca,1)});import{promises as Bb}from"fs";import*as qb from"path";async function Of(r,t){if(!Je.commit||!await Ce.exists(a2))return{userLocale:"en",osLocale:"en",resolvedLanguage:"en",defaultMessagesFile:a2,locale:"en",availableLanguages:{}};let e=`${r}||${t}`,n=$P.get(e);return n||(n=Pg({userLocale:r,osLocale:r,commit:Je.commit,nlsMetadataHash:Je.nlsMetadataHash,userDataPath:t,nlsMetadataPath:l2}),$P.set(e,n),n.then(o=>{!r.startsWith("en")&&o.resolvedLanguage.startsWith("en")&&$P.delete(e)})),n}async function d2(r,t){if(r.startsWith("en"))return"";let e=await Of(r,t),n=e?.languagePack?.messagesFile,o=e?.resolvedLanguage;if(!n||!o)return"";let i=qb.join(qb.dirname(n),"nls.messages.js");try{return await Bb.stat(i),i}catch(l){if(l.code!=="ENOENT")throw l}let a=`globalThis._VSCODE_NLS_MESSAGES=${(await Bb.readFile(n)).toString()};
globalThis._VSCODE_NLS_LANGUAGE=${JSON.stringify(o)};`;return await Bb.writeFile(i,a,"utf-8"),i}var l2,a2,$P,c2,qQ,$b=v(()=>{Me();Oe();ER();vo();ai();l2=$(Pt.asFileUri("").fsPath),a2=$(l2,"nls.messages.json"),$P=new Map;c2=async r=>{try{let t=qQ(await Bb.readFile(r,"utf8"));return JSON.parse(t).locale}catch(t){return t.code!=="ENOENT"&&console.warn(t),"en"}},qQ=r=>{let t=/('(?:[^\\']*(?:\\.)?)*')|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;return r.replace(t,(e,n,o,i,s)=>{if(i)return"";if(s){let a=s.length;return a>2&&s[a-1]===`
`?s[a-2]==="\r"?`\r
`:`
`:""}else return e})}});var Tl,zP=v(()=>{it();te();Dn();Hc();Ju();st();Z();De();Wn();co();xo();$b();Tl=class extends Ku{constructor(e,n,o,i,s,a,l,c){super(S.file(s.builtinExtensionsPath),S.file(s.extensionsPath),ge(s.userHome,".vscode-oss-dev","extensions","control.json"),e.defaultProfile,e,n,o,i,s,a,l,c);this.nativeEnvironmentService=s}async getTranslations(e){let n=await Of(e,this.nativeEnvironmentService.userDataPath);if(n.languagePack)try{let o=await this.fileService.readFile(S.file(n.languagePack.translationsConfigFile));return JSON.parse(o.value.toString())}catch{}return Object.create(null)}};Tl=w([b(0,Bt),b(1,Cr),b(2,Le),b(3,z),b(4,An),b(5,Be),b(6,Ye),b(7,Hn)],Tl)});var u2,zb,GP=v(()=>{Z();u2=A("stateReadService"),zb=A("stateService")});var KP,Uf,Gb,p2=v(()=>{Ue();Ve();Q();Ie();Dn();st();De();KP=class extends D{constructor(e,n,o,i){super();this.storagePath=e;this.logService=o;this.fileService=i;this.storage=Object.create(null);this.lastSavedStorageContents="";this.initializing=void 0;this.closing=void 0;this.flushDelayer=this._register(new Or(n===0?0:100))}init(){return this.initializing||(this.initializing=this.doInit()),this.initializing}async doInit(){try{this.lastSavedStorageContents=(await this.fileService.readFile(this.storagePath)).value.toString(),this.storage=JSON.parse(this.lastSavedStorageContents)}catch(e){e.fileOperationResult!==1&&this.logService.error(e)}}getItem(e,n){let o=this.storage[e];return Kt(o)?n:o}setItem(e,n){this.setItems([{key:e,data:n}])}setItems(e){let n=!1;for(let{key:o,data:i}of e)this.storage[o]!==i&&(Kt(i)?$n(this.storage[o])||(this.storage[o]=void 0,n=!0):(this.storage[o]=i,n=!0));n&&this.save()}removeItem(e){$n(this.storage[e])||(this.storage[e]=void 0,this.save())}async save(){if(!this.closing)return this.flushDelayer.trigger(()=>this.doSave())}async doSave(){if(!this.initializing)return;await this.initializing;let e=JSON.stringify(this.storage,null,4);if(e!==this.lastSavedStorageContents)try{await this.fileService.writeFile(this.storagePath,O.fromString(e),{atomic:{postfix:".vsctmp"}}),this.lastSavedStorageContents=e}catch(n){this.logService.error(n)}}async close(){return this.closing||(this.closing=this.flushDelayer.trigger(()=>this.doSave(),0)),this.closing}},Uf=class extends D{constructor(t,e,n,o){super(),this.fileStorage=this._register(new KP(e.stateResource,t,n,o))}async init(){await this.fileStorage.init()}getItem(t,e){return this.fileStorage.getItem(t,e)}};Uf=w([b(1,Ut),b(2,z),b(3,Le)],Uf);Gb=class extends Uf{setItem(t,e){this.fileStorage.setItem(t,e)}setItems(t){this.fileStorage.setItems(t)}removeItem(t){this.fileStorage.removeItem(t)}close(){return this.fileStorage.close()}}});var Pl,yi,kl,Kb=v(()=>{te();Dn();st();De();GP();co();xo();Ie();p2();Pl=class extends Ou{constructor(e,n,o,i,s){super(o,i,n,s);this.stateReadonlyService=e;this.nativeEnvironmentService=o}getStoredProfiles(){return this.stateReadonlyService.getItem(Pl.PROFILES_KEY,[]).map(n=>({...n,location:G(n.location)?this.uriIdentityService.extUri.joinPath(this.profilesHome,n.location):S.revive(n.location)}))}getStoredProfileAssociations(){return this.stateReadonlyService.getItem(Pl.PROFILE_ASSOCIATIONS_KEY,{})}getDefaultProfileExtensionsLocation(){return this.uriIdentityService.extUri.joinPath(S.file(this.nativeEnvironmentService.extensionsPath).with({scheme:this.profilesHome.scheme}),"extensions.json")}};Pl=w([b(0,u2),b(1,Ye),b(2,An),b(3,Le),b(4,z)],Pl);yi=class extends Pl{constructor(e,n,o,i,s){super(e,n,o,i,s);this.stateService=e}saveStoredProfiles(e){e.length?this.stateService.setItem(yi.PROFILES_KEY,e.map(n=>({...n,location:this.uriIdentityService.extUri.relativePath(this.profilesHome,n.location)}))):this.stateService.removeItem(yi.PROFILES_KEY)}saveStoredProfileAssociations(e){e.emptyWindows||e.workspaces?this.stateService.setItem(yi.PROFILE_ASSOCIATIONS_KEY,e):this.stateService.removeItem(yi.PROFILE_ASSOCIATIONS_KEY)}};yi=w([b(0,zb),b(1,Ye),b(2,An),b(3,Le),b(4,z)],yi);kl=class extends yi{constructor(t,e,n,o){super(new Gb(0,e,o,n),t,e,n,o)}async init(){return await this.stateService.init(),super.init()}};kl=w([b(0,Ye),b(1,An),b(2,Le),b(3,z)],kl)});var Al,jP=v(()=>{De();xo();co();Hc();st();Dn();te();Al=class extends Gu{constructor(t,e,n,o,i){super(S.file(t.extensionsPath),e,n,o,i)}};Al=w([b(0,An),b(1,Le),b(2,Bt),b(3,Ye),b(4,z)],Al)});async function $Q(r,t,e,n,o){try{let i=await import("@vscode/spdlog");i.setFlushOn(0);let s=await i.createAsyncRotatingLogger(r,t,e,n);return o?s.clearFormatters():s.setPattern("%Y-%m-%d %H:%M:%S.%e [%l] %v"),s}catch(i){console.error(i)}return null}function m2(r,t,e){switch(t){case 1:r.trace(e);break;case 2:r.debug(e);break;case 3:r.info(e);break;case 4:r.warn(e);break;case 5:r.error(e);break;case 0:break;default:throw new Error(`Invalid log level ${t}`)}}function g2(r,t){switch(t){case 1:r.setLevel(0);break;case 2:r.setLevel(1);break;case 3:r.setLevel(2);break;case 4:r.setLevel(3);break;case 5:r.setLevel(4);break;case 0:r.setLevel(6);break;default:throw new Error(`Invalid log level ${t}`)}}var jb,f2=v(()=>{st();De();jb=class extends Lg{constructor(e,n,o,i,s){super();this.buffer=[];this.setLevel(s),this._loggerCreationPromise=this._createSpdLogLogger(e,n,o,i),this._register(this.onDidChangeLogLevel(a=>{this._logger&&g2(this._logger,a)}))}async _createSpdLogLogger(e,n,o,i){let s=o?6:1,a=30/s*Oi.MB,l=await $Q(e,n,a,s,i);if(l){this._logger=l,g2(this._logger,this.getLevel());for(let{level:c,message:u}of this.buffer)m2(this._logger,c,u);this.buffer=[]}}log(e,n){this._logger?m2(this._logger,e,n):this.getLevel()<=e&&this.buffer.push({level:e,message:n})}flush(){this._logger?this.flushLogger():this._loggerCreationPromise.then(()=>this.flushLogger())}dispose(){this._logger?this.disposeLogger():this._loggerCreationPromise.then(()=>this.disposeLogger()),super.dispose()}flushLogger(){this._logger&&this._logger.flush()}disposeLogger(){this._logger&&(this._logger.drop(),this._logger=void 0)}}});var pp,QP=v(()=>{Vt();De();f2();pp=class extends Og{doCreateLogger(t,e,n){return new jb(Ee(),t.fsPath,!n?.donotRotate,!!n?.donotUseFormatters,e)}}});function zQ(){return process.uncHostAllowlist}function Nf(r){if(process.platform!=="win32")return;let t=zQ();if(t)if(typeof r=="string")t.add(r.toLowerCase());else for(let e of GQ(r))Nf(e)}function GQ(r){let t=new Set;if(Array.isArray(r))for(let e of r)typeof e=="string"&&t.add(e);return Array.from(t)}function Qb(){process.platform==="win32"&&(process.restrictUNCAccess=!1)}var JP=v(()=>{});function KQ(r){return r.type==="gallery"}function jQ(r){return r.type===1||r.type===0}var QQ,Dl,YP=v(()=>{Q();ee();_o();Yn();Wn();xr();dn();Ie();ue();QQ=/^(?<version>\d+\.\d+\.\d+(-.*)?)(@(?<platform>.+))?$/,Dl=class extends D{constructor(e,n){super();this.configurationService=n;this._onDidChangeAllowedExtensions=this._register(new R);this.onDidChangeAllowedExtensionsConfigValue=this._onDidChangeAllowedExtensions.event;this.publisherOrgs=e.extensionPublisherOrgs?.map(o=>o.toLowerCase())??[],this._allowedExtensionsConfigValue=this.getAllowedExtensionsValue(),this._register(this.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(lf)&&(this._allowedExtensionsConfigValue=this.getAllowedExtensionsValue(),this._onDidChangeAllowedExtensions.fire())}))}get allowedExtensionsConfigValue(){return this._allowedExtensionsConfigValue}getAllowedExtensionsValue(){let e=this.configurationService.getValue(lf);if(!ve(e)||Array.isArray(e))return;let n=Object.entries(e).map(([o,i])=>[o.toLowerCase(),i]);if(!(n.length===1&&n[0][0]==="*"&&n[0][1]===!0))return Object.assign(Object.create(null),Object.fromEntries(n))}isAllowed(e){if(!this._allowedExtensionsConfigValue)return!0;let n,o,i,s,a,l;KQ(e)?(n=e.identifier.id.toLowerCase(),o=e.version,s=e.properties.isPreReleaseVersion,a=e.publisher.toLowerCase(),l=e.publisherDisplayName.toLowerCase(),i=e.properties.targetPlatform):jQ(e)?(n=e.identifier.id.toLowerCase(),o=e.manifest.version,s=e.preRelease,a=e.manifest.publisher.toLowerCase(),l=e.publisherDisplayName?.toLowerCase(),i=e.targetPlatform):(n=e.id.toLowerCase(),o=e.version??"*",i=e.targetPlatform??"universal",s=e.prerelease??!1,a=e.id.substring(0,e.id.indexOf(".")).toLowerCase(),l=e.publisherDisplayName?.toLowerCase());let c=FI("workbench.action.openSettings",{query:`@id:${lf}`}).toString(),u=this._allowedExtensionsConfigValue[n],p=new at(d(4325,null,c));if(!$n(u))return er(u)?u?!0:p:u==="stable"&&s?new at(d(4322,null,c)):o!=="*"&&Array.isArray(u)&&!u.some(y=>{let h=QQ.exec(y);if(h&&h.groups){let{platform:I,version:x}=h.groups;return!(x!==o||i!=="universal"&&I&&i!==I)}return!1})?new at(d(4326,null,o,c)):!0;let m=l&&this.publisherOrgs.includes(l)?l:a,g=this._allowedExtensionsConfigValue[m];return $n(g)?this._allowedExtensionsConfigValue["*"]===!0?!0:p:er(g)?g?!0:new at(d(4324,null,m,c)):g==="stable"&&s?new at(d(4323,null,m,c)):!0}};Dl=w([b(0,Be),b(1,bt)],Dl)});var _l,XP=v(()=>{ue();Q();te();Wn();Lc();_o();_l=class extends D{constructor(e){super();this.productService=e;this.onDidChangeExtensionGalleryManifest=F.None;this.onDidChangeExtensionGalleryManifestStatus=F.None}get extensionGalleryManifestStatus(){return this.productService.extensionsGallery?.serviceUrl?"available":"unavailable"}async getExtensionGalleryManifest(){let e=this.productService.extensionsGallery;if(!e?.serviceUrl)return null;let n=[{id:`${e.serviceUrl}/extensionquery`,type:"ExtensionQueryService"},{id:`${e.serviceUrl}/vscode/{publisher}/{name}/latest`,type:"ExtensionLatestVersionUriTemplate"},{id:`${e.serviceUrl}/publishers/{publisher}/extensions/{name}/{version}/stats?statType={statTypeName}`,type:"ExtensionStatisticsUriTemplate"}];e.publisherUrl&&n.push({id:`${e.publisherUrl}/{publisher}`,type:"PublisherViewUriTemplate"}),e.itemUrl&&(n.push({id:`${e.itemUrl}?itemName={publisher}.{name}`,type:"ExtensionDetailsViewUriTemplate"}),n.push({id:`${e.itemUrl}?itemName={publisher}.{name}&ssr=false#review-details`,type:"ExtensionRatingViewUriTemplate"})),e.resourceUrlTemplate&&n.push({id:e.resourceUrlTemplate,type:"ExtensionResourceUriTemplate"});let o=[{name:"Tag",value:1},{name:"ExtensionId",value:4},{name:"Category",value:5},{name:"ExtensionName",value:7},{name:"Target",value:8},{name:"Featured",value:9},{name:"SearchText",value:10},{name:"ExcludeWithFlags",value:12}],i=[{name:"NoneOrRelevance",value:0},{name:"LastUpdatedDate",value:1},{name:"Title",value:2},{name:"PublisherName",value:3},{name:"InstallCount",value:4},{name:"AverageRating",value:6},{name:"PublishedDate",value:10},{name:"WeightedRating",value:12}],s=[{name:"None",value:0},{name:"IncludeVersions",value:1},{name:"IncludeFiles",value:2},{name:"IncludeCategoryAndTags",value:4},{name:"IncludeSharedAccounts",value:8},{name:"IncludeVersionProperties",value:16},{name:"ExcludeNonValidated",value:32},{name:"IncludeInstallationTargets",value:64},{name:"IncludeAssetUri",value:128},{name:"IncludeStatistics",value:256},{name:"IncludeLatestVersionOnly",value:512},{name:"Unpublished",value:4096},{name:"IncludeNameConflictInfo",value:32768},{name:"IncludeLatestPrereleaseAndStableVersionOnly",value:65536}];return{version:"",resources:n,capabilities:{extensionQuery:{filtering:o,sorting:i,flags:s},signing:{allPublicRepositorySigned:!0}}}}async getAccessToken(e){let n=this.extensionGalleryAccessToken,o=this.extensionGalleryServiceIndexUrl;if(!(!n||!o))try{let i=S.parse(e),s=S.parse(o);return i.scheme==="https"&&s.scheme==="https"&&i.authority.toLowerCase()===s.authority.toLowerCase()?n:void 0}catch{return}}setAuthorization(e,n){this.extensionGalleryAccessToken=e,this.extensionGalleryServiceIndexUrl=n}};_l=w([b(0,Be)],_l)});function h2(r){setTimeout(()=>process.exit(r),0)}async function y2(r,t,e){if(r.help){let o=Je.serverApplicationName+(oe?".cmd":"");console.log(_N(Je.nameLong,o,Je.version,e,{noInputFiles:!0,noPipe:!0}));return}if(r.version){console.log(MN(Je.version,Je.commit));return}let n=new ZP(r,t);try{await n.run(),h2(0)}catch{h2(1)}finally{n.dispose()}}var ZP,v2=v(()=>{Gv();De();Hg();dT();dn();Ui();CT();Wr();_n();_o();lP();IP();sb();SP();ai();Q();wP();kf();Me();st();Wn();zc();VP();Wb();BP();xe();te();Oe();hr();s2();rb();co();qP();Yg();fe();Ju();zP();xo();Hc();bu();Kb();jP();$v();QP();ee();JP();YP();Lc();XP();ZP=class extends D{constructor(e,n){super();this.args=e;this.remoteDataFolder=n;this.registerListeners()}registerListeners(){process.once("exit",()=>this.dispose())}async run(){let e=await this.initServices();await e.invokeFunction(async n=>{let o=n.get(bt),i=n.get(z),s=n.get(Be);oe&&(o.getValue("security.restrictUNCAccess")===!1?Qb():Nf(o.getValue("security.allowedUNCHosts")));try{await this.doRun(e.createInstance(wl,s.extensionsForceVersionByQuality??[],new au(i.getLevel(),!1)))}catch(a){throw i.error(a),console.error(ye(a)),a}})}async initServices(){let e=new sl,n={_serviceBrand:void 0,...Je};e.set(Be,n);let o=new Ss(this.args,n);e.set(El,o);let i=new pp(Ng(o),o.logsHome);e.set(Bo,i);let s=new il(this._register(i.createLogger("remoteCLI",{name:d(5101,null)})));e.set(z,s),s.trace(`Remote configuration data at ${this.remoteDataFolder}`),s.trace("process arguments:",Hb(this.args));let a=this._register(new vs(s));e.set(Le,a),a.registerProvider(q.file,this._register(new bs(s)));let l=new ca(a);e.set(Ye,l);let c=this._register(new kl(l,o,a,s));e.set(Bt,c);let u=this._register(new xu(c.defaultProfile.settingsResource,a,new ul,s));return e.set(bt,u),await Promise.all([u.initialize(),c.init()]),e.set(ao,new ht(ml,["remote"])),e.set(qu,new ht(up)),e.set(Mt,JN),e.set(ys,new ht(_l)),e.set(So,new ht(yl)),e.set(Cr,new ht(Al)),e.set(sa,new ht(Tl)),e.set(Yu,new ht(vl)),e.set(Br,new ht(Dl)),e.set(xf,new ht(Il)),e.set(dp,new ht(Rl)),new Zu(e)}async doRun(e){if(this.args["list-extensions"])return e.listExtensions(!!this.args["show-versions"],this.args.category);if(this.args["install-extension"]||this.args["install-builtin-extension"]){let n={isMachineScoped:!!this.args["do-not-sync"],installPreReleaseVersion:!!this.args["pre-release"],donotIncludePackAndDependencies:!!this.args["do-not-include-pack-dependencies"]};return e.installExtensions(this.asExtensionIdOrVSIX(this.args["install-extension"]||[]),this.asExtensionIdOrVSIX(this.args["install-builtin-extension"]||[]),n,!!this.args.force)}else{if(this.args["uninstall-extension"])return e.uninstallExtensions(this.asExtensionIdOrVSIX(this.args["uninstall-extension"]),!!this.args.force);if(this.args["update-extensions"])return e.updateExtensions();if(this.args["locate-extension"])return e.locateExtension(this.args["locate-extension"])}}asExtensionIdOrVSIX(e){return e.map(n=>/\.vsix$/i.test(n)?S.file(Gn(n)?n:$(_r(),n)):n)}}});import{constants as JQ,promises as YQ}from"fs";import{createInterface as XQ}from"readline";async function Jb(r){if(vt||oe)return;let t;for(let e of["/etc/os-release","/usr/lib/os-release","/etc/lsb-release"])try{t=await YQ.open(e,JQ.R_OK);break}catch{}if(!t){r("Unable to retrieve release information from known identifier paths.");return}try{let e=new Set(["ID","DISTRIB_ID","ID_LIKE","VERSION_ID","DISTRIB_RELEASE"]),n={id:"unknown"};for await(let o of XQ({input:t.createReadStream(),crlfDelay:1/0})){if(!o.includes("="))continue;let i=o.split("=")[0].toUpperCase().trim();if(e.has(i)){let s=o.split("=")[1].replace(/"/g,"").toLowerCase().trim();i==="ID"||i==="DISTRIB_ID"?n.id=s:i==="ID_LIKE"?n.id_like=s:(i==="VERSION_ID"||i==="DISTRIB_RELEASE")&&(n.version_id=s)}}return n}catch(e){r(e)}finally{await t.close()}}var ek=v(()=>{fe()});import*as nk from"net";function b2(r,t,e,n=1){let o=!1;return new Promise(i=>{let s=setTimeout(()=>{if(!o)return o=!0,i(0)},e);tk(r,t,n,a=>{if(!o)return o=!0,clearTimeout(s),i(a)})})}function tk(r,t,e,n){if(t===0)return n(0);let o=new nk.Socket;o.once("connect",()=>(I2(o),tk(r+e,t-1,e,n))),o.once("data",()=>{}),o.once("error",i=>(I2(o),i.code!=="ECONNREFUSED"?tk(r+e,t-1,e,n):n(r))),o.connect(r,"127.0.0.1")}function I2(r){try{r.removeAllListeners("connect"),r.removeAllListeners("error"),r.end(),r.destroy(),r.unref()}catch(t){console.error(t)}}var S2=v(()=>{});function C2(r,t){let e=t.final??!0,n=t.compressed??!1;rk(t.opcode),R2(t.mask),w2((e?Xb:0)|(n?Zb:0)|t.opcode,r.byteLength);let o=tJ(r.byteLength,t.mask!==void 0),i=O.alloc(o);i.writeUInt8((e?Xb:0)|(n?Zb:0)|t.opcode,0);let s=2;return r.byteLength<mp?i.writeUInt8((t.mask===void 0?0:Yb)|r.byteLength,1):r.byteLength<2**16?(i.writeUInt8((t.mask===void 0?0:Yb)|mp,1),i.writeUInt8(r.byteLength>>>8,s++),i.writeUInt8(r.byteLength,s++)):(i.writeUInt8((t.mask===void 0?0:Yb)|x2,1),i.writeUInt32BE(0,s),s+=4,i.writeUInt32BE(r.byteLength,s),s+=4),t.mask===void 0?O.concat([i,r]):(i.writeUInt32BE(t.mask,s),O.concat([i,T2(r,t.mask)]))}function E2(r,t){if(R2(t),t===0)return;let e=r.byteLength>>>2;for(let i=0;i<e;i++){let s=i*4;r.writeUInt32BE(r.readUInt32BE(s)^t,s)}let n=e*4,o=r.byteLength-n;o>=1&&r.writeUInt8(r.readUInt8(n)^t>>>24&255,n),o>=2&&r.writeUInt8(r.readUInt8(n+1)^t>>>16&255,n+1),o>=3&&r.writeUInt8(r.readUInt8(n+2)^t>>>8&255,n+2)}function tJ(r,t){if(r>eS)throw new Error("WebSocket payload lengths greater than 2^32 - 1 are not supported.");return r<mp?2+(t?4:0):r<2**16?4+(t?4:0):10+(t?4:0)}function nJ(r,t){if(t<mp)return t;if(t===mp)return r.readUInt8(2)*2**8+r.readUInt8(3);if(r.readUInt32BE(2)!==0)throw new Error("WebSocket payload lengths greater than 2^32 - 1 are not supported.");return r.readUInt32BE(6)}function w2(r,t){if((r&ZQ)!==0)throw new Error("WebSocket frames must not set RSV2 or RSV3.");let e=r&15;if(rk(e),oJ(e)){if((r&Xb)===0)throw new Error("WebSocket control frames must be final.");if(t>125)throw new Error("WebSocket control frames must not exceed 125 bytes.");if((r&Zb)!==0)throw new Error("WebSocket control frames must not set RSV1.")}}function rk(r){if(r!==0&&r!==1&&r!==2&&r!==8&&r!==9&&r!==10)throw new Error(`WebSocket frame has reserved opcode ${r}.`)}function R2(r){if(r!==void 0&&(!Number.isInteger(r)||r<0||r>eS))throw new Error("WebSocket masks must be unsigned 32-bit integers.")}function oJ(r){return(r&8)!==0}function T2(r,t){let e=O.alloc(r.byteLength);return e.set(r),E2(e,t),e}var Xb,Zb,ZQ,Yb,eJ,mp,x2,eS,ok,tS,P2=v(()=>{Ve();Cl();Xb=128,Zb=64,ZQ=48,Yb=128,eJ=127,mp=126,x2=127,eS=4294967295,ok=class extends Error{constructor(e,n){super(`WebSocket frame payload length ${e} exceeds the configured limit of ${n}.`);this.payloadLength=e;this.maxPayloadLength=n}},tS=class{constructor(t={}){this._incomingData=new Df;if(this._maxPayloadLength=t.maxPayloadLength??eS,this._unmaskInPlace=t.unmaskInPlace??!1,!Number.isInteger(this._maxPayloadLength)||this._maxPayloadLength<0||this._maxPayloadLength>eS)throw new Error("WebSocket frame payload limits must be unsigned 32-bit integers.")}acceptChunk(t){if(t.byteLength===0)return[];this._incomingData.acceptChunk(t);let e=[];for(;this._incomingData.byteLength>=2;){let n=this._incomingData.peek(2),o=n.readUInt8(0),i=n.readUInt8(1),s=i&eJ,a=s===mp?2:s===x2?8:0,l=(i&Yb)!==0,c=2+a+(l?4:0);if(this._incomingData.byteLength<c)break;let u=this._incomingData.peek(c),p=nJ(u,s);if(p>this._maxPayloadLength)throw new ok(p,this._maxPayloadLength);w2(o,p);let m=o&15;if(rk(m),this._incomingData.byteLength<c+p)break;this._incomingData.read(c);let g=this._incomingData.read(p),y=l?u.readUInt32BE(c-4):void 0,h=g;y!==void 0&&(this._unmaskInPlace?E2(h,y):h=T2(g,y)),e.push({final:(o&Xb)!==0,compressed:(o&Zb)!==0,opcode:m,payload:h,mask:y})}return e}}});import{createHash as sJ}from"crypto";import{tmpdir as aJ}from"os";import{createDeflateRaw as lJ,createInflateRaw as cJ}from"zlib";function A2(r,t,{debugLabel:e,skipWebSocketFrames:n=!1,disableWebSocketCompression:o=!1,enableMessageSplitting:i=!0}){if(r.headers.upgrade===void 0||r.headers.upgrade.toLowerCase()!=="websocket"){t.end("HTTP/1.1 400 Bad Request");return}let s=r.headers["sec-websocket-key"],a=sJ("sha1");a.update(s+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11");let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${a.digest("base64")}`],u=!1;if(!n&&!o&&r.headers["sec-websocket-extensions"]){let p=Array.isArray(r.headers["sec-websocket-extensions"])?r.headers["sec-websocket-extensions"]:[r.headers["sec-websocket-extensions"]];for(let m of p)if(!/\b((server_max_window_bits)|(server_no_context_takeover)|(client_no_context_takeover))\b/.test(m)){if(/\b(permessage-deflate)\b/.test(m)){u=!0,c.push("Sec-WebSocket-Extensions: permessage-deflate");break}if(/\b(x-webkit-deflate-frame)\b/.test(m)){u=!0,c.push("Sec-WebSocket-Extensions: x-webkit-deflate-frame");break}}}return t.write(c.join(`\r
`)+`\r
\r
`),t.setTimeout(0),t.setNoDelay(!0),n?new da(t,e):new ua(new da(t,e),u,null,!0,i)}function Ml(){let r=Ee();if(process.platform==="win32")return`\\\\.\\pipe\\vscode-ipc-${r}-sock`;let t=process.platform!=="darwin"&&k2?k2:aJ(),e=uJ[ei],n=r;if(typeof e=="number"){let o=Math.max(0,e-1-$(t,"vscode-ipc-.sock").length);o<n.length&&(n=n.slice(0,o))}return $(t,`vscode-ipc-${n}.sock`)}var dJ,da,ua,ik,sk,ak,k2,uJ,gp=v(()=>{Ve();xe();ue();Q();Oe();fe();Vt();la();Cl();P2();dJ=3e4,da=class{constructor(t,e=""){this._canWrite=!0;this.debugLabel=e,this.socket=t,this.traceSocketEvent("created",{type:"NodeSocket"}),this._errorListener=n=>{if(this.traceSocketEvent("error",{code:n?.code,message:n?.message}),n){if(n.code==="EPIPE")return;pt(n)}},this.socket.on("error",this._errorListener),this._closeListener=n=>{this.traceSocketEvent("close",{hadError:n}),this._canWrite=!1,this._endTimeoutHandle&&clearTimeout(this._endTimeoutHandle)},this.socket.on("close",this._closeListener),this._endListener=()=>{this.traceSocketEvent("nodeEndReceived"),this._canWrite=!1,this._endTimeoutHandle=setTimeout(()=>t.destroy(),dJ)},this.socket.on("end",this._endListener)}traceSocketEvent(t,e){NP.traceSocketEvent(this.socket,this.debugLabel,t,e)}dispose(t=!0){this._endTimeoutHandle&&(clearTimeout(this._endTimeoutHandle),this._endTimeoutHandle=void 0),this.socket.off("error",this._errorListener),this.socket.off("close",this._closeListener),this.socket.off("end",this._endListener),t&&this.socket.destroy()}onData(t){let e=n=>{this.traceSocketEvent("read",n),t(O.wrap(n))};return this.socket.on("data",e),{dispose:()=>this.socket.off("data",e)}}onClose(t){let e=n=>{t({type:0,hadError:n,error:void 0})};return this.socket.on("close",e),{dispose:()=>this.socket.off("close",e)}}onEnd(t){let e=()=>{t()};return this.socket.on("end",e),{dispose:()=>this.socket.off("end",e)}}write(t){if(!(this.socket.destroyed||!this._canWrite))try{this.traceSocketEvent("write",t),this.socket.write(t.buffer,e=>{if(e){if(e.code==="EPIPE")return;pt(e)}})}catch(e){if(e.code==="EPIPE")return;pt(e)}}end(){this.traceSocketEvent("nodeEndSent"),this.socket.end()}drain(){return this.traceSocketEvent("nodeDrainBegin"),new Promise((t,e)=>{if(this.socket.bufferSize===0){this.traceSocketEvent("nodeDrainEnd"),t();return}let n=()=>{this.socket.off("close",n),this.socket.off("end",n),this.socket.off("error",n),this.socket.off("timeout",n),this.socket.off("drain",n),this.traceSocketEvent("nodeDrainEnd"),t()};this.socket.on("close",n),this.socket.on("end",n),this.socket.on("error",n),this.socket.on("timeout",n),this.socket.on("drain",n)})}},ua=class extends D{constructor(e,n,o,i,s=!0){super();this._frameParser=new tS({unmaskInPlace:!0});this._onData=this._register(new R);this._onClose=this._register(new R);this._isEnded=!1;this._compressedMessage=!1;this.socket=e,this._maxSocketMessageLength=s?262144:1/0,this.traceSocketEvent("created",{type:"WebSocketNodeSocket",permessageDeflate:n,inflateBytesLength:o?.byteLength||0,recordInflateBytes:i}),this._flowManager=this._register(new ik(this,n,o,i,this._onData,(a,l)=>this._write(a,l))),this._register(this._flowManager.onError(a=>{console.error(a),pt(a),this._onClose.fire({type:0,hadError:!0,error:a})})),this._register(this.socket.onData(a=>this._acceptChunk(a))),this._register(this.socket.onClose(async a=>{this._flowManager.isProcessingReadQueue()&&await F.toPromise(this._flowManager.onDidFinishProcessingReadQueue),this._onClose.fire(a)}))}get permessageDeflate(){return this._flowManager.permessageDeflate}get recordedInflateBytes(){return this._flowManager.recordedInflateBytes}setRecordInflateBytes(e){this._flowManager.setRecordInflateBytes(e)}traceSocketEvent(e,n){this.socket.traceSocketEvent(e,n)}dispose(){this._flowManager.isProcessingWriteQueue()?this._register(this._flowManager.onDidFinishProcessingWriteQueue(()=>{this.dispose()})):(this.socket.dispose(),super.dispose())}onData(e){return this._onData.event(e)}onClose(e){return this._onClose.event(e)}onEnd(e){return this.socket.onEnd(e)}write(e){let n=0;for(;n<e.byteLength;)this._flowManager.writeMessage(e.slice(n,Math.min(n+this._maxSocketMessageLength,e.byteLength)),{compressed:!0,opcode:2}),n+=this._maxSocketMessageLength}_write(e,{compressed:n,opcode:o}){this._isEnded||(this.traceSocketEvent("webSocketNodeSocketWrite",e),this.socket.write(C2(e,{compressed:n,opcode:o})))}end(){this._isEnded=!0,this.socket.end()}_acceptChunk(e){for(let n of this._frameParser.acceptChunk(e)){let o=n.opcode===0?this._compressedMessage:n.compressed;(n.opcode===1||n.opcode===2)&&(this._compressedMessage=n.compressed),this.traceSocketEvent("webSocketNodeSocketPeekedHeader",{bodySize:n.payload.byteLength,compressed:o,fin:Number(n.final),mask:n.mask,opcode:n.opcode}),this.traceSocketEvent("webSocketNodeSocketReadData",n.payload),n.mask!==void 0&&this.traceSocketEvent("webSocketNodeSocketUnmaskedData",n.payload),n.opcode===0||n.opcode===1||n.opcode===2?(this._flowManager.acceptFrame(n.payload,o,n.final),n.final&&(this._compressedMessage=!1)):n.opcode===9&&this._flowManager.writeMessage(n.payload,{compressed:!1,opcode:10})}}async drain(){this.traceSocketEvent("webSocketNodeSocketDrainBegin"),this._flowManager.isProcessingWriteQueue()&&await F.toPromise(this._flowManager.onDidFinishProcessingWriteQueue),await this.socket.drain(),this.traceSocketEvent("webSocketNodeSocketDrainEnd")}},ik=class extends D{constructor(e,n,o,i,s,a){super();this._tracer=e;this._onData=s;this._writeFn=a;this._onError=this._register(new R);this.onError=this._onError.event;this._writeQueue=[];this._readQueue=[];this._onDidFinishProcessingReadQueue=this._register(new R);this.onDidFinishProcessingReadQueue=this._onDidFinishProcessingReadQueue.event;this._onDidFinishProcessingWriteQueue=this._register(new R);this.onDidFinishProcessingWriteQueue=this._onDidFinishProcessingWriteQueue.event;this._isProcessingWriteQueue=!1;this._isProcessingReadQueue=!1;n?(this._zlibInflateStream=this._register(new sk(this._tracer,i,o,{windowBits:15})),this._zlibDeflateStream=this._register(new ak(this._tracer,{windowBits:15})),this._register(this._zlibInflateStream.onError(l=>this._onError.fire(l))),this._register(this._zlibDeflateStream.onError(l=>this._onError.fire(l)))):(this._zlibInflateStream=null,this._zlibDeflateStream=null)}get permessageDeflate(){return!!(this._zlibInflateStream&&this._zlibDeflateStream)}get recordedInflateBytes(){return this._zlibInflateStream?this._zlibInflateStream.recordedInflateBytes:O.alloc(0)}setRecordInflateBytes(e){this._zlibInflateStream?.setRecordInflateBytes(e)}writeMessage(e,n){this._writeQueue.push({data:e,options:n}),this._processWriteQueue()}async _processWriteQueue(){if(!this._isProcessingWriteQueue){for(this._isProcessingWriteQueue=!0;this._writeQueue.length>0;){let{data:e,options:n}=this._writeQueue.shift();if(this._zlibDeflateStream&&n.compressed){let o=await this._deflateMessage(this._zlibDeflateStream,e);this._writeFn(o,n)}else this._writeFn(e,{...n,compressed:!1})}this._isProcessingWriteQueue=!1,this._onDidFinishProcessingWriteQueue.fire()}}isProcessingWriteQueue(){return this._isProcessingWriteQueue}_deflateMessage(e,n){return new Promise((o,i)=>{e.write(n),e.flush(s=>o(s))})}acceptFrame(e,n,o){this._readQueue.push({data:e,isCompressed:n,isLastFrameOfMessage:o}),this._processReadQueue()}async _processReadQueue(){if(!this._isProcessingReadQueue){for(this._isProcessingReadQueue=!0;this._readQueue.length>0;){let e=this._readQueue.shift();if(this._zlibInflateStream&&e.isCompressed){let n=await this._inflateFrame(this._zlibInflateStream,e.data,e.isLastFrameOfMessage);this._onData.fire(n)}else this._onData.fire(e.data)}this._isProcessingReadQueue=!1,this._onDidFinishProcessingReadQueue.fire()}}isProcessingReadQueue(){return this._isProcessingReadQueue}_inflateFrame(e,n,o){return new Promise((i,s)=>{e.write(n),o&&e.write(O.fromByteArray([0,0,255,255])),e.flush(a=>i(a))})}},sk=class extends D{constructor(e,n,o,i){super();this._tracer=e;this._onError=this._register(new R);this.onError=this._onError.event;this._recordedInflateBytes=[];this._pendingInflateData=[];this._recordInflateBytes=n,this._zlibInflate=cJ(i),this._zlibInflate.on("error",s=>{this._tracer.traceSocketEvent("zlibInflateError",{message:s?.message,code:s?.code}),this._onError.fire(s)}),this._zlibInflate.on("data",s=>{this._tracer.traceSocketEvent("zlibInflateData",s),this._pendingInflateData.push(O.wrap(s))}),o&&(this._tracer.traceSocketEvent("zlibInflateInitialWrite",o.buffer),this._zlibInflate.write(o.buffer),this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateInitialFlushFired"),this._pendingInflateData.length=0}))}get recordedInflateBytes(){return this._recordInflateBytes?O.concat(this._recordedInflateBytes):O.alloc(0)}write(e){this._recordInflateBytes&&this._recordedInflateBytes.push(e.clone()),this._tracer.traceSocketEvent("zlibInflateWrite",e),this._zlibInflate.write(e.buffer)}setRecordInflateBytes(e){this._recordInflateBytes=e,e||(this._recordedInflateBytes.length=0)}flush(e){this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateFlushFired");let n=O.concat(this._pendingInflateData);this._pendingInflateData.length=0,e(n)})}dispose(){this._recordedInflateBytes.length=0,this._pendingInflateData.length=0;try{this._zlibInflate.close()}catch{}super.dispose()}},ak=class extends D{constructor(e,n){super();this._tracer=e;this._onError=this._register(new R);this.onError=this._onError.event;this._pendingDeflateData=[];this._zlibDeflate=lJ({windowBits:15}),this._zlibDeflate.on("error",o=>{this._tracer.traceSocketEvent("zlibDeflateError",{message:o?.message,code:o?.code}),this._onError.fire(o)}),this._zlibDeflate.on("data",o=>{this._tracer.traceSocketEvent("zlibDeflateData",o),this._pendingDeflateData.push(O.wrap(o))})}write(e){this._tracer.traceSocketEvent("zlibDeflateWrite",e.buffer),this._zlibDeflate.write(e.buffer)}flush(e){this._zlibDeflate.flush(2,()=>{this._tracer.traceSocketEvent("zlibDeflateFlushFired");let n=O.concat(this._pendingDeflateData);this._pendingDeflateData.length=0,n=n.slice(0,n.byteLength-4),e(n)})}dispose(){this._pendingDeflateData.length=0;try{this._zlibDeflate.close()}catch{}super.dispose()}},k2=process.env.XDG_RUNTIME_DIR,uJ={2:107,1:103}});var D2,fp,nS=v(()=>{xe();Z();D2=A("remoteAuthorityResolverService"),fp=class r extends eo{static isNotAvailable(t){return t instanceof r&&t._code==="NotAvailable"}static isTemporarilyNotAvailable(t){return t instanceof r&&t._code==="TemporarilyNotAvailable"}static isNoResolverFound(t){return t instanceof r&&t._code==="NoResolverFound"}static isInvalidAuthority(t){return t instanceof r&&t._code==="InvalidAuthority"}static isHandled(t){return t instanceof r&&t.isHandled}constructor(t,e="Unknown",n){super(t),this._message=t,this._code=e,this._detail=n,this.isHandled=e==="NotAvailable"&&n===!0,Object.setPrototypeOf(this,r.prototype)}}});function mJ(r){switch(r){case 1:return"Management";case 2:return"ExtensionHost";case 3:return"Tunnel"}}function gJ(r){let t=new _t;return setTimeout(()=>t.cancel(),r),t.token}async function fJ(r,t,e){let{connectTo:n,connectionToken:o}=await r.addressProvider.getAddress();return{commit:r.commit,quality:r.quality,connectTo:n,connectionToken:o,reconnectionToken:t,reconnectionProtocol:e,remoteSocketFactoryService:r.remoteSocketFactoryService,signService:r.signService,logService:r.logService}}function hJ(r){return or(t=>new Promise((e,n)=>{let o=setTimeout(e,r*1e3);t.onCancellationRequested(()=>{clearTimeout(o),e()})}))}function yJ(r){try{r.acceptDisconnect();let t=r.getSocket();r.dispose(),t.dispose()}catch(t){pt(t)}}function vJ(r,t){return typeof r!="number"||!isFinite(r)||r<0?t:r>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:Math.floor(r)}function IJ(r,t){for(;r.length<t;)r+=" ";return r}function bJ(r,t){return`[remote-connection][${IJ(mJ(r),13)}][${t.substr(0,5)}\u2026]`}function oS(r,t,e){return`${bJ(r,t)}[${e?"reconnect":"initial"}]`}var pJ,lk,ck,dk,rS,uk,_2,M2=v(()=>{Ue();Ve();Jt();xe();ue();Q();Me();Xr();Vs();Vt();Cl();nS();pJ=30*1e3;lk=class{constructor(t,e){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.type=0}},ck=class{constructor(t,e,n,o){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.durationSeconds=n;this.cancellableTimer=o;this.type=1}skipWait(){this.cancellableTimer.cancel()}},dk=class{constructor(t,e,n){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.attempt=n;this.type=2}},rS=class{constructor(t,e,n){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.attempt=n;this.type=4}},uk=class{constructor(t,e,n,o){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.attempt=n;this.handled=o;this.type=3}},_2=class r extends D{constructor(e,n,o,i,s){super();this._connectionType=e;this._options=n;this.reconnectionToken=o;this.protocol=i;this._reconnectionFailureIsFatal=s;this._onDidStateChange=this._register(new R);this.onDidStateChange=this._onDidStateChange.event;this._connectionState=4;this._permanentFailure=!1;this._isReconnecting=!1;this._isDisposed=!1;this._reconnectionGraceTime=108e5;this._fireStateChange(new rS(this.reconnectionToken,0,0)),this._register(i.onSocketClose(a=>{let l=oS(this._connectionType,this.reconnectionToken,!0);a?a.type===0?(this._options.logService.info(`${l} received socket close event (hadError: ${a.hadError}).`),a.error&&this._options.logService.error(a.error)):(this._options.logService.info(`${l} received socket close event (wasClean: ${a.wasClean}, code: ${a.code}, reason: ${a.reason}).`),a.event&&this._options.logService.error(a.event)):this._options.logService.info(`${l} received socket close event.`),this._beginReconnecting()})),this._register(i.onSocketTimeout(a=>{let l=oS(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${l} received socket timeout event (reason: ${a.reason}, unacknowledgedMsgCount: ${a.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${a.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${a.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),r._instances.push(this),this._register(se(()=>{let a=r._instances.indexOf(this);a>=0&&r._instances.splice(a,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(r._permanentFailureMillisSinceLastIncomingData,r._permanentFailureAttempt,r._permanentFailureHandled)}static triggerPermanentFailure(e,n,o){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=n,this._permanentFailureHandled=o,this._instances.forEach(i=>i._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}static{this._permanentFailure=!1}static{this._permanentFailureMillisSinceLastIncomingData=0}static{this._permanentFailureAttempt=0}static{this._permanentFailureHandled=!1}static{this._instances=[]}get isConnected(){return this._connectionState===4&&!this._isDisposed&&!this._isPermanentFailure}_fireStateChange(e){this._connectionState=e.type,this._onDidStateChange.fire(e)}get _isPermanentFailure(){return this._permanentFailure||r._permanentFailure}updateGraceTime(e){let n=vJ(e,108e5),o=oS(this._connectionType,this.reconnectionToken,!1);this._options.logService.trace(`${o} Applying reconnection grace time: ${n}ms (${Math.floor(n/1e3)}s)`),this._reconnectionGraceTime=n}dispose(){super.dispose(),this._isDisposed=!0}async _beginReconnecting(){if(!this._isReconnecting)try{this._isReconnecting=!0,await this._runReconnectingLoop()}finally{this._isReconnecting=!1}}async _runReconnectingLoop(){if(this._isPermanentFailure||this._isDisposed)return;let e=oS(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${e} starting reconnecting loop. You can get more information with the trace log level.`),this._fireStateChange(new lk(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));let n=[0,5,5,10,10,10,10,10,30],o=this._reconnectionGraceTime;if(this._options.logService.info(`${e} starting reconnection with grace time: ${o}ms (${Math.floor(o/1e3)}s)`),o<=0){this._options.logService.error(`${e} reconnection grace time is set to 0ms, will not attempt to reconnect.`),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),0,!1);return}let i=!1,s=new Ic(()=>i=!0,o);s.schedule();let a=-1;do{a++;let l=a<n.length?n[a]:n[n.length-1];try{if(l>0){let u=hJ(l);this._fireStateChange(new ck(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),l,u)),this._options.logService.info(`${e} waiting for ${l} seconds before reconnecting...`);try{await u}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._fireStateChange(new dk(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),a+1)),this._options.logService.info(`${e} resolving connection...`);let c=await fJ(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${c.connectTo}...`),await this._reconnect(c,gJ(pJ)),this._options.logService.info(`${e} reconnected!`),this._fireStateChange(new rS(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),a+1));break}catch(c){if(c.code==="VSCODE_CONNECTION_ERROR"){this._options.logService.error(`${e} A permanent error occurred in the reconnecting loop! Will give up now! Error:`),this._options.logService.error(c),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),a+1,!1);break}if(i){let u=Math.round(o/1e3);this._options.logService.error(`${e} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time (${u}s) has expired! Will give up now! Error:`),this._options.logService.error(c),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),a+1,!1);break}if(fp.isTemporarilyNotAvailable(c)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(c);continue}if((c.code==="ETIMEDOUT"||c.code==="ENETUNREACH"||c.code==="ECONNREFUSED"||c.code==="ECONNRESET")&&c.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(c);continue}if(on(c)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(c);continue}if(c instanceof fp){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(c),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),a+1,fp.isHandled(c));break}this._options.logService.error(`${e} An unknown error occurred while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error:`),this._options.logService.error(c),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),a+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed);s.dispose()}_onReconnectionPermanentFailure(e,n,o){this._reconnectionFailureIsFatal?r.triggerPermanentFailure(e,n,o):this._gotoPermanentFailure(e,n,o)}_gotoPermanentFailure(e,n,o){this._fireStateChange(new uk(this.reconnectionToken,e,n,o)),yJ(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}}});var sS,iS,pk=v(()=>{Z();sS=A("extensionHostStatusService"),iS=class{constructor(){this._exitInfo=new Map}setExitInfo(t,e){this._exitInfo.set(t,e)}getExitInfo(t){return this._exitInfo.get(t)||null}}});function SJ(r){delete r[Ff.ENV_KEY],delete r[Hf.ENV_KEY],delete r[mk.ENV_KEY]}function gk(r,t){SJ(t),r.serialize(t)}var Ff,Hf,mk,L2=v(()=>{Ff=class r{constructor(t){this.pipeName=t;this.type=1}static{this.ENV_KEY="VSCODE_EXTHOST_IPC_HOOK"}serialize(t){t[r.ENV_KEY]=this.pipeName}},Hf=class r{constructor(){this.type=2}static{this.ENV_KEY="VSCODE_EXTHOST_WILL_SEND_SOCKET"}serialize(t){t[r.ENV_KEY]="1"}},mk=class r{constructor(){this.type=3}static{this.ENV_KEY="VSCODE_WILL_SEND_MESSAGE_PORT"}serialize(t){t[r.ENV_KEY]="1"}}});import*as O2 from"child_process";import*as U2 from"net";async function fk(r={},t,e,n,o,i){let s=await Of(e,n.userDataPath),a={};if(t)try{a=await pl(i,o,n.args,process.env)}catch(g){o.error("ExtensionHostConnection#buildUserEnvironment resolving shell environment failed",g)}let c={...process.env,...a,...r,VSCODE_ESM_ENTRYPOINT:"vs/workbench/api/node/extensionHostProcess",VSCODE_HANDLES_UNCAUGHT_ERRORS:"true",VSCODE_NLS_CONFIG:JSON.stringify(s)},u=n.isBuilt?$(n.appRoot,"bin"):$(n.appRoot,"resources","server","bin-dev"),p=$(u,"remote-cli"),m=xJ(c,"PATH");return m?m=p+Fa+m:m=p,CJ(c,"PATH",m),n.args["without-browser-env-var"]||(c.BROWSER=$(u,"helpers",oe?"browser.cmd":"browser.sh")),c.VSCODE_RECONNECTION_GRACE_TIME=String(n.reconnectionGraceTime),o.trace(`[reconnection-grace-time] Setting VSCODE_RECONNECTION_GRACE_TIME env var for extension host: ${n.reconnectionGraceTime}ms (${Math.floor(n.reconnectionGraceTime/1e3)}s)`),EJ(c),c}function xJ(r,t){let e=Object.keys(r).filter(o=>o.toLowerCase()===t.toLowerCase()),n=e.length>0?e[0]:t;return r[n]}function CJ(r,t,e){let n=Object.keys(r).filter(i=>i.toLowerCase()===t.toLowerCase()),o=n.length>0?n[0]:t;r[o]=e}function EJ(r){for(let t of Object.keys(r))r[t]===null&&delete r[t]}var aS,hp,hk=v(()=>{Ve();ue();Q();Me();Oe();fe();Ru();gp();dn();De();Xg();pk();$b();zc();L2();aS=class{constructor(t,e){this.socket=t;this.initialDataChunk=e}socketDrain(){return this.socket.drain()}toIExtHostSocketMessage(){let t,e,n;return this.socket instanceof da?(t=!0,e=!1,n=O.alloc(0)):(t=!1,e=this.socket.permessageDeflate,n=this.socket.recordedInflateBytes,this.socket.setRecordInflateBytes(!1)),{type:"VSCODE_EXTHOST_IPC_SOCKET",initialDataChunk:this.initialDataChunk.buffer.toString("base64"),skipWebSocketFrames:t,permessageDeflate:e,inflateBytes:n.buffer.toString("base64")}}},hp=class extends D{constructor(e,n,o,i,s,a,l,c){super();this._reconnectionToken=e;this._environmentService=s;this._logService=a;this._extensionHostStatusService=l;this._configurationService=c;this._onClose=this._register(new R);this.onClose=this._onClose.event;this._canSendSocket=!oe||!this._environmentService.args["socket-path"],this._disposed=!1,this._remoteAddress=n,this._extensionHostProcess=null,this._connectionData=new aS(o,i),!this._canSendSocket&&o instanceof ua&&o.setRecordInflateBytes(!1),this._log("New connection established.")}dispose(){this._cleanResources(),super.dispose()}get _logPrefix(){return`[${this._remoteAddress}][${this._reconnectionToken.substr(0,8)}][ExtensionHostConnection] `}_log(e){this._logService.info(`${this._logPrefix}${e}`)}_logError(e){this._logService.error(`${this._logPrefix}${e}`)}async _pipeSockets(e,n){let o=new re;o.add(n.socket),o.add(se(()=>{!e.destroyed&&!e.writableEnded&&e.end()}));let i=()=>{o.dispose()};o.add(n.socket.onEnd(i)),o.add(n.socket.onClose(i)),o.add(F.fromNodeEventEmitter(e,"end")(i)),o.add(F.fromNodeEventEmitter(e,"close")(i)),o.add(F.fromNodeEventEmitter(e,"error")(i)),o.add(n.socket.onData(s=>e.write(s.buffer))),o.add(F.fromNodeEventEmitter(e,"data")(s=>{n.socket.write(O.wrap(s))})),n.initialDataChunk.byteLength>0&&e.write(n.initialDataChunk.buffer)}async _sendSocketToExtensionHost(e,n){await n.socketDrain();let o=n.toIExtHostSocketMessage(),i;n.socket instanceof da?i=n.socket.socket:i=n.socket.socket.socket,e.send(o,i)}shortenReconnectionGraceTimeIfNecessary(){if(!this._extensionHostProcess)return;let e={type:"VSCODE_EXTHOST_IPC_REDUCE_GRACE_TIME"};this._extensionHostProcess.send(e)}acceptReconnection(e,n,o){this._remoteAddress=e,this._log("The client has reconnected."),!this._canSendSocket&&n instanceof ua&&n.setRecordInflateBytes(!1);let i=new aS(n,o);if(!this._extensionHostProcess){this._connectionData=i;return}this._sendSocketToExtensionHost(this._extensionHostProcess,i)}_cleanResources(){this._disposed||(this._disposed=!0,this._connectionData&&(this._connectionData.socket.end(),this._connectionData=null),this._extensionHostProcess&&(this._extensionHostProcess.kill(),this._extensionHostProcess=null),this._onClose.fire(void 0))}async start(e){try{let n=process.execArgv?process.execArgv.filter(m=>!/^--inspect(-brk)?=/.test(m)):[];e.port&&!process.pkg&&(n=[`--inspect${e.break?"-brk":""}=${e.port}`,"--experimental-network-inspection"]),this._log("Starting extension host process...");let o=await fk(e.env,!0,e.language,this._environmentService,this._logService,this._configurationService);wu(o);let i;if(this._canSendSocket)gk(new Hf,o),i=null;else{let{namedPipeServer:m,pipeName:g}=await this._listenOnPipe();gk(new Ff(g),o),i=m}let s={env:o,execArgv:n,silent:!0};s.execArgv.unshift("--dns-result-order=ipv4first");let a=["--type=extensionHost","--transformURIs"],l=this._environmentService.args["use-host-proxy"];a.push(`--useHostProxy=${l?"true":"false"}`),this._configurationService.getValue("extensions.supportNodeGlobalNavigator")&&a.push("--supportGlobalNavigator"),this._extensionHostProcess=O2.fork(Pt.asFileUri("bootstrap-fork").fsPath,a,s);let c=this._extensionHostProcess.pid;this._log(`<${c}> Launched Extension Host Process.`),this._extensionHostProcess.stdout.setEncoding("utf8"),this._extensionHostProcess.stderr.setEncoding("utf8");let u=F.fromNodeEventEmitter(this._extensionHostProcess.stdout,"data"),p=F.fromNodeEventEmitter(this._extensionHostProcess.stderr,"data");if(this._register(u(m=>this._log(`<${c}> ${m}`))),this._register(p(m=>this._log(`<${c}><stderr> ${m}`))),this._extensionHostProcess.on("error",m=>{this._logError(`<${c}> Extension Host Process had an error`),this._logService.error(m),this._cleanResources()}),this._extensionHostProcess.on("exit",(m,g)=>{this._extensionHostStatusService.setExitInfo(this._reconnectionToken,{code:m,signal:g}),this._log(`<${c}> Extension Host Process exited with code: ${m}, signal: ${g}.`),this._cleanResources()}),i)i.on("connection",m=>{i.close(),this._pipeSockets(m,this._connectionData)});else{let m=g=>{g.type==="VSCODE_EXTHOST_IPC_READY"&&(this._extensionHostProcess.removeListener("message",m),this._sendSocketToExtensionHost(this._extensionHostProcess,this._connectionData),this._connectionData=null)};this._extensionHostProcess.on("message",m)}}catch(n){this._logError("Failed to start extension host process"),this._logService.error(n),this._cleanResources()}}_listenOnPipe(){return new Promise((e,n)=>{let o=Ml(),i=U2.createServer();i.on("error",n),i.listen(o,()=>{i?.removeListener("error",n),e({pipeName:o,namedPipeServer:i})})})}};hp=w([b(4,El),b(5,z),b(6,sS),b(7,bt)],hp)});function lS(r){let t=0,e=0,n=0;r>=1e3&&(n=Math.floor(r/1e3),r-=n*1e3),n>=60&&(e=Math.floor(n/60),n-=e*60),e>=60&&(t=Math.floor(e/60),e-=t*60);let o=t?`${t}h`:"",i=e?`${e}m`:"",s=n?`${n}s`:"",a=r?`${r}ms`:"";return`${o}${i}${s}${a}`}var cS,N2=v(()=>{Cl();ue();Ue();cS=class{constructor(t,e,n,o,i){this._logService=t;this._reconnectionToken=e;this._onClose=new R;this.onClose=this._onClose.event;this._reconnectionGraceTime=i;let s=3e5;this._reconnectionShortGraceTime=i>0?Math.min(s,i):0,this._remoteAddress=n,this.protocol=o,this._disposed=!1,this._disconnectRunner1=new Ic(()=>{this._log(`The reconnection grace time of ${lS(this._reconnectionGraceTime)} has expired, so the connection will be disposed.`),this._cleanResources()},this._reconnectionGraceTime),this._disconnectRunner2=new Ic(()=>{this._log(`The reconnection short grace time of ${lS(this._reconnectionShortGraceTime)} has expired, so the connection will be disposed.`),this._cleanResources()},this._reconnectionShortGraceTime),F.once(this.protocol.onDidDispose)(()=>{this._log("The client has disconnected gracefully, so the connection will be disposed."),this._cleanResources()}),this._socketCloseListener=this.protocol.onSocketClose(()=>{this._log(`The client has disconnected, will wait for reconnection ${lS(this._reconnectionGraceTime)} before disposing...`),this._disconnectRunner1.schedule()}),this._log("New connection established.")}_log(t){this._logService.info(`[${this._remoteAddress}][${this._reconnectionToken.substr(0,8)}][ManagementConnection] ${t}`)}shortenReconnectionGraceTimeIfNecessary(){this._disconnectRunner2.isScheduled()||this._disconnectRunner1.isScheduled()&&(this._log(`Another client has connected, will shorten the wait for reconnection ${lS(this._reconnectionShortGraceTime)} before disposing...`),this._disconnectRunner2.schedule())}_cleanResources(){if(this._disposed)return;this._disposed=!0,this._disconnectRunner1.dispose(),this._disconnectRunner2.dispose(),this._socketCloseListener.dispose();let t=this.protocol.getSocket();this.protocol.sendDisconnect(),this.protocol.dispose(),t.end(),this._onClose.fire(void 0),this._onClose.dispose()}acceptReconnection(t,e,n){this._remoteAddress=t,this._log("The client has reconnected."),this._disconnectRunner1.cancel(),this._disconnectRunner2.cancel(),this.protocol.beginAcceptReconnection(e,n),this.protocol.endAcceptReconnection()}}});import*as F2 from"cookie";import*as Ik from"fs";async function wJ(r,t){let e=r["without-connection-token"],n=r["connection-token"],o=r["connection-token-file"];if(e)return typeof n<"u"||typeof o<"u"?new pa("Please do not use the argument '--connection-token' or '--connection-token-file' at the same time as '--without-connection-token'."):new vk;if(typeof o<"u"){if(typeof n<"u")return new pa("Please do not use the argument '--connection-token' at the same time as '--connection-token-file'.");let i;try{i=(await Ik.promises.readFile(o,"utf8")).replace(/\r?\n$/,"")}catch{return new pa(`Unable to read the connection token file at '${o}'.`)}return yk.test(i)?new Wf(i):new pa(`The connection token defined in '${o} does not adhere to the characters 0-9, a-z, A-Z, _, or -.`)}return typeof n<"u"?yk.test(n)?new Wf(n):new pa(`The connection token '${n} does not adhere to the characters 0-9, a-z, A-Z or -.`):new Wf(await t())}async function H2(r){return wJ(r,async()=>{if(!r["user-data-dir"])return Ee();let e=$(r["user-data-dir"],"token");try{let i=(await Ik.promises.readFile(e)).toString().replace(/\r?\n$/,"");if(yk.test(i))return i}catch{}let n=Ee();try{await Ce.writeFile(e,n,{mode:384})}catch{}return n})}function W2(r,t,e){let n=e.getAll(is);if(r.validate(n.length>1?n:n[0]))return!0;let o=F2.parse(t.headers.cookie||"");return r.validate(o[bg])}var yk,vk,Wf,pa,Vf=v(()=>{Oe();Vt();Me();vo();yk=/^[0-9A-Za-z_-]+$/,vk=class{constructor(){this.type=0}validate(t){return!0}},Wf=class{constructor(t){this.value=t;this.type=2}validate(t){return t===this.value}},pa=class{constructor(t){this.message=t}}});var vp,RJ,yp,dS=v(()=>{ue();Q();Z();De();vp=A("serverLifetimeService"),RJ=300*1e3,yp=class extends D{constructor(e,n=process.exit,o){super();this._options=e;this._exit=n;this._logService=o;this._onWillShutdown=this._register(new R);this.onWillShutdown=this._onWillShutdown.event;this._onDidAbortShutdown=this._register(new R);this.onDidAbortShutdown=this._onDidAbortShutdown.event;this._consumers=new Map;this._totalCount=0;this._shutdownGeneration=0;this._options.enableAutoShutdown&&this._scheduleShutdown(!0)}get hasActiveConsumers(){return this._totalCount>0}active(e){this._shutdownGeneration++;let n=this._totalCount===0,o=this._consumers.get(e)??0;this._consumers.set(e,o+1),this._totalCount++,this._logService.debug(`ServerLifetime: consumer '${e}' active (total: ${this._totalCount})`),n&&this._cancelShutdown();let i=!1;return se(()=>{if(i)return;i=!0;let s=this._consumers.get(e);s!==void 0&&(s<=1?this._consumers.delete(e):this._consumers.set(e,s-1)),this._totalCount--,this._logService.debug(`ServerLifetime: consumer '${e}' inactive (total: ${this._totalCount})`),this._totalCount===0&&this._options.enableAutoShutdown&&this._scheduleShutdown(!1)})}delay(){this._shutdownGeneration++,this._shutdownTimer?(this._logService.debug("ServerLifetime: delay requested, resetting shutdown timer"),this._cancelShutdown(),this._scheduleShutdown(!1)):this._shutdownPromise&&this._logService.debug("ServerLifetime: delay requested during shutdown, aborting pending exit")}_scheduleShutdown(e){this._options.shutdownWithoutDelay&&!e?this._tryShutdown():(this._logService.debug("ServerLifetime: scheduling shutdown timer"),this._shutdownTimer=setTimeout(()=>{this._shutdownTimer=void 0,this._tryShutdown()},RJ))}_tryShutdown(){if(this._totalCount>0){this._logService.debug("ServerLifetime: consumer became active, aborting shutdown");return}if(this._shutdownPromise)return;this._logService.info("ServerLifetime: all consumers inactive, shutting down");let e=this._shutdownGeneration,n=[];this._onWillShutdown.fire({join:o=>n.push(o)}),this._shutdownPromise=Promise.all(n.map(o=>o.catch(i=>{this._logService.error("ServerLifetime: shutdown participant failed",i)}))).then(()=>{if(this._shutdownPromise=void 0,this._totalCount>0||e!==this._shutdownGeneration){this._logService.info("ServerLifetime: consumer became active during shutdown, aborting exit"),this._onDidAbortShutdown.fire(),this._totalCount===0&&this._options.enableAutoShutdown&&this._scheduleShutdown(!1);return}this.dispose(),this._exit(0)})}_cancelShutdown(){this._shutdownTimer&&(this._logService.debug("ServerLifetime: cancelling shutdown timer"),clearTimeout(this._shutdownTimer),this._shutdownTimer=void 0)}};yp=w([b(2,z)],yp)});function V2(r,t){let e={"Content-Security-Policy":"default-src 'none'; sandbox","X-Content-Type-Options":"nosniff",Vary:"Origin"};return r&&(r===TJ||t(r))&&(e["Access-Control-Allow-Origin"]=r),e}var TJ,B2=v(()=>{Me();TJ=`${q.vscodeFileResource}://${Sg}`});import{networkInterfaces as PJ}from"os";function AJ(r){let t=r.replace(/\-/g,":").toLowerCase();return!kJ.has(t)}function q2(){let r=PJ();for(let t in r){let e=r[t];if(e){for(let{mac:n}of e)if(AJ(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}var kJ,$2=v(()=>{kJ=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"])});import{networkInterfaces as DJ}from"os";async function z2(r){return bk||(bk=(async()=>await _J(r)||Ee())()),bk}async function _J(r){try{let t=await import("crypto"),e=q2();return t.createHash("sha256").update(e,"utf8").digest("hex")}catch(t){r(t);return}}async function G2(r){if(oe){let t=await import("@vscode/windows-registry");try{return t.GetStringRegKey("HKEY_LOCAL_MACHINE",MJ,"MachineId")||""}catch(e){return r(e),""}}return""}async function K2(r){try{let e=await(await import("@vscode/deviceid")).getDeviceId();return LO(e)}catch(t){return r(t),Ee()}}var Sk,bk,MJ,xk=v(()=>{zg();Vt();$2();fe();Tt();Sk=new class{_isVirtualMachineMacAddress(r){return this._virtualMachineOUIs||(this._virtualMachineOUIs=Li.forStrings(),this._virtualMachineOUIs.set("00-50-56",!0),this._virtualMachineOUIs.set("00-0C-29",!0),this._virtualMachineOUIs.set("00-05-69",!0),this._virtualMachineOUIs.set("00-03-FF",!0),this._virtualMachineOUIs.set("00-1C-42",!0),this._virtualMachineOUIs.set("00-16-3E",!0),this._virtualMachineOUIs.set("08-00-27",!0),this._virtualMachineOUIs.set("00:50:56",!0),this._virtualMachineOUIs.set("00:0C:29",!0),this._virtualMachineOUIs.set("00:05:69",!0),this._virtualMachineOUIs.set("00:03:FF",!0),this._virtualMachineOUIs.set("00:1C:42",!0),this._virtualMachineOUIs.set("00:16:3E",!0),this._virtualMachineOUIs.set("08:00:27",!0)),!!this._virtualMachineOUIs.findSubstr(r)}value(){if(this._value===void 0){let r=0,t=0,e=DJ();for(let n in e){let o=e[n];if(o)for(let{mac:i,internal:s}of o)s||(t+=1,this._isVirtualMachineMacAddress(i.toUpperCase())&&(r+=1))}this._value=t>0?r/t:0}return this._value}};MJ="Software\\Microsoft\\SQMClient"});var Bf,j2=v(()=>{ue();Q();Bf=class extends D{constructor(){super(...arguments);this._onCloseEmitter=this._register(new R);this._onReloadEmitter=this._register(new R);this._onTerminateEmitter=this._register(new R);this._onAttachEmitter=this._register(new R)}static{this.ChannelName="extensionhostdebugservice"}call(e,n,o){switch(n){case"close":return Promise.resolve(this._onCloseEmitter.fire({sessionId:o[0]}));case"reload":return Promise.resolve(this._onReloadEmitter.fire({sessionId:o[0]}));case"terminate":return Promise.resolve(this._onTerminateEmitter.fire({sessionId:o[0]}));case"attach":return Promise.resolve(this._onAttachEmitter.fire({sessionId:o[0],port:o[1],subId:o[2]}))}throw new Error("Method not implemented.")}listen(e,n,o){switch(n){case"close":return this._onCloseEmitter.event;case"reload":return this._onReloadEmitter.event;case"terminate":return this._onTerminateEmitter.event;case"attach":return this._onAttachEmitter.event}throw new Error("Method not implemented.")}}});var uS,Q2=v(()=>{te();uS=class{constructor(t,e){this.channel=t;this.getUriTransformer=e}async download(t,e,n){let o=this.getUriTransformer();o&&(t=o.transformOutgoingURI(t),e=o.transformOutgoingURI(e)),await this.channel.call("download",[t,e])}}});function J2(r){return r.toJSON()}function Y2(r,t,e){if(!r||e>200)return null;if(typeof r=="object"){if(r instanceof S)return t.transformOutgoing(r);for(let n in r)if(Object.hasOwnProperty.call(r,n)){let o=Y2(r[n],t,e+1);o!==null&&(r[n]=o)}}return null}function $r(r,t){let e=Y2(r,t,0);return e===null?r:e}function Ck(r,t,e,n){if(!r||n>200)return null;if(typeof r=="object"){if(r.$mid===1)return e?S.revive(t.transformIncoming(r)):t.transformIncoming(r);if(r instanceof O)return null;for(let o in r)if(Object.hasOwnProperty.call(r,o)){let i=Ck(r[o],t,e,n+1);i!==null&&(r[o]=i)}}return null}function Ek(r,t){let e=Ck(r,t,!1,0);return e===null?r:e}function bp(r,t){let e=Ck(r,t,!0,0);return e===null?r:e}var pS,Ip,Ll=v(()=>{Ve();Ka();te();pS=class{constructor(t){this._uriTransformer=t}transformIncoming(t){let e=this._uriTransformer.transformIncoming(t);return e===t?t:J2(S.from(e))}transformOutgoing(t){let e=this._uriTransformer.transformOutgoing(t);return e===t?t:J2(S.from(e))}transformOutgoingURI(t){let e=this._uriTransformer.transformOutgoing(t);return e===t?t:S.from(e)}transformOutgoingScheme(t){return this._uriTransformer.transformOutgoingScheme(t)}},Ip=new class{transformIncoming(r){return r}transformOutgoing(r){return r}transformOutgoingURI(r){return r}transformOutgoingScheme(r){return r}}});function Wi(r,t){return r?S.revive(t?t.transformIncoming(r):r):void 0}function Sp(r,t){return t?t.transformOutgoingURI(r):r}function qf(r,t){t=t||Ip;let e=r.manifest;return{...bp({...r,manifest:void 0},t),manifest:e}}function $f(r,t){return r?.profileLocation?bp(r,t??Ip):r}function zf(r,t){return t?so(r,e=>e instanceof S?t.transformOutgoingURI(e):void 0):r}var mS,X2=v(()=>{ue();Xt();te();Ll();yf();fe();mS=class{constructor(t,e){this.service=t;this.getUriTransformer=e;this.onInstallExtension=F.buffer(t.onInstallExtension,"onInstallExtension",!0),this.onDidInstallExtensions=F.buffer(t.onDidInstallExtensions,"onDidInstallExtensions",!0),this.onUninstallExtension=F.buffer(t.onUninstallExtension,"onUninstallExtension",!0),this.onDidUninstallExtension=F.buffer(t.onDidUninstallExtension,"onDidUninstallExtension",!0),this.onDidUpdateExtensionMetadata=F.buffer(t.onDidUpdateExtensionMetadata,"onDidUpdateExtensionMetadata",!0)}listen(t,e){let n=this.getUriTransformer(t);switch(e){case"onInstallExtension":return F.map(this.onInstallExtension,o=>({...o,profileLocation:o.profileLocation?Sp(o.profileLocation,n):o.profileLocation}));case"onDidInstallExtensions":return F.map(this.onDidInstallExtensions,o=>o.map(i=>({...i,local:i.local?zf(i.local,n):i.local,profileLocation:i.profileLocation?Sp(i.profileLocation,n):i.profileLocation})));case"onUninstallExtension":return F.map(this.onUninstallExtension,o=>({...o,profileLocation:o.profileLocation?Sp(o.profileLocation,n):o.profileLocation}));case"onDidUninstallExtension":return F.map(this.onDidUninstallExtension,o=>({...o,profileLocation:o.profileLocation?Sp(o.profileLocation,n):o.profileLocation}));case"onDidUpdateExtensionMetadata":return F.map(this.onDidUpdateExtensionMetadata,o=>({local:zf(o.local,n),profileLocation:Sp(o.profileLocation,n)}))}throw new Error("Invalid listen")}async call(t,e,n){let o=this.getUriTransformer(t);switch(e){case"zip":{let i=qf(n[0],o),s=await this.service.zip(i);return Sp(s,o)}case"install":return this.service.install(Wi(n[0],o),$f(n[1],o));case"installFromLocation":return this.service.installFromLocation(Wi(n[0],o),Wi(n[1],o));case"installExtensionsFromProfile":return this.service.installExtensionsFromProfile(n[0],Wi(n[1],o),Wi(n[2],o));case"getManifest":return this.service.getManifest(Wi(n[0],o));case"getTargetPlatform":return this.service.getTargetPlatform();case"installFromGallery":return this.service.installFromGallery(n[0],$f(n[1],o));case"installGalleryExtensions":{let i=n[0];return this.service.installGalleryExtensions(i.map(({extension:s,options:a})=>({extension:s,options:$f(a,o)??{}})))}case"uninstall":return this.service.uninstall(qf(n[0],o),$f(n[1],o));case"uninstallExtensions":{let i=n[0];return this.service.uninstallExtensions(i.map(({extension:s,options:a})=>({extension:qf(s,o),options:$f(a,o)})))}case"getInstalled":return(await this.service.getInstalled(n[0],Wi(n[1],o),n[2],n[3])).map(s=>zf(s,o));case"toggleApplicationScope":{let i=await this.service.toggleApplicationScope(qf(n[0],o),Wi(n[1],o));return zf(i,o)}case"copyExtensions":return this.service.copyExtensions(Wi(n[0],o),Wi(n[1],o));case"updateMetadata":{let i=await this.service.updateMetadata(qf(n[0],o),n[1],Wi(n[2],o));return zf(i,o)}case"resetPinnedStateForAllUserExtensions":return this.service.resetPinnedStateForAllUserExtensions(n[0]);case"getExtensionsControlManifest":return this.service.getExtensionsControlManifest();case"download":return this.service.download(n[0],n[1],n[2]);case"cleanUp":return this.service.cleanUp()}throw new Error("Invalid call")}}});var gS,Z2=v(()=>{Ve();Jt();ue();gS=class{constructor(t){this.service=t}listen(t,e){throw new Error("Invalid listen")}call(t,e,n,o=Ae.None){switch(e){case"request":return this.service.request(n[0],o).then(async({res:i,stream:s,timings:a})=>{let l=await Ir(s);return[{statusCode:i.statusCode,headers:i.headers},l,a]});case"resolveProxy":return this.service.resolveProxy(n[0]);case"lookupAuthorization":return this.service.lookupAuthorization(n[0]);case"lookupKerberosAuthorization":return this.service.lookupKerberosAuthorization(n[0]);case"loadCertificates":return this.service.loadCertificates()}throw new Error("Invalid call")}}});function wk(r){if(!r||typeof r!="object")return{callstack:void 0,msg:pu(r)};let t=Array.isArray(r.stack)?r.stack.join(`
`):r.stack,e=r.message?r.message:pu(r);return{callstack:t,msg:e}}var eW,Gf,Rk=v(()=>{Dt();xe();ue();Q();Xt();st();(t=>{function r(e,n){return e.callstack<n.callstack?-1:e.callstack>n.callstack?1:0}t.compare=r})(eW||={});Gf=class r{constructor(t,e=r.ERROR_FLUSH_TIMEOUT){this._flushHandle=void 0;this._buffer=[];this._disposables=new re;this._telemetryService=t,this._flushDelay=e;let n=Bd.addListener(o=>this._onErrorEvent(o));this._disposables.add(se(n)),this.installErrorListeners()}static{this.ERROR_FLUSH_TIMEOUT=5*1e3}dispose(){clearTimeout(this._flushHandle),this._flushBuffer(),this._disposables.dispose()}installErrorListeners(){}_onErrorEvent(t){if(!t||t.code||(t.detail&&t.detail.stack&&(t=t.detail),eo.isErrorNoTelemetry(t)||t instanceof kn||pv.is(t)||typeof t?.message=="string"&&t.message.includes("Unable to read file")))return;let{callstack:e,msg:n}=wk(t);if(!e)return;let o={msg:n,callstack:e};jd.is(t)&&(o.kind=t.kind,o.listenerCount=t.listenerCount),this._enqueue(o)}_enqueue(t){let e=Y0(this._buffer,t,eW.compare);e<0?(t.count=1,this._buffer.splice(~e,0,t)):(this._buffer[e].count||(this._buffer[e].count=0),this._buffer[e].count+=1),this._flushHandle===void 0&&(this._flushHandle=setTimeout(()=>{this._flushBuffer(),this._flushHandle=void 0},this._flushDelay))}_flushBuffer(){for(let t of this._buffer)this._telemetryService.publicLogError2("UnhandledError",t);this._buffer.length=0}}});var Kf,tW=v(()=>{xe();Rk();Kf=class extends Gf{installErrorListeners(){mv(e=>console.error(e));let t=[];process.on("unhandledRejection",(e,n)=>{t.push(n),setTimeout(()=>{let o=t.indexOf(n);o>=0&&n.catch(i=>{t.splice(o,1),on(i)||(console.warn(`rejected promise not handled within 1 second: ${i}`),i.stack&&console.warn(`stack trace: ${i.stack}`),e&&pt(e))})},1e3)}),process.on("rejectionHandled",e=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}),process.on("uncaughtException",e=>{gv(e)||pt(e)})}}});var nW,LJ,Tk,B0e,oW,Ol=v(()=>{Z();$o();nW=A("ptyService"),LJ={Backend:"workbench.contributions.terminal.processBackend"},Tk=class{constructor(){this._backends=new Map}get backends(){return this._backends}registerTerminalBackend(t){let e=this._sanitizeRemoteAuthority(t.remoteAuthority);if(this._backends.has(e))throw new Error(`A terminal backend with remote authority '${e}' was already registered.`);this._backends.set(e,t)}getTerminalBackend(t){return this._backends.get(this._sanitizeRemoteAuthority(t))}_sanitizeRemoteAuthority(t){return t?.toLowerCase()??""}};St.add(LJ.Backend,new Tk);B0e=A("localPtyService"),oW=A("terminalLogService")});var fS,xp,hS=v(()=>{te();ue();De();Q();fS=class{constructor(t,e){this.loggerService=t;this.getUriTransformer=e}listen(t,e){let n=this.getUriTransformer(t);switch(e){case"onDidChangeLoggers":return F.map(this.loggerService.onDidChangeLoggers,o=>({added:[...o.added].map(i=>this.transformLogger(i,n)),removed:[...o.removed].map(i=>this.transformLogger(i,n))}));case"onDidChangeVisibility":return F.map(this.loggerService.onDidChangeVisibility,o=>[n.transformOutgoingURI(o[0]),o[1]]);case"onDidChangeLogLevel":return F.map(this.loggerService.onDidChangeLogLevel,o=>OR(o)?o:[n.transformOutgoingURI(o[0]),o[1]])}throw new Error(`Event not found: ${e}`)}async call(t,e,n){let o=this.getUriTransformer(t);switch(e){case"setLogLevel":return OR(n[0])?this.loggerService.setLogLevel(n[0]):this.loggerService.setLogLevel(S.revive(o.transformIncoming(n[0][0])),n[0][1]);case"getRegisteredLoggers":return Promise.resolve([...this.loggerService.getRegisteredLoggers()].map(i=>this.transformLogger(i,o)))}throw new Error(`Call not found: ${e}`)}transformLogger(t,e){return{...t,resource:e.transformOutgoingURI(t.resource)}}},xp=class extends D{constructor(t,e){super(),e.call("setLogLevel",[t.getLogLevel()]),this._register(t.onDidChangeLogLevel(n=>e.call("setLogLevel",[n]))),e.call("getRegisteredLoggers").then(n=>{for(let o of n)t.registerLogger({...o,resource:S.revive(o.resource)})}),this._register(e.listen("onDidChangeVisibility")(([n,o])=>t.setVisibility(S.revive(n),o))),this._register(e.listen("onDidChangeLoggers")(({added:n,removed:o})=>{for(let i of n)t.registerLogger({...i,resource:S.revive(i.resource)});for(let i of o)t.deregisterLogger(i.resource)}))}}});var Cp,rW=v(()=>{Ue();Jt();ue();Q();De();Cp=class extends D{constructor(e,n){super();this._logService=n;this._lastRequestId=0;this._pendingRequests=new Map;this._pendingRequestDisposables=new Map;this._onCreateRequest=this._register(new R);this.onCreateRequest=this._onCreateRequest.event;this._timeout=e===void 0?15e3:e,this._register(se(()=>{for(let o of this._pendingRequestDisposables.values())hn(o)}))}createRequest(e){return new Promise((n,o)=>{let i=++this._lastRequestId;this._pendingRequests.set(i,n),this._onCreateRequest.fire({requestId:i,...e});let s=new _t;ko(this._timeout,s.token).then(()=>o(`Request ${i} timed out (${this._timeout}ms)`)),this._pendingRequestDisposables.set(i,[se(()=>s.cancel())])})}acceptReply(e,n){let o=this._pendingRequests.get(e);o?(this._pendingRequests.delete(e),hn(this._pendingRequestDisposables.get(e)||[]),this._pendingRequestDisposables.delete(e),o(n)):this._logService.warn(`RequestStore#acceptReply was called without receiving a matching request ${e}`)}};Cp=w([b(1,z)],Cp)});function iW(r,t){let e=[{name:null,description:d(4695,null)}];return e.push(...r.map(n=>({name:n.profileName,description:OJ(n)}))),t&&e.push(...t.map(n=>({name:n.title,description:UJ(n)}))),{values:e.map(n=>n.name),markdownDescriptions:e.map(n=>n.description)}}function OJ(r){let t=`$(${Zt.isThemeIcon(r.icon)?r.icon.id:r.icon?r.icon:ne.terminal.id}) ${r.profileName}
- path: ${r.path}`;return r.args&&(G(r.args)?t+=`
- args: "${r.args}"`:t+=`
- args: [${r.args.length===0?"":`'${r.args.join("','")}'`}]`),r.overrideName!==void 0&&(t+=`
- overrideName: ${r.overrideName}`),r.color&&(t+=`
- color: ${r.color}`),r.env&&(t+=`
- env: ${JSON.stringify(r.env)}`),t}function UJ(r){return`$(${Zt.isThemeIcon(r.icon)?r.icon.id:r.icon?r.icon:ne.terminal.id}) ${r.title}
- extensionIdentifier: ${r.extensionIdentifier}`}var sW=v(()=>{ms();te();ee();ra();Ie()});function kk(r){let t=r===2?"linux":r===1?"osx":"windows";return d(4674,null,cg(r),'```json\n"terminal.integrated.profile.'+t+'": {\n "bash": null\n}\n```',"[","](https://code.visualstudio.com/docs/terminal/profiles)")}function aW(){St.as(Jn.Configuration).registerConfiguration(HJ),WJ()}function WJ(r,t){let e=St.as(Jn.Configuration),n;r&&(n=iW(r?.profiles,t));let o=Ak;Ak={id:"terminal",order:100,title:d(4678,null),type:"object",properties:{"terminal.integrated.defaultProfile.linux":{restricted:!0,markdownDescription:d(4669,null),type:["string","null"],default:null,enum:r?.os===3?n?.values:void 0,markdownEnumDescriptions:r?.os===3?n?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.osx":{restricted:!0,markdownDescription:d(4670,null),type:["string","null"],default:null,enum:r?.os===2?n?.values:void 0,markdownEnumDescriptions:r?.os===2?n?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.windows":{restricted:!0,markdownDescription:d(4671,null),type:["string","null"],default:null,enum:r?.os===1?n?.values:void 0,markdownEnumDescriptions:r?.os===1?n?.markdownDescriptions:void 0}}},e.updateConfigurations({add:[Ak],remove:o?[o]:[]})}var NJ,FJ,wp,Pk,Ep,HJ,Ak,lW=v(()=>{ms();fe();ee();br();$o();Ol();sW();NJ={type:["string","null"],enum:["terminal.ansiBlack","terminal.ansiRed","terminal.ansiGreen","terminal.ansiYellow","terminal.ansiBlue","terminal.ansiMagenta","terminal.ansiCyan","terminal.ansiWhite"],default:null},FJ={type:"string",enum:Array.from(zT(),r=>r.id),markdownEnumDescriptions:Array.from(zT(),r=>`$(${r.id})`)},wp={args:{description:d(4679,null),type:"array",items:{type:"string"}},icon:{description:d(4682,null),...FJ},color:{description:d(4680,null),...NJ},env:{markdownDescription:d(4681,null),type:"object",additionalProperties:{type:["string","null"]},default:{}}},Pk={type:"object",required:["path"],properties:{path:{description:d(4690,null),type:["string","array"],items:{type:"string"}},overrideName:{description:d(4689,null),type:"boolean"},...wp}},Ep={type:"object",required:["path"],properties:{path:{description:d(4677,null),type:["string"],items:{type:"string"}},...wp}};HJ={id:"terminal",order:100,title:d(4678,null),type:"object",properties:{"terminal.integrated.automationProfile.linux":{restricted:!0,markdownDescription:d(4665,null),type:["object","null"],default:null,anyOf:[{type:"null"},Ep],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.osx":{restricted:!0,markdownDescription:d(4666,null),type:["object","null"],default:null,anyOf:[{type:"null"},Ep],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.windows":{restricted:!0,markdownDescription:d(4667,null,"`terminal.integrated.automationShell.windows`"),type:["object","null"],default:null,anyOf:[{type:"null"},Ep],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.agentHostProfile.linux":{restricted:!0,markdownDescription:d(4662,null,"`#terminal.integrated.profiles.linux#`","`#terminal.integrated.defaultProfile.linux#`"),type:["string","object","null"],default:null,anyOf:[{type:"null"},{type:"string"},Ep],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.agentHostProfile.osx":{restricted:!0,markdownDescription:d(4663,null,"`#terminal.integrated.profiles.osx#`","`#terminal.integrated.defaultProfile.osx#`"),type:["string","object","null"],default:null,anyOf:[{type:"null"},{type:"string"},Ep],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.agentHostProfile.windows":{restricted:!0,markdownDescription:d(4664,null,"`#terminal.integrated.profiles.windows#`","`#terminal.integrated.defaultProfile.windows#`"),type:["string","object","null"],default:null,anyOf:[{type:"null"},{type:"string"},Ep],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.profiles.windows":{restricted:!0,markdownDescription:kk(3),type:"object",default:{PowerShell:{source:"PowerShell",icon:ne.terminalPowershell.id},"Command Prompt":{path:["${env:windir}\\Sysnative\\cmd.exe","${env:windir}\\System32\\cmd.exe"],args:[],icon:ne.terminalCmd.id},"Git Bash":{source:"Git Bash",icon:ne.terminalGitBash.id}},additionalProperties:{anyOf:[{type:"object",required:["source"],properties:{source:{description:d(4694,null),enum:["PowerShell","Git Bash"]},...wp}},{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:d(4692,null),type:"string"},id:{description:d(4691,null),type:"string"},title:{description:d(4693,null),type:"string"},...wp}},{type:"null"},Pk]}},"terminal.integrated.profiles.osx":{restricted:!0,markdownDescription:kk(1),type:"object",default:{bash:{path:"bash",args:["-l"],icon:ne.terminalBash.id},zsh:{path:"zsh",args:["-l"]},fish:{path:"fish",args:["-l"]},tmux:{path:"tmux",icon:ne.terminalTmux.id},pwsh:{path:"pwsh",icon:ne.terminalPowershell.id}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:d(4687,null),type:"string"},id:{description:d(4686,null),type:"string"},title:{description:d(4688,null),type:"string"},...wp}},{type:"null"},Pk]}},"terminal.integrated.profiles.linux":{restricted:!0,markdownDescription:kk(2),type:"object",default:{bash:{path:"bash",icon:ne.terminalBash.id},zsh:{path:"zsh"},fish:{path:"fish"},tmux:{path:"tmux",icon:ne.terminalTmux.id},pwsh:{path:"pwsh",icon:ne.terminalPowershell.id}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:d(4684,null),type:"string"},id:{description:d(4683,null),type:"string"},title:{description:d(4685,null),type:"string"},...wp}},{type:"null"},Pk]}},"terminal.integrated.useWslProfiles":{description:d(4676,null),type:"boolean",default:!0},"terminal.integrated.inheritEnv":{scope:1,description:d(4672,null),type:"boolean",default:!0},"terminal.integrated.persistentSessionScrollback":{scope:1,markdownDescription:d(4673,null),type:"number",default:100},"terminal.integrated.showLinkHover":{scope:1,description:d(4675,null),type:"boolean",default:!0},"terminal.integrated.ignoreProcessNames":{markdownDescription:d(4668,null,"`#terminal.integrated.confirmOnKill#`"),type:"array",items:{type:"string",uniqueItems:!0},default:["starship","oh-my-posh","bash","zsh"]}}}});import*as vS from"os";async function VJ(){if(jf)return;if(!oe){jf={release:vS.release(),buildNumber:0};return}let r,t;try{let e=await import("@vscode/windows-registry"),n="SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",o=e.GetStringRegKey("HKEY_LOCAL_MACHINE",n,"CurrentBuild");o!==void 0&&(r=parseInt(o,10),isNaN(r)&&(r=void 0));let i=e.GetDWORDRegKey("HKEY_LOCAL_MACHINE",n,"CurrentMajorVersionNumber"),s=e.GetDWORDRegKey("HKEY_LOCAL_MACHINE",n,"CurrentMinorVersionNumber");i!==void 0&&s!==void 0&&o!==void 0&&(t=`${i}.${s}.${o}`)}catch{}finally{jf={release:t||vS.release(),buildNumber:r||BJ()}}}async function cW(){return jf||await VJ(),jf.buildNumber}function BJ(){let r=/(\d+)\.(\d+)\.(\d+)/g.exec(vS.release());return r&&r.length===4?parseInt(r[3],10):0}var jf,dW=v(()=>{fe()});import*as mW from"fs";import*as gW from"child_process";import{userInfo as qJ}from"os";function fW(r,t,e,n,o=process.env,i,s,a,l,c){return i=i||{existsFile:Ao.existsFile,readFile:mW.promises.readFile},oe?$J(e,i,o,s,n.getValue("terminal.integrated.useWslProfiles")!==!1,r&&ve(r)?{...r}:n.getValue("terminal.integrated.profiles.windows"),G(t)?t:n.getValue("terminal.integrated.defaultProfile.windows"),l,a):YJ(i,s,e,r&&ve(r)?{...r}:n.getValue(Ke?"terminal.integrated.profiles.linux":"terminal.integrated.profiles.osx"),G(t)?t:n.getValue(Ke?"terminal.integrated.defaultProfile.linux":"terminal.integrated.defaultProfile.osx"),l,a,o,c??XJ(o))}async function $J(r,t,e,n,o,i,s,a,l){let c=process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),u=`${process.env.windir}\\${c?"Sysnative":"System32"}`,p=await cW()>=19041;await GJ(a);let m=new Map;if(r){m.set("PowerShell",{source:"PowerShell",icon:ne.terminalPowershell,isAutoDetected:!0}),m.set("Windows PowerShell",{path:`${u}\\WindowsPowerShell\\v1.0\\powershell.exe`,icon:ne.terminalPowershell,isAutoDetected:!0}),m.set("Git Bash",{source:"Git Bash",icon:ne.terminalGitBash,isAutoDetected:!0}),m.set("Command Prompt",{path:`${u}\\cmd.exe`,icon:ne.terminalCmd,isAutoDetected:!0}),m.set("Cygwin",{path:[{path:`${process.env.HOMEDRIVE}\\cygwin64\\bin\\bash.exe`,isUnsafe:!0},{path:`${process.env.HOMEDRIVE}\\cygwin\\bin\\bash.exe`,isUnsafe:!0}],args:["--login"],isAutoDetected:!0}),m.set("bash (MSYS2)",{path:[{path:`${process.env.HOMEDRIVE}\\msys64\\usr\\bin\\bash.exe`,isUnsafe:!0}],args:["--login","-i"],env:{CHERE_INVOKING:"1"},icon:ne.terminalBash,isAutoDetected:!0});let y=`${process.env.CMDER_ROOT||`${process.env.HOMEDRIVE}\\cmder`}\\vendor\\bin\\vscode_init.cmd`;m.set("Cmder",{path:`${u}\\cmd.exe`,args:["/K",y],requiresPath:process.env.CMDER_ROOT?y:{path:y,isUnsafe:!0},isAutoDetected:!0})}yW(i,m);let g=await hW(m.entries(),s,t,e,n,l);if(r&&o&&p)try{let y=await QJ(`${u}\\wsl.exe`,s);for(let h of y)(!i||!Object.prototype.hasOwnProperty.call(i,h.profileName))&&g.push(h)}catch{uW&&(n?.trace("WSL is not installed, so could not detect WSL profiles"),uW=!1)}return g}async function hW(r,t,e,n=process.env,o,i,s){let a=[];for(let[l,c]of r)a.push(zJ(l,c,t,e,n,o,i,s));return(await Promise.all(a)).filter(l=>!!l)}async function zJ(r,t,e,n,o=process.env,i,s,a){if(t===null)return;let l,c,u;if(Rn(t,{source:!0})){let h=Qf?.get(t.source);if(!h)return;l=h.paths,c=t.args||h.args,t.icon?u=pW(t.icon):h.icon&&(u=h.icon)}else l=Array.isArray(t.path)?t.path:[t.path],c=oe||Array.isArray(t.args)?t.args:void 0,u=pW(t.icon);let p;if(s){let h=l.map(x=>G(x)?x:x.path),I=await s(h);p=new Array(l.length);for(let x=0;x<l.length;x++)G(l[x])?p[x]=I[x]:p[x]={path:I[x],isUnsafe:!0}}else p=l.slice();let m=p.filter(h=>G(h)&&Ze(h)===h);p.push(...m.flatMap(h=>(a??[]).filter(I=>Ze(I)===h)));let g;if(t.requiresPath){let h;if(G(t.requiresPath)?h=t.requiresPath:(h=t.requiresPath.path,t.requiresPath.isUnsafe&&(g=h)),!await n.existsFile(h))return}let y=await IS(r,e,p,n,o,c,t.env,t.overrideName,t.isAutoDetected,g);if(!y){i?.debug("Terminal profile not validated",r,l);return}return y.isAutoDetected=t.isAutoDetected,y.icon=u,y.color=t.color,y}function pW(r){return G(r)?{id:r}:r}async function GJ(r){if(Qf&&!r)return;let[t,e]=await Promise.all([KJ(),r||jJ()]);Qf=new Map,Qf.set("Git Bash",{profileName:"Git Bash",paths:t,args:["--login","-i"]}),Qf.set("PowerShell",{profileName:"PowerShell",paths:e,icon:ne.terminalPowershell})}async function KJ(){let r=new Set,t=await Qg("git.exe");if(t){let o=It(t);r.add(Sn(o,"../.."))}function e(o,i){i&&o.add(i)}e(r,process.env.ProgramW6432),e(r,process.env.ProgramFiles),e(r,process.env["ProgramFiles(X86)"]),e(r,`${process.env.LocalAppData}\\Program`);let n=[];for(let o of r)n.push(`${o}\\Git\\bin\\bash.exe`,`${o}\\Git\\usr\\bin\\bash.exe`,`${o}\\usr\\bin\\bash.exe`);return n.push(`${process.env.UserProfile}\\scoop\\apps\\git\\current\\bin\\bash.exe`),n.push(`${process.env.UserProfile}\\scoop\\apps\\git-with-openssh\\current\\bin\\bash.exe`),n}async function jJ(){let r=[];for await(let t of hT())r.push(t.exePath);return r}async function QJ(r,t){let e=[],n=await new Promise((i,s)=>{gW.exec("wsl.exe -l -q",{encoding:"utf16le",env:{...process.env,WSL_UTF8:"0"},timeout:1e3},(a,l)=>{if(a)return s("Problem occurred when getting wsl distros");i(l)})});if(!n)return[];let o=n.split(/\r?\n/).filter(i=>i.trim().length>0);for(let i of o){if(i===""||i.startsWith("docker-desktop"))continue;let s=`${i} (WSL)`,a={profileName:s,path:r,args:["-d",`${i}`],isDefault:s===t,icon:JJ(i),isAutoDetected:!1};e.push(a)}return e}function JJ(r){return r.includes("Ubuntu")?ne.terminalUbuntu:r.includes("Debian")?ne.terminalDebian:ne.terminalLinux}async function YJ(r,t,e,n,o,i,s,a,l){let c=new Map;if(e&&await r.existsFile("/etc/shells")){let u=(await r.readFile("/etc/shells")).toString(),p=(i||u.split(`
`)).map(g=>{let y=g.indexOf("#");return y===-1?g:g.substring(0,y)}).filter(g=>g.trim().length>0),m=new Map;for(let g of p){let y=Ze(g),h=m.get(y)||0;h++,h>1&&(y=`${y} (${h})`),m.set(y,h),c.set(y,{path:g,isAutoDetected:!0})}}return yW(n,c),await hW(c.entries(),o,r,a,t,s,l)}function XJ(r){let t=[r.SHELL,process.env.SHELL];try{t.push(qJ().shell??void 0)}catch{}return rn(t.filter(e=>!!e&&Gn(e)))}function yW(r,t){if(r)for(let[e,n]of Object.entries(r))n===null||!ve(n)||!Rn(n,{path:!0})&&!Rn(n,{source:!0})?t.delete(e):(n.icon=n.icon||t.get(e)?.icon,t.set(e,n))}async function IS(r,t,e,n,o,i,s,a,l,c){if(e.length===0)return Promise.resolve(void 0);let u=e.shift();if(u==="")return IS(r,t,e,n,o,i,s,a,l);let p=!G(u)&&u.isUnsafe,m=G(u)?u:u.path,g={profileName:r,path:m,args:i,env:s,overrideName:a,isAutoDetected:l,isDefault:r===t,isUnsafePath:p,requiresUnsafePath:c};if(Ze(m)===m){let h=o.PATH?o.PATH.split(Fa):void 0,I=await Qg(m,void 0,h,void 0,n.existsFile);return I?(g.path=I,g.isFromPath=!0,g):IS(r,t,e,n,o,i,s,a,l)}return await n.existsFile(Fn(m))?g:IS(r,t,e,n,o,i,s,a,l)}var Qf,uW,vW=v(()=>{Dt();ms();Oe();fe();Jg();Ie();vo();yT();Ol();dW();uW=!0});var Rp,IW=v(()=>{ue();Q();fe();la();dn();De();hS();Xg();rW();Ol();lW();vW();bT();Vs();Rp=class extends D{constructor(e,n,o,i){super();this._ptyHostStarter=e;this._configurationService=n;this._logService=o;this._loggerService=i;this._wasQuitRequested=!1;this._restartCount=0;this._isResponsive=!0;this._onPtyHostExit=this._register(new R);this.onPtyHostExit=this._onPtyHostExit.event;this._onPtyHostStart=this._register(new R);this.onPtyHostStart=this._onPtyHostStart.event;this._onPtyHostUnresponsive=this._register(new R);this.onPtyHostUnresponsive=this._onPtyHostUnresponsive.event;this._onPtyHostResponsive=this._register(new R);this.onPtyHostResponsive=this._onPtyHostResponsive.event;this._onPtyHostRequestResolveVariables=this._register(new R);this.onPtyHostRequestResolveVariables=this._onPtyHostRequestResolveVariables.event;this._onProcessData=this._register(new R);this.onProcessData=this._onProcessData.event;this._onProcessReady=this._register(new R);this.onProcessReady=this._onProcessReady.event;this._onProcessReplay=this._register(new R);this.onProcessReplay=this._onProcessReplay.event;this._onProcessOrphanQuestion=this._register(new R);this.onProcessOrphanQuestion=this._onProcessOrphanQuestion.event;this._onDidRequestDetach=this._register(new R);this.onDidRequestDetach=this._onDidRequestDetach.event;this._onDidChangeProperty=this._register(new R);this.onDidChangeProperty=this._onDidChangeProperty.event;this._onProcessExit=this._register(new R);this.onProcessExit=this._onProcessExit.event;this._ptyHostStore=this._register(new re);aW(),this._register(this._ptyHostStarter),this._register(se(()=>this._disposePtyHost())),this._resolveVariablesRequestStore=this._register(new Cp(void 0,this._logService)),this._register(this._resolveVariablesRequestStore.onCreateRequest(this._onPtyHostRequestResolveVariables.fire,this._onPtyHostRequestResolveVariables)),this._ptyHostStarter.onRequestConnection&&this._register(F.once(this._ptyHostStarter.onRequestConnection)(()=>this._ensurePtyHost())),this._ptyHostStarter.onWillShutdown&&this._register(this._ptyHostStarter.onWillShutdown(()=>this._wasQuitRequested=!0))}get _proxy(){return this._ensurePtyHost(),this.__proxy}get _optionalProxy(){return this.__proxy}_ensurePtyHost(){this.__connection||this._startPtyHost()}get _ignoreProcessNames(){return this._configurationService.getValue("terminal.integrated.ignoreProcessNames")}async _refreshIgnoreProcessNames(){return this._optionalProxy?.refreshIgnoreProcessNames?.(this._ignoreProcessNames)}async _resolveShellEnv(){if(oe)return process.env;try{return await pl(this._configurationService,this._logService,{_:[]},process.env)}catch(e){return this._logService.error("ptyHost was unable to resolve shell environment",e),{}}}_startPtyHost(){let e=this._ptyHostStarter.start(),n=e.client,o=this._ptyHostStore;o.add(e.store),this._logService.getLevel()===1&&this._logService.trace("PtyHostService#_startPtyHost",new Error().stack?.replace(/^Error/,""));let i=Er.toService(n.getChannel("heartbeat"));o.add(i.onBeat(()=>this._handleHeartbeat())),this._handleHeartbeat(!0),o.add(e.onDidProcessExit(a=>{this._onPtyHostExit.fire(a.code),!this._wasQuitRequested&&!this._store.isDisposed&&(this._restartCount<=5?(this._logService.error(`ptyHost terminated unexpectedly with code ${a.code}`),this._restartCount++,this.restartPtyHost()):this._logService.error(`ptyHost terminated unexpectedly with code ${a.code}, giving up`))}));let s=Er.toService(n.getChannel("ptyHost"));o.add(s.onProcessData(a=>this._onProcessData.fire(a))),o.add(s.onProcessReady(a=>this._onProcessReady.fire(a))),o.add(s.onProcessExit(a=>this._onProcessExit.fire(a))),o.add(s.onDidChangeProperty(a=>this._onDidChangeProperty.fire(a))),o.add(s.onProcessReplay(a=>this._onProcessReplay.fire(a))),o.add(s.onProcessOrphanQuestion(a=>this._onProcessOrphanQuestion.fire(a))),o.add(s.onDidRequestDetach(a=>this._onDidRequestDetach.fire(a))),o.add(new xp(this._loggerService,n.getChannel("logger"))),this.__connection=e,this.__proxy=s,this._onPtyHostStart.fire(),o.add(this._configurationService.onDidChangeConfiguration(async a=>{a.affectsConfiguration("terminal.integrated.ignoreProcessNames")&&await this._refreshIgnoreProcessNames()})),this._refreshIgnoreProcessNames()}async createProcess(e,n,o,i,s,a,l,c,u,p,m){let g=setTimeout(()=>this._handleUnresponsiveCreateProcess(),5e3),y=await this._proxy.createProcess(e,n,o,i,s,a,l,c,u,p,m);return clearTimeout(g),y}updateTitle(e,n,o){return this._proxy.updateTitle(e,n,o)}updateIcon(e,n,o,i){return this._proxy.updateIcon(e,n,o,i)}attachToProcess(e,n){return this._proxy.attachToProcess(e,n)}detachFromProcess(e,n){return this._proxy.detachFromProcess(e,n)}shutdownAll(){return this._proxy.shutdownAll()}listProcesses(){return this._proxy.listProcesses()}async getPerformanceMarks(){return this._optionalProxy?.getPerformanceMarks()??[]}async reduceConnectionGraceTime(){return this._optionalProxy?.reduceConnectionGraceTime()}start(e){return this._proxy.start(e)}shutdown(e,n){return this._proxy.shutdown(e,n)}input(e,n){return this._proxy.input(e,n)}sendSignal(e,n){return this._proxy.sendSignal(e,n)}processBinary(e,n){return this._proxy.processBinary(e,n)}resize(e,n,o,i,s){return this._proxy.resize(e,n,o,i,s)}clearBuffer(e){return this._proxy.clearBuffer(e)}setParentWindow(e,n){return this._proxy.setParentWindow(e,n)}acknowledgeDataEvent(e,n){return this._proxy.acknowledgeDataEvent(e,n)}setUnicodeVersion(e,n){return this._proxy.setUnicodeVersion(e,n)}setNextCommandId(e,n,o){return this._proxy.setNextCommandId(e,n,o)}getInitialCwd(e){return this._proxy.getInitialCwd(e)}getCwd(e){return this._proxy.getCwd(e)}async getLatency(){let e=new no,n=await this._proxy.getLatency();return e.stop(),[{label:"ptyhostservice<->ptyhost",latency:e.elapsed()},...n]}orphanQuestionReply(e){return this._proxy.orphanQuestionReply(e)}installAutoReply(e,n,o){return this._proxy.installAutoReply(e,n,o)}uninstallAllAutoReplies(e){return this._proxy.uninstallAllAutoReplies(e)}getDefaultSystemShell(e){return this._optionalProxy?.getDefaultSystemShell(e)??bI(e??fr,process.env)}async getProfiles(e,n,o,i=!1){let s=await this._resolveShellEnv();return fW(n,o,i,this._configurationService,s,void 0,this._logService,this._resolveVariables.bind(this,e))}async getEnvironment(){return this.__proxy?this._proxy.getEnvironment():{...process.env}}getWslPath(e,n){return this._proxy.getWslPath(e,n)}getRevivedPtyNewId(e,n){return this._proxy.getRevivedPtyNewId(e,n)}setTerminalLayoutInfo(e){return this._proxy.setTerminalLayoutInfo(e)}async getTerminalLayoutInfo(e){return this._optionalProxy?.getTerminalLayoutInfo(e)}async requestDetachInstance(e,n){return this._proxy.requestDetachInstance(e,n)}async acceptDetachInstanceReply(e,n){return this._proxy.acceptDetachInstanceReply(e,n)}async freePortKillProcess(e){if(!this._proxy.freePortKillProcess)throw new Error("freePortKillProcess does not exist on the pty proxy");return this._proxy.freePortKillProcess(e)}async serializeTerminalState(e){return this._proxy.serializeTerminalState(e)}async reviveTerminalProcesses(e,n,o){return this._proxy.reviveTerminalProcesses(e,n,o)}async refreshProperty(e,n){return this._proxy.refreshProperty(e,n)}async updateProperty(e,n,o){return this._proxy.updateProperty(e,n,o)}async restartPtyHost(){this._disposePtyHost(),this._isResponsive=!0,this._startPtyHost()}_disposePtyHost(){this._clearHeartbeatTimeouts(),this._optionalProxy?.shutdownAll().catch(()=>{}),this.__connection=void 0,this.__proxy=void 0,this._ptyHostStore.clear()}_handleHeartbeat(e){this._clearHeartbeatTimeouts(),this._heartbeatFirstTimeout=setTimeout(()=>this._handleHeartbeatFirstTimeout(),e?2e4:5e3*1.2),this._isResponsive||(this._isResponsive=!0,this._onPtyHostResponsive.fire())}_handleHeartbeatFirstTimeout(){this._logService.warn(`No ptyHost heartbeat after ${5e3*1.2/1e3} seconds`),this._heartbeatFirstTimeout=void 0,this._heartbeatSecondTimeout=setTimeout(()=>this._handleHeartbeatSecondTimeout(),5e3*1)}_handleHeartbeatSecondTimeout(){this._logService.error(`No ptyHost heartbeat after ${(5e3*1.2+5e3*1.2)/1e3} seconds`),this._heartbeatSecondTimeout=void 0,this._isResponsive&&(this._isResponsive=!1,this._onPtyHostUnresponsive.fire())}_handleUnresponsiveCreateProcess(){this._clearHeartbeatTimeouts(),this._logService.error(`No ptyHost response to createProcess after ${5e3/1e3} seconds`),this._isResponsive&&(this._isResponsive=!1,this._onPtyHostUnresponsive.fire())}_clearHeartbeatTimeouts(){this._heartbeatFirstTimeout&&(clearTimeout(this._heartbeatFirstTimeout),this._heartbeatFirstTimeout=void 0),this._heartbeatSecondTimeout&&(clearTimeout(this._heartbeatSecondTimeout),this._heartbeatSecondTimeout=void 0)}_resolveVariables(e,n){return this._resolveVariablesRequestStore.createRequest({workspaceId:e,originalText:n})}async acceptPtyHostResolvedVariables(e,n){this._resolveVariablesRequestStore.acceptReply(e,n)}};Rp=w([b(1,bt),b(2,z),b(3,Bo)],Rp)});function ZJ(r){return{transformIncoming:t=>t.scheme==="vscode-remote"?{scheme:"file",path:t.path,query:t.query,fragment:t.fragment}:t.scheme==="file"?{scheme:"vscode-local",path:t.path,query:t.query,fragment:t.fragment}:t,transformOutgoing:t=>t.scheme==="file"?{scheme:"vscode-remote",authority:r,path:t.path,query:t.query,fragment:t.fragment}:t.scheme==="vscode-local"?{scheme:"file",path:t.path,query:t.query,fragment:t.fragment}:t,transformOutgoingScheme:t=>t==="file"?"vscode-remote":t==="vscode-local"?"file":t}}function xs(r){return new pS(ZJ(r))}var Tp=v(()=>{Ll()});import{exec as bS}from"child_process";import{totalmem as eY}from"os";function Jf(r){return new Promise((t,e)=>{let n,o=new Map,i=eY();function s(l,c,u,p,m){let g=o.get(c);if(l===r||g){let y={name:a(u),cmd:u,pid:l,ppid:c,load:p,mem:oe?m:i*(m/100)};o.set(l,y),l===r&&(n=y),g&&(g.children||(g.children=[]),g.children.push(y),g.children.length>1&&(g.children=g.children.sort((h,I)=>h.pid-I.pid)))}}function a(l){let c=/--utility-sub-type=network/i,u=/--crashes-directory/i,p=/conhost\.exe.+--headless/i,m=/--type=([a-zA-Z-]+)/;if(u.exec(l))return"electron-crash-reporter";if(p.exec(l))return"conpty-agent";let g=m.exec(l);if(g&&g.length===2)return g[1]==="renderer"?"window":g[1]==="utility"?c.exec(l)?"utility-network-service":"utility-process":g[1]==="extensionHost"?"extension-host":g[1];if(l.indexOf("node ")<0&&l.indexOf("node.exe")<0){let y="";do g=tY.exec(l),g&&(y+=g+" ");while(g);if(y)return`electron-nodejs (${y.trim()})`}return l}if(process.platform==="win32"){let l=c=>c.indexOf("\\\\?\\")===0||c.indexOf("\\??\\")===0?c.substring(4):c.indexOf('"\\\\?\\')===0||c.indexOf('"\\??\\')===0?'"'+c.substring(5):c;import("@vscode/windows-process-tree").then(c=>{c.getProcessList(r,u=>{if(!u){e(new Error(`Root process ${r} not found`));return}c.getProcessCpuUsage(u,p=>{let m=new Map;p.forEach(g=>{let y=l(g.commandLine||"");m.set(g.pid,{name:a(y),cmd:y,pid:g.pid,ppid:g.ppid,load:g.cpu||0,mem:g.memory||0})}),n=m.get(r),n?(m.forEach(g=>{let y=m.get(g.ppid);y&&(y.children||(y.children=[]),y.children.push(g))}),m.forEach(g=>{g.children&&(g.children=g.children.sort((y,h)=>y.pid-h.pid))}),t(n)):e(new Error(`Root process ${r} not found`))})},c.ProcessDataFlag.CommandLine|c.ProcessDataFlag.Memory)})}else{let l=function(){let c=[n],u=[];for(;c.length;){let m=c.shift();m&&(u.push(m.pid),m.children&&(c=c.concat(m.children)))}let p=JSON.stringify(Pt.asFileUri("vs/base/node/cpuUsage.sh").fsPath);p+=" "+u.join(" "),bS(p,{},(m,g,y)=>{if(m||y)e(m||new Error(y.toString()));else{let h=g.toString().split(`
`);for(let I=0;I<u.length;I++){let x=o.get(u[I]);x.load=parseFloat(h[I])}if(!n){e(new Error(`Root process ${r} not found`));return}t(n)}})};bS("which ps",{},(c,u,p)=>{if(c||p)if(process.platform!=="linux")e(c||new Error(p.toString()));else{let m=JSON.stringify(Pt.asFileUri("vs/base/node/ps.sh").fsPath);bS(m,{},(g,y,h)=>{g||h?e(g||new Error(h.toString())):(bW(y,s),l())})}else{let m=u.toString().trim();bS(`${m} -ax -o pid=,ppid=,pcpu=,pmem=,command=`,{maxBuffer:1e3*1024,env:{LC_NUMERIC:"en_US.UTF-8"}},(y,h,I)=>{y||I&&!I.includes("screen size is bogus")?e(y||new Error(I.toString())):(bW(h,s),process.platform==="linux"?l():n?t(n):e(new Error(`Root process ${r} not found`)))})}})}})}function bW(r,t){let e=/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+\.[0-9]+)\s+([0-9]+\.[0-9]+)\s+(.+)$/,n=r.toString().split(`
`);for(let o of n){let i=e.exec(o.trim());i&&i.length===6&&t(parseInt(i[1]),parseInt(i[2]),i[5],parseFloat(i[3]),parseFloat(i[4]))}}var tY,Dk=v(()=>{Me();fe();tY=/[a-zA-Z-]+\.js\b/g});function _k(r){let t=r;return!!t?.hostName&&!!t?.errorMessage}var nY,$Ue,SW=v(()=>{Z();nY="diagnosticsService",$Ue=A(nY)});import*as xW from"fs";import*as Vn from"os";async function Yf(r,t,e){let n=`${r}::${t.join(":")}::${e?.unbounded?"unbounded":"bounded"}`;if(e?.skipCache)Mk.delete(n);else{let u=Mk.get(n);if(u)return u}let o=[{tag:"grunt.js",filePattern:/^gruntfile\.js$/i},{tag:"gulp.js",filePattern:/^gulpfile\.js$/i},{tag:"tsconfig.json",filePattern:/^tsconfig\.json$/i},{tag:"package.json",filePattern:/^package\.json$/i},{tag:"jsconfig.json",filePattern:/^jsconfig\.json$/i},{tag:"tslint.json",filePattern:/^tslint\.json$/i},{tag:"eslint.json",filePattern:/^eslint\.json$/i},{tag:"tasks.json",filePattern:/^tasks\.json$/i},{tag:"launch.json",filePattern:/^launch\.json$/i},{tag:"mcp.json",filePattern:/^mcp\.json$/i},{tag:"settings.json",filePattern:/^settings\.json$/i},{tag:"webpack.config.js",filePattern:/^webpack\.config\.js$/i},{tag:"project.json",filePattern:/^project\.json$/i},{tag:"makefile",filePattern:/^makefile$/i},{tag:"sln",filePattern:/^.+\.sln$/i},{tag:"csproj",filePattern:/^.+\.csproj$/i},{tag:"cmake",filePattern:/^.+\.cmake$/i},{tag:"github-actions",filePattern:/^.+\.ya?ml$/i,relativePathPattern:/^\.github(?:\/|\\)workflows$/i},{tag:"devcontainer.json",filePattern:/^devcontainer\.json$/i},{tag:"dockerfile",filePattern:/^(dockerfile|docker\-compose\.ya?ml)$/i},{tag:"cursorrules",filePattern:/^\.cursorrules$/i},{tag:"cursorrules-dir",filePattern:/\.mdc$/i,relativePathPattern:/^\.cursor[\/\\]rules$/i},{tag:"github-instructions-dir",filePattern:/\.instructions\.md$/i,relativePathPattern:/^\.github[\/\\]instructions$/i},{tag:"github-prompts-dir",filePattern:/\.prompt\.md$/i,relativePathPattern:/^\.github[\/\\]prompts$/i},{tag:"clinerules",filePattern:/^\.clinerules$/i},{tag:"clinerules-dir",filePattern:/\.md$/i,relativePathPattern:/^\.clinerules$/i},{tag:"agent.md",filePattern:/^agent\.md$/i},{tag:"agents.md",filePattern:/^agents\.md$/i},{tag:"claude.md",filePattern:/^claude\.md$/i},{tag:"claude-settings",filePattern:/^settings\.json$/i,relativePathPattern:/^\.claude$/i},{tag:"claude-settings-local",filePattern:/^settings\.local\.json$/i,relativePathPattern:/^\.claude$/i},{tag:"claude-mcp",filePattern:/^mcp\.json$/i,relativePathPattern:/^\.claude$/i},{tag:"claude-commands-dir",filePattern:/\.md$/i,relativePathPattern:/^\.claude[\/\\]commands$/i},{tag:"claude-skills-dir",filePattern:/^SKILL\.md$/i,relativePathPattern:/^\.claude[\/\\]skills[\/\\]/i},{tag:"claude-rules-dir",filePattern:/\.md$/i,relativePathPattern:/^\.claude[\/\\]rules$/i},{tag:"gemini.md",filePattern:/^gemini\.md$/i},{tag:"copilot-instructions.md",filePattern:/^copilot\-instructions\.md$/i,relativePathPattern:/^\.github$/i}],i=new Map,s=new Map,a=e?.unbounded?Number.POSITIVE_INFINITY:2e4;function l(u,p,m,g){let y=p.substring(u.length+1);return Pn.withAsyncBody(async h=>{if(g.count>=a){g.maxReached=!0,h();return}let I;g.readdirCount++;try{I=await Ce.readdir(p,{withFileTypes:!0})}catch{h();return}if(g.count>=a){g.maxReached=!0,h();return}let x=I.length;if(x===0){h();return}for(let E of I)if(E.isDirectory()){if(m.includes(E.name)||await l(u,$(p,E.name),m,g),--x===0){h();return}}else{if(g.count>=a){g.maxReached=!0,h();return}g.count++;let T=E.name.lastIndexOf("."),P;T>=0&&(P=E.name.substring(T+1)||void 0),i.set(P??Pp,(i.get(P??Pp)??0)+1);for(let M of o)M.relativePathPattern?.test(y)!==!1&&M.filePattern.test(E.name)&&s.set(M.tag,(s.get(M.tag)??0)+1);if(--x===0){h();return}}})}let c=Pn.withAsyncBody(async u=>{let p={count:0,maxReached:!1,readdirCount:0},m=new no(!0);await l(r,r,t,p);let g=await oY(r);u({configFiles:Lk(s),fileTypes:Lk(i),fileCount:p.count,maxFilesReached:p.maxReached,launchConfigFiles:g,totalScanTime:m.elapsed(),totalReaddirCount:p.readdirCount})});return Mk.set(n,c),c}function Lk(r){return Array.from(r.entries(),([t,e])=>({name:t,count:e})).sort((t,e)=>e.count-t.count)}function Ok(){let r={os:`${Vn.type()} ${Vn.arch()} ${Vn.release()}`,memory:`${(Vn.totalmem()/Oi.GB).toFixed(2)}GB (${(Vn.freemem()/Oi.GB).toFixed(2)}GB free)`,vmHint:`${Math.round(Sk.value()*100)}%`},t=Vn.cpus();return t&&t.length>0&&(r.cpus=`${t[0].model} (${t.length} x ${t[0].speed})`),r}async function oY(r){try{let t=new Map,e=$(r,".vscode","launch.json"),n=await xW.promises.readFile(e),o=[],i=bo(n.toString(),o);if(o.length)return console.log(`Unable to parse ${e}`),[];if(al(i)==="object"&&i.configurations)for(let s of i.configurations){let a=s.type;a&&(t.has(a)?t.set(a,t.get(a)+1):t.set(a,1))}return Lk(t)}catch{return[]}}var Mk,Pp,SS,CW=v(()=>{Ue();qo();Me();Oe();fe();Vs();te();xk();vo();Dk();SW();st();Wn();_n();Mk=new Map,Pp="\0no-extension";SS=class{constructor(t,e){this.telemetryService=t;this.productService=e}formatMachineInfo(t){let e=[];return e.push(`OS Version: ${t.os}`),e.push(`CPUs: ${t.cpus}`),e.push(`Memory (System): ${t.memory}`),e.push(`VM: ${t.vmHint}`),e.join(`
`)}formatEnvironment(t){let e=[];e.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit||"Commit unknown"}, ${this.productService.date||"Date unknown"})`),e.push(`OS Version: ${Vn.type()} ${Vn.arch()} ${Vn.release()}`);let n=Vn.cpus();return n&&n.length>0&&e.push(`CPUs: ${n[0].model} (${n.length} x ${n[0].speed})`),e.push(`Memory (System): ${(Vn.totalmem()/Oi.GB).toFixed(2)}GB (${(Vn.freemem()/Oi.GB).toFixed(2)}GB free)`),oe||e.push(`Load (avg): ${Vn.loadavg().map(o=>Math.round(o)).join(", ")}`),e.push(`VM: ${Math.round(Sk.value()*100)}%`),e.push(`Screen Reader: ${t.screenReader?"yes":"no"}`),e.push(`Process Argv: ${t.mainArguments.join(" ")}`),e.push(`GPU Status: ${this.expandGPUFeatures(t.gpuFeatureStatus)}`),t.gpuLogMessages&&t.gpuLogMessages.length>0&&(e.push("GPU Log Messages:"),t.gpuLogMessages.forEach(o=>{e.push(`${o.header}: ${o.message}`)})),e.join(`
`)}async getPerformanceInfo(t,e,n){return Promise.all([Jf(t.mainPID),this.formatWorkspaceMetadata(t,n)]).then(async o=>{let[i,s]=o,a=this.formatProcessList(t,i);return e.forEach(l=>{if(_k(l))a+=`
${l.errorMessage}`,s+=`
${l.errorMessage}`;else if(a+=`
Remote: ${l.hostName}`,l.processes&&(a+=`
${this.formatProcessList(t,l.processes)}`),l.workspaceMetadata){s+=`
| Remote: ${l.hostName}`;for(let c of Object.keys(l.workspaceMetadata)){let u=l.workspaceMetadata[c],p=`${u.fileCount} files`;u.maxFilesReached&&(p=`more than ${p}`),s+=`| Folder (${c}): ${p}`,s+=this.formatWorkspaceStats(u)}}}),{processInfo:a,workspaceInfo:s}})}async getSystemInfo(t,e){let{memory:n,vmHint:o,os:i,cpus:s}=Ok(),a={os:i,memory:n,cpus:s,vmHint:o,processArgs:`${t.mainArguments.join(" ")}`,gpuStatus:t.gpuFeatureStatus,screenReader:`${t.screenReader?"yes":"no"}`,remoteData:e};return oe||(a.load=`${Vn.loadavg().map(l=>Math.round(l)).join(", ")}`),Ke&&(a.linuxEnv={desktopSession:process.env.DESKTOP_SESSION,xdgSessionDesktop:process.env.XDG_SESSION_DESKTOP,xdgCurrentDesktop:process.env.XDG_CURRENT_DESKTOP,xdgSessionType:process.env.XDG_SESSION_TYPE}),Promise.resolve(a)}async getDiagnostics(t,e){let n=[];return Jf(t.mainPID).then(async o=>(n.push(""),n.push(this.formatEnvironment(t)),n.push(""),n.push(this.formatProcessList(t,o)),t.windows.some(i=>i.folderURIs&&i.folderURIs.length>0&&!i.remoteAuthority)&&(n.push(""),n.push("Workspace Stats: "),n.push(await this.formatWorkspaceMetadata(t))),e.forEach(i=>{if(_k(i))n.push(`
${i.errorMessage}`);else if(n.push(`
`),n.push(`Remote: ${i.hostName}`),n.push(this.formatMachineInfo(i.machineInfo)),i.processes&&n.push(this.formatProcessList(t,i.processes)),i.workspaceMetadata)for(let s of Object.keys(i.workspaceMetadata)){let a=i.workspaceMetadata[s],l=`${a.fileCount} files`;a.maxFilesReached&&(l=`more than ${l}`),n.push(`Folder (${s}): ${l}`),n.push(this.formatWorkspaceStats(a))}}),n.push(""),n.push(""),n.join(`
`)))}formatWorkspaceStats(t){let e=[],o=0,i=(m,g)=>{let y=` ${m}(${g})`;o+y.length>60?(e.push(s),s="| ",o=s.length):o+=y.length,s+=y},s="| File types:",a=10,l=t.fileTypes.filter(m=>m.name!==Pp),c=t.fileTypes.filter(m=>m.name===Pp).reduce((m,g)=>m+g.count,0),u=Math.min(l.length,a);for(let m=0;m<u;m++){let g=l[m];i(g.name,g.count)}let p=c;for(let m=u;m<l.length;m++)p+=l[m].count;if(p>0&&i("other",p),e.push(s),t.configFiles.length>=0&&(s="| Conf files:",o=0,t.configFiles.forEach(m=>{i(m.name,m.count)}),e.push(s)),t.launchConfigFiles.length>0){let m="| Launch Configs:";t.launchConfigFiles.forEach(g=>{let y=g.count>1?` ${g.name}(${g.count})`:` ${g.name}`;m+=y}),e.push(m)}return e.join(`
`)}expandGPUFeatures(t){let e=Math.max(...Object.keys(t).map(n=>n.length));return Object.keys(t).map(n=>`${n}: ${" ".repeat(e-n.length)} ${t[n]}`).join(`
`)}formatWorkspaceMetadata(t,e){let n=[],o=[];return t.windows.forEach(i=>{i.folderURIs.length===0||i.remoteAuthority||(n.push(`| Window (${i.title})`),i.folderURIs.forEach(s=>{let a=S.revive(s);if(a.scheme===q.file){let l=a.fsPath;o.push(Yf(l,["node_modules",".git"],e).then(c=>{let u=`${c.fileCount} files`;c.maxFilesReached&&(u=`more than ${u}`),n.push(`| Folder (${Ze(l)}): ${u}`),n.push(this.formatWorkspaceStats(c))}).catch(c=>{n.push(`| Error: Unable to collect workspace stats for folder ${l} (${c.toString()})`)}))}else n.push(`| Folder (${a.toString()}): Workspace stats not available.`)}))}),Promise.all(o).then(i=>n.join(`
`)).catch(i=>`Unable to collect workspace stats: ${i}`)}formatProcessList(t,e){let n=new Map;t.windows.forEach(i=>n.set(i.pid,`window [${i.id}] (${i.title})`)),t.pidToNames.forEach(({pid:i,name:s})=>n.set(i,s));let o=[];return o.push("CPU % Mem MB PID Process"),e&&this.formatProcessItem(t.mainPID,n,o,e,0),o.join(`
`)}formatProcessItem(t,e,n,o,i){let s=i===0,a;s?a=o.pid===t?this.productService.applicationName:"remote-server":e.has(o.pid)?a=e.get(o.pid):a=`${" ".repeat(i)} ${o.name}`;let l=process.platform==="win32"?o.mem:Vn.totalmem()*(o.mem/100);n.push(`${o.load.toFixed(0).padStart(5," ")} ${(l/Oi.MB).toFixed(0).padStart(6," ")} ${o.pid.toFixed(0).padStart(6," ")} ${a}`),Array.isArray(o.children)&&o.children.forEach(c=>this.formatProcessItem(t,e,n,c,i+1))}async getWorkspaceFileExtensions(t){let e=new Set;for(let{uri:n}of t.folders){let o=S.revive(n);if(o.scheme!==q.file)continue;let i=o.fsPath;try{(await Yf(i,["node_modules",".git"])).fileTypes.forEach(a=>{a.name!==Pp&&e.add(a.name)})}catch{}}return{extensions:[...e]}}async reportWorkspaceStats(t){for(let{uri:e}of t.folders){let n=S.revive(e);if(n.scheme!==q.file)continue;let o=n.fsPath;try{let i=await Yf(o,["node_modules",".git"]);this.telemetryService.publicLog2("workspace.stats",{"workspace.id":t.telemetryId,rendererSessionId:t.rendererSessionId}),i.fileTypes.forEach(s=>{s.name!==Pp&&this.telemetryService.publicLog2("workspace.stats.file",{rendererSessionId:t.rendererSessionId,type:s.name,count:s.count})}),i.launchConfigFiles.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.launchConfigFile",{rendererSessionId:t.rendererSessionId,type:s.name,count:s.count})}),i.configFiles.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.configFiles",{rendererSessionId:t.rendererSessionId,type:s.name,count:s.count})}),this.telemetryService.publicLog2("workspace.stats.metadata",{duration:i.totalScanTime,reachedLimit:i.maxFilesReached,fileCount:i.fileCount,readdirCount:i.totalReaddirCount})}catch{}}}};SS=w([b(0,Mt),b(1,Be)],SS)});var xS,EW=v(()=>{fe();Xr();te();Tp();Ll();Dk();CW();Oe();Vf();it();xS=class r{constructor(t,e,n,o,i){this._connectionToken=t;this._environmentService=e;this._userDataProfilesService=n;this._extensionHostStatusService=o;this._logService=i}static{this._namePool=1}async call(t,e,n){switch(e){case"getEnvironmentData":{let o=n,i=xs(o.remoteAuthority),s=await this._getEnvironmentData(o.profile);return s=$r(s,i),s}case"getExtensionHostExitInfo":{let o=n;return this._extensionHostStatusService.getExitInfo(o.reconnectionToken)}case"getDiagnosticInfo":{let o=n,i={machineInfo:Ok()},s=o.includeProcesses?Jf(process.pid):Promise.resolve(),a=[],l={};if(o.folders){let c=xs("");a=o.folders.map(p=>S.revive(c.transformIncoming(p))).filter(p=>p.scheme==="file").map(p=>Yf(p.fsPath,["node_modules",".git"]).then(m=>{l[Ze(p.fsPath)]=m}))}return Promise.all([s,...a]).then(([c,u])=>(i.processes=c||void 0,i.workspaceMetadata=o.folders?l:void 0,i))}}throw new Error(`IPC Command ${e} not found`)}listen(t,e,n){throw new Error("Not supported")}async _getEnvironmentData(t){t&&!this._userDataProfilesService.profiles.some(n=>n.id===t)&&await this._userDataProfilesService.createProfile(t,t);let e=!1;if(process.platform==="linux"){let n=process.glibcVersion;e=(n?parseInt(n.split(".")[1]):28)<=27||!!process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER}return this._logService.trace(`[reconnection-grace-time] Server sending grace time to client: ${this._environmentService.reconnectionGraceTime}ms (${Math.floor(this._environmentService.reconnectionGraceTime/1e3)}s)`),{pid:process.pid,connectionToken:this._connectionToken.type!==0?this._connectionToken.value:"",appRoot:S.file(this._environmentService.appRoot),execPath:process.execPath,tmpDir:this._environmentService.tmpDir,settingsPath:this._environmentService.machineSettingsResource,mcpResource:this._environmentService.mcpResource,logsPath:this._environmentService.logsHome,extensionHostLogsPath:ge(this._environmentService.logsHome,`exthost${r._namePool++}`),globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,localHistoryHome:this._environmentService.localHistoryHome,userHome:this._environmentService.userHome,os:fr,arch:process.arch,marks:I0(),useHostProxy:!!this._environmentService.args["use-host-proxy"],profiles:{home:this._userDataProfilesService.profilesHome,all:[...this._userDataProfilesService.profiles].map(n=>({...n}))},isUnsupportedGlibc:e,reconnectionGraceTime:this._environmentService.reconnectionGraceTime}}}});var CS,ES,wW=v(()=>{ue();kf();Q();Ve();Xa();Jt();CS=class extends D{constructor(e,n){super();this.provider=e;this.logService=n;this.sessionToWatcher=new Map;this.watchRequests=new Map}call(e,n,o){let i=this.getUriTransformer(e);switch(n){case"stat":return this.stat(i,o[0]);case"realpath":return this.realpath(i,o[0],o[1]);case"readdir":return this.readdir(i,o[0]);case"open":return this.open(i,o[0],o[1]);case"close":return this.close(o[0]);case"read":return this.read(o[0],o[1],o[2]);case"readFile":return this.readFile(i,o[0],o[1]);case"write":return this.write(o[0],o[1],o[2],o[3],o[4]);case"writeFile":return this.writeFile(i,o[0],o[1],o[2]);case"rename":return this.rename(i,o[0],o[1],o[2]);case"renameFileAtomic":return this.renameFileAtomic(i,o[0],o[1],o[2]);case"copy":return this.copy(i,o[0],o[1],o[2]);case"cloneFile":return this.cloneFile(i,o[0],o[1]);case"mkdir":return this.mkdir(i,o[0]);case"delete":return this.delete(i,o[0],o[1]);case"watch":return this.watch(i,o[0],o[1],o[2],o[3]);case"unwatch":return this.unwatch(o[0],o[1])}throw new Error(`IPC Command ${n} not found`)}listen(e,n,o){let i=this.getUriTransformer(e);switch(n){case"fileChange":return this.onFileChange(i,o[0]);case"readFileStream":return this.onReadFileStream(i,o[0],o[1])}throw new Error(`Unknown event ${n}`)}stat(e,n){let o=this.transformIncoming(e,n,!0);return this.provider.stat(o)}realpath(e,n,o){let i=this.transformIncoming(e,n,!0);return this.provider.realpath(i,o)}readdir(e,n){let o=this.transformIncoming(e,n);return this.provider.readdir(o)}async readFile(e,n,o){let i=this.transformIncoming(e,n,!0);this.logService.trace(`File action: readFile ${i.path}`);let s=await this.provider.readFile(i,o);return O.wrap(s)}onReadFileStream(e,n,o){let i=this.transformIncoming(e,n,!0),s=new _t,a=new R({onDidRemoveLastListener:()=>{s.cancel()}});this.logService.trace(`File action: readFileStream ${i.path}`);let l=this.provider.readFileStream(i,o,s.token);return Ya(l,{onData:c=>a.fire(O.wrap(c)),onError:c=>a.fire(c),onEnd:()=>{a.fire("end"),a.dispose(),s.dispose()}}),a.event}writeFile(e,n,o,i){let s=this.transformIncoming(e,n);return this.logService.trace(`File action: writeFile ${s.path}`),this.provider.writeFile(s,o.buffer,i)}open(e,n,o){let i=this.transformIncoming(e,n,!0);return this.provider.open(i,o)}close(e){return this.provider.close(e)}async read(e,n,o){let i=O.alloc(o),a=await this.provider.read(e,n,i.buffer,0,o);return[i,a]}write(e,n,o,i,s){return this.provider.write(e,n,o.buffer,i,s)}mkdir(e,n){let o=this.transformIncoming(e,n);return this.provider.mkdir(o)}delete(e,n,o){let i=this.transformIncoming(e,n);return this.provider.delete(i,o)}rename(e,n,o,i){let s=this.transformIncoming(e,n),a=this.transformIncoming(e,o);return this.provider.rename(s,a,i)}renameFileAtomic(e,n,o,i){let s=this.transformIncoming(e,n),a=this.transformIncoming(e,o);return this.provider.renameFileAtomic(s,a,i)}copy(e,n,o,i){let s=this.transformIncoming(e,n),a=this.transformIncoming(e,o);return this.provider.copy(s,a,i)}cloneFile(e,n,o){let i=this.transformIncoming(e,n),s=this.transformIncoming(e,o);return this.provider.cloneFile(i,s)}onFileChange(e,n){let o=new R({onWillAddFirstListener:()=>{this.sessionToWatcher.set(n,this.createSessionFileWatcher(e,o))},onDidRemoveLastListener:()=>{hn(this.sessionToWatcher.get(n)),this.sessionToWatcher.delete(n)}});return o.event}async watch(e,n,o,i,s){let a=this.sessionToWatcher.get(n);if(a){let l=this.transformIncoming(e,i),c=a.watch(o,l,s);this.watchRequests.set(n+o,c)}}async unwatch(e,n){let o=e+n,i=this.watchRequests.get(o);i&&(hn(i),this.watchRequests.delete(o))}dispose(){super.dispose();for(let[,e]of this.watchRequests)e.dispose();this.watchRequests.clear();for(let[,e]of this.sessionToWatcher)e.dispose();this.sessionToWatcher.clear()}},ES=class extends D{constructor(e,n,o,i){super();this.uriTransformer=e;this.environmentService=i;this.watcherRequests=new Map;this.fileWatcher=this._register(new bs(o)),this.registerListeners(n)}registerListeners(e){let n=this._register(new R);this._register(n.event(o=>{e.fire(o.map(i=>({resource:this.uriTransformer.transformOutgoingURI(i.resource),type:i.type,cId:i.cId})))})),this._register(this.fileWatcher.onDidChangeFile(o=>n.fire(o))),this._register(this.fileWatcher.onDidWatchError(o=>e.fire(o)))}getRecursiveWatcherOptions(e){}getExtraExcludes(e){}watch(e,n,o){let i=this.getExtraExcludes(this.environmentService);return Array.isArray(i)&&(o.excludes=[...o.excludes,...i]),this.watcherRequests.set(e,this.fileWatcher.watch(n,o)),se(()=>{hn(this.watcherRequests.get(e)),this.watcherRequests.delete(e)})}dispose(){for(let[,e]of this.watcherRequests)e.dispose();this.watcherRequests.clear(),super.dispose()}}});var wS,Nk,RW=v(()=>{te();Tp();kf();Oe();wW();wS=class extends CS{constructor(e,n,o){super(new bs(e),e);this.environmentService=n;this.configurationService=o;this.uriTransformerCache=new Map;this._register(this.provider)}getUriTransformer(e){let n=this.uriTransformerCache.get(e.remoteAuthority);return n||(n=xs(e.remoteAuthority),this.uriTransformerCache.set(e.remoteAuthority,n)),n}transformIncoming(e,n,o=!1){if(o&&n.path==="/vscode-resource"&&n.query){let i=JSON.parse(n.query).requestResourcePath;return S.from({scheme:"file",path:i})}return S.revive(e.transformIncoming(n))}createSessionFileWatcher(e,n){return new Nk(e,n,this.logService,this.environmentService,this.configurationService)}},Nk=class extends ES{constructor(t,e,n,o,i){super(t,e,n,o)}getRecursiveWatcherOptions(t){let e=t.args["file-watcher-polling"];if(e){let n=e.split(Fa),o=Number(n[0]);if(o>0)return{usePolling:n.length>1?n.slice(1):!0,pollingInterval:o}}}getExtraExcludes(t){if(t.extensionsPath)return[ze.join(t.extensionsPath,"**")]}}});var RS,TW=v(()=>{Q();_n();RS=class extends D{constructor(e,n){super();this.telemetryService=e;this.telemetryAppender=n}async call(e,n,o){switch(n){case"updateTelemetryLevel":{let{telemetryLevel:i}=o;return this.telemetryService.updateInjectedTelemetryLevel(i)}case"logTelemetry":{let{eventName:i,data:s}=o;return this.telemetryAppender?this.telemetryAppender.log(i,s):Promise.resolve()}case"flushTelemetry":return this.telemetryAppender?this.telemetryAppender.flush():Promise.resolve();case"ping":return}throw new Error(`IPC Command ${n} not found`)}listen(e,n,o){throw new Error("Not supported")}dispose(){this.telemetryService.updateInjectedTelemetryLevel(0),super.dispose()}}});function rY(){let r=d(4657,null,Je.nameLong),t=Je.privacyStatementUrl?d(4643,null,"https://aka.ms/vscode-telemetry",Je.privacyStatementUrl):d(4644,null,"https://aka.ms/vscode-telemetry"),e=bn?"":d(4649,null),n=d(4642,null),o=d(4647,null),i=d(4658,null),s=d(4656,null),a=`
| | ${n} | ${o} | ${i} |
|:------|:-------------:|:---------------:|:----------:|
| all | \u2713 | \u2713 | \u2713 |
| error | \u2713 | \u2713 | - |
| crash | \u2713 | - | - |
| off | - | - | - |
`,l=d(4652,null);return`
${r} ${t} ${e}
${s}
${a}
${l}
`}var Cs,iY,PW=v(()=>{Q();Xt();fe();of();Tt();ee();dn();br();ai();Wn();$o();_n();Wr();Cs=class{constructor(t,e,n){this._productService=n;this._experimentProperties={};this._pendingEvents=[];this._isExperimentPropertySet=!1;this._disposables=new re;this._cleanupPatterns=[];this._relativePathRootPatterns=[];this._userContentRootPatterns=[];this._appenders=t.appenders,this._commonProperties=t.commonProperties??Object.create(null),this.sessionId=this._commonProperties.sessionID,this.machineId=this._commonProperties["common.machineId"],this.sqmId=this._commonProperties["common.sqmId"],this.devDeviceId=this._commonProperties["common.devDeviceId"],this.firstSessionDate=this._commonProperties["common.firstSessionDate"],this._piiPaths=t.piiPaths||[],this._telemetryLevel=3,this._sendErrorTelemetry=!!t.sendErrorTelemetry,this._meteredConnectionService=t.meteredConnectionService;let o=/(vscode-)?file:\/\/.*?\/resources\/app\//gi;this._cleanupPatterns=[o],this._relativePathRootPatterns=[o];let i=new Set(t.userContentPaths);for(let s of new Set([...this._piiPaths,...i])){let a=[new RegExp(yo(s),"gi")];s.indexOf("\\")>=0&&a.push(new RegExp(yo(s.replace(/\\/g,"/")),"gi")),this._cleanupPatterns.push(...a),i.has(s)?this._userContentRootPatterns.push(...a):this._relativePathRootPatterns.push(...a)}if(t.telemetryLevel!==void 0)this._updateTelemetryLevel(t.telemetryLevel);else{if(!e)throw new Error("TelemetryService requires a configuration service or a fixed telemetry level.");this._updateTelemetryLevel(tf(e)),this._disposables.add(e.onDidChangeConfiguration(s=>{(s.affectsConfiguration(Tu)||s.affectsConfiguration(Zg)||s.affectsConfiguration(CI))&&this._updateTelemetryLevel(tf(e))}))}t.waitForExperimentProperties?this._flushTimeout=setTimeout(()=>this._flushPendingEvents(),Cs.BUFFER_FLUSH_TIMEOUT):this._isExperimentPropertySet=!0}static{this.IDLE_START_EVENT_NAME="UserIdleStart"}static{this.IDLE_STOP_EVENT_NAME="UserIdleStop"}static{this.BUFFER_FLUSH_TIMEOUT=1e4}static{this.MAX_BUFFER_SIZE=1e3}static createWithLevel(t,e){return new Cs(t,void 0,e)}setExperimentProperty(t,e){this._experimentProperties[t]=new Sr(e),this._isExperimentPropertySet||this._flushPendingEvents()}setCommonProperty(t,e){e===void 0?delete this._commonProperties[t]:this._commonProperties[t]=e}_flushPendingEvents(){if(!this._isExperimentPropertySet){this._isExperimentPropertySet=!0,this._flushTimeout!==void 0&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0);for(let t of this._pendingEvents)this._doLog(t.eventName,t.eventLevel,t.data);this._pendingEvents=[]}}_updateTelemetryLevel(t){let e=this._productService.enabledTelemetryLevels;if(e){this._sendErrorTelemetry=this.sendErrorTelemetry?e.error:!1;let n=e.usage?3:e.error?2:0;t=Math.min(t,n)}this._telemetryLevel=t}get msftInternal(){return this._commonProperties["common.msftInternal"]}get sendErrorTelemetry(){return this._sendErrorTelemetry}get telemetryLevel(){return this._telemetryLevel}dispose(){this._flushPendingEvents(),this._disposables.dispose()}_log(t,e,n){if(!(this._telemetryLevel<e)&&!this._meteredConnectionService?.isConnectionMetered){if(!this._isExperimentPropertySet){this._pendingEvents.length<Cs.MAX_BUFFER_SIZE&&this._pendingEvents.push({eventName:t,eventLevel:e,data:n});return}this._doLog(t,e,n)}}_doLog(t,e,n){n=Ys(n,this._experimentProperties),n=nf(n,this._cleanupPatterns,this._relativePathRootPatterns,this._userContentRootPatterns),n=Ys(n,this._commonProperties),e===2&&(n={...n,isError:!0}),this._appenders.forEach(o=>o.log(t,n??{}))}publicLog(t,e){this._log(t,3,e)}publicLog2(t,e){this.publicLog(t,e)}publicLogError(t,e){this._sendErrorTelemetry&&this._log(t,2,e)}publicLogError2(t,e){this.publicLogError(t,e)}};Cs=w([b(1,bt),b(2,Be)],Cs);iY=St.as(Jn.Configuration);iY.registerConfiguration({id:KN,order:1,type:"object",title:d(4659,null),properties:{[Tu]:{type:"string",enum:["all","error","crash","off"],enumDescriptions:[d(4651,null),d(4653,null),d(4650,null),d(4654,null)],markdownDescription:rY(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"],policy:{name:"TelemetryLevel",category:"Telemetry",minimumVersion:"1.99",localization:{description:{key:"telemetry.telemetryLevel.policyDescription",value:d(4655,null)},enumDescriptions:[{key:"telemetry.telemetryLevel.default",value:d(4651,null)},{key:"telemetry.telemetryLevel.error",value:d(4653,null)},{key:"telemetry.telemetryLevel.crash",value:d(4650,null)},{key:"telemetry.telemetryLevel.off",value:d(4654,null)}]}}},"telemetry.feedback.enabled":{type:"boolean",default:!0,description:d(4648,null),policy:{name:"EnableFeedback",category:"Telemetry",minimumVersion:"1.99",localization:{description:{key:"telemetry.feedback.enabled",value:d(4648,null)}}}},[Zg]:{type:"boolean",markdownDescription:Je.privacyStatementUrl?d(4646,null,Je.nameLong,Je.privacyStatementUrl):d(4645,null,Je.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:d(4641,null,`\`#${Tu}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}})});var kp,kW,TS,AW=v(()=>{dn();Z();Wn();_n();PW();Wr();kp=class extends Cs{constructor(t,e,n,o){super(t,n,o),this._injectedTelemetryLevel=e}get telemetryLevel(){return Math.min(super.telemetryLevel,this._injectedTelemetryLevel)}publicLog(t,e){if(!(this._injectedTelemetryLevel<3))return super.publicLog(t,e)}publicLog2(t,e){return this.publicLog(t,e)}publicLogError(t,e){return this._injectedTelemetryLevel<2?Promise.resolve(void 0):super.publicLogError(t,e)}publicLogError2(t,e){return this.publicLogError(t,e)}async updateInjectedTelemetryLevel(t){if(t===void 0)throw this._injectedTelemetryLevel=0,new Error("Telemetry level cannot be undefined. This will cause infinite looping!");this._injectedTelemetryLevel=Math.min(this._injectedTelemetryLevel,t),this._injectedTelemetryLevel===0&&this.dispose()}};kp=w([b(2,bt),b(3,Be)],kp);kW=new class extends ef{async updateInjectedTelemetryLevel(){}},TS=Mt});function Fk(r){let t=ki(r),e=sY[t.toLowerCase()];return Array.isArray(e)?e[0]:e}function Hk(r,t){let e=aY.exec(r);return e?`${e[1].toLowerCase()}/${e[2].toLowerCase()}${e[3]??""}`:t?void 0:r}function DW(r){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(r)}var wr,sY,aY,Kc=v(()=>{Oe();wr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"}),sY={".aac":"audio/x-aac",".avi":"video/x-msvideo",".avif":"image/avif",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};aY=/^(.+)\/(.+?)(;.+)?$/});var Wk=v(()=>{Dt()});function pe(r){return Object.assign(r,{apply:function(...e){if(e.length===0)return Reflect.construct(r,[]);{let n=e.length===1?[]:e[1];return Reflect.construct(r,n,e[0].constructor)}},call:function(...e){if(e.length===0)return Reflect.construct(r,[]);{let[n,...o]=e;return Reflect.construct(r,o,n.constructor)}}})}var Rr=v(()=>{});var po,Lo,Vk=v(()=>{xr();Rr();Lo=class{constructor(t,e=!1){Wd(this,po);tg(this,po,new at(t,{supportThemeIcons:e}))}static isMarkdownString(t){return t instanceof Lo?!0:!t||typeof t!="object"?!1:t.appendCodeblock&&t.appendMarkdown&&t.appendText&&t.value!==void 0}get value(){return gn(this,po).value}set value(t){gn(this,po).value=t}get isTrusted(){return gn(this,po).isTrusted}set isTrusted(t){gn(this,po).isTrusted=t}get supportThemeIcons(){return gn(this,po).supportThemeIcons}set supportThemeIcons(t){gn(this,po).supportThemeIcons=t}get supportHtml(){return gn(this,po).supportHtml}set supportHtml(t){gn(this,po).supportHtml=t}get supportAlertSyntax(){return gn(this,po).supportAlertSyntax}set supportAlertSyntax(t){gn(this,po).supportAlertSyntax=t}get baseUri(){return gn(this,po).baseUri}set baseUri(t){gn(this,po).baseUri=t}appendText(t){return gn(this,po).appendText(t),this}appendMarkdown(t){return gn(this,po).appendMarkdown(t),this}appendCodeblock(t,e){return gn(this,po).appendCodeblock(e??"",t),this}};po=new WeakMap,Lo=w([pe],Lo)});var qe,Ap=v(()=>{xe();Rr();qe=class{static Min(...t){if(t.length===0)throw new TypeError;let e=t[0];for(let n=1;n<t.length;n++){let o=t[n];o.isBefore(e)&&(e=o)}return e}static Max(...t){if(t.length===0)throw new TypeError;let e=t[0];for(let n=1;n<t.length;n++){let o=t[n];o.isAfter(e)&&(e=o)}return e}static isPosition(t){if(!t)return!1;if(t instanceof qe)return!0;let{line:e,character:n}=t;return typeof e=="number"&&typeof n=="number"}static of(t){if(t instanceof qe)return t;if(this.isPosition(t))return new qe(t.line,t.character);throw new Error("Invalid argument, is NOT a position-like object")}get line(){return this._line}get character(){return this._character}constructor(t,e){if(t<0)throw mt("line must be non-negative");if(e<0)throw mt("character must be non-negative");this._line=t,this._character=e}isBefore(t){return this._line<t._line?!0:t._line<this._line?!1:this._character<t._character}isBeforeOrEqual(t){return this._line<t._line?!0:t._line<this._line?!1:this._character<=t._character}isAfter(t){return!this.isBeforeOrEqual(t)}isAfterOrEqual(t){return!this.isBefore(t)}isEqual(t){return this._line===t._line&&this._character===t._character}compareTo(t){return this._line<t._line?-1:this._line>t.line?1:this._character<t._character?-1:this._character>t._character?1:0}translate(t,e=0){if(t===null||e===null)throw mt();let n;return typeof t>"u"?n=0:typeof t=="number"?n=t:(n=typeof t.lineDelta=="number"?t.lineDelta:0,e=typeof t.characterDelta=="number"?t.characterDelta:0),n===0&&e===0?this:new qe(this.line+n,this.character+e)}with(t,e=this.character){if(t===null||e===null)throw mt();let n;return typeof t>"u"?n=this.line:typeof t=="number"?n=t:(n=typeof t.line=="number"?t.line:this.line,e=typeof t.character=="number"?t.character:this.character),n===this.line&&e===this.character?this:new qe(n,e)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};qe=w([pe],qe)});function Bk(r){return r.isEmpty?`[${r.start.line}:${r.start.character})`:`[${r.start.line}:${r.start.character} -> ${r.end.line}:${r.end.character})`}var Xe,Es=v(()=>{xe();Rr();Ap();Xe=class{static isRange(t){return t instanceof Xe?!0:!t||typeof t!="object"?!1:qe.isPosition(t.start)&&qe.isPosition(t.end)}static of(t){if(t instanceof Xe)return t;if(this.isRange(t))return new Xe(t.start,t.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(t,e,n,o){let i,s;if(typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof o=="number"?(i=new qe(t,e),s=new qe(n,o)):qe.isPosition(t)&&qe.isPosition(e)&&(i=qe.of(t),s=qe.of(e)),!i||!s)throw new Error("Invalid arguments");i.isBefore(s)?(this._start=i,this._end=s):(this._start=s,this._end=i)}contains(t){return Xe.isRange(t)?this.contains(t.start)&&this.contains(t.end):qe.isPosition(t)?!(qe.of(t).isBefore(this._start)||this._end.isBefore(t)):!1}isEqual(t){return this._start.isEqual(t._start)&&this._end.isEqual(t._end)}intersection(t){let e=qe.Max(t.start,this._start),n=qe.Min(t.end,this._end);if(!e.isAfter(n))return new Xe(e,n)}union(t){if(this.contains(t))return this;if(t.contains(this))return t;let e=qe.Min(t.start,this._start),n=qe.Max(t.end,this.end);return new Xe(e,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(t,e=this.end){if(t===null||e===null)throw mt();let n;return t?qe.isPosition(t)?n=t:(n=t.start||this.start,e=t.end||this.end):n=this.start,n.isEqual(this._start)&&e.isEqual(this.end)?this:new Xe(n,e)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return Bk(this)}};Xe=w([pe],Xe)});var Ht,_W=v(()=>{Rr();Ht=class{constructor(t){this.value=t}append(t){return new Ht(this.value?this.value+Ht.sep+t:t)}intersects(t){return this.contains(t)||t.contains(this)}contains(t){return this.value===t.value||t.value.startsWith(this.value+Ht.sep)}};Ht.sep=".",Ht=w([pe],Ht);Ht.Empty=new Ht("");Ht.QuickFix=Ht.Empty.append("quickfix");Ht.Refactor=Ht.Empty.append("refactor");Ht.RefactorExtract=Ht.Refactor.append("extract");Ht.RefactorInline=Ht.Refactor.append("inline");Ht.RefactorMove=Ht.Refactor.append("move");Ht.RefactorRewrite=Ht.Refactor.append("rewrite");Ht.Source=Ht.Empty.append("source");Ht.SourceOrganizeImports=Ht.Source.append("organizeImports");Ht.SourceFixAll=Ht.Source.append("fixAll");Ht.Notebook=Ht.Empty.append("notebook")});var PS,Ul,jc,MW=v(()=>{Dt();te();Rr();Es();PS=(o=>(o[o.Hint=3]="Hint",o[o.Information=2]="Information",o[o.Warning=1]="Warning",o[o.Error=0]="Error",o))(PS||{}),Ul=class{static is(t){return t?typeof t.message=="string"&&t.location&&Xe.isRange(t.location.range)&&S.isUri(t.location.uri):!1}constructor(t,e){this.location=t,this.message=e}static isEqual(t,e){return t===e?!0:!t||!e?!1:t.message===e.message&&t.location.range.isEqual(e.location.range)&&t.location.uri.toString()===e.location.uri.toString()}};Ul=w([pe],Ul);jc=class{constructor(t,e,n=0){if(!Xe.isRange(t))throw new TypeError("range must be set");if(!e)throw new TypeError("message must be set");this.range=t,this.message=e,this.severity=n}toJSON(){return{severity:PS[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(t,e){return t===e?!0:!t||!e?!1:t.message===e.message&&t.severity===e.severity&&t.code===e.code&&t.severity===e.severity&&t.source===e.source&&t.range.isEqual(e.range)&&Gt(t.tags,e.tags)&&Gt(t.relatedInformation,e.relatedInformation,Ul.isEqual)}};jc=w([pe],jc)});var Oo,qk=v(()=>{te();Rr();Ap();Es();Oo=class{static isLocation(t){return t instanceof Oo?!0:t?Xe.isRange(t.range)&&S.isUri(t.uri):!1}constructor(t,e){if(this.uri=t,e)if(Xe.isRange(e))this.range=Xe.of(e);else if(qe.isPosition(e))this.range=new Xe(e,e);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Oo=w([pe],Oo)});var Vi,Dp,Xf,Tr,Zf,eh,$k=v(()=>{Rr();xe();Kc();Vt();Vi=class r{static isNotebookRange(t){return t instanceof r?!0:t?typeof t.start=="number"&&typeof t.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(t,e){if(t<0)throw mt("start must be positive");if(e<0)throw mt("end must be positive");t<=e?(this._start=t,this._end=e):(this._start=e,this._end=t)}with(t){let e=this._start,n=this._end;return t.start!==void 0&&(e=t.start),t.end!==void 0&&(n=t.end),e===this._start&&n===this._end?this:new r(e,n)}},Dp=class r{static validate(t){if(typeof t.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof t.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof t.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(t){return Array.isArray(t)&&t.every(e=>r.isNotebookCellData(e))}static isNotebookCellData(t){return!0}constructor(t,e,n,o,i,s,a){this.kind=t,this.value=e,this.languageId=n,this.mime=o,this.outputs=i??[],this.metadata=s,this.executionSummary=a,r.validate(this)}},Xf=class{constructor(t){this.cells=t}},Tr=class{static isNotebookCellEdit(t){return t instanceof Tr?!0:t?Vi.isNotebookRange(t)&&Array.isArray(t.newCells):!1}static replaceCells(t,e){return new Tr(t,e)}static insertCells(t,e){return new Tr(new Vi(t,t),e)}static deleteCells(t){return new Tr(t,[])}static updateCellMetadata(t,e){let n=new Tr(new Vi(t,t),[]);return n.newCellMetadata=e,n}static updateNotebookMetadata(t){let e=new Tr(new Vi(0,0),[]);return e.newNotebookMetadata=t,e}constructor(t,e){this.range=t,this.newCells=e}};Tr=w([pe],Tr);Zf=class r{constructor(t,e){this.data=t;this.mime=e;let n=Hk(e,!0);if(!n)throw new Error(`INVALID mime type: ${e}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}static isNotebookCellOutputItem(t){return t instanceof r?!0:t?typeof t.mime=="string"&&t.data instanceof Uint8Array:!1}static error(t){let e={name:t.name,message:t.message,stack:t.stack};return r.json(e,"application/vnd.code.notebook.error")}static stdout(t){return r.text(t,"application/vnd.code.notebook.stdout")}static stderr(t){return r.text(t,"application/vnd.code.notebook.stderr")}static bytes(t,e="application/octet-stream"){return new r(t,e)}static $a=new TextEncoder;static text(t,e=wr.text){let n=r.$a.encode(String(t));return new r(n,e)}static json(t,e="text/x-json"){let n=JSON.stringify(t,void 0," ");return r.text(n,e)}},eh=class r{static isNotebookCellOutput(t){return t instanceof r?!0:!t||typeof t!="object"?!1:typeof t.id=="string"&&Array.isArray(t.items)}static ensureUniqueMimeTypes(t,e=!1){let n=new Set,o=new Set;for(let i=0;i<t.length;i++){let s=t[i],a=Hk(s.mime);if(!n.has(a)||DW(a)){n.add(a);continue}o.add(i),e&&console.warn(`DUPLICATED mime type '${s.mime}' will be dropped`)}return o.size===0?t:t.filter((i,s)=>!o.has(s))}constructor(t,e,n){this.items=r.ensureUniqueMimeTypes(t,!0),typeof e=="string"?(this.id=e,this.metadata=n):(this.id=Ee(),this.metadata=e??n)}}});function lY(r){let t=Bk(r);return r.isEmpty||(r.active.isEqual(r.start)?t=`|${t}`:t=`${t}|`),t}var Bi,LW=v(()=>{Rr();Ap();Es();Bi=class extends Xe{static isSelection(t){return t instanceof Bi?!0:!t||typeof t!="object"?!1:Xe.isRange(t)&&qe.isPosition(t.anchor)&&qe.isPosition(t.active)&&typeof t.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(t,e,n,o){let i,s;if(typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof o=="number"?(i=new qe(t,e),s=new qe(n,o)):qe.isPosition(t)&&qe.isPosition(e)&&(i=qe.of(t),s=qe.of(e)),!i||!s)throw new Error("Invalid arguments");super(i,s),this._anchor=i,this._active=s}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return lY(this)}};Bi=w([pe],Bi)});var zo,zk=v(()=>{Rr();zo=class{constructor(t){this._tabstop=1;this.value=t||""}static isSnippetString(t){return t instanceof zo?!0:!t||typeof t!="object"?!1:typeof t.value=="string"}static _escape(t){return t.replace(/\$|}|\\/g,"\\$&")}appendText(t){return this.value+=zo._escape(t),this}appendTabstop(t=this._tabstop++){return this.value+="$",this.value+=t,this}appendPlaceholder(t,e=this._tabstop++){if(typeof t=="function"){let n=new zo;n._tabstop=this._tabstop,t(n),this._tabstop=n._tabstop,t=n.value}else t=zo._escape(t);return this.value+="${",this.value+=e,this.value+=":",this.value+=t,this.value+="}",this}appendChoice(t,e=this._tabstop++){let n=t.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=e,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(t,e){if(typeof e=="function"){let n=new zo;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else typeof e=="string"&&(e=e.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=t,e&&(this.value+=":",this.value+=e),this.value+="}",this}};zo=w([pe],zo)});var Qc,Gk=v(()=>{zk();Es();Qc=class r{static isSnippetTextEdit(t){return t instanceof r?!0:t?Xe.isRange(t.range)&&zo.isSnippetString(t.snippet):!1}static replace(t,e){return new r(t,e)}static insert(t,e){return r.replace(new Xe(t,t),e)}constructor(t,e){this.range=t,this.snippet=e}}});var kS,ma,OW=v(()=>{Rr();qk();Es();kS=(W=>(W[W.File=0]="File",W[W.Module=1]="Module",W[W.Namespace=2]="Namespace",W[W.Package=3]="Package",W[W.Class=4]="Class",W[W.Method=5]="Method",W[W.Property=6]="Property",W[W.Field=7]="Field",W[W.Constructor=8]="Constructor",W[W.Enum=9]="Enum",W[W.Interface=10]="Interface",W[W.Function=11]="Function",W[W.Variable=12]="Variable",W[W.Constant=13]="Constant",W[W.String=14]="String",W[W.Number=15]="Number",W[W.Boolean=16]="Boolean",W[W.Array=17]="Array",W[W.Object=18]="Object",W[W.Key=19]="Key",W[W.Null=20]="Null",W[W.EnumMember=21]="EnumMember",W[W.Struct=22]="Struct",W[W.Event=23]="Event",W[W.Operator=24]="Operator",W[W.TypeParameter=25]="TypeParameter",W))(kS||{}),ma=class{static validate(t){if(!t.name)throw new Error("name must not be falsy")}constructor(t,e,n,o,i){this.name=t,this.kind=e,this.containerName=i,typeof n=="string"&&(this.containerName=n),o instanceof Oo?this.location=o:n instanceof Xe&&(this.location=new Oo(o,n)),ma.validate(this)}toJSON(){return{name:this.name,kind:kS[this.kind],location:this.location,containerName:this.containerName}}};ma=w([pe],ma)});var Uo,Kk=v(()=>{xe();Rr();Ap();Es();Uo=class{static isTextEdit(t){return t instanceof Uo?!0:!t||typeof t!="object"?!1:Xe.isRange(t)&&typeof t.newText=="string"}static replace(t,e){return new Uo(t,e)}static insert(t,e){return Uo.replace(new Xe(t,t),e)}static delete(t){return Uo.replace(t,"")}static setEndOfLine(t){let e=new Uo(new Xe(new qe(0,0),new qe(0,0)),"");return e.newEol=t,e}get range(){return this._range}set range(t){if(t&&!Xe.isRange(t))throw mt("range");this._range=t}get newText(){return this._newText||""}set newText(t){if(t&&typeof t!="string")throw mt("newText");this._newText=t}get newEol(){return this._newEol}set newEol(t){if(t&&typeof t!="number")throw mt("newEol");this._newEol=t}constructor(t,e){this._range=t,this._newText=e}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};Uo=w([pe],Uo)});function AS(r){if(r.scheme!==q.vscodeNotebookCell)return;let t=r.fragment.indexOf("s");if(t<0)return;let e=parseInt(r.fragment.substring(0,t).replace(dY,""),UW),n=ir(r.fragment.substring(t+1)).toString();if(!isNaN(e))return{handle:e,notebook:r.with({scheme:n,fragment:null})}}function NW(r,t){let e=t.toString(UW),o=`${e.length<jk.length?jk[e.length-1]:"z"}${e}s${oo(O.fromString(r.scheme),!0,!0)}`;return r.with({scheme:q.vscodeNotebookCell,fragment:o})}function FW(r){if(r.scheme!==q.vscodeNotebookMetadata)return;let t=ir(r.fragment).toString();return r.with({scheme:t,fragment:null})}function HW(r){let t=`${oo(O.fromString(r.scheme),!0,!0)}`;return r.with({scheme:q.vscodeNotebookMetadata,fragment:t})}function Jk(r){if(r.scheme!==q.vscodeNotebookCellOutput)return;let t=new URLSearchParams(r.query),e=t.get("openIn");if(!e)return;let n=t.get("outputId")??void 0,o=AS(r.with({scheme:q.vscodeNotebookCell,query:null})),i=t.get("outputIndex")?parseInt(t.get("outputIndex")||"",10):void 0,s=o?o.notebook:r.with({scheme:t.get("notebookScheme")||q.file,fragment:null,query:null}),a=t.get("cellIndex")?parseInt(t.get("cellIndex")||"",10):void 0;return{notebook:s,openIn:e,outputId:n,outputIndex:i,cellHandle:o?.handle,cellFragment:r.fragment,cellIndex:a}}var cY,jk,dY,UW,Qk,WW=v(()=>{Ve();fn();Me();Gc();Z();cY=A("notebookDocumentService"),jk=["W","X","Y","Z","a","b","c","d","e","f"],dY=new RegExp(`^[${jk.join("")}]+`),UW=7;Qk=class{constructor(){this._documents=new je}getNotebook(t){if(t.scheme===q.vscodeNotebookCell){let e=AS(t);if(e){let n=this._documents.get(e.notebook);if(n)return n}}if(t.scheme===q.vscodeNotebookCellOutput){let e=Jk(t);if(e){let n=this._documents.get(e.notebook);if(n)return n}}return this._documents.get(t)}addNotebookDocument(t){this._documents.set(t.uri,t)}removeNotebookDocument(t){this._documents.delete(t.uri)}};hi(cY,Qk,1)});var QHe,JHe,uY,Yk,YHe,XHe,VW,ZHe,pY,e2e,th=v(()=>{Ve();fb();ri();Kc();Me();fe();ro();WW();QHe=["application/json","application/javascript","text/html","image/svg+xml",wr.latex,wr.markdown,"image/png","image/jpeg",wr.text],JHe=[wr.latex,wr.markdown,"application/json","text/html","image/svg+xml","image/png","image/jpeg",wr.text];(n=>{n.scheme=q.vscodeNotebookMetadata;function t(o){return HW(o)}n.generate=t;function e(o){return FW(o)}n.parse=e})(uY||={});(c=>{c.scheme=q.vscodeNotebookCell;function t(u,p){return NW(u,p)}c.generate=t;function e(u){return AS(u)}c.parse=e;function n(u,p){return u.with({scheme:q.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"editor",outputId:p??"",notebookScheme:u.scheme!==q.file?u.scheme:""}).toString()})}c.generateCellOutputUriWithId=n;function o(u,p,m){return u.with({scheme:q.vscodeNotebookCellOutput,fragment:p.fragment,query:new URLSearchParams({openIn:"notebook",outputIndex:String(m)}).toString()})}c.generateCellOutputUriWithIndex=o;function i(u,p,m,g,y){return u.with({scheme:q.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"notebookOutputEditor",notebook:u.toString(),cellIndex:String(m),outputId:g,outputIndex:String(y)}).toString()})}c.generateOutputEditorUri=i;function s(u){return Jk(u)}c.parseCellOutputUri=s;function a(u,p,m){return c.generate(u,p).with({scheme:m})}c.generateCellPropertyUri=a;function l(u,p){if(u.scheme===p)return c.parse(u.with({scheme:c.scheme}))}c.parseCellPropertyUri=l})(Yk||={});YHe=new C("notebookEditorCursorAtBoundary","none"),XHe=new C("notebookEditorCursorAtLineBoundary","none"),VW=class r{static{this._prefix="notebook/"}static create(t,e){return`${r._prefix}${t}/${e??t}`}static parse(t){if(t.startsWith(r._prefix)){let e=t.substring(r._prefix.length).split("/");if(e.length===2)return{notebookType:e[0],viewType:e[1]}}}},ZHe=new TextDecoder,pY="\x1B[A",e2e=pY.split("").map(r=>r.charCodeAt(0))});var Nl,qW=v(()=>{Dt();fn();th();$k();Gk();Rr();Es();Kk();Nl=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(t,e,n,o){this._edits.push({_type:1,from:t,to:e,options:n,metadata:o})}createFile(t,e,n){this._edits.push({_type:1,from:void 0,to:t,options:e,metadata:n})}deleteFile(t,e,n){this._edits.push({_type:1,from:t,to:void 0,options:e,metadata:n})}replaceNotebookMetadata(t,e,n){this._edits.push({_type:3,metadata:n,uri:t,edit:{editType:5,metadata:e}})}replaceNotebookCells(t,e,n,o){let i=e.start,s=e.end;(i!==s||n.length>0)&&this._edits.push({_type:5,uri:t,index:i,count:s-i,cells:n,metadata:o})}replaceNotebookCellMetadata(t,e,n,o){this._edits.push({_type:3,metadata:o,uri:t,edit:{editType:3,index:e,metadata:n}})}replace(t,e,n,o){this._edits.push({_type:2,uri:t,edit:new Uo(e,n),metadata:o})}insert(t,e,n,o){this.replace(t,new Xe(e,e),n,o)}delete(t,e,n){this.replace(t,e,"",n)}has(t){return this._edits.some(e=>e._type===2&&e.uri.toString()===t.toString())}set(t,e){if(e)for(let n of e){if(!n)continue;let o,i;Array.isArray(n)?(o=n[0],i=n[1]):o=n,Tr.isNotebookCellEdit(o)?o.newCellMetadata?this.replaceNotebookCellMetadata(t,o.range.start,o.newCellMetadata,i):o.newNotebookMetadata?this.replaceNotebookMetadata(t,o.newNotebookMetadata,i):this.replaceNotebookCells(t,o.range,o.newCells,i):Qc.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:t,range:o.range,edit:o.snippet,metadata:i,keepWhitespace:o.keepWhitespace}):this._edits.push({_type:2,uri:t,edit:o,metadata:i})}else{for(let n=0;n<this._edits.length;n++){let o=this._edits[n];switch(o._type){case 2:case 6:case 3:case 5:o.uri.toString()===t.toString()&&(this._edits[n]=void 0);break}}Z0(this._edits)}}get(t){let e=[];for(let n of this._edits)n._type===2&&n.uri.toString()===t.toString()&&e.push(n.edit);return e}entries(){let t=new je;for(let e of this._edits)if(e._type===2){let n=t.get(e.uri);n||(n=[e.uri,[]],t.set(e.uri,n)),n[1].push(e.edit)}return[...t.values()]}get size(){return this.entries().length}toJSON(){return this.entries()}};Nl=w([pe],Nl)});function GW(r){let t="";for(let e=0;e<r.length;e++)t+=r[e].replace(/,/g,",,")+",";return t}function kh(r){if(r){if(r.covered>r.total)throw new Error(`The total number of covered items (${r.covered}) cannot be greater than the total (${r.total})`);if(r.total<0)throw new Error(`The number of covered items (${r.total}) cannot be negative`)}}var Zc,fa,oh,_p,zW,Mp,Lp,ha,DS,Op,jp,ZS,ex,_S,MS,LS,OS,Up,Np,Zk,Fp,US,NS,FS,eA,tA,Hp,Jc,HS,Wp,No,rh,ih,Xk,Fo,bY,Vp,sh,Qp,tx,nx,ga,ed,ah,Bp,WS,Wl,ya,VS,Fl,SY,Yc,BS,qS,$S,zS,GS,KS,jS,qp,$p,zp,Gp,Kp,Co,QS,nh,JS,ox,YS,rx,XS,Hl,Xc,lh,ix,sx,ax,lx,Jp,ch,dh,cx,uh,ph,dx,mh,gh,fh,hh,ux,yh,vh,Ih,bh,Sh,xh,px,Ch,mx,gx,fx,Eh,wh,hx,yx,Rh,ws,Th,vx,td,Ix,bx,nd,zn,Go,Yp,Rs,$W,Ph,Sx,xx,Cx,Ex,wx=v(()=>{Dt();Ve();xe();Ka();Kc();Tt();Ie();te();Vt();Wk();Yn();st();nS();Rr();Vk();Es();_W();Wk();MW();qk();Vk();$k();Ap();Es();LW();zk();Gk();OW();Kk();qW();fa=class{constructor(t){Wd(this,Zc);tg(this,Zc,t)}static from(...t){let e=t;return new fa(function(){if(e){for(let n of e)n&&typeof n.dispose=="function"&&n.dispose();e=void 0}})}dispose(){typeof gn(this,Zc)=="function"&&(gn(this,Zc).call(this),tg(this,Zc,void 0))}};Zc=new WeakMap,fa=w([pe],fa);oh=class{constructor(t,e){if(!t)throw new Error("Illegal argument, contents must be defined");Array.isArray(t)?this.contents=t:this.contents=[t],this.range=e}};oh=w([pe],oh);_p=class extends oh{constructor(t,e,n,o){super(t,e),this.canIncreaseVerbosity=n,this.canDecreaseVerbosity=o}};_p=w([pe],_p);zW=(n=>(n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write",n))(zW||{}),Mp=class{constructor(t,e=0){this.range=t,this.kind=e}toJSON(){return{range:this.range,kind:zW[this.kind]}}};Mp=w([pe],Mp);Lp=class{constructor(t,e){this.uri=t,this.highlights=e}toJSON(){return{uri:this.uri,highlights:this.highlights.map(t=>t.toJSON())}}};Lp=w([pe],Lp);ha=class{static validate(t){if(!t.name)throw new Error("name must not be falsy");if(!t.range.contains(t.selectionRange))throw new Error("selectionRange must be contained in fullRange");t.children?.forEach(ha.validate)}constructor(t,e,n,o,i){this.name=t,this.detail=e,this.kind=n,this.range=o,this.selectionRange=i,this.children=[],ha.validate(this)}};ha=w([pe],ha);DS=class{constructor(t,e){this.title=t,this.kind=e}};DS=w([pe],DS);Op=class{constructor(t,e){if(this.range=t,this.parent=e,e&&!e.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};Op=w([pe],Op);jp=class{constructor(t,e,n,o,i,s){this.kind=t,this.name=e,this.detail=n,this.uri=o,this.range=i,this.selectionRange=s}},ZS=class{constructor(t,e){this.fromRanges=e,this.from=t}},ex=class{constructor(t,e){this.fromRanges=e,this.to=t}},_S=class{constructor(t,e){this.range=t,this.command=e}get isResolved(){return!!this.command}};_S=w([pe],_S);MS=class{constructor(t,e){this.label=t,this.documentation=e}};MS=w([pe],MS);LS=class{constructor(t,e){this.label=t,this.documentation=e,this.parameters=[]}};LS=w([pe],LS);OS=class{constructor(){this.activeSignature=0;this.activeParameter=0;this.signatures=[]}};OS=w([pe],OS);Up=class{constructor(t){this.value=t}};Up=w([pe],Up);Np=class{constructor(t,e,n){this.position=t,this.label=e,this.kind=n}};Np=w([pe],Np);Zk=(J=>(J[J.Text=0]="Text",J[J.Method=1]="Method",J[J.Function=2]="Function",J[J.Constructor=3]="Constructor",J[J.Field=4]="Field",J[J.Variable=5]="Variable",J[J.Class=6]="Class",J[J.Interface=7]="Interface",J[J.Module=8]="Module",J[J.Property=9]="Property",J[J.Unit=10]="Unit",J[J.Value=11]="Value",J[J.Enum=12]="Enum",J[J.Keyword=13]="Keyword",J[J.Snippet=14]="Snippet",J[J.Color=15]="Color",J[J.File=16]="File",J[J.Reference=17]="Reference",J[J.Folder=18]="Folder",J[J.EnumMember=19]="EnumMember",J[J.Constant=20]="Constant",J[J.Struct=21]="Struct",J[J.Event=22]="Event",J[J.Operator=23]="Operator",J[J.TypeParameter=24]="TypeParameter",J[J.User=25]="User",J[J.Issue=26]="Issue",J))(Zk||{}),Fp=class{constructor(t,e){this.label=t,this.kind=e}toJSON(){return{label:this.label,kind:this.kind&&Zk[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};Fp=w([pe],Fp);US=class{constructor(t=[],e=!1){this.items=t,this.isIncomplete=e}};US=w([pe],US);NS=class{constructor(t,e,n){this.insertText=t,this.range=e,this.command=n}};NS=w([pe],NS);FS=class{constructor(t){this.commands=void 0;this.suppressSuggestions=void 0;this.items=t}};FS=w([pe],FS);eA=(n=>(n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command",n))(eA||{});(t=>{function r(e){switch(e){case"keyboard":return 1;case"mouse":return 2;case"api":case"code.jump":case"code.navigation":return 3}}t.fromValue=r})(eA||={});tA=(o=>(o[o.Other=0]="Other",o[o.Comment=1]="Comment",o[o.String=2]="String",o[o.RegEx=3]="RegEx",o))(tA||{});(t=>{function r(e){switch(e){case 0:return"other";case 1:return"comment";case 2:return"string";case 3:return"regex"}return"other"}t.toString=r})(tA||={});Hp=class{constructor(t,e){if(e&&!S.isUri(e))throw mt("target");if(!Xe.isRange(t)||t.isEmpty)throw mt("range");this.range=t,this.target=e}};Hp=w([pe],Hp);Jc=class{constructor(t,e,n,o){this.red=t,this.green=e,this.blue=n,this.alpha=o}};Jc=w([pe],Jc);HS=class{constructor(t,e){if(e&&!(e instanceof Jc))throw mt("color");if(!Xe.isRange(t)||t.isEmpty)throw mt("range");this.range=t,this.color=e}};HS=w([pe],HS);Wp=class{constructor(t){if(!t||typeof t!="string")throw mt("label");this.label=t}};Wp=w([pe],Wp);No=class{constructor(t,e){this.label=e;if(typeof t!="string")throw mt("name");if(typeof e!="string")throw mt("name");this._id=t}static from(t){switch(t){case"clean":return No.Clean;case"build":return No.Build;case"rebuild":return No.Rebuild;case"test":return No.Test;default:return}}get id(){return this._id}};No.Clean=new No("clean","Clean"),No.Build=new No("build","Build"),No.Rebuild=new No("rebuild","Rebuild"),No.Test=new No("test","Test"),No=w([pe],No);rh=class{constructor(t,e,n){if(typeof t!="string")throw mt("process");this._args=[],this._process=t,e!==void 0&&(Array.isArray(e)?(this._args=e,this._options=n):this._options=e)}get process(){return this._process}set process(t){if(typeof t!="string")throw mt("process");this._process=t}get args(){return this._args}set args(t){Array.isArray(t)||(t=[]),this._args=t}get options(){return this._options}set options(t){this._options=t}computeId(){let t=[];if(t.push("process"),this._process!==void 0&&t.push(this._process),this._args&&this._args.length>0)for(let e of this._args)t.push(e);return GW(t)}};rh=w([pe],rh);ih=class{constructor(t,e,n){this._args=[];if(Array.isArray(e)){if(!t)throw mt("command can't be undefined or null");if(typeof t!="string"&&typeof t.value!="string")throw mt("command");this._command=t,e&&(this._args=e),this._options=n}else{if(typeof t!="string")throw mt("commandLine");this._commandLine=t,this._options=e}}get commandLine(){return this._commandLine}set commandLine(t){if(typeof t!="string")throw mt("commandLine");this._commandLine=t}get command(){return this._command?this._command:""}set command(t){if(typeof t!="string"&&typeof t.value!="string")throw mt("command");this._command=t}get args(){return this._args}set args(t){this._args=t||[]}get options(){return this._options}set options(t){this._options=t}computeId(){let t=[];if(t.push("shell"),this._commandLine!==void 0&&t.push(this._commandLine),this._command!==void 0&&t.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(let e of this._args)t.push(typeof e=="string"?e:e.value);return GW(t)}};ih=w([pe],ih);Xk=class{constructor(t){this._callback=t}computeId(){return"customExecution"+Ee()}set callback(t){this._callback=t}get callback(){return this._callback}},Fo=class{constructor(t,e,n,o,i,s){this.__deprecated=!1;this._definition=this.definition=t;let a;typeof e=="string"?(this._name=this.name=e,this._source=this.source=n,this.execution=o,a=i,this.__deprecated=!0):e===1||e===2?(this.target=e,this._name=this.name=n,this._source=this.source=o,this.execution=i,a=s):(this.target=e,this._name=this.name=n,this._source=this.source=o,this.execution=i,a=s),typeof a=="string"?(this._problemMatchers=[a],this._hasDefinedMatchers=!0):Array.isArray(a)?(this._problemMatchers=a,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(t){this.__id=t}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof rh?this._definition={type:Fo.ProcessType,id:this._execution.computeId()}:this._execution instanceof ih?this._definition={type:Fo.ShellType,id:this._execution.computeId()}:this._execution instanceof Xk?this._definition={type:Fo.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:Fo.EmptyType,id:Ee()}}get definition(){return this._definition}set definition(t){if(t==null)throw mt("Kind can't be undefined or null");this.clear(),this._definition=t}get scope(){return this._scope}set target(t){this.clear(),this._scope=t}get name(){return this._name}set name(t){if(typeof t!="string")throw mt("name");this.clear(),this._name=t}get execution(){return this._execution}set execution(t){t===null&&(t=void 0),this.clear(),this._execution=t;let e=this._definition.type;(Fo.EmptyType===e||Fo.ProcessType===e||Fo.ShellType===e||Fo.ExtensionCallbackType===e)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(t){if(Array.isArray(t))this.clear(),this._problemMatchers=t,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(t){t!==!0&&t!==!1&&(t=!1),this.clear(),this._isBackground=t}get source(){return this._source}set source(t){if(typeof t!="string"||t.length===0)throw mt("source must be a string of length > 0");this.clear(),this._source=t}get group(){return this._group}set group(t){t===null&&(t=void 0),this.clear(),this._group=t}get detail(){return this._detail}set detail(t){t===null&&(t=void 0),this._detail=t}get presentationOptions(){return this._presentationOptions}set presentationOptions(t){t==null&&(t=Object.create(null)),this.clear(),this._presentationOptions=t}get runOptions(){return this._runOptions}set runOptions(t){t==null&&(t=Object.create(null)),this.clear(),this._runOptions=t}};Fo.ExtensionCallbackType="customExecution",Fo.ProcessType="process",Fo.ShellType="shell",Fo.EmptyType="$empty",Fo=w([pe],Fo);(t=>{function r(e){let n=e;return to(n.value)?n.tooltip&&!G(n.tooltip)?(console.log("INVALID view badge, invalid tooltip",n.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",n.value),!1)}t.isViewBadge=r})(bY||={});Vp=class{constructor(t,e=0){this.collapsibleState=e;S.isUri(t)?this.resourceUri=t:this.label=t}static isTreeItem(t,e){let n=t;if(n.checkboxState!==void 0){let o=to(n.checkboxState)?n.checkboxState:ve(n.checkboxState)&&to(n.checkboxState.state)?n.checkboxState.state:void 0,i=!to(n.checkboxState)&&ve(n.checkboxState)?n.checkboxState.tooltip:void 0;if(o===void 0||o!==1&&o!==0||i!==void 0&&!G(i))return console.log("INVALID tree item, invalid checkboxState",n.checkboxState),!1}if(t instanceof Vp)return!0;if(n.label!==void 0&&!G(n.label)&&!n.label?.label)return console.log("INVALID tree item, invalid label",n.label),!1;if(n.id!==void 0&&!G(n.id))return console.log("INVALID tree item, invalid id",n.id),!1;if(n.iconPath!==void 0&&!G(n.iconPath)&&!S.isUri(n.iconPath)&&(!n.iconPath||!G(n.iconPath.id))){let o=n.iconPath;if(!o||!G(o.light)&&!S.isUri(o.light)&&!G(o.dark)&&!S.isUri(o.dark))return console.log("INVALID tree item, invalid iconPath",n.iconPath),!1}return n.description!==void 0&&!G(n.description)&&typeof n.description!="boolean"?(console.log("INVALID tree item, invalid description",n.description),!1):n.resourceUri!==void 0&&!S.isUri(n.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",n.resourceUri),!1):n.tooltip!==void 0&&!G(n.tooltip)&&!(n.tooltip instanceof Lo)?(console.log("INVALID tree item, invalid tooltip",n.tooltip),!1):n.command!==void 0&&!n.command.command?(console.log("INVALID tree item, invalid command",n.command),!1):n.collapsibleState!==void 0&&n.collapsibleState<0&&n.collapsibleState>2?(console.log("INVALID tree item, invalid collapsibleState",n.collapsibleState),!1):n.contextValue!==void 0&&!G(n.contextValue)?(console.log("INVALID tree item, invalid contextValue",n.contextValue),!1):n.accessibilityInformation!==void 0&&!n.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",n.accessibilityInformation),!1):!0}};Vp=w([pe],Vp);sh=class{constructor(t){this.value=t}async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}};sh=w([pe],sh);Qp=class extends sh{},tx=class extends Qp{$b;constructor(t){super(""),this.$b=t}asFile(){return this.$b}},nx=class{constructor(t,e,n,o){this.name=t,this.uri=e,this._itemId=n,this._getData=o}data(){return this._getData()}},Bp=class{constructor(t){Wd(this,ed);Wd(this,ga,new Map);for(let[e,n]of t??[]){let o=gn(this,ga).get(ng(this,ed,ah).call(this,e));o?o.push(n):gn(this,ga).set(ng(this,ed,ah).call(this,e),[n])}}get(t){return gn(this,ga).get(ng(this,ed,ah).call(this,t))?.[0]}set(t,e){gn(this,ga).set(ng(this,ed,ah).call(this,t),[e])}forEach(t,e){for(let[n,o]of gn(this,ga))for(let i of o)t.call(e,i,n,this)}*[Symbol.iterator](){for(let[t,e]of gn(this,ga))for(let n of e)yield[t,n]}};ga=new WeakMap,ed=new WeakSet,ah=function(t){return t.toLowerCase()},Bp=w([pe],Bp);WS=class{constructor(t,e,n){this.insertText=t,this.title=e,this.kind=n}};WS=w([pe],WS);Wl=class r{constructor(t){this.value=t}static{this.sep="."}append(...t){return new r((this.value?[this.value,...t]:t).join(r.sep))}intersects(t){return this.contains(t)||t.contains(this)}contains(t){return this.value===t.value||t.value.startsWith(this.value+r.sep)}};Wl.Empty=new Wl("");Wl.Text=new Wl("text");Wl.TextUpdateImports=Wl.Text.append("updateImports");ya=class{constructor(t,e){this.id=t,this.color=e}static isThemeIcon(t){return typeof t.id!="string"?(console.log("INVALID ThemeIcon, invalid id",t.id),!1):!0}};ya=w([pe],ya);ya.File=new ya("file");ya.Folder=new ya("folder");VS=class{constructor(t){this.id=t}};VS=w([pe],VS);Fl=class{get base(){return this._base}set base(t){this._base=t,this._baseUri=S.file(t)}get baseUri(){return this._baseUri}set baseUri(t){this._baseUri=t,this._base=t.fsPath}constructor(t,e){if(typeof t!="string"&&(!t||!S.isUri(t)&&!S.isUri(t.uri)))throw mt("base");if(typeof e!="string")throw mt("pattern");typeof t=="string"?this.baseUri=S.file(t):S.isUri(t)?this.baseUri=t:this.baseUri=t.uri,this.pattern=e}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};Fl=w([pe],Fl);SY=new WeakMap,Yc=class{constructor(t,e,n,o,i){this.enabled=typeof t=="boolean"?t:!0,typeof e=="string"&&(this.condition=e),typeof n=="string"&&(this.hitCondition=n),typeof o=="string"&&(this.logMessage=o),typeof i=="string"&&(this.mode=i)}get id(){return this._id||(this._id=SY.get(this)??Ee()),this._id}};Yc=w([pe],Yc);BS=class extends Yc{constructor(t,e,n,o,i,s){if(super(e,n,o,i,s),t===null)throw mt("location");this.location=t}};BS=w([pe],BS);qS=class extends Yc{constructor(t,e,n,o,i,s){super(e,n,o,i,s),this.functionName=t}};qS=w([pe],qS);$S=class extends Yc{constructor(t,e,n,o,i,s,a,l){if(super(o,i,s,a,l),!e)throw mt("dataId");this.label=t,this.dataId=e,this.canPersist=n}};$S=w([pe],$S);zS=class{constructor(t,e,n){this.command=t,this.args=e||[],this.options=n}};zS=w([pe],zS);GS=class{constructor(t,e){this.port=t,this.host=e}};GS=w([pe],GS);KS=class{constructor(t){this.path=t}};KS=w([pe],KS);jS=class{constructor(t){this.implementation=t}};jS=w([pe],jS);qp=class{constructor(t,e){this.range=t,this.expression=e}};qp=w([pe],qp);$p=class{constructor(t,e){this.range=t,this.text=e}};$p=w([pe],$p);zp=class{constructor(t,e,n=!0){this.range=t,this.variableName=e,this.caseSensitiveLookup=n}};zp=w([pe],zp);Gp=class{constructor(t,e){this.range=t,this.expression=e}};Gp=w([pe],Gp);Kp=class{constructor(t,e){this.frameId=t,this.stoppedLocation=e}};Kp=w([pe],Kp);Co=class extends Error{static FileExists(t){return new Co(t,"EntryExists",Co.FileExists)}static FileNotFound(t){return new Co(t,"EntryNotFound",Co.FileNotFound)}static FileNotADirectory(t){return new Co(t,"EntryNotADirectory",Co.FileNotADirectory)}static FileIsADirectory(t){return new Co(t,"EntryIsADirectory",Co.FileIsADirectory)}static NoPermissions(t){return new Co(t,"NoPermissions",Co.NoPermissions)}static Unavailable(t){return new Co(t,"Unavailable",Co.Unavailable)}constructor(t,e="Unknown",n){super(S.isUri(t)?t.toString(!0):t),this.code=n?.name??"Unknown",iT(this,e),Object.setPrototypeOf(this,Co.prototype),typeof Error.captureStackTrace=="function"&&typeof n=="function"&&Error.captureStackTrace(this,n)}};Co=w([pe],Co);QS=class{constructor(t,e,n){this.start=t,this.end=e,this.kind=n}};QS=w([pe],QS);nh=class{constructor(){}};nh.Back={iconPath:new ya("arrow-left")},nh=w([pe],nh);JS=class{constructor(t){this.kind=t}};JS=w([pe],JS);ox=class{constructor(t,e=[]){this.uri=t;this.provides=qd(e)}},YS=class{constructor(t,e){this.timestamp=e;S.isUri(t)?this.resourceUri=t:this.label=t}};YS=w([pe],YS);rx=class{constructor(t,e,n){this.controllerId=t;this.profileId=e;this.kind=n}},XS=class{constructor(t=void 0,e=void 0,n=void 0,o=!1,i=!0){this.include=t;this.exclude=e;this.profile=n;this.continuous=o;this.preserveFocus=i}};XS=w([pe],XS);Hl=class{constructor(t){this.message=t}static diff(t,e,n){let o=new Hl(t);return o.expectedOutput=e,o.actualOutput=n,o}};Hl=w([pe],Hl);Xc=class{constructor(t){this.id=t}};Xc=w([pe],Xc);lh=class{constructor(t,e){this.covered=t;this.total=e;kh(this)}};ix=class r{constructor(t,e,n,o,i=[]){this.uri=t;this.statementCoverage=e;this.branchCoverage=n;this.declarationCoverage=o;this.includesTests=i}static fromDetails(t,e){let n=new lh(0,0),o=new lh(0,0),i=new lh(0,0);for(let a of e)if("branches"in a){n.total+=1,n.covered+=a.executed?1:0;for(let l of a.branches)o.total+=1,o.covered+=l.executed?1:0}else i.total+=1,i.covered+=a.executed?1:0;let s=new r(t,n,o.total>0?o:void 0,i.total>0?i:void 0);return s.detailedCoverage=e,s}},sx=class{constructor(t,e,n=[]){this.executed=t;this.location=e;this.branches=n}get executionCount(){return+this.executed}set executionCount(t){this.executed=t}},ax=class{constructor(t,e,n){this.executed=t;this.location=e;this.label=n}get executionCount(){return+this.executed}set executionCount(t){this.executed=t}},lx=class{constructor(t,e,n){this.name=t;this.executed=e;this.location=n}get executionCount(){return+this.executed}set executionCount(t){this.executed=t}},Jp=class{constructor(t,e,n,o,i,s){this.kind=t,this.name=e,this.detail=n,this.uri=o,this.range=i,this.selectionRange=s}},ch=class{constructor(t){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new Lo(t):t}},dh=class{constructor(t,e){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new Lo(t):t,this.vulnerabilities=e}},cx=class{constructor(t,e,n,o){this.title=t,this.message=e,this.data=n,this.buttons=o}},uh=class{constructor(t,e){this.value=t,this.baseUri=e}},ph=class{constructor(t,e,n){this.value=t,this.title=e,this.readOnly=n}},dx=class{constructor(t,e,n,o){this.description=t,this.agentName=e,this.prompt=n,this.result=o}},mh=class{constructor(t,e){this.value=t,this.value2=t,this.title=e}},gh=class{constructor(t){this.value=t}},fh=class{constructor(t,e,n){this.value=t,this.id=e,this.metadata=n}},hh=class{constructor(t,e,n,o){this.hookType=t,this.stopReason=e,this.systemMessage=n,this.metadata=o}},ux=class{constructor(t,e){this.id=t,this.value=e}},yh=class{constructor(t){this.resolvedModel=t}},vh=class{constructor(t){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new Lo(t):t}},Ih=class{constructor(t){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new Lo(t):t}},bh=class{constructor(t){this.value=t}},Sh=class{constructor(t,e,n){this.value=t,this.iconPath=e,this.options=n}},xh=class{constructor(t,e,n){this.value=t,this.isEdit=e,this.undoStopId=n}},px=class{constructor(t,e,n){this.value=t,this.license=e,this.snippet=n}},Ch=class{constructor(t,e){this.uri=t;this.range=e}},mx=class{constructor(t){this.extensions=t}},gx=class{constructor(t,e,n,o,i){this.title=e;this.description=n;this.author=o;this.linkTag=i;rs(t)?(this.uri=t,this.command={title:"Open Pull Request",command:"vscode.open",arguments:[t]}):this.command=t}toJSON(){return{$mid:26,uri:this.uri,title:this.title,description:this.description,author:this.author}}},fx=class{constructor(t,e,n,o){this.id=t,this.type=e,this.title=n,this.message=o?.message,this.options=o?.options,this.defaultValue=o?.defaultValue,this.allowFreeformInput=o?.allowFreeformInput}},Eh=class{constructor(t,e=!0){this.questions=t,this.allowSkip=e}},wh=class{constructor(t,e){this.uri=t,e===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(e)?e:[e]}},hx=class{constructor(t,e){this.uri=t,e===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(e)?e:[e]}},yx=class{constructor(t){this.edits=t}},Rh=class{constructor(t,e,n){this.toolName=t,this.toolCallId=e,this.errorMessage=n}},ws=class r{constructor(t){this.id=t}static{this.Agent=new r("agent")}static{this.Skill=new r("skill")}static{this.Instructions=new r("instructions")}static{this.Prompt=new r("prompt")}static{this.Hook=new r("hook")}static{this.Plugins=new r("plugins")}},Th=class{constructor(t,e,n,o,i){this.mimeType=t,this.data=e,this.reference=n,this.isPasted=o,this.isURL=i}},vx=class{constructor(t){this.diagnostics=t}},td=class{constructor(t,e,n){this.callId=t,this.content=e,this.isError=n??!1}},Ix=class r{constructor(t,e,n){this._content=[];this.role=t,this.content=e,this.name=n}static User(t,e){return new r(1,t,e)}static Assistant(t,e){return new r(2,t,e)}set content(t){typeof t=="string"?this._content=[new zn(t)]:this._content=t}get content(){return this._content}},bx=class r{constructor(t,e,n){this._content=[];this.role=t,this.content=e,this.name=n}static User(t,e){return new r(1,t,e)}static Assistant(t,e){return new r(2,t,e)}set content(t){typeof t=="string"?this._content=[new zn(t)]:this._content=t}get content(){return this._content}set content2(t){t&&(this.content=t.map(e=>typeof e=="string"?new zn(e):e))}get content2(){return this.content.map(t=>t instanceof zn?t.value:t)}},nd=class{constructor(t,e,n){this.callId=t,this.name=e,this.input=n}},zn=class{constructor(t,e){this.value=t,e=e}toJSON(){return{$mid:21,value:this.value,audience:this.audience}}},Go=class r{constructor(t,e,n){this.mimeType=e,this.data=t,this.audience=n}static image(t,e){return new r(t,e)}static json(t,e="text/x-json"){let n=JSON.stringify(t,void 0," ");return new r(O.fromString(n).buffer,e)}static text(t,e=wr.text){return new r(O.fromString(t).buffer,e)}toJSON(){return{$mid:24,mimeType:this.mimeType,data:oo(O.wrap(this.data)),audience:this.audience}}},Yp=class{constructor(t,e,n){this.value=t,this.id=e,this.metadata=n}toJSON(){return{$mid:22,value:this.value,id:this.id,metadata:this.metadata}}},Rs=class{constructor(t){this.value=t}toJSON(){return{$mid:23,value:this.value}}},$W=class r extends Error{static $c="LanguageModelError";static NotFound(t){return new r(t,r.NotFound.name)}static NoPermissions(t){return new r(t,r.NoPermissions.name)}static Blocked(t){return new r(t,r.Blocked.name)}static RateLimited(t,e){return new r(t,r.RateLimited.name,void 0,e)}static tryDeserialize(t){if(t.name===r.$c)return new r(t.message,t.code,t.cause,t.retryAfter)}constructor(t,e,n,o){super(t,{cause:n}),this.name=r.$c,this.code=e??"",typeof o=="number"&&o>=0&&(this.retryAfter=o)}},Ph=class{constructor(t){this.content=t}toJSON(){return{$mid:20,content:this.content}}},Sx=class{constructor(t,e){this.id=t;this.label=e}},xx=class{constructor(t,e,n){this.label=t;this.name=e;this.instructions=n}},Cx=class{constructor(t,e,n,o={},i,s){this.label=t;this.command=e;this.args=n;this.env=o;this.version=i;this.metadata=s}},Ex=class{constructor(t,e,n={},o,i,s){this.label=t;this.uri=e;this.headers=n;this.version=o;this.metadata=i;this.authentication=s}}});var Rx,jW=v(()=>{Dt();ri();Vt();Rx=Object.freeze({create:r=>rn(r.map(t=>t.toString())).join(`\r
`),split:r=>r.split(`\r
`),parse:r=>Rx.split(r).filter(t=>!t.startsWith("#"))})});function rA(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function eV(r){rd=r}function zr(r,t){if(t){if(tV.test(r))return r.replace(xY,QW)}else if(nV.test(r))return r.replace(CY,QW);return r}function tn(r,t){let e=typeof r=="string"?r:r.source;t=t||"";let n={replace:(o,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(wY,"$1"),e=e.replace(o,s),n},getRegex:()=>new RegExp(e,t)};return n}function JW(r){try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}function YW(r,t){let e=r.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=e.split(/ \|/),o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function Ah(r,t,e){let n=r.length;if(n===0)return"";let o=0;for(;o<n;){let i=r.charAt(n-o-1);if(i===t&&!e)o++;else if(i!==t&&e)o++;else break}return r.slice(0,n-o)}function RY(r,t){if(r.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===t[0])e++;else if(r[n]===t[1]&&(e--,e<0))return n;return-1}function XW(r,t,e,n){let o=t.href,i=t.title?zr(t.title):null,s=r[1].replace(/\\([\[\]])/g,"$1");if(r[0].charAt(0)!=="!"){n.state.inLink=!0;let a={type:"link",raw:e,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:e,href:o,title:i,text:zr(s)}}function TY(r,t){let e=r.match(/^(\s+)(?:```)/);if(e===null)return t;let n=e[1];return t.split(`
`).map(o=>{let i=o.match(/^\s+/);if(i===null)return o;let[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(`
`)}function Ft(r,t){return od.parse(r,t)}var rd,tV,xY,nV,CY,EY,QW,wY,_h,Zp,PY,kY,AY,Lh,DY,oV,rV,iA,_Y,sA,MY,LY,kx,aA,OY,iV,UY,lA,ZW,NY,FY,sV,HY,aV,WY,Oh,VY,BY,qY,$Y,zY,GY,KY,jY,QY,Px,JY,lV,cV,YY,cA,XY,nA,ZY,Tx,Dh,va,em,Mh,Ia,Xp,oA,od,eWe,tWe,nWe,eX,oWe,rWe,tX,Ax=v(()=>{rd=rA();tV=/[&<>"']/,xY=new RegExp(tV.source,"g"),nV=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,CY=new RegExp(nV.source,"g"),EY={"&":"&","<":"<",">":">",'"':""","'":"'"},QW=r=>EY[r];wY=/(^|[^\[])\^/g;_h={exec:()=>null};Zp=class{options;rules;lexer;constructor(t){this.options=t||rd}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ah(n,`
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],o=TY(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:o}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){let o=Ah(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Ah(e[0],`
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Ah(e[0],`
`).split(`
`),o="",i="",s=[];for(;n.length>0;){let a=!1,l=[],c;for(c=0;c<n.length;c++)if(/^ {0,3}>/.test(n[c]))l.push(n[c]),a=!0;else if(!a)l.push(n[c]);else break;n=n.slice(c);let u=l.join(`
`),p=u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
$1`).replace(/^ {0,3}>[ \t]?/gm,"");o=o?`${o}
${u}`:u,i=i?`${i}
${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=m,n.length===0)break;let g=s[s.length-1];if(g?.type==="code")break;if(g?.type==="blockquote"){let y=g,h=y.raw+`
`+n.join(`
`),I=this.blockquote(h);s[s.length-1]=I,o=o.substring(0,o.length-y.raw.length)+I.raw,i=i.substring(0,i.length-y.text.length)+I.text;break}else if(g?.type==="list"){let y=g,h=y.raw+`
`+n.join(`
`),I=this.list(h);s[s.length-1]=I,o=o.substring(0,o.length-g.raw.length)+I.raw,i=i.substring(0,i.length-y.raw.length)+I.raw,n=h.substring(s[s.length-1].raw.length).split(`
`);continue}}return{type:"blockquote",raw:o,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),o=n.length>1,i={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),a=!1;for(;t;){let l=!1,c="",u="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let p=e[2].split(`
`,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),m=t.split(`
`,1)[0],g=!p.trim(),y=0;if(this.options.pedantic?(y=2,u=p.trimStart()):g?y=e[1].length+1:(y=e[2].search(/[^ ]/),y=y>4?1:y,u=p.slice(y),y+=e[1].length),g&&/^ *$/.test(m)&&(c+=m+`
`,t=t.substring(m.length+1),l=!0),!l){let x=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),E=new RegExp(`^ {0,${Math.min(3,y-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),T=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:\`\`\`|~~~)`),P=new RegExp(`^ {0,${Math.min(3,y-1)}}#`);for(;t;){let M=t.split(`
`,1)[0];if(m=M,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),T.test(m)||P.test(m)||x.test(m)||E.test(t))break;if(m.search(/[^ ]/)>=y||!m.trim())u+=`
`+m.slice(y);else{if(g||p.search(/[^ ]/)>=4||T.test(p)||P.test(p)||E.test(p))break;u+=`
`+m}!g&&!m.trim()&&(g=!0),c+=M+`
`,t=t.substring(M.length+1),p=m.slice(y)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(c)&&(a=!0));let h=null,I;this.options.gfm&&(h=/^\[[ xX]\] /.exec(u),h&&(I=h[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:c,task:!!h,checked:I,loose:!1,text:u,tokens:[]}),i.raw+=c}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let l=0;l<i.items.length;l++)if(this.lexer.state.top=!1,i.items[l].tokens=this.lexer.blockTokens(i.items[l].text,[]),!i.loose){let c=i.items[l].tokens.filter(p=>p.type==="space"),u=c.length>0&&c.some(p=>/\n.*\n/.test(p.raw));i.loose=u}if(i.loose)for(let l=0;l<i.items.length;l++)i.items[l].loose=!0;return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(/\s+/g," "),o=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:o,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!/[:|]/.test(e[2]))return;let n=YW(e[1]),o=e[2].replace(/^\||\| *$/g,"").split("|"),i=e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split(`
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===o.length){for(let a of o)/^ *-+: *$/.test(a)?s.align.push("right"):/^ *:-+: *$/.test(a)?s.align.push("center"):/^ *:-+ *$/.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(YW(a,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:zr(e[1])}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let s=Ah(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=RY(e[2],"()");if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let o=e[2],i="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),XW(e,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," "),i=e[o.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return XW(n,i,n[0],this.lexer)}}emStrong(t,e,n=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...o[0]].length-1,a,l,c=s,u=0,p=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(o=p.exec(e))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);let m=[...o[0]][0].length,g=t.slice(0,s+o.index+m+l);if(Math.min(s,l)%2){let h=g.slice(1,-1);return{type:"em",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(/\n/g," "),o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=zr(n,!0),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,o;return e[2]==="@"?(n=zr(e[1]),o="mailto:"+n):(n=zr(e[1]),o=n),{type:"link",raw:e[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,o;if(e[2]==="@")n=zr(e[0]),o="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=zr(e[0]),e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n;return this.lexer.state.inRawBlock?n=e[0]:n=zr(e[0]),{type:"text",raw:e[0],text:n}}}},PY=/^(?: *(?:\n|$))+/,kY=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,AY=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Lh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,DY=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oV=/(?:[*+-]|\d{1,9}[.)])/,rV=tn(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,oV).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),iA=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_Y=/^[^\n]+/,sA=/(?!\s*\])(?:\\.|[^\[\]\\])+/,MY=tn(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",sA).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),LY=tn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oV).getRegex(),kx="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",aA=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,OY=tn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",aA).replace("tag",kx).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),iV=tn(iA).replace("hr",Lh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kx).getRegex(),UY=tn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",iV).getRegex(),lA={blockquote:UY,code:kY,def:MY,fences:AY,heading:DY,hr:Lh,html:OY,lheading:rV,list:LY,newline:PY,paragraph:iV,table:_h,text:_Y},ZW=tn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Lh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kx).getRegex(),NY={...lA,table:ZW,paragraph:tn(iA).replace("hr",Lh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ZW).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kx).getRegex()},FY={...lA,html:tn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",aA).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_h,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tn(iA).replace("hr",Lh).replace("heading",` *#{1,6} *[^
]`).replace("lheading",rV).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sV=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HY=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aV=/^( {2,}|\\)\n(?!\s*$)/,WY=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Oh="\\p{P}\\p{S}",VY=tn(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Oh).getRegex(),BY=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,qY=tn(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Oh).getRegex(),$Y=tn("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Oh).getRegex(),zY=tn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Oh).getRegex(),GY=tn(/\\([punct])/,"gu").replace(/punct/g,Oh).getRegex(),KY=tn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jY=tn(aA).replace("(?:-->|$)","-->").getRegex(),QY=tn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",jY).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Px=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,JY=tn(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Px).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lV=tn(/^!?\[(label)\]\[(ref)\]/).replace("label",Px).replace("ref",sA).getRegex(),cV=tn(/^!?\[(ref)\](?:\[\])?/).replace("ref",sA).getRegex(),YY=tn("reflink|nolink(?!\\()","g").replace("reflink",lV).replace("nolink",cV).getRegex(),cA={_backpedal:_h,anyPunctuation:GY,autolink:KY,blockSkip:BY,br:aV,code:HY,del:_h,emStrongLDelim:qY,emStrongRDelimAst:$Y,emStrongRDelimUnd:zY,escape:sV,link:JY,nolink:cV,punctuation:VY,reflink:lV,reflinkSearch:YY,tag:QY,text:WY,url:_h},XY={...cA,link:tn(/^!?\[(label)\]\((.*?)\)/).replace("label",Px).getRegex(),reflink:tn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Px).getRegex()},nA={...cA,escape:tn(sV).replace("])","~|])").getRegex(),url:tn(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ZY={...nA,br:tn(aV).replace("{2,}","*").getRegex(),text:tn(nA.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tx={normal:lA,gfm:NY,pedantic:FY},Dh={normal:cA,gfm:nA,breaks:ZY,pedantic:XY},va=class r{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||rd,this.options.tokenizer=this.options.tokenizer||new Zp,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={block:Tx.normal,inline:Dh.normal};this.options.pedantic?(e.block=Tx.pedantic,e.inline=Dh.pedantic):this.options.gfm&&(e.block=Tx.gfm,this.options.breaks?e.inline=Dh.breaks:e.inline=Dh.gfm),this.tokenizer.rules=e}static get rules(){return{block:Tx,inline:Dh}}static lex(t,e){return new r(e).lex(t)}static lexInline(t,e){return new r(e).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let n=this.inlineQueue[e];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(o=a.call({lexer:this},t,e))?(t=t.substring(o.raw.length),e.push(o),!0):!1))){if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length),o.raw.length===1&&e.length>0?e[e.length-1].raw+=`
`:e.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+o.raw,i.text+=`
`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+o.raw,i.text+=`
`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),e.push(o);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){i=e[e.length-1],n&&i?.type==="paragraph"?(i.raw+=`
`+o.raw,i.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(o),n=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length),i=e[e.length-1],i&&i.type==="text"?(i.raw+=`
`+o.raw,i.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=e[e.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=e[e.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),e.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,p=t.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(u=Math.min(u,m))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=e[e.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):e.push(n);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return e}},em=class{options;parser;constructor(t){this.options=t||rd}space(t){return""}code({text:t,lang:e,escaped:n}){let o=(e||"").match(/^\S*/)?.[0],i=t.replace(/\n$/,"")+`
`;return o?'<pre><code class="language-'+zr(o)+'">'+(n?i:zr(i,!0))+`</code></pre>
`:"<pre><code>"+(n?i:zr(i,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
`}hr(t){return`<hr>
`}list(t){let e=t.ordered,n=t.start,o="";for(let a=0;a<t.items.length;a++){let l=t.items[a];o+=this.listitem(l)}let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
`+o+"</"+i+`>
`}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens.length>0&&t.tokens[0].type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let o="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+o+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${t}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let o=this.parser.parseInline(n),i=JW(t);if(i===null)return o;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+e+'"'),s+=">"+o+"</a>",s}image({href:t,title:e,text:n}){let o=JW(t);if(o===null)return n;t=o;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${e}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):t.text}},Mh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ia=class r{options;renderer;textRenderer;constructor(t){this.options=t||rd,this.options.renderer=this.options.renderer||new em,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Mh}static parse(t,e){return new r(e).parse(t)}static parseInline(t,e){return new r(e).parseInline(t)}parse(t,e=!0){let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=l||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);continue}case"hr":{n+=this.renderer.hr(s);continue}case"heading":{n+=this.renderer.heading(s);continue}case"code":{n+=this.renderer.code(s);continue}case"table":{n+=this.renderer.table(s);continue}case"blockquote":{n+=this.renderer.blockquote(s);continue}case"list":{n+=this.renderer.list(s);continue}case"html":{n+=this.renderer.html(s);continue}case"paragraph":{n+=this.renderer.paragraph(s);continue}case"text":{let a=s,l=this.renderer.text(a);for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],l+=`
`+this.renderer.text(a);e?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):n+=l;continue}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let o=0;o<t.length;o++){let i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case"escape":{n+=e.text(s);break}case"html":{n+=e.html(s);break}case"link":{n+=e.link(s);break}case"image":{n+=e.image(s);break}case"strong":{n+=e.strong(s);break}case"em":{n+=e.em(s);break}case"codespan":{n+=e.codespan(s);break}case"br":{n+=e.br(s);break}case"del":{n+=e.del(s);break}case"text":{n+=e.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},Xp=class{options;constructor(t){this.options=t||rd}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}},oA=class{defaults=rA();options=this.setOptions;parse=this.parseMarkdown(va.lex,Ia.parse);parseInline=this.parseMarkdown(va.lexInline,Ia.parseInline);Parser=Ia;Renderer=em;TextRenderer=Mh;Lexer=va;Tokenizer=Zp;Hooks=Xp;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let o of t)switch(n=n.concat(e.call(this,o)),o.type){case"table":{let i=o;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{let i=o;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o={...n};if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),o.extensions=e),n.renderer){let i=this.defaults.renderer||new em(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=n.renderer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Zp(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=n.tokenizer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Xp;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;let a=s,l=n.hooks[a],c=i[a];Xp.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(i,u)).then(m=>c.call(i,m));let p=l.call(i,u);return c.call(i,p)}:i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}o.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;o.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return va.lex(t,e??this.defaults)}parser(t,e){return Ia.parse(t,e??this.defaults)}parseMarkdown(t,e){return(o,i)=>{let s={...i},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(o):o).then(c=>t(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>e(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(l);try{a.hooks&&(o=a.hooks.preprocess(o));let c=t(o,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let u=e(c,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(c){return l(c)}}}onError(t,e){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+zr(n.message+"",!0)+"</pre>";return e?Promise.resolve(o):o}if(e)return Promise.reject(n);throw n}}},od=new oA;Ft.options=Ft.setOptions=function(r){return od.setOptions(r),Ft.defaults=od.defaults,eV(Ft.defaults),Ft};Ft.getDefaults=rA;Ft.defaults=rd;Ft.use=function(...r){return od.use(...r),Ft.defaults=od.defaults,eV(Ft.defaults),Ft};Ft.walkTokens=function(r,t){return od.walkTokens(r,t)};Ft.parseInline=od.parseInline;Ft.Parser=Ia;Ft.parser=Ia.parse;Ft.Renderer=em;Ft.TextRenderer=Mh;Ft.Lexer=va;Ft.lexer=va.lex;Ft.Tokenizer=Zp;Ft.Hooks=Xp;Ft.parse=Ft;eWe=Ft.options,tWe=Ft.setOptions,nWe=Ft.use,eX=Ft.walkTokens,oWe=Ft.parseInline,rWe=Ia.parse,tX=va.lex});function*uV(r){let t=[r];for(;t.length>0;){let e=t.pop();if(yield e,e.children)for(let n of e.children.values())t.push(n)}}var Ko,Dx,Uh,pV=v(()=>{ri();Ko=Symbol("unset"),Dx=class{constructor(){this.root=new Uh;this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||sn.empty()}get entries(){return this.root.children?.entries()||sn.empty()}insert(t,e,n){this.opNode(t,o=>o._value=e,n)}mutate(t,e){this.opNode(t,n=>n._value=e(n._value===Ko?void 0:n._value))}mutatePath(t,e){this.opNode(t,()=>{},n=>e(n))}delete(t){let e=this.getPathToKey(t);if(!e)return;let n=e.length-1,o=e[n].node._value;if(o!==Ko){for(this._size--,e[n].node._value=Ko;n>0;n--){let{node:i,part:s}=e[n];if(i.children?.size||i._value!==Ko)break;e[n-1].node.children.delete(s)}return o}}*deleteRecursive(t){let e=this.getPathToKey(t);if(!e)return;let n=e[e.length-1].node;for(let o=e.length-1;o>0;o--){let i=e[o-1];if(i.node.children.delete(e[o].part),i.node.children.size>0||i.node._value!==Ko)break}for(let o of uV(n))o._value!==Ko&&(this._size--,yield o._value);n===this.root&&(this.root._value=Ko,this.root.children=void 0)}find(t){let e=this.root;for(let n of t){let o=e.children?.get(n);if(!o)return;e=o}return e._value===Ko?void 0:e._value}hasKeyOrParent(t){let e=this.root;for(let n of t){let o=e.children?.get(n);if(!o)return!1;if(o._value!==Ko)return!0;e=o}return!1}hasKeyOrChildren(t){let e=this.root;for(let n of t){let o=e.children?.get(n);if(!o)return!1;e=o}return!0}hasKey(t){let e=this.root;for(let n of t){let o=e.children?.get(n);if(!o)return!1;e=o}return e._value!==Ko}getPathToKey(t){let e=[{part:"",node:this.root}],n=0;for(let o of t){let i=e[n].node.children?.get(o);if(!i)return;e.push({part:o,node:i}),n++}return e}opNode(t,e,n){let o=this.root;for(let a of t){if(o.children)if(o.children.has(a))o=o.children.get(a);else{let l=new Uh;o.children.set(a,l),o=l}else{let l=new Uh;o.children=new Map([[a,l]]),o=l}n?.(o)}let i=o._value===Ko?0:1;e(o);let s=o._value===Ko?0:1;this._size+=s-i}*values(){for(let{_value:t}of uV(this.root))t!==Ko&&(yield t)}};Uh=class{constructor(){this._value=Ko}get value(){return this._value===Ko?void 0:this._value}set value(t){this._value=t===void 0?Ko:t}}});var mV=v(()=>{ue();Q()});var gV,fV=v(()=>{ue();gV=new class{constructor(){this._zoomLevel=0;this._onDidChangeZoomLevel=new R;this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(r){r=Math.min(Math.max(-5,r),20),this._zoomLevel!==r&&(this._zoomLevel=r,this._onDidChangeZoomLevel.fire(this._zoomLevel))}}});var nX,dA,uA,oX,_x,pA,mA,rX,iX,sX,qi,hV=v(()=>{fe();fV();nX=vt?1.5:1.35,dA=8,uA=class r{constructor(t){this._bareFontInfoBrand=void 0;this.pixelRatio=t.pixelRatio,this.fontFamily=String(t.fontFamily),this.fontWeight=String(t.fontWeight),this.fontSize=t.fontSize,this.fontFeatureSettings=t.fontFeatureSettings,this.fontVariationSettings=t.fontVariationSettings,this.lineHeight=t.lineHeight|0,this.letterSpacing=t.letterSpacing}static _create(t,e,n,o,i,s,a,l,c){s===0?s=nX*n:s<dA&&(s=s*n),s=Math.round(s),s<dA&&(s=dA);let u=1+(c?0:gV.getZoomLevel()*.1);return n*=u,s*=u,i===mA&&(e==="normal"||e==="bold"?i=pA:(i=`'wght' ${parseInt(e,10)}`,e="normal")),new r({pixelRatio:l,fontFamily:t,fontWeight:e,fontSize:n,fontFeatureSettings:o,fontVariationSettings:i,lineHeight:s,letterSpacing:a})}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=qi.fontFamily,e=r._wrapInQuotes(this.fontFamily);return t&&this.fontFamily!==t?`${e}, ${t}`:e}static _wrapInQuotes(t){return/[,"']/.test(t)?t:/[+ ]/.test(t)?`"${t}"`:t}},oX=2,_x=class extends uA{constructor(e,n){super(e);this._editorStylingBrand=void 0;this.version=oX;this.isTrusted=n,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}},pA="normal",mA="translate",rX="Consolas, 'Courier New', monospace",iX="Menlo, Monaco, 'Courier New', monospace",sX="'Droid Sans Mono', monospace",qi={fontFamily:vt?iX:oe?rX:sX,fontWeight:"normal",fontSize:vt?12:14,lineHeight:0,letterSpacing:0}});var gA,yV=v(()=>{gA={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}}});function aX(r=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(let e of fA)r.indexOf(e)>=0||(t+="\\"+e);return t+="\\s]+)",new RegExp(t,"g")}var fA,xWe,lX,vV=v(()=>{ri();Q();xv();fA="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";xWe=aX(),lX=new qa;lX.unshift({maxLen:1e3,windowSize:15,timeBudget:150})});var RWe,TWe,IV=v(()=>{ro();Z();RWe=A("accessibilityService"),TWe=new C("accessibilityModeEnabled",!1)});function Mx(r,t){if(typeof r!="object"||typeof t!="object"||!r||!t)return new tm(t,r!==t);if(Array.isArray(r)||Array.isArray(t)){let n=Array.isArray(r)&&Array.isArray(t)&&Gt(r,t);return new tm(t,!n)}let e=!1;for(let n in t)if(t.hasOwnProperty(n)){let o=Mx(r[n],t[n]);o.didChange&&(r[n]=o.newValue,e=!0)}return new tm(r,e)}function ce(r,t){return typeof r>"u"?t:r==="false"?!1:!!r}function dX(r,t,e,n){if(typeof r=="string"&&(r=parseInt(r,10)),typeof r!="number"||isNaN(r))return t;let o=r;return o=Math.max(e,o),o=Math.min(n,o),o|0}function kt(r,t,e,n){return typeof r!="string"?t:n&&r in n?n[r]:e.indexOf(r)===-1?t:r}function uX(r){switch(r){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}function pX(r){switch(r){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}function bV(r){switch(r){case"line":return 1;case"block":return 2;case"underline":return 3;case"line-thin":return 4;case"block-outline":return 5;case"underline-thin":return 6}}function mX(r){try{let t=new URL(r).origin;return t==="null"?void 0:t}catch{return}}function gX(r){return r==="ctrlCmd"?vt?"metaKey":"ctrlKey":"altKey"}function SV(r,t){if(typeof r!="string")return t;switch(r){case"hidden":return 2;case"visible":return 3;default:return 1}}function nm(r,t,e){let n=e.indexOf(r);return n===-1?t:e[n]}function _(r){return fX[r.id]=r,r}var cX,hA,Rt,tm,zi,Vl,Se,nt,Pr,Eo,Ct,sd,yA,vA,IA,bA,SA,xA,CA,EA,wA,RA,TA,PA,kA,AA,DA,_A,MA,LA,OA,UA,NA,FA,HA,WA,VA,BA,qA,$A,zA,GA,KA,jA,QA,JA,$i,id,YA,XA,ZA,eD,tD,nD,oD,rD,iD,sD,aD,fX,NWe,xV=v(()=>{Dt();Xt();fe();mV();nR();hV();yV();vV();ee();IV();cX=8,hA=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},Rt=class{constructor(t,e,n,o){this.id=t,this.name=e,this.defaultValue=n,this.schema=o}applyUpdate(t,e){return Mx(t,e)}compute(t,e,n){return n}},tm=class{constructor(t,e){this.newValue=t;this.didChange=e}};zi=class{constructor(t,e){this.schema=void 0;this.id=t,this.name="_never_",this.defaultValue=e}applyUpdate(t,e){return Mx(t,e)}validate(t){return this.defaultValue}},Vl=class{constructor(t,e,n,o){this.id=t,this.name=e,this.defaultValue=n,this.schema=o}applyUpdate(t,e){return Mx(t,e)}compute(t,e,n){return n}};Se=class extends Vl{constructor(t,e,n,o=void 0){typeof o<"u"&&(o.type="boolean",o.default=n),super(t,e,n,o)}validate(t){return ce(t,this.defaultValue)}};nt=class r extends Vl{static clampedInt(t,e,n,o){return dX(t,e,n,o)}constructor(t,e,n,o,i,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=o,s.maximum=i),super(t,e,n,s),this.minimum=o,this.maximum=i}validate(t){return r.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}},Pr=class r extends Vl{static clamp(t,e,n){return t<e?e:t>n?n:t}static float(t,e){return typeof t=="string"&&(t=parseFloat(t)),typeof t!="number"||isNaN(t)?e:t}constructor(t,e,n,o,i,s,a){typeof i<"u"&&(i.type="number",i.default=n,i.minimum=s,i.maximum=a),super(t,e,n,i),this.validationFn=o,this.minimum=s,this.maximum=a}validate(t){return this.validationFn(r.float(t,this.defaultValue))}},Eo=class r extends Vl{static string(t,e){return typeof t!="string"?e:t}constructor(t,e,n,o=void 0){typeof o<"u"&&(o.type="string",o.default=n),super(t,e,n,o)}validate(t){return r.string(t,this.defaultValue)}};Ct=class extends Vl{constructor(t,e,n,o,i=void 0){typeof i<"u"&&(i.type="string",i.enum=o.slice(0),i.default=n),super(t,e,n,i),this._allowedValues=o}validate(t){return kt(t,this.defaultValue,this._allowedValues)}},sd=class extends Rt{constructor(t,e,n,o,i,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=i,a.default=o),super(t,e,n,a),this._allowedValues=i,this._convert=s}validate(t){return typeof t!="string"?this.defaultValue:this._allowedValues.indexOf(t)===-1?this.defaultValue:this._convert(t)}};yA=class extends Rt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[d(319,null),d(321,null),d(320,null)],default:"auto",tags:["accessibility"],description:d(318,null)})}validate(t){switch(t){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(t,e,n){return n===0?t.accessibilitySupport:n}},vA=class extends Rt{constructor(){let t={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",t,{"editor.comments.insertSpace":{type:"boolean",default:t.insertSpace,description:d(349,null)},"editor.comments.ignoreEmptyLines":{type:"boolean",default:t.ignoreEmptyLines,description:d(348,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{insertSpace:ce(e.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ce(e.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};IA=class extends zi{constructor(){super(166,"")}compute(t,e,n){let o=["monaco-editor"];return e.get(48)&&o.push(e.get(48)),t.extraEditorClassName&&o.push(t.extraEditorClassName),e.get(83)==="default"?o.push("mouse-default"):e.get(83)==="copy"&&o.push("mouse-copy"),e.get(130)&&o.push("showUnused"),e.get(160)&&o.push("showDeprecated"),o.join(" ")}},bA=class extends Se{constructor(){super(45,"emptySelectionClipboard",!0,{description:d(472,null)})}compute(t,e,n){return n&&t.emptySelectionClipboard}},SA=class extends Rt{constructor(){let t={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,closeOnResult:!1,history:"workspace",replaceHistory:"workspace"};super(50,"find",t,{"editor.find.cursorMoveOnType":{type:"boolean",default:t.cursorMoveOnType,description:d(485,null)},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:t.seedSearchStringFromSelection,enumDescriptions:[d(408,null),d(407,null),d(409,null)],description:d(491,null)},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:t.autoFindInSelection,enumDescriptions:[d(402,null),d(400,null),d(401,null)],description:d(483,null)},"editor.find.globalFindClipboard":{type:"boolean",default:t.globalFindClipboard,description:d(487,null),included:vt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:t.addExtraSpaceOnTop,description:d(482,null)},"editor.find.loop":{type:"boolean",default:t.loop,description:d(489,null)},"editor.find.closeOnResult":{type:"boolean",default:t.closeOnResult,description:d(484,null)},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[d(403,null),d(404,null)],description:d(488,null)},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[d(405,null),d(406,null)],description:d(490,null)},"editor.find.findOnType":{type:"boolean",default:t.findOnType,description:d(486,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{cursorMoveOnType:ce(e.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:ce(e.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":kt(e.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":kt(e.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ce(e.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ce(e.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ce(e.loop,this.defaultValue.loop),closeOnResult:ce(e.closeOnResult,this.defaultValue.closeOnResult),history:kt(e.history,this.defaultValue.history,["never","workspace"]),replaceHistory:kt(e.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}},xA=class r extends Rt{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",r.OFF,{anyOf:[{type:"boolean",description:d(501,null)},{type:"string",description:d(500,null)}],description:d(502,null),default:!1})}validate(t){return typeof t>"u"?this.defaultValue:typeof t=="string"?t==="false"||t.length===0?r.OFF:t==="true"?r.ON:t:t?r.ON:r.OFF}},CA=class r extends Rt{static{this.OFF=pA}static{this.TRANSLATE=mA}constructor(){super(63,"fontVariations",r.OFF,{anyOf:[{type:"boolean",description:d(504,null)},{type:"string",description:d(505,null)}],description:d(506,null),default:!1})}validate(t){return typeof t>"u"?this.defaultValue:typeof t=="string"?t==="false"?r.OFF:t==="true"?r.TRANSLATE:t:t?r.TRANSLATE:r.OFF}compute(t,e,n){return t.fontInfo.fontVariationSettings}},EA=class extends zi{constructor(){super(59,new _x({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(t,e,n){return t.fontInfo}},wA=class extends zi{constructor(){super(165,1)}compute(t,e,n){return t.inputMode==="overtype"?e.get(94):e.get(34)}},RA=class extends zi{constructor(){super(174,!1)}compute(t,e){return t.editContextSupported&&e.get(44)}},TA=class extends zi{constructor(){super(176,!1)}compute(t,e){return t.accessibilitySupport===2?e.get(7):e.get(6)}},PA=class extends zi{constructor(){super(179,"font")}compute(t,e){return e.get(178)==="twoCells"&&t.fontInfo.isMonospace?"twoCells":"font"}},kA=class extends Vl{constructor(){super(61,"fontSize",qi.fontSize,{type:"number",minimum:6,maximum:100,default:qi.fontSize,description:d(503,null)})}validate(t){let e=Pr.float(t,this.defaultValue);return e===0?qi.fontSize:Pr.clamp(e,6,100)}compute(t,e,n){return t.fontInfo.fontSize}},AA=class r extends Rt{static{this.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,"fontWeight",qi.fontWeight,{anyOf:[{type:"number",minimum:r.MINIMUM_VALUE,maximum:r.MAXIMUM_VALUE,errorMessage:d(508,null)},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:r.SUGGESTION_VALUES}],default:qi.fontWeight,description:d(507,null)})}validate(t){return t==="normal"||t==="bold"?t:String(nt.clampedInt(t,qi.fontWeight,r.MINIMUM_VALUE,r.MAXIMUM_VALUE))}},DA=class extends Rt{constructor(){let t={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},e={type:"string",enum:["peek","gotoAndPeek","goto"],default:t.multiple,enumDescriptions:[d(413,null),d(412,null),d(411,null)]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",t,{"editor.gotoLocation.multiple":{deprecationMessage:d(410,null)},"editor.gotoLocation.multipleDefinitions":{description:d(396,null),...e},"editor.gotoLocation.multipleTypeDefinitions":{description:d(399,null),...e},"editor.gotoLocation.multipleDeclarations":{description:d(395,null),...e},"editor.gotoLocation.multipleImplementations":{description:d(397,null),...e},"editor.gotoLocation.multipleReferences":{description:d(398,null),...e},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:t.alternativeDefinitionCommand,enum:n,description:d(326,null)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:t.alternativeTypeDefinitionCommand,enum:n,description:d(329,null)},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:t.alternativeDeclarationCommand,enum:n,description:d(325,null)},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:t.alternativeImplementationCommand,enum:n,description:d(327,null)},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:t.alternativeReferenceCommand,enum:n,description:d(328,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{multiple:kt(e.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:kt(e.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:kt(e.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:kt(e.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:kt(e.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:kt(e.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:kt(e.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Eo.string(e.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Eo.string(e.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Eo.string(e.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Eo.string(e.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Eo.string(e.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Eo.string(e.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},_A=class extends Rt{constructor(){let t={enabled:"on",delay:300,hidingDelay:300,sticky:!0,above:!0,showLongLineWarning:!0};super(69,"hover",t,{"editor.hover.enabled":{type:"string",enum:["on","off","onKeyboardModifier"],default:t.enabled,markdownEnumDescriptions:[d(520,null),d(519,null),d(521,null,vt?"Command":"Control")],description:d(518,null),keywords:["hint","info","tooltip"]},"editor.hover.delay":{type:"number",default:t.delay,minimum:0,maximum:1e4,description:d(517,null)},"editor.hover.sticky":{type:"boolean",default:t.sticky,description:d(524,null)},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:t.hidingDelay,markdownDescription:d(522,null)},"editor.hover.above":{type:"boolean",default:t.above,description:d(516,null)},"editor.hover.showLongLineWarning":{type:"boolean",default:t.showLongLineWarning,description:d(523,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:kt(e.enabled,this.defaultValue.enabled,["on","off","onKeyboardModifier"]),delay:nt.clampedInt(e.delay,this.defaultValue.delay,0,1e4),sticky:ce(e.sticky,this.defaultValue.sticky),hidingDelay:nt.clampedInt(e.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:ce(e.above,this.defaultValue.above),showLongLineWarning:ce(e.showLongLineWarning,this.defaultValue.showLongLineWarning)}}};MA=class extends Rt{constructor(){super(80,"markdownImages",{allowedOrigins:!0})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;if(e.allowedOrigins===!0)return{allowedOrigins:!0};if(!Array.isArray(e.allowedOrigins))return this.defaultValue;let n=[];for(let o of e.allowedOrigins){let i=typeof o=="string"?mX(o):void 0;i!==void 0&&!n.includes(i)&&n.push(i)}return{allowedOrigins:n}}},LA=class r extends zi{constructor(){super(169,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,e,n){return r.computeLayout(e,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(t){let e=t.height/t.lineHeight,n=Math.floor(t.paddingTop/t.lineHeight),o=Math.floor(t.paddingBottom/t.lineHeight);t.scrollBeyondLastLine&&(o=Math.max(o,e-1));let i=(n+t.viewLineCount+o)/(t.pixelRatio*t.height),s=Math.floor(t.viewLineCount/i);return{typicalViewportLineCount:e,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:o,desiredRatio:i,minimapLineCount:s}}static _computeMinimapScale(t,e){return e>=2?Math.round(t*2):Math.max(t,Math.floor(t*e+.125))}static _computeMinimapLayout(t,e){let n=t.outerWidth,o=t.outerHeight,i=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(i*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};let s=e.stableMinimapLayoutInput,a=s&&t.outerHeight===s.outerHeight&&t.lineHeight===s.lineHeight&&t.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&t.pixelRatio===s.pixelRatio&&t.scrollBeyondLastLine===s.scrollBeyondLastLine&&t.paddingTop===s.paddingTop&&t.paddingBottom===s.paddingBottom&&t.minimap.enabled===s.minimap.enabled&&t.minimap.side===s.minimap.side&&t.minimap.size===s.minimap.size&&t.minimap.showSlider===s.minimap.showSlider&&t.minimap.renderCharacters===s.minimap.renderCharacters&&t.minimap.maxColumn===s.minimap.maxColumn&&t.minimap.scale===s.minimap.scale&&t.verticalScrollbarWidth===s.verticalScrollbarWidth&&t.isViewportWrapping===s.isViewportWrapping,l=t.lineHeight,c=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,p=t.minimap.renderCharacters,m=r._computeMinimapScale(t.minimap.scale,i),g=t.minimap.maxColumn,y=t.minimap.size,h=t.minimap.side,I=t.verticalScrollbarWidth,x=t.viewLineCount,E=t.remainingWidth,T=t.isViewportWrapping,P=p?2:3,M=Math.floor(i*o),X=M/i,N=!1,ae=!1,Y=P*m,W=m/i,J=1;if(y==="fill"||y==="fit"){let{typicalViewportLineCount:K,extraLinesBeforeFirstLine:V,extraLinesBeyondLastLine:le,desiredRatio:me,minimapLineCount:dt}=r.computeContainedMinimapLineCount({viewLineCount:x,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:o,lineHeight:l,pixelRatio:i});if(x/dt>1)N=!0,ae=!0,m=1,Y=1,W=m/i;else{let et=!1,lt=m+1;if(y==="fit"){let Lt=Math.ceil((V+x+le)*Y);T&&a&&E<=e.stableFitRemainingWidth?(et=!0,lt=e.stableFitMaxMinimapScale):et=Lt>M}if(y==="fill"||et){N=!0;let Lt=m;Y=Math.min(l*i,Math.max(1,Math.floor(1/me))),T&&a&&E<=e.stableFitRemainingWidth&&(lt=e.stableFitMaxMinimapScale),m=Math.min(lt,Math.max(1,Math.floor(Y/P))),m>Lt&&(J=Math.min(2,m/Lt)),W=m/i/J,M=Math.ceil(Math.max(K,V+x+le)*Y),T?(e.stableMinimapLayoutInput=t,e.stableFitRemainingWidth=E,e.stableFitMaxMinimapScale=m):(e.stableMinimapLayoutInput=null,e.stableFitRemainingWidth=0)}}}let we=Math.floor(g*W),In=Math.min(we,Math.max(0,Math.floor((E-I-2)*W/(c+W)))+cX),Wt=Math.floor(i*In),de=Wt/i;Wt=Math.floor(Wt*J);let j=p?1:2,ie=h==="left"?0:n-In-I;return{renderMinimap:j,minimapLeft:ie,minimapWidth:In,minimapHeightIsEditorHeight:N,minimapIsSampling:ae,minimapScale:m,minimapLineHeight:Y,minimapCanvasInnerWidth:Wt,minimapCanvasInnerHeight:M,minimapCanvasOuterWidth:de,minimapCanvasOuterHeight:X}}static computeLayout(t,e){let n=e.outerWidth|0,o=e.outerHeight|0,i=e.lineHeight|0,s=e.lineNumbersDigitCount|0,a=e.typicalHalfwidthCharacterWidth,l=e.maxDigitWidth,c=e.pixelRatio,u=e.viewLineCount,p=t.get(157),m=p==="inherit"?t.get(156):p,g=m==="inherit"?t.get(152):m,y=t.get(155),h=t.get(164),I=e.isDominatedByLongLines,x=t.get(66),E=t.get(76).renderType!==0,T=t.get(77),P=t.get(121),M=t.get(98),X=t.get(82),N=t.get(119),ae=N.verticalScrollbarSize,Y=N.verticalHasArrows,W=N.arrowSize,J=N.horizontalScrollbarSize,we=t.get(52),In=t.get(129)!=="never",Wt=t.get(74);we&&In&&(Wt+=16);let de=0;if(E){let Zi=Math.max(s,T);de=Math.round(Zi*l)}let j=0;x&&(j=i*e.glyphMarginDecorationLaneCount);let ie=0,K=ie+j,V=K+de,le=V+Wt,me=n-j-de-Wt,dt=!1,We=!1,et=-1;t.get(2)===2&&m==="inherit"&&I?(dt=!0,We=!0):g==="on"||g==="bounded"?We=!0:g==="wordWrapColumn"&&(et=y);let lt=r._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:i,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:P,paddingTop:M.top,paddingBottom:M.bottom,minimap:X,verticalScrollbarWidth:ae,viewLineCount:u,remainingWidth:me,isViewportWrapping:We},e.memory||new hA);lt.renderMinimap!==0&<.minimapLeft===0&&(ie+=lt.minimapWidth,K+=lt.minimapWidth,V+=lt.minimapWidth,le+=lt.minimapWidth);let Lt=me-lt.minimapWidth,zt=Math.max(1,Math.floor((Lt-ae-2)/a)),mo=Y?W:0;return We&&(et=Math.max(1,zt-(h?1:0)),g==="bounded"&&(et=Math.min(et,y))),{width:n,height:o,glyphMarginLeft:ie,glyphMarginWidth:j,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount,lineNumbersLeft:K,lineNumbersWidth:de,decorationsLeft:V,decorationsWidth:Wt,contentLeft:le,contentWidth:Lt,minimap:lt,viewportColumn:zt,isWordWrapMinified:dt,isViewportWrapping:We,wrappingColumn:et,verticalScrollbarWidth:ae,horizontalScrollbarHeight:J,overviewRuler:{top:mo,width:ae,height:o-2*mo,right:0}}}},OA=class extends Rt{constructor(){super(159,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[d(743,null),d(742,null)],type:"string",enum:["simple","advanced"],default:"simple",description:d(741,null)}})}validate(t){return kt(t,"simple",["simple","advanced"])}compute(t,e,n){return e.get(2)===2?"advanced":n}},UA=class extends Rt{constructor(){let t={enabled:"onCode"};super(73,"lightbulb",t,{"editor.lightbulb.enabled":{type:"string",enum:["off","onCode","on"],default:t.enabled,enumDescriptions:[d(434,null),d(436,null),d(435,null)],description:d(473,null)}})}validate(t){return!t||typeof t!="object"?this.defaultValue:{enabled:kt(t.enabled,this.defaultValue.enabled,["off","onCode","on"])}}},NA=class extends Rt{constructor(){let t={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(134,"stickyScroll",t,{"editor.stickyScroll.enabled":{type:"boolean",default:t.enabled,description:d(438,null)},"editor.stickyScroll.maxLineCount":{type:"number",default:t.maxLineCount,minimum:1,maximum:20,description:d(439,null)},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:t.defaultModel,description:d(437,null)},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:t.scrollWithEditor,description:d(440,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ce(e.enabled,this.defaultValue.enabled),maxLineCount:nt.clampedInt(e.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:kt(e.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:ce(e.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},FA=class extends Rt{constructor(){let t={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(162,"inlayHints",t,{"editor.inlayHints.enabled":{type:"string",default:t.enabled,description:d(526,null),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[d(430,null),d(431,null,vt?"Ctrl+Option":"Ctrl+Alt"),d(429,null,vt?"Ctrl+Option":"Ctrl+Alt"),d(428,null)]},"editor.inlayHints.fontSize":{type:"number",default:t.fontSize,markdownDescription:d(528,null,"`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:t.fontFamily,markdownDescription:d(527,null,"`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:t.padding,description:d(530,null)},"editor.inlayHints.maximumLength":{type:"number",default:t.maximumLength,markdownDescription:d(529,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return typeof e.enabled=="boolean"&&(e.enabled=e.enabled?"on":"off"),{enabled:kt(e.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:nt.clampedInt(e.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Eo.string(e.fontFamily,this.defaultValue.fontFamily),padding:ce(e.padding,this.defaultValue.padding),maximumLength:nt.clampedInt(e.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}},HA=class extends Rt{constructor(){super(74,"lineDecorationsWidth",10)}validate(t){return typeof t=="string"&&/^\d+(\.\d+)?ch$/.test(t)?-parseFloat(t.substring(0,t.length-2)):nt.clampedInt(t,this.defaultValue,0,1e3)}compute(t,e,n){return n<0?nt.clampedInt(-n*t.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},WA=class extends Pr{constructor(){super(75,"lineHeight",qi.lineHeight,t=>Pr.clamp(t,0,150),{markdownDescription:d(553,null)},0,150)}compute(t,e,n){return t.fontInfo.lineHeight}},VA=class extends Rt{constructor(){let t={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(82,"minimap",t,{"editor.minimap.enabled":{type:"boolean",default:t.enabled,description:d(566,null)},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[d(564,null),d(563,null),d(565,null)],default:t.autohide,description:d(562,null)},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[d(580,null),d(578,null),d(579,null)],default:t.size,description:d(577,null)},"editor.minimap.side":{type:"string",enum:["left","right"],default:t.side,description:d(576,null)},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:t.showSlider,description:d(575,null)},"editor.minimap.scale":{type:"number",default:t.scale,minimum:1,maximum:3,enum:[1,2,3],description:d(570,null)},"editor.minimap.renderCharacters":{type:"boolean",default:t.renderCharacters,description:d(569,null)},"editor.minimap.maxColumn":{type:"number",default:t.maxColumn,description:d(568,null)},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:t.showRegionSectionHeaders,description:d(574,null)},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:t.showMarkSectionHeaders,description:d(573,null)},"editor.minimap.markSectionHeaderRegex":{type:"string",default:t.markSectionHeaderRegex,description:d(567,null)},"editor.minimap.sectionHeaderFontSize":{type:"number",default:t.sectionHeaderFontSize,description:d(571,null)},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:t.sectionHeaderLetterSpacing,description:d(572,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t,n=this.defaultValue.markSectionHeaderRegex,o=e.markSectionHeaderRegex;if(typeof o=="string")try{new RegExp(o,"d"),n=o}catch{}return{enabled:ce(e.enabled,this.defaultValue.enabled),autohide:kt(e.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:kt(e.size,this.defaultValue.size,["proportional","fill","fit"]),side:kt(e.side,this.defaultValue.side,["right","left"]),showSlider:kt(e.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ce(e.renderCharacters,this.defaultValue.renderCharacters),scale:nt.clampedInt(e.scale,1,1,3),maxColumn:nt.clampedInt(e.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:ce(e.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:ce(e.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:Pr.clamp(Pr.float(e.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:Pr.clamp(Pr.float(e.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};BA=class extends Rt{constructor(){super(98,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:d(606,null)},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:d(605,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{top:nt.clampedInt(e.top,0,0,1e3),bottom:nt.clampedInt(e.bottom,0,0,1e3)}}},qA=class extends Rt{constructor(){let t={enabled:!0,cycle:!0};super(100,"parameterHints",t,{"editor.parameterHints.enabled":{type:"boolean",default:t.enabled,description:d(608,null)},"editor.parameterHints.cycle":{type:"boolean",default:t.cycle,description:d(607,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ce(e.enabled,this.defaultValue.enabled),cycle:ce(e.cycle,this.defaultValue.cycle)}}},$A=class extends zi{constructor(){super(167,1)}compute(t,e,n){return t.pixelRatio}},zA=class extends Rt{constructor(){super(102,"placeholder",void 0)}validate(t){return typeof t>"u"?this.defaultValue:typeof t=="string"?t:this.defaultValue}},GA=class extends Rt{constructor(){let t={other:"offWhenInlineCompletions",comments:"off",strings:"off"},e=[{type:"boolean"},{type:"string",enum:["on","inline","off","offWhenInlineCompletions"],enumDescriptions:[d(601,null),d(531,null),d(599,null),d(600,null)]}];super(104,"quickSuggestions",t,{anyOf:[{type:"boolean"},{type:"string",enum:["on","inline","off","offWhenInlineCompletions"],enumDescriptions:[d(623,null),d(620,null),d(621,null),d(622,null)]},{type:"object",additionalProperties:!1,properties:{strings:{anyOf:e,default:t.strings,description:d(619,null)},comments:{anyOf:e,default:t.comments,description:d(617,null)},other:{anyOf:e,default:t.other,description:d(618,null)}}}],default:t,markdownDescription:d(616,null,"`#editor.suggestOnTriggerCharacters#`"),experiment:{mode:"auto"}}),this.defaultValue=t}validate(t){if(typeof t=="boolean"){let c=t?"on":"off";return{comments:c,strings:c,other:c}}if(typeof t=="string"){let c=["on","inline","off","offWhenInlineCompletions"],u=kt(t,this.defaultValue.other,c);return{comments:u,strings:u,other:u}}if(!t||typeof t!="object")return this.defaultValue;let{other:e,comments:n,strings:o}=t,i=["on","inline","off","offWhenInlineCompletions"],s,a,l;return typeof e=="boolean"?s=e?"on":"off":s=kt(e,this.defaultValue.other,i),typeof n=="boolean"?a=n?"on":"off":a=kt(n,this.defaultValue.comments,i),typeof o=="boolean"?l=o?"on":"off":l=kt(o,this.defaultValue.strings,i),{other:s,comments:a,strings:l}}},KA=class extends Rt{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[d(556,null),d(557,null),d(558,null),d(555,null)],default:"on",description:d(554,null)})}validate(t){let e=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof t<"u"&&(typeof t=="function"?(e=4,n=t):t==="interval"?e=3:t==="relative"?e=2:t==="on"?e=1:e=0),{renderType:e,renderFn:n}}},jA=class extends Rt{constructor(){let t=[],e={type:"number",description:d(640,null)};super(118,"rulers",t,{type:"array",items:{anyOf:[e,{type:["object"],properties:{column:e,color:{type:"string",description:d(639,null),format:"color-hex"}}}]},default:t,description:d(638,null)})}validate(t){if(Array.isArray(t)){let e=[];for(let n of t)if(typeof n=="number")e.push({column:nt.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){let o=n;e.push({column:nt.clampedInt(o.column,0,0,1e4),color:o.color})}return e.sort((n,o)=>n.column-o.column),e}return this.defaultValue}},QA=class extends Rt{constructor(){super(107,"readOnlyMessage",void 0)}validate(t){return!t||typeof t!="object"?this.defaultValue:t}};JA=class extends Rt{constructor(){let t={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(119,"scrollbar",t,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[d(650,null),d(652,null),d(651,null)],default:"auto",description:d(649,null)},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[d(643,null),d(645,null),d(644,null)],default:"auto",description:d(642,null)},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:t.verticalScrollbarSize,description:d(653,null)},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:t.horizontalScrollbarSize,description:d(646,null)},"editor.scrollbar.scrollByPage":{type:"boolean",default:t.scrollByPage,description:d(648,null)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:t.ignoreHorizontalScrollbarInContentHeight,description:d(647,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t,n=nt.clampedInt(e.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=nt.clampedInt(e.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:nt.clampedInt(e.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:SV(e.vertical,this.defaultValue.vertical),horizontal:SV(e.horizontal,this.defaultValue.horizontal),useShadows:ce(e.useShadows,this.defaultValue.useShadows),verticalHasArrows:ce(e.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ce(e.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ce(e.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ce(e.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:nt.clampedInt(e.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:o,verticalSliderSize:nt.clampedInt(e.verticalSliderSize,o,0,1e3),scrollByPage:ce(e.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:ce(e.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},$i="inUntrustedWorkspace",id={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"},YA=class extends Rt{constructor(){let t={nonBasicASCII:$i,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:$i,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(145,"unicodeHighlight",t,{[id.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,$i],default:t.nonBasicASCII,description:d(717,null)},[id.invisibleCharacters]:{restricted:!0,type:"boolean",default:t.invisibleCharacters,description:d(716,null)},[id.ambiguousCharacters]:{restricted:!0,type:"boolean",default:t.ambiguousCharacters,description:d(713,null)},[id.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,$i],default:t.includeComments,description:d(714,null)},[id.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,$i],default:t.includeStrings,description:d(715,null)},[id.allowedCharacters]:{restricted:!0,type:"object",default:t.allowedCharacters,description:d(711,null),additionalProperties:{type:"boolean"}},[id.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:t.allowedLocales,description:d(712,null)}})}applyUpdate(t,e){let n=!1;e.allowedCharacters&&t&&(Ge(t.allowedCharacters,e.allowedCharacters)||(t={...t,allowedCharacters:e.allowedCharacters},n=!0)),e.allowedLocales&&t&&(Ge(t.allowedLocales,e.allowedLocales)||(t={...t,allowedLocales:e.allowedLocales},n=!0));let o=super.applyUpdate(t,e);return n?new tm(o.newValue,!0):o}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{nonBasicASCII:nm(e.nonBasicASCII,$i,[!0,!1,$i]),invisibleCharacters:ce(e.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ce(e.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:nm(e.includeComments,$i,[!0,!1,$i]),includeStrings:nm(e.includeStrings,$i,[!0,!1,$i]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(t,e){if(typeof t!="object"||!t)return e;let n={};for(let[o,i]of Object.entries(t))i===!0&&(n[o]=!0);return n}},XA=class extends Rt{constructor(){let t={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always",showLongDistanceHint:!0,longDistanceHintContextLineCount:0},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",t,{"editor.inlineSuggest.enabled":{type:"boolean",default:t.enabled,description:d(539,null)},"editor.inlineSuggest.showToolbar":{type:"string",default:t.showToolbar,enum:["always","onHover","never"],enumDescriptions:[d(544,null),d(546,null),d(545,null)],description:d(543,null)},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:t.syntaxHighlightingEnabled,description:d(550,null)},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:t.suppressSuggestions,description:d(549,null)},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:t.suppressInSnippetMode,description:d(548,null)},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:d(541,null)},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:t.experimental.suppressInlineSuggestions,tags:["experimental"],description:d(547,null),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:t.experimental.emptyResponseInformation,tags:["experimental"],description:d(538,null),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:t.triggerCommandOnProviderChange,tags:["experimental"],description:d(551,null),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:t.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:d(542,null),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:t.fontFamily,restricted:!0,description:d(540,null)},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:t.edits.allowCodeShifting,description:d(533,null),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showLongDistanceHint":{type:"boolean",default:t.edits.showLongDistanceHint,description:d(537,null),tags:["nextEditSuggestions","experimental"]},"editor.inlineSuggest.edits.longDistanceHintContextLineCount":{type:"number",default:t.edits.longDistanceHintContextLineCount,minimum:0,maximum:10,description:d(534,null),tags:["nextEditSuggestions","experimental"],experiment:{mode:"auto"}},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:t.edits.renderSideBySide,description:d(535,null),enum:["auto","never"],enumDescriptions:[d(432,null),d(433,null)],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:t.edits.showCollapsed,description:d(536,null),tags:["nextEditSuggestions"]}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ce(e.enabled,this.defaultValue.enabled),mode:kt(e.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:kt(e.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:ce(e.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ce(e.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Eo.string(e.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:ce(e.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:nt.clampedInt(e.minShowDelay,0,0,1e4),suppressInSnippetMode:ce(e.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(e.edits),triggerCommandOnProviderChange:ce(e.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(e.experimental)}}_validateEdits(t){if(!t||typeof t!="object")return this.defaultValue.edits;let e=t;return{enabled:ce(e.enabled,this.defaultValue.edits.enabled),showCollapsed:ce(e.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:kt(e.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),showLongDistanceHint:ce(e.showLongDistanceHint,this.defaultValue.edits.showLongDistanceHint),longDistanceHintContextLineCount:nt.clampedInt(e.longDistanceHintContextLineCount,this.defaultValue.edits.longDistanceHintContextLineCount,0,10),renderSideBySide:kt(e.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])}}_validateExperimental(t){if(!t||typeof t!="object")return this.defaultValue.experimental;let e=t;return{suppressInlineSuggestions:Eo.string(e.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:kt(e.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:ce(e.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},ZA=class extends Rt{constructor(){let t={enabled:gA.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:gA.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",t,{"editor.bracketPairColorization.enabled":{type:"boolean",default:t.enabled,markdownDescription:d(339,null,"`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:t.independentColorPoolPerBracketType,description:d(340,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ce(e.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ce(e.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},eD=class extends Rt{constructor(){let t={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",t,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[d(417,null),d(415,null),d(416,null)],default:t.bracketPairs,description:d(414,null)},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[d(421,null),d(419,null),d(420,null)],default:t.bracketPairsHorizontal,description:d(418,null)},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:t.highlightActiveBracketPair,description:d(422,null)},"editor.guides.indentation":{type:"boolean",default:t.indentation,description:d(427,null)},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[d(426,null),d(424,null),d(425,null)],default:t.highlightActiveIndentation,description:d(423,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{bracketPairs:nm(e.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:nm(e.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ce(e.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ce(e.indentation,this.defaultValue.indentation),highlightActiveIndentation:nm(e.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}};tD=class extends Rt{constructor(){let t={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,fitWidthToDetails:!1,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(137,"suggest",t,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[d(684,null),d(686,null)],default:t.insertMode,description:d(682,null)},"editor.suggest.filterGraceful":{type:"boolean",default:t.filterGraceful,description:d(681,null)},"editor.suggest.localityBonus":{type:"boolean",default:t.localityBonus,description:d(689,null)},"editor.suggest.shareSuggestSelections":{type:"boolean",default:t.shareSuggestSelections,markdownDescription:d(692,null)},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[d(683,null),d(685,null),d(688,null),d(687,null)],default:t.selectionMode,markdownDescription:d(691,null,"`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:t.snippetsPreventQuickSuggestions,description:d(696,null)},"editor.suggest.showIcons":{type:"boolean",default:t.showIcons,description:d(693,null)},"editor.suggest.showStatusBar":{type:"boolean",default:t.showStatusBar,description:d(695,null)},"editor.suggest.preview":{type:"boolean",default:t.preview,description:d(690,null)},"editor.suggest.showInlineDetails":{type:"boolean",default:t.showInlineDetails,description:d(694,null)},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:d(365,null)},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:d(458,null)},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:d(454,null)},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:d(445,null)},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:d(447,null)},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:d(441,null)},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:d(451,null)},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:d(470,null)},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:d(442,null)},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:d(464,null)},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:d(455,null)},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:d(459,null)},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:d(461,null)},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:d(450,null)},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:d(460,null)},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:d(467,null)},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:d(469,null)},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:d(444,null)},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:d(449,null)},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:d(448,null)},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:d(457,null)},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:d(465,null)},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:d(443,null)},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:d(452,null)},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:d(462,null)},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:d(446,null)},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:d(453,null)},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:d(466,null)},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:d(463,null)},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:d(468,null)},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:d(456,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{insertMode:kt(e.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ce(e.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ce(e.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ce(e.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ce(e.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:kt(e.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ce(e.showIcons,this.defaultValue.showIcons),showStatusBar:ce(e.showStatusBar,this.defaultValue.showStatusBar),preview:ce(e.preview,this.defaultValue.preview),previewMode:kt(e.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ce(e.showInlineDetails,this.defaultValue.showInlineDetails),fitWidthToDetails:ce(e.fitWidthToDetails,this.defaultValue.fitWidthToDetails),showMethods:ce(e.showMethods,this.defaultValue.showMethods),showFunctions:ce(e.showFunctions,this.defaultValue.showFunctions),showConstructors:ce(e.showConstructors,this.defaultValue.showConstructors),showDeprecated:ce(e.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ce(e.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ce(e.showFields,this.defaultValue.showFields),showVariables:ce(e.showVariables,this.defaultValue.showVariables),showClasses:ce(e.showClasses,this.defaultValue.showClasses),showStructs:ce(e.showStructs,this.defaultValue.showStructs),showInterfaces:ce(e.showInterfaces,this.defaultValue.showInterfaces),showModules:ce(e.showModules,this.defaultValue.showModules),showProperties:ce(e.showProperties,this.defaultValue.showProperties),showEvents:ce(e.showEvents,this.defaultValue.showEvents),showOperators:ce(e.showOperators,this.defaultValue.showOperators),showUnits:ce(e.showUnits,this.defaultValue.showUnits),showValues:ce(e.showValues,this.defaultValue.showValues),showConstants:ce(e.showConstants,this.defaultValue.showConstants),showEnums:ce(e.showEnums,this.defaultValue.showEnums),showEnumMembers:ce(e.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ce(e.showKeywords,this.defaultValue.showKeywords),showWords:ce(e.showWords,this.defaultValue.showWords),showColors:ce(e.showColors,this.defaultValue.showColors),showFiles:ce(e.showFiles,this.defaultValue.showFiles),showReferences:ce(e.showReferences,this.defaultValue.showReferences),showFolders:ce(e.showFolders,this.defaultValue.showFolders),showTypeParameters:ce(e.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ce(e.showSnippets,this.defaultValue.showSnippets),showUsers:ce(e.showUsers,this.defaultValue.showUsers),showIssues:ce(e.showIssues,this.defaultValue.showIssues)}}},nD=class extends Rt{constructor(){super(132,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:d(666,null),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:d(667,null),default:!0,type:"boolean"}})}validate(t){return!t||typeof t!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:ce(t.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ce(t.selectSubwords,this.defaultValue.selectSubwords)}}},oD=class extends Rt{constructor(){let t=[];super(150,"wordSegmenterLocales",t,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:d(726,null),type:"array",items:{type:"string"},default:t})}validate(t){if(typeof t=="string"&&(t=[t]),Array.isArray(t)){let e=[];for(let n of t)if(typeof n=="string")try{Intl.Segmenter.supportedLocalesOf(n).length>0&&e.push(n)}catch{}return e}return this.defaultValue}},rD=class extends Rt{constructor(){super(158,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[d(739,null),d(740,null),d(738,null),d(737,null)],description:d(736,null),default:"same"}})}validate(t){switch(t){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(t,e,n){return e.get(2)===2?0:n}},iD=class extends zi{constructor(){super(170,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(t,e,n){let o=e.get(169);return{isDominatedByLongLines:t.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}},sD=class extends Rt{constructor(){let t={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",t,{"editor.dropIntoEditor.enabled":{type:"boolean",default:t.enabled,markdownDescription:d(368,null)},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:d(369,null),enum:["afterDrop","never"],enumDescriptions:[d(370,null),d(371,null)],default:"afterDrop"}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ce(e.enabled,this.defaultValue.enabled),showDropSelector:kt(e.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}},aD=class extends Rt{constructor(){let t={enabled:!0,showPasteSelector:"afterPaste"};super(99,"pasteAs",t,{"editor.pasteAs.enabled":{type:"boolean",default:t.enabled,markdownDescription:d(609,null)},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:d(610,null),enum:["afterPaste","never"],enumDescriptions:[d(611,null),d(612,null)],default:"afterPaste"}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ce(e.enabled,this.defaultValue.enabled),showPasteSelector:kt(e.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}},fX=[];NWe={acceptSuggestionOnCommitCharacter:_(new Se(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:d(314,null)})),acceptSuggestionOnEnter:_(new Ct(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",d(316,null),""],markdownDescription:d(315,null)})),accessibilitySupport:_(new yA),accessibilityPageSize:_(new nt(3,"accessibilityPageSize",500,1,1073741824,{description:d(317,null),tags:["accessibility"]})),allowOverflow:_(new Se(4,"allowOverflow",!0)),allowVariableLineHeights:_(new Se(5,"allowVariableLineHeights",!0,{description:d(324,null)})),allowVariableFonts:_(new Se(6,"allowVariableFonts",!0,{description:d(322,null)})),allowVariableFontsInAccessibilityMode:_(new Se(7,"allowVariableFontsInAccessibilityMode",!1,{description:d(323,null),tags:["accessibility"]})),ariaLabel:_(new Eo(8,"ariaLabel",d(471,null))),ariaRequired:_(new Se(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:_(new Se(12,"screenReaderAnnounceInlineSuggestion",!0,{description:d(641,null),tags:["accessibility"]})),autoClosingBrackets:_(new Ct(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",d(374,null),d(373,null),""],description:d(330,null)})),autoClosingComments:_(new Ct(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",d(376,null),d(375,null),""],description:d(331,null)})),autoClosingDelete:_(new Ct(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",d(377,null),""],description:d(332,null)})),autoClosingOvertype:_(new Ct(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",d(378,null),""],description:d(333,null)})),autoClosingQuotes:_(new Ct(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",d(380,null),d(379,null),""],description:d(334,null)})),autoIndent:_(new sd(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],uX,{enumDescriptions:[d(385,null),d(384,null),d(382,null),d(381,null),d(383,null)],description:d(335,null)})),autoIndentOnPaste:_(new Se(17,"autoIndentOnPaste",!1,{description:d(336,null)})),autoIndentOnPasteWithinString:_(new Se(18,"autoIndentOnPasteWithinString",!0,{description:d(337,null)})),automaticLayout:_(new Se(19,"automaticLayout",!1)),autoSurround:_(new Ct(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[d(387,null),d(388,null),d(386,null),""],description:d(338,null)})),bracketPairColorization:_(new ZA),bracketPairGuides:_(new eD),stickyTabStops:_(new Se(135,"stickyTabStops",!1,{description:d(680,null)})),codeLens:_(new Se(23,"codeLens",!0,{description:d(341,null)})),codeLensFontFamily:_(new Eo(24,"codeLensFontFamily","",{description:d(342,null)})),codeLensFontSize:_(new nt(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:d(343,null)})),colorDecorators:_(new Se(26,"colorDecorators",!0,{description:d(345,null)})),colorDecoratorActivatedOn:_(new Ct(172,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[d(390,null),d(391,null),d(389,null)],description:d(344,null)})),colorDecoratorsLimit:_(new nt(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:d(346,null)})),columnSelection:_(new Se(28,"columnSelection",!1,{description:d(347,null)})),comments:_(new vA),contextmenu:_(new Se(30,"contextmenu",!0)),copyWithSyntaxHighlighting:_(new Se(31,"copyWithSyntaxHighlighting",!0,{description:d(350,null)})),cursorBlinking:_(new sd(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],pX,{description:d(351,null)})),cursorSmoothCaretAnimation:_(new Ct(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[d(355,null),d(354,null),d(356,null)],description:d(353,null)})),cursorStyle:_(new sd(34,"cursorStyle",1,"line",["line","block","underline","line-thin","block-outline","underline-thin"],bV,{description:d(357,null)})),overtypeCursorStyle:_(new sd(94,"overtypeCursorStyle",2,"block",["line","block","underline","line-thin","block-outline","underline-thin"],bV,{description:d(602,null)})),cursorSurroundingLines:_(new nt(35,"cursorSurroundingLines",0,0,1073741824,{description:d(358,null)})),cursorSurroundingLinesStyle:_(new Ct(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[d(361,null),d(360,null)],markdownDescription:d(359,null)})),cursorWidth:_(new nt(37,"cursorWidth",0,0,1073741824,{markdownDescription:d(362,null)})),cursorHeight:_(new nt(38,"cursorHeight",0,0,1073741824,{markdownDescription:d(352,null)})),disableLayerHinting:_(new Se(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:_(new Se(40,"disableMonospaceOptimizations",!1)),domReadOnly:_(new Se(41,"domReadOnly",!1)),doubleClickSelectsBlock:_(new Se(177,"doubleClickSelectsBlock",!0,{description:d(366,null)})),dragAndDrop:_(new Se(42,"dragAndDrop",!0,{description:d(367,null)})),emptySelectionClipboard:_(new bA),dropIntoEditor:_(new sD),editContext:_(new Se(44,"editContext",!0,{description:d(372,null),included:ug||sv||dg})),renderRichScreenReaderContent:_(new Se(109,"renderRichScreenReaderContent",!1,{markdownDescription:d(632,null)})),stickyScroll:_(new NA),experimentalGpuAcceleration:_(new Ct(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[d(475,null),d(476,null)],description:d(474,null)})),experimentalWhitespaceRendering:_(new Ct(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[d(480,null),d(478,null),d(479,null)],description:d(477,null)})),extraEditorClassName:_(new Eo(48,"extraEditorClassName","")),fastScrollSensitivity:_(new Pr(49,"fastScrollSensitivity",5,r=>r<=0?5:r,{markdownDescription:d(481,null)})),find:_(new SA),fixedOverflowWidgets:_(new Se(51,"fixedOverflowWidgets",!1)),folding:_(new Se(52,"folding",!0,{description:d(492,null)})),foldingStrategy:_(new Ct(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[d(497,null),d(498,null)],description:d(496,null)})),foldingHighlight:_(new Se(54,"foldingHighlight",!0,{description:d(493,null)})),foldingImportsByDefault:_(new Se(55,"foldingImportsByDefault",!1,{description:d(494,null)})),foldingMaximumRegions:_(new nt(56,"foldingMaximumRegions",5e3,10,65e3,{description:d(495,null)})),unfoldOnClickAfterEndOfLine:_(new Se(57,"unfoldOnClickAfterEndOfLine",!1,{description:d(710,null)})),fontFamily:_(new Eo(58,"fontFamily",qi.fontFamily,{description:d(499,null)})),fontInfo:_(new EA),fontLigatures2:_(new xA),fontSize:_(new kA),fontWeight:_(new AA),fontVariations:_(new CA),formatOnPaste:_(new Se(64,"formatOnPaste",!1,{description:d(509,null)})),formatOnType:_(new Se(65,"formatOnType",!1,{description:d(510,null)})),fullwidthCharacterWidth:_(new Ct(178,"fullwidthCharacterWidth","font",["font","twoCells"],{enumDescriptions:[d(512,null),d(513,null)],description:d(511,null)})),glyphMargin:_(new Se(66,"glyphMargin",!0,{description:d(514,null)})),gotoLocation:_(new DA),hideCursorInOverviewRuler:_(new Se(68,"hideCursorInOverviewRuler",!1,{description:d(515,null)})),hover:_(new _A),inDiffEditor:_(new Se(70,"inDiffEditor",!1)),inertialScroll:_(new Se(161,"inertialScroll",!1,{description:d(525,null)})),letterSpacing:_(new Pr(72,"letterSpacing",qi.letterSpacing,r=>Pr.clamp(r,-5,20),{description:d(552,null)})),lightbulb:_(new UA),lineDecorationsWidth:_(new HA),lineHeight:_(new WA),lineNumbers:_(new KA),lineNumbersMinChars:_(new nt(77,"lineNumbersMinChars",5,1,300)),linkedEditing:_(new Se(78,"linkedEditing",!1,{description:d(559,null)})),links:_(new Se(79,"links",!0,{description:d(560,null)})),markdownImages:_(new MA),matchBrackets:_(new Ct(81,"matchBrackets","always",["always","near","never"],{description:d(561,null)})),minimap:_(new VA),mouseStyle:_(new Ct(83,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:_(new Pr(84,"mouseWheelScrollSensitivity",1,r=>r===0?1:r,{markdownDescription:d(582,null)})),mouseWheelZoom:_(new Se(85,"mouseWheelZoom",!1,{markdownDescription:vt?d(584,null):d(583,null)})),multiCursorMergeOverlapping:_(new Se(86,"multiCursorMergeOverlapping",!0,{description:d(586,null)})),multiCursorModifier:_(new sd(87,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],gX,{markdownEnumDescriptions:[d(589,null),d(588,null)],markdownDescription:d(587,null)})),mouseMiddleClickAction:_(new Ct(88,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:d(581,null)})),multiCursorPaste:_(new Ct(89,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[d(592,null),d(591,null)],markdownDescription:d(590,null)})),multiCursorLimit:_(new nt(90,"multiCursorLimit",1e4,1,1e5,{markdownDescription:d(585,null)})),occurrencesHighlight:_(new Ct(91,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[d(595,null),d(596,null),d(594,null)],markdownDescription:d(593,null)})),occurrencesHighlightDelay:_(new nt(92,"occurrencesHighlightDelay",0,0,2e3,{description:d(597,null),tags:["preview"]})),occurrencesHighlightFromAllProviders:_(new Se(93,"occurrencesHighlightFromAllProviders",!1,{description:d(598,null)})),overtypeOnPaste:_(new Se(95,"overtypeOnPaste",!0,{description:d(603,null)})),overviewRulerBorder:_(new Se(96,"overviewRulerBorder",!0,{description:d(604,null)})),overviewRulerLanes:_(new nt(97,"overviewRulerLanes",3,0,3)),padding:_(new BA),pasteAs:_(new aD),parameterHints:_(new qA),peekWidgetDefaultFocus:_(new Ct(101,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[d(615,null),d(614,null)],description:d(613,null)})),placeholder:_(new zA),definitionLinkOpensInPeek:_(new Se(103,"definitionLinkOpensInPeek",!1,{description:d(364,null)})),quickSuggestions:_(new GA),quickSuggestionsDelay:_(new nt(105,"quickSuggestionsDelay",10,0,1073741824,{description:d(624,null),experiment:{mode:"auto"}})),readOnly:_(new Se(106,"readOnly",!1)),readOnlyMessage:_(new QA),renameOnType:_(new Se(108,"renameOnType",!1,{description:d(625,null),markdownDeprecationMessage:d(626,null)})),renderControlCharacters:_(new Se(110,"renderControlCharacters",!0,{description:d(627,null),restricted:!0})),renderFinalNewline:_(new Ct(111,"renderFinalNewline",Ke?"dimmed":"on",["off","on","dimmed"],{description:d(628,null)})),renderLineHighlight:_(new Ct(112,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",d(630,null)],description:d(629,null)})),renderLineHighlightOnlyWhenFocus:_(new Se(113,"renderLineHighlightOnlyWhenFocus",!1,{description:d(631,null)})),renderValidationDecorations:_(new Ct(114,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:_(new Ct(115,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",d(634,null),d(635,null),d(636,null),""],description:d(633,null)})),revealHorizontalRightPadding:_(new nt(116,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:_(new Se(117,"roundedSelection",!0,{description:d(637,null)})),rulers:_(new jA),scrollbar:_(new JA),scrollBeyondLastColumn:_(new nt(120,"scrollBeyondLastColumn",4,0,1073741824,{description:d(654,null)})),scrollBeyondLastLine:_(new Se(121,"scrollBeyondLastLine",!0,{description:d(655,null)})),scrollOnMiddleClick:_(new Se(175,"scrollOnMiddleClick",!1,{description:d(656,null)})),scrollPredominantAxis:_(new Se(122,"scrollPredominantAxis",!0,{description:d(657,null)})),selectionClipboard:_(new Se(123,"selectionClipboard",!0,{description:d(662,null),included:Ke})),selectionHighlight:_(new Se(124,"selectionHighlight",!0,{description:d(663,null)})),selectionHighlightMaxLength:_(new nt(125,"selectionHighlightMaxLength",200,0,1073741824,{description:d(664,null)})),selectionHighlightMultiline:_(new Se(126,"selectionHighlightMultiline",!1,{description:d(665,null)})),selectedTextMatchMode:_(new Ct(127,"selectedTextMatchMode","findOptions",["findOptions","caseSensitive","caseInsensitive"],{enumDescriptions:[d(661,null),d(660,null),d(659,null)],markdownDescription:d(658,null)})),selectOnLineNumbers:_(new Se(128,"selectOnLineNumbers",!0)),showFoldingControls:_(new Ct(129,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[d(670,null),d(672,null),d(671,null)],description:d(669,null)})),showUnused:_(new Se(130,"showUnused",!0,{description:d(673,null)})),showDeprecated:_(new Se(160,"showDeprecated",!0,{description:d(668,null)})),inlayHints:_(new FA),snippetSuggestions:_(new Ct(131,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[d(679,null),d(676,null),d(677,null),d(678,null)],description:d(675,null)})),smartSelect:_(new nD),smoothScrolling:_(new Se(133,"smoothScrolling",!1,{description:d(674,null)})),stopRenderingLineAfter:_(new nt(136,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:_(new tD),inlineSuggest:_(new XA),inlineCompletionsAccessibilityVerbose:_(new Se(173,"inlineCompletionsAccessibilityVerbose",!1,{description:d(532,null)})),suggestFontSize:_(new nt(138,"suggestFontSize",0,0,1e3,{markdownDescription:d(697,null,"`0`","`#editor.fontSize#`")})),suggestLineHeight:_(new nt(139,"suggestLineHeight",0,0,1e3,{markdownDescription:d(698,null,"`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:_(new Se(140,"suggestOnTriggerCharacters",!0,{description:d(699,null)})),suggestSelection:_(new Ct(141,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[d(701,null),d(702,null),d(703,null)],description:d(700,null)})),tabCompletion:_(new Ct(142,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[d(706,null),d(705,null),d(707,null)],description:d(704,null)})),tabIndex:_(new nt(143,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:_(new Se(144,"trimWhitespaceOnDelete",!1,{description:d(709,null)})),unicodeHighlight:_(new YA),unusualLineTerminators:_(new Ct(146,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[d(719,null),d(720,null),d(721,null)],description:d(718,null)})),useShadowDOM:_(new Se(147,"useShadowDOM",!0)),useTabStops:_(new Se(148,"useTabStops",!0,{description:d(722,null)})),wordBreak:_(new Ct(149,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[d(725,null),d(724,null)],description:d(723,null)})),wordSegmenterLocales:_(new oD),wordSeparators:_(new Eo(151,"wordSeparators",fA,{description:d(727,null)})),wordWrap:_(new Ct(152,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[d(730,null),d(731,null),d(732,null),d(729,null)],description:d(728,null)})),wordWrapIndicator:_(new Se(164,"wordWrapIndicator",!1,{markdownDescription:d(734,null)})),wordWrapBreakAfterCharacters:_(new Eo(153,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:_(new Eo(154,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:_(new nt(155,"wordWrapColumn",80,1,1073741824,{markdownDescription:d(733,null)})),wordWrapOverride1:_(new Ct(156,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:_(new Ct(157,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:_(new Se(163,"wrapOnEscapedLineFeeds",!1,{markdownDescription:d(735,null)})),effectiveCursorStyle:_(new wA),editorClassName:_(new IA),defaultColorDecorators:_(new Ct(171,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[d(393,null),d(392,null),d(394,null)],description:d(363,null)})),pixelRatio:_(new $A),tabFocusMode:_(new Se(168,"tabFocusMode",!1,{markdownDescription:d(708,null)})),layoutInfo:_(new LA),wrappingInfo:_(new iD),wrappingIndent:_(new rD),wrappingStrategy:_(new OA),effectiveEditContextEnabled:_(new RA),effectiveAllowVariableFonts:_(new TA),effectiveFullwidthCharacterWidth:_(new PA)}});var Gi,Lx=v(()=>{Gi=class r{constructor(t,e){this.lineNumber=t,this.column=e}with(t=this.lineNumber,e=this.column){return t===this.lineNumber&&e===this.column?this:new r(t,e)}delta(t=0,e=0){return this.with(Math.max(1,this.lineNumber+t),Math.max(1,this.column+e))}equals(t){return r.equals(this,t)}static equals(t,e){return!t&&!e?!0:!!t&&!!e&&t.lineNumber===e.lineNumber&&t.column===e.column}isBefore(t){return r.isBefore(this,t)}static isBefore(t,e){return t.lineNumber<e.lineNumber?!0:e.lineNumber<t.lineNumber?!1:t.column<e.column}isBeforeOrEqual(t){return r.isBeforeOrEqual(this,t)}static isBeforeOrEqual(t,e){return t.lineNumber<e.lineNumber?!0:e.lineNumber<t.lineNumber?!1:t.column<=e.column}static compare(t,e){let n=t.lineNumber|0,o=e.lineNumber|0;if(n===o){let i=t.column|0,s=e.column|0;return i-s}return n-o}clone(){return new r(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(t){return new r(t.lineNumber,t.column)}static isIPosition(t){return!!t&&typeof t.lineNumber=="number"&&typeof t.column=="number"}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}});var Mn,ba=v(()=>{Lx();Mn=class r{constructor(t,e,n,o){t>n||t===n&&e>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=t,this.endColumn=e):(this.startLineNumber=t,this.startColumn=e,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return r.isEmpty(this)}static isEmpty(t){return t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn}containsPosition(t){return r.containsPosition(this,t)}static containsPosition(t,e){return!(e.lineNumber<t.startLineNumber||e.lineNumber>t.endLineNumber||e.lineNumber===t.startLineNumber&&e.column<t.startColumn||e.lineNumber===t.endLineNumber&&e.column>t.endColumn)}static strictContainsPosition(t,e){return!(e.lineNumber<t.startLineNumber||e.lineNumber>t.endLineNumber||e.lineNumber===t.startLineNumber&&e.column<=t.startColumn||e.lineNumber===t.endLineNumber&&e.column>=t.endColumn)}containsRange(t){return r.containsRange(this,t)}static containsRange(t,e){return!(e.startLineNumber<t.startLineNumber||e.endLineNumber<t.startLineNumber||e.startLineNumber>t.endLineNumber||e.endLineNumber>t.endLineNumber||e.startLineNumber===t.startLineNumber&&e.startColumn<t.startColumn||e.endLineNumber===t.endLineNumber&&e.endColumn>t.endColumn)}strictContainsRange(t){return r.strictContainsRange(this,t)}static strictContainsRange(t,e){return!(e.startLineNumber<t.startLineNumber||e.endLineNumber<t.startLineNumber||e.startLineNumber>t.endLineNumber||e.endLineNumber>t.endLineNumber||e.startLineNumber===t.startLineNumber&&e.startColumn<=t.startColumn||e.endLineNumber===t.endLineNumber&&e.endColumn>=t.endColumn)}plusRange(t){return r.plusRange(this,t)}static plusRange(t,e){let n,o,i,s;return e.startLineNumber<t.startLineNumber?(n=e.startLineNumber,o=e.startColumn):e.startLineNumber===t.startLineNumber?(n=e.startLineNumber,o=Math.min(e.startColumn,t.startColumn)):(n=t.startLineNumber,o=t.startColumn),e.endLineNumber>t.endLineNumber?(i=e.endLineNumber,s=e.endColumn):e.endLineNumber===t.endLineNumber?(i=e.endLineNumber,s=Math.max(e.endColumn,t.endColumn)):(i=t.endLineNumber,s=t.endColumn),new r(n,o,i,s)}intersectRanges(t){return r.intersectRanges(this,t)}static intersectRanges(t,e){let n=t.startLineNumber,o=t.startColumn,i=t.endLineNumber,s=t.endColumn,a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn;return n<a?(n=a,o=l):n===a&&(o=Math.max(o,l)),i>c?(i=c,s=u):i===c&&(s=Math.min(s,u)),n>i||n===i&&o>s?null:new r(n,o,i,s)}equalsRange(t){return r.equalsRange(this,t)}static equalsRange(t,e){return!t&&!e?!0:!!t&&!!e&&t.startLineNumber===e.startLineNumber&&t.startColumn===e.startColumn&&t.endLineNumber===e.endLineNumber&&t.endColumn===e.endColumn}getEndPosition(){return r.getEndPosition(this)}static getEndPosition(t){return new Gi(t.endLineNumber,t.endColumn)}getStartPosition(){return r.getStartPosition(this)}static getStartPosition(t){return new Gi(t.startLineNumber,t.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(t,e){return new r(this.startLineNumber,this.startColumn,t,e)}setStartPosition(t,e){return new r(t,e,this.endLineNumber,this.endColumn)}collapseToStart(){return r.collapseToStart(this)}static collapseToStart(t){return new r(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return r.collapseToEnd(this)}static collapseToEnd(t){return new r(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new r(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(t,e=t){return new r(t.lineNumber,t.column,e.lineNumber,e.column)}static lift(t){return t?new r(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(t){return!!t&&typeof t.startLineNumber=="number"&&typeof t.startColumn=="number"&&typeof t.endLineNumber=="number"&&typeof t.endColumn=="number"}static areIntersectingOrTouching(t,e){return!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn||e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn)}static areIntersecting(t,e){return!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn||e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn)}static areOnlyIntersecting(t,e){return!(t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1||e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1)}static compareRangesUsingStarts(t,e){if(t&&e){let i=t.startLineNumber|0,s=e.startLineNumber|0;if(i===s){let a=t.startColumn|0,l=e.startColumn|0;if(a===l){let c=t.endLineNumber|0,u=e.endLineNumber|0;if(c===u){let p=t.endColumn|0,m=e.endColumn|0;return p-m}return c-u}return a-l}return i-s}return(t?1:0)-(e?1:0)}static compareRangesUsingEnds(t,e){return t.endLineNumber===e.endLineNumber?t.endColumn===e.endColumn?t.startLineNumber===e.startLineNumber?t.startColumn-e.startColumn:t.startLineNumber-e.startLineNumber:t.endColumn-e.endColumn:t.endLineNumber-e.endLineNumber}static spansMultipleLines(t){return t.endLineNumber>t.startLineNumber}toJSON(){return this}}});var lD=v(()=>{});var EV=v(()=>{ba()});var Ox,cD,wV=v(()=>{ue();Q();lD();Ox=class{constructor(){this._tokenizationSupports=new Map;this._factories=new Map;this._onDidChange=new R;this.onDidChange=this._onDidChange.event;this._colorMap=null}handleChange(t){this._onDidChange.fire({changedLanguages:t,changedColorMap:!1})}register(t,e){return this._tokenizationSupports.set(t,e),this.handleChange([t]),se(()=>{this._tokenizationSupports.get(t)===e&&(this._tokenizationSupports.delete(t),this.handleChange([t]))})}get(t){return this._tokenizationSupports.get(t)||null}registerFactory(t,e){this._factories.get(t)?.dispose();let n=new cD(this,t,e);return this._factories.set(t,n),se(()=>{let o=this._factories.get(t);!o||o!==n||(this._factories.delete(t),o.dispose())})}async getOrCreate(t){let e=this.get(t);if(e)return e;let n=this._factories.get(t);return!n||n.isResolved?null:(await n.resolve(),this.get(t))}isResolved(t){if(this.get(t))return!0;let n=this._factories.get(t);return!!(!n||n.isResolved)}setColorMap(t){this._colorMap=t,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},cD=class extends D{constructor(e,n,o){super();this._registry=e;this._languageId=n;this._factory=o;this._isDisposed=!1;this._resolvePromise=null;this._isResolved=!1}get isResolved(){return this._isResolved}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}});function Ux(r){return!!r&&S.isUri(r.uri)&&Mn.isIRange(r.range)}var yX,lVe,vX,Sa,dD,cVe,Nh=v(()=>{ms();te();EV();ba();wV();ee();(i=>{let r=new Map;r.set(0,ne.symbolMethod),r.set(1,ne.symbolFunction),r.set(2,ne.symbolConstructor),r.set(3,ne.symbolField),r.set(4,ne.symbolVariable),r.set(5,ne.symbolClass),r.set(6,ne.symbolStruct),r.set(7,ne.symbolInterface),r.set(8,ne.symbolModule),r.set(9,ne.symbolProperty),r.set(10,ne.symbolEvent),r.set(11,ne.symbolOperator),r.set(12,ne.symbolUnit),r.set(13,ne.symbolValue),r.set(15,ne.symbolEnum),r.set(14,ne.symbolConstant),r.set(16,ne.symbolEnumMember),r.set(17,ne.symbolKeyword),r.set(28,ne.symbolSnippet),r.set(18,ne.symbolText),r.set(19,ne.symbolColor),r.set(20,ne.symbolFile),r.set(21,ne.symbolReference),r.set(22,ne.symbolCustomColor),r.set(23,ne.symbolFolder),r.set(24,ne.symbolTypeParameter),r.set(25,ne.account),r.set(26,ne.issues),r.set(27,ne.tools);function t(s){let a=r.get(s);return a||(console.info("No codicon found for CompletionItemKind "+s),a=ne.symbolProperty),a}i.toIcon=t;function e(s){switch(s){case 0:return d(909,null);case 1:return d(905,null);case 2:return d(897,null);case 3:return d(902,null);case 4:return d(922,null);case 5:return d(894,null);case 6:return d(915,null);case 7:return d(906,null);case 8:return d(910,null);case 9:return d(912,null);case 10:return d(901,null);case 11:return d(911,null);case 12:return d(919,null);case 13:return d(921,null);case 14:return d(896,null);case 15:return d(899,null);case 16:return d(900,null);case 17:return d(908,null);case 18:return d(916,null);case 19:return d(895,null);case 20:return d(903,null);case 21:return d(913,null);case 22:return d(898,null);case 23:return d(904,null);case 24:return d(918,null);case 25:return d(920,null);case 26:return d(907,null);case 27:return d(917,null);case 28:return d(914,null);default:return""}}i.toLabel=e;let n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",28),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26),n.set("tool",27);function o(s,a){let l=n.get(s);return typeof l>"u"&&!a&&(l=9),l}i.fromString=o})(yX||={});lVe={17:d(870,null),16:d(871,null),4:d(872,null),13:d(873,null),8:d(874,null),9:d(875,null),21:d(876,null),23:d(877,null),7:d(878,null),0:d(879,null),11:d(880,null),10:d(881,null),19:d(882,null),5:d(883,null),1:d(884,null),2:d(885,null),20:d(886,null),15:d(887,null),18:d(888,null),24:d(889,null),3:d(890,null),6:d(891,null),14:d(892,null),22:d(893,null),25:d(924,null),12:d(925,null)};(o=>{let r=new Map;r.set(0,ne.symbolFile),r.set(1,ne.symbolModule),r.set(2,ne.symbolNamespace),r.set(3,ne.symbolPackage),r.set(4,ne.symbolClass),r.set(5,ne.symbolMethod),r.set(6,ne.symbolProperty),r.set(7,ne.symbolField),r.set(8,ne.symbolConstructor),r.set(9,ne.symbolEnum),r.set(10,ne.symbolInterface),r.set(11,ne.symbolFunction),r.set(12,ne.symbolVariable),r.set(13,ne.symbolConstant),r.set(14,ne.symbolString),r.set(15,ne.symbolNumber),r.set(16,ne.symbolBoolean),r.set(17,ne.symbolArray),r.set(18,ne.symbolObject),r.set(19,ne.symbolKey),r.set(20,ne.symbolNull),r.set(21,ne.symbolEnumMember),r.set(22,ne.symbolStruct),r.set(23,ne.symbolEvent),r.set(24,ne.symbolOperator),r.set(25,ne.symbolTypeParameter);function t(i){let s=r.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=ne.symbolProperty),s}o.toIcon=t;let e=new Map;e.set(0,20),e.set(1,8),e.set(2,8),e.set(3,8),e.set(4,5),e.set(5,0),e.set(6,9),e.set(7,3),e.set(8,2),e.set(9,15),e.set(10,7),e.set(11,1),e.set(12,4),e.set(13,14),e.set(14,18),e.set(15,13),e.set(16,13),e.set(17,13),e.set(18,13),e.set(19,17),e.set(20,13),e.set(21,16),e.set(22,6),e.set(23,10),e.set(24,11),e.set(25,24);function n(i){let s=e.get(i);return s===void 0&&(console.info("No completion kind found for SymbolKind "+i),s=20),s}o.toCompletionKind=n})(vX||={});Sa=class r{constructor(t){this.value=t}static{this.Comment=new r("comment")}static{this.Imports=new r("imports")}static{this.Region=new r("region")}static fromValue(t){switch(t){case"comment":return r.Comment;case"imports":return r.Imports;case"region":return r.Region}return new r(t)}};(t=>{function r(e){return!e||typeof e!="object"?!1:typeof e.id=="string"&&typeof e.title=="string"}t.is=r})(dD||={});cVe=new Ox});var RV=v(()=>{Xt()});var Fh,bX,fVe,TV=v(()=>{gs();ee();Z();Fh=(o=>(o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error",o))(Fh||{});(a=>{function r(l,c){return c-l}a.compare=r;let t=Object.create(null);t[8]=d(4527,null),t[4]=d(4531,null),t[2]=d(4529,null);function e(l){return t[l]||""}a.toString=e;let n=Object.create(null);n[8]=d(4528,null),n[4]=d(4532,null),n[2]=d(4530,null);function o(l){return n[l]||""}a.toStringPlural=o;function i(l){switch(l){case Qe.Error:return 8;case Qe.Warning:return 4;case Qe.Info:return 2;case Qe.Ignore:return 1}}a.fromSeverity=i;function s(l){switch(l){case 8:return Qe.Error;case 4:return Qe.Warning;case 2:return Qe.Info;case 1:return Qe.Ignore}}a.toSeverity=s})(Fh||={});(n=>{function t(o){return e(o,!0)}n.makeKey=t;function e(o,i){let s=[""];return o.source?s.push(o.source.replace("\xA6","\\\xA6")):s.push(""),o.code?typeof o.code=="string"?s.push(o.code.replace("\xA6","\\\xA6")):s.push(o.code.value.replace("\xA6","\\\xA6")):s.push(""),o.severity!==void 0&&o.severity!==null?s.push(Fh.toString(o.severity)):s.push(""),o.message&&i?s.push(o.message.replace("\xA6","\\\xA6")):s.push(""),o.startLineNumber!==void 0&&o.startLineNumber!==null?s.push(o.startLineNumber.toString()):s.push(""),o.startColumn!==void 0&&o.startColumn!==null?s.push(o.startColumn.toString()):s.push(""),o.endLineNumber!==void 0&&o.endLineNumber!==null?s.push(o.endLineNumber.toString()):s.push(""),o.endColumn!==void 0&&o.endColumn!==null?s.push(o.endColumn.toString()):s.push(""),s.push(""),s.join("\xA6")}n.makeKeyOptionalMessage=e})(bX||={});fVe=A("markerService")});var SX,xVe,PV,Nx,CVe,kV=v(()=>{Ue();Jt();Q();Z();SX=A("progressService"),xVe=Object.freeze({total(){},worked(){},done(){}}),PV=class{constructor(t){this.callback=t}static{this.None=Object.freeze({report(){}})}get value(){return this._value}report(t){this._value=t,this.callback(this._value)}},Nx=class extends D{constructor(e,n){super();this.deferred=new jn;n.withProgress(e,o=>(this.reporter=o,this.lastStep&&o.report(this.lastStep),this.deferred.p)),this._register(se(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};Nx=w([b(1,SX)],Nx);CVe=A("editorProgressService")});var uD,AV,Fx,DV,pD=v(()=>{ue();Q();fe();ee();uD=class extends D{constructor(e,n="",o="",i=!0,s){super();this._onDidChange=this._register(new R);this._enabled=!0;this._id=e,this._label=n,this._cssClass=o,this._enabled=i,this._actionCallback=s}get onDidChange(){return this._onDidChange.event}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,n){this._actionCallback&&await this._actionCallback(e)}},AV=class r{constructor(t=""){this.label=t;this.id=r.ID;this.tooltip="";this.class="separator";this.enabled=!1;this.checked=void 0}static join(...t){let e=[];for(let n of t)n.length&&(e.length?e=[...e,new r,...n]:e=n);return e}static clean(t){for(;t.length>0&&t[0].id===r.ID;)t.shift();for(;t.length>0&&t[t.length-1].id===r.ID;)t.pop();for(let e=t.length-2;e>=0;e--)t[e].id===r.ID&&t[e+1].id===r.ID&&t.splice(e+1,1);return t}static{this.ID="vs.actions.separator"}async run(){}},Fx=class{constructor(t,e,n,o,i){this.tooltip="";this.enabled=!0;this.id=t,this.label=e,this.class=o,this._actions=n,this.checked=i}get actions(){return this._actions}async run(){}},DV=class r extends uD{static{this.ID="vs.actions.empty"}constructor(){super(r.ID,d(49,null),void 0,!1)}}});function Wx(r){if(xa(r))return!1;let t=r;return t?.original!==void 0&&t.modified!==void 0}function _V(r){if(xa(r))return!1;let t=r;return!t||t.resources&&!Array.isArray(t.resources)?!1:!!t.resources||!!t.multiDiffSource}function mD(r){if(xa(r)||Wx(r))return!1;let t=r;return t?.primary!==void 0&&t.secondary!==void 0}function Hx(r){if(xa(r))return!1;let t=r;return S.isUri(t?.base?.resource)&&S.isUri(t?.input1?.resource)&&S.isUri(t?.input2?.resource)&&S.isUri(t?.result?.resource)}function xa(r){return r instanceof fD}function CX(r){let t=r;return S.isUri(t?.preferredResource)}function EX(r){let t=r;return xa(t?.primary)&&xa(t?.secondary)}function MV(r){let t=r;return xa(t?.modified)&&xa(t?.original)}var xX,vD,gD,t4e,fD,hD,Hh,yD,Wh=v(()=>{ee();Ie();te();Q();Z();$o();st();Me();$s();pD();gs();xX={EditorPane:"workbench.contributions.editors",EditorFactory:"workbench.contributions.editor.inputFactories"},vD={id:"default",displayName:d(7040,null),providerDisplayName:d(7037,null)};gD=class{constructor(){this.mapIdToSaveSource=new Map}registerSource(t,e){let n=this.mapIdToSaveSource.get(t);return n||(n={source:t,label:e},this.mapIdToSaveSource.set(t,n)),n.source}getSourceLabel(t){return this.mapIdToSaveSource.get(t)?.label??t}},t4e=new gD,fD=class extends D{};hD=class{getOriginalUri(t,e){if(!t)return;if(Hx(t))return Hh.getOriginalUri(t.result,e);if(e?.supportSideBySide){let{primary:o,secondary:i}=this.getSideEditors(t);if(o&&i){if(e?.supportSideBySide===3)return{primary:this.getOriginalUri(o,{filterByScheme:e.filterByScheme}),secondary:this.getOriginalUri(i,{filterByScheme:e.filterByScheme})};if(e?.supportSideBySide===4)return this.getOriginalUri(o,{filterByScheme:e.filterByScheme})??this.getOriginalUri(i,{filterByScheme:e.filterByScheme});t=e.supportSideBySide===1?o:i}}if(Wx(t)||_V(t)||mD(t)||Hx(t))return;let n=CX(t)?t.preferredResource:t.resource;return!n||!e?.filterByScheme?n:this.filterUri(n,e.filterByScheme)}getSideEditors(t){return EX(t)||mD(t)?{primary:t.primary,secondary:t.secondary}:MV(t)||Wx(t)?{primary:t.modified,secondary:t.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(t,e){if(!t)return;if(Hx(t))return Hh.getCanonicalUri(t.result,e);if(e?.supportSideBySide){let{primary:o,secondary:i}=this.getSideEditors(t);if(o&&i){if(e?.supportSideBySide===3)return{primary:this.getCanonicalUri(o,{filterByScheme:e.filterByScheme}),secondary:this.getCanonicalUri(i,{filterByScheme:e.filterByScheme})};if(e?.supportSideBySide===4)return this.getCanonicalUri(o,{filterByScheme:e.filterByScheme})??this.getCanonicalUri(i,{filterByScheme:e.filterByScheme});t=e.supportSideBySide===1?o:i}}if(Wx(t)||_V(t)||mD(t)||Hx(t))return;let n=t.resource;return!n||!e?.filterByScheme?n:this.filterUri(n,e.filterByScheme)}filterUri(t,e){if(Array.isArray(e)){if(e.some(n=>t.scheme===n))return t}else if(e===t.scheme)return t}},Hh=new hD,yD=class{constructor(){this.editorSerializerConstructors=new Map;this.editorSerializerInstances=new Map}start(t){let e=this.instantiationService=t.get(Hn);for(let[n,o]of this.editorSerializerConstructors)this.createEditorSerializer(n,o,e);this.editorSerializerConstructors.clear()}createEditorSerializer(t,e,n){let o=n.createInstance(e);this.editorSerializerInstances.set(t,o)}registerFileEditorFactory(t){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=t}getFileEditorFactory(){return hg(this.fileEditorFactory)}registerEditorSerializer(t,e){if(this.editorSerializerConstructors.has(t)||this.editorSerializerInstances.has(t))throw new Error(`A editor serializer with type ID '${t}' was already registered.`);return this.instantiationService?this.createEditorSerializer(t,e,this.instantiationService):this.editorSerializerConstructors.set(t,e),se(()=>{this.editorSerializerConstructors.delete(t),this.editorSerializerInstances.delete(t)})}getEditorSerializer(t){return this.editorSerializerInstances.get(typeof t=="string"?t:t.typeId)}};St.add(xX.EditorFactory,new yD)});var LV=v(()=>{});var ID,i4e,s4e,a4e,OV=v(()=>{Ve();ID="/.well-known",i4e=`${ID}/oauth-protected-resource`,s4e=`${ID}/oauth-authorization-server`,a4e=`${ID}/openid-configuration`});var UV=v(()=>{});var NV=v(()=>{OV();UV()});var bD=v(()=>{te();NV()});var FV=v(()=>{bD()});var SD=v(()=>{Mi();it();te()});var HV=v(()=>{});var WV=v(()=>{HV()});var VV=v(()=>{});var BV=v(()=>{});var qV=v(()=>{});var xD=v(()=>{});var $V=v(()=>{});var zV=v(()=>{});var GV=v(()=>{});var KV=v(()=>{});var jV=v(()=>{});var CD=v(()=>{});var QV=v(()=>{});var JV=v(()=>{});var YV=v(()=>{});var Bl=v(()=>{VV();BV();qV();xD();$V();zV();GV();KV();jV();CD();QV();JV();YV()});var Vx=v(()=>{});var XV=v(()=>{Ie()});var ZV=v(()=>{fe()});var e4=v(()=>{ZV()});var t4=v(()=>{Ie()});var TX,xBe,ED=v(()=>{Vx();XV();e4();t4();TX=["running","succeeded","failed","cancelled"],xBe=new Set(TX)});var Bx=v(()=>{Ie();Vx()});var PBe,wD=v(()=>{qo();PBe=4*1024});var o4=v(()=>{});var $Be,r4=v(()=>{si();xr();Me();it();Ie();te();ee();wD();Bl();o4();$Be={search:{kind:"search",subjectKeys:["pattern","query"],running:d(2618,null),completed:d(2616,null),failed:d(2617,null)},view:{kind:"read",subjectKeys:["file_path","path"],running:d(2558,null),completed:d(2556,null),failed:d(2557,null)},show_file:{subjectKeys:["file_path","path"],running:d(2630,null),completed:d(2628,null),failed:d(2629,null)},edit:{subjectKeys:["file_path","path"],running:d(2487,null),completed:d(2485,null),failed:d(2486,null)},write_file:{subjectKeys:["file_path","path"],running:d(2670,null),completed:d(2668,null),failed:d(2669,null)},apply_patch:{running:d(2538,null),completed:d(2536,null),failed:d(2537,null)},bash:{kind:"terminal",subjectKeys:["description","command"],running:d(2627,null),completed:d(2625,null),failed:d(2626,null)},read_bash:{running:d(2564,null),completed:d(2562,null),failed:d(2563,null)},write_bash:{running:d(2676,null),completed:d(2674,null),failed:d(2675,null)},stop_bash:{running:d(2639,null),completed:d(2637,null),failed:d(2638,null)},list_bash:{running:d(2517,null),completed:d(2515,null),failed:d(2516,null)},task:{subjectKeys:["description","agent_type"],running:d(2645,null),completed:d(2643,null),failed:d(2644,null)},read_agent:{subjectKeys:["agent_id","agentId"],running:d(2561,null),completed:d(2559,null),failed:d(2560,null)},write_agent:{running:d(2673,null),completed:d(2671,null),failed:d(2672,null)},task_complete:{running:d(2648,null),completed:d(2646,null),failed:d(2647,null)},ask_user:{subjectKeys:["question"],running:d(2457,null),completed:d(2455,null),failed:d(2456,null)},exit_plan_mode:{running:d(2543,null),completed:d(2541,null),failed:d(2542,null)},respond_to_session_plan:{running:d(2591,null),completed:d(2589,null),failed:d(2590,null)},skill:{subjectKeys:["skill","name"],running:d(2633,null),completed:d(2631,null),failed:d(2632,null)},web_search:{subjectKeys:["query"],running:d(2664,null),completed:d(2662,null),failed:d(2663,null)},web_fetch:{subjectKeys:["url"],running:d(2661,null),completed:d(2659,null),failed:d(2660,null)},sql:{subjectKeys:["description"],running:d(2636,null),completed:d(2634,null),failed:d(2635,null)},tool_search_tool_regex:{subjectKeys:["regex","pattern"],running:d(2655,null),completed:d(2653,null),failed:d(2654,null)},update_todo:{running:d(2651,null),completed:d(2649,null),failed:d(2650,null)},update_profile:{running:d(2555,null),completed:d(2553,null),failed:d(2554,null)},store_memory:{subjectKeys:["fact"],running:d(2526,null),completed:d(2524,null),failed:d(2525,null)},create_pull_request:{subjectKeys:["title"],running:d(2475,null),completed:d(2473,null),failed:d(2474,null)},create_issue:{subjectKeys:["title"],running:d(2472,null),completed:d(2470,null),failed:d(2471,null)},create_session:{subjectKeys:["name"],running:d(2478,null),completed:d(2476,null),failed:d(2477,null)},get_changes_overview:{running:d(2466,null),completed:d(2464,null),failed:d(2465,null)},send_session_message:{running:d(2621,null),completed:d(2619,null),failed:d(2620,null)},annotate_diff_line:{subjectKeys:["path"],running:d(2448,null),completed:d(2446,null),failed:d(2447,null)},add_pr_review_comment:{running:d(2546,null),completed:d(2544,null),failed:d(2545,null)},edit_pr_review_comment:{running:d(2490,null),completed:d(2488,null),failed:d(2489,null)},remove_pr_review_comment:{running:d(2567,null),completed:d(2565,null),failed:d(2566,null)},reply_and_resolve_review_thread:{running:d(2588,null),completed:d(2586,null),failed:d(2587,null)},navigate_to:{running:d(2529,null),completed:d(2527,null),failed:d(2528,null)},navigate_to_github_item:{running:d(2502,null),completed:d(2500,null),failed:d(2501,null)},open_pr_session:{running:d(2535,null),completed:d(2533,null),failed:d(2534,null)},open_issue_session:{running:d(2532,null),completed:d(2530,null),failed:d(2531,null)},list_agents:{running:d(2505,null),completed:d(2503,null),failed:d(2504,null)},list_sessions_and_chats:{running:d(2514,null),completed:d(2512,null),failed:d(2513,null)},list_items:{running:d(2508,null),completed:d(2506,null),failed:d(2507,null)},list_projects:{running:d(2511,null),completed:d(2509,null),failed:d(2510,null)},get_session:{running:d(2499,null),completed:d(2497,null),failed:d(2498,null)},get_sessions_status:{running:d(2624,null),completed:d(2622,null),failed:d(2623,null)},get_main_session_transcript:{running:d(2658,null),completed:d(2656,null),failed:d(2657,null)},rename_session:{subjectKeys:["title"],running:d(2573,null),completed:d(2571,null),failed:d(2572,null)},rename_workspace:{subjectKeys:["title"],running:d(2576,null),completed:d(2574,null),failed:d(2575,null)},rename_branch:{subjectKeys:["name"],running:d(2570,null),completed:d(2568,null),failed:d(2569,null)},delete_item:{running:d(2481,null),completed:d(2479,null),failed:d(2480,null)},archive_session:{running:d(2451,null),completed:d(2449,null),failed:d(2450,null)},suggest_items:{running:d(2642,null),completed:d(2640,null),failed:d(2641,null)},get_session_automation:{running:d(2493,null),completed:d(2491,null),failed:d(2492,null)},save_session_automation:{running:d(2606,null),completed:d(2604,null),failed:d(2605,null)},list_workflows:{running:d(2520,null),completed:d(2518,null),failed:d(2519,null)},save_workflow:{subjectKeys:["name"],running:d(2612,null),completed:d(2610,null),failed:d(2611,null)},run_workflow:{running:d(2600,null),completed:d(2598,null),failed:d(2599,null)},run_dynamic_workflow:{running:d(2594,null),completed:d(2592,null),failed:d(2593,null)},dynamic_workflows_manage:{running:d(2523,null),completed:d(2521,null),failed:d(2522,null)},open_canvas:{subjectKeys:["title","name","url"],running:d(2460,null),completed:d(2458,null),failed:d(2459,null)},send_canvas_command:{subjectKeys:["name","command"],running:d(2463,null),completed:d(2461,null),failed:d(2462,null)},clear_widget:{running:d(2469,null),completed:d(2467,null),failed:d(2468,null)},discover_widgets:{running:d(2667,null),completed:d(2665,null),failed:d(2666,null)},render_widget:{running:d(2582,null),completed:d(2580,null),failed:d(2581,null)},render_widget_inbox:{running:d(2579,null),completed:d(2577,null),failed:d(2578,null)},list_priorities:{running:d(2549,null),completed:d(2547,null),failed:d(2548,null)},get_priority:{running:d(2552,null),completed:d(2550,null),failed:d(2551,null)},save_priority:{subjectKeys:["title"],running:d(2603,null),completed:d(2601,null),failed:d(2602,null)},reorder_priorities:{running:d(2585,null),completed:d(2583,null),failed:d(2584,null)},archive_priority:{running:d(2454,null),completed:d(2452,null),failed:d(2453,null)},list_scheduled_tasks:{running:d(2615,null),completed:d(2613,null),failed:d(2614,null)},get_scheduled_task:{running:d(2496,null),completed:d(2494,null),failed:d(2495,null)},save_scheduled_task:{subjectKeys:["title"],running:d(2609,null),completed:d(2607,null),failed:d(2608,null)},delete_scheduled_task:{running:d(2484,null),completed:d(2482,null),failed:d(2483,null)},run_scheduled_task:{running:d(2597,null),completed:d(2595,null),failed:d(2596,null)}}});var i4=v(()=>{Ie();Bl();ED();Bx();r4();ED()});var dqe,TD=v(()=>{ee();dqe=16*1024*1024});var PD=v(()=>{TD()});var kD=v(()=>{TD();Vx();PD();Bx();PD()});var s4=v(()=>{});var AD=v(()=>{Bx();s4()});var a4=v(()=>{});var l4=v(()=>{});var c4=v(()=>{});var d4=v(()=>{});var u4=v(()=>{});var p4=v(()=>{});var m4=v(()=>{});var g4=v(()=>{});var f4=v(()=>{});var h4=v(()=>{});var y4=v(()=>{});var v4=v(()=>{a4();l4();c4();d4();u4();p4();m4();g4();f4();h4();y4()});var S4=v(()=>{Ie();v4();Bl()});var x4=v(()=>{});var C4=v(()=>{});var E4=v(()=>{});var w4=v(()=>{});var R4=v(()=>{});var T4=v(()=>{});var P4=v(()=>{});var k4=v(()=>{});var A4=v(()=>{});var DD=v(()=>{x4();C4();E4();w4();R4();T4();P4();k4();A4()});function _4(r,t){return t?`${r.replace(/#/g,"%23")}#range=${t.start.line}:${t.start.character}-${t.end.line}:${t.end.character}`:r}function M4(r,t){let e=typeof r=="string"?r:r.toString(),n=oo(O.fromString(e),!1,!0);return`${Vh}://${$X}/${n}/${encodeURIComponent(t)}`}var BX,r7e,qX,i7e,Vh,$X,s7e,ql=v(()=>{Dt();Ve();Ie();Vt();te();FV();SD();WV();i4();kD();AD();kD();wD();AD();S4();Bl();Bl();DD();Bl();BX="ahp-automations",r7e=`${BX}://`;qX="subagent",i7e=`/${qX}/`,Vh="ahp-chat",$X="subagent";s7e=`${Vh}:/`});var v7e,MD=v(()=>{Z();ql();v7e=A("agentHostConnectionsService")});var LD,OD,qx,GX,KX,$x=v(()=>{LV();Z();$o();MD();ee();LD=class{constructor(){this._contributions=new Set}register(t){return this._contributions.add(t),{dispose:()=>this._contributions.delete(t)}}getActivators(t){return Array.from(this._contributions).filter(e=>e.matchSessionType(t)).sort((e,n)=>(n.priority??0)-(e.priority??0))}};St.add("workbench.contrib.chatSessions.asyncActivation",new LD);(c=>(c.CopilotCLI="copilotcli",c.CopilotCloud="copilot-cloud-agent",c.CloudSandbox="cloud-sandbox",c.Local="local",c.Codex="openai-codex",c.Growth="copilot-growth",c.AgentHostCopilot="agent-host-copilotcli",c.AgentHostClaude="agent-host-claude",c.AgentHostCodex="agent-host-codex"))(OD||={});qx=OD.Local;(o=>{function r(i){return new Map(Object.entries(i))}o.fromRecord=r;function t(i){let s=Object.create(null),a=n(i);for(let[l,c]of a)s[l]=c;return s}o.toRecord=t;function e(i){if(!i)return;let s=n(i);return Array.from(s,([a,l])=>({optionId:a,value:typeof l=="string"?l:l.id}))}o.toStrValueArray=e;function n(i){return i instanceof Map?i:Object.entries(i)}})(GX||={});KX=A("chatSessionsService")});function zx(r){let t=$l.parseLocalSessionId(r);return t||r.toString()}var $l,Bh=v(()=>{Ve();Me();it();te();Vt();$x();(s=>{s.scheme=q.vscodeLocalChatSession;function t(a){let l=oo(O.wrap(new TextEncoder().encode(a)),!1,!0);return S.from({scheme:s.scheme,authority:qx,path:"/"+l})}s.forSession=t;function e(){let a=Math.floor(Math.random()*1e9);return t(`chat-${a}`)}s.getNewSessionUri=e;function n(a){let l=i(a);return l?.chatSessionType===qx?l.sessionId:void 0}s.parseLocalSessionId=n;function o(a){return!!n(a)}s.isLocalSession=o;function i(a){if(a.scheme!==s.scheme||!a.authority)return;let l=a.path.split("/");if(l.length!==2)return;let c=a.authority,u=ir(l[1]);return{chatSessionType:c,sessionId:new TextDecoder().decode(u.buffer)}}})($l||={})});function jX(r){if(!r||typeof r!="object")return!1;if(Zt.isThemeIcon(r)||S.isUri(r))return!0;let t=r;return S.isUri(t.light)&&S.isUri(t.dark)}function O4(r){return typeof r=="object"&&r!==null&&r.$mid==="agentHostChatReference"}function U4(r,t,e,n,o){let i;try{i=S.parse(r.chatResource)}catch{return}return{kind:"chatReference",id:t,name:e,value:i,endTurn:r.endTurn,range:n,_meta:o}}function N4(r){return r.kind==="implicit"}function F4(r){return r.kind==="string"}function ND(r){return r.kind==="image"}function Gx(r){return r.kind==="element"}function H4(r){return r.kind==="promptFile"}function W4(r){return r.kind==="promptText"}function V4(r){let t=r;return typeof t=="object"&&t!==null&&(typeof t.value=="string"||typeof t.value>"u")&&(typeof t.name=="string"||typeof t.name>"u")&&(t.resourceUri===void 0||S.isUri(t.resourceUri))&&(typeof t.name=="string"||S.isUri(t.resourceUri))&&(t.iconPath===void 0||jX(t.iconPath))&&S.isUri(t.uri)&&typeof t.handle=="number"}var UD,L4,om,qh=v(()=>{ms();it();ra();te();Vt();Nh();ee();Ve();(i=>{i.icon=ne.error;function t(s){return{filterUri:s.resource,owner:s.owner,problemMessage:s.message,filterRange:{startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,startColumn:s.startColumn,endColumn:s.endColumn}}}i.fromMarker=t;function e(s){return{id:n(s),name:o(s),icon:i.icon,value:s,kind:"diagnostic",...s}}i.toEntry=e;function n(s){return[s.filterUri,s.owner,s.filterSeverity,s.filterRange?.startLineNumber,s.filterRange?.startColumn].join(":")}i.id=n;function o(s){let a;if((p=>(p[p.MaxChars=30]="MaxChars",p[p.MaxSpaceLookback=10]="MaxSpaceLookback"))(a||={}),s.problemMessage){if(s.problemMessage.length<30)return s.problemMessage;let c=s.problemMessage.lastIndexOf(" ",30);return c===-1||c+10<30?s.problemMessage.substring(0,30)+"\u2026":s.problemMessage.substring(0,c)+"\u2026"}let l=d(14999,null);return s.filterUri&&(l=d(15000,null,xn(s.filterUri))),l}i.label=o})(UD||={});L4="vscode.sessionReference";(n=>{function r(o){return S.isUri(o.value)?o.value:Ux(o.value)?o.value.uri:void 0}n.toUri=r;function t(o){if(o.value instanceof Uint8Array){let i={...o};return i.value={$base64:oo(O.wrap(o.value))},i}return Gx(o)&&o.imageData instanceof Uint8Array?{...o,imageData:{$base64:oo(O.wrap(o.imageData))}}:o}n.toExport=t;function e(o){if(o&&"values"in o&&Array.isArray(o.values))return{kind:"generic",id:o.id??"",name:o.name,value:o.values[0]?.value,range:o.range,modelDescription:o.modelDescription,references:o.references};if(o.value&&typeof o.value=="object"&&"$base64"in o.value&&typeof o.value.$base64=="string"){let i={...o};return i.value=ir(o.value.$base64).buffer,i}return Gx(o)&&o.imageData&&typeof o.imageData=="object"&&"$base64"in o.imageData&&typeof o.imageData.$base64=="string"?{...o,imageData:ir(o.imageData.$base64).buffer}:o}n.fromExport=e})(om||={})});var n9e,B4=v(()=>{Ve();Q();Me();fe();it();te();Tp();n9e=new Set([q.file,q.vscodeRemote])});function G4(r,t){let e=FD.get(r);if(e)return e;let n=QX(r,t);if(n){let o=q4.get(n)??0;o++,q4.set(n,o);let i=o===1?n:`${n}#${o}`;return FD.set(r,i),i}}function QX(r,t){let e=FD.get(r);if(e)return e;let n=t.owner?YX(t.owner)+".":"",o,i=t.debugNameSource;if(i!==void 0)if(typeof i=="function"){if(o=i(),o!==void 0)return n+o}else return n+i;let s=t.referenceFn;if(s!==void 0&&(o=$h(s),o!==void 0))return n+o;if(t.owner!==void 0){let a=JX(t.owner,r);if(a!==void 0)return n+a}}function JX(r,t){for(let e in r)if(r[e]===t)return e}function YX(r){let t=z4.get(r);if(t)return t;let e=HD(r)??"Object",n=$4.get(e)??0;n++,$4.set(e,n);let o=n===1?e:`${e}#${n}`;return z4.set(r,o),o}function HD(r){let t=r.constructor;if(t)return t.name==="Object"?void 0:t.name}function $h(r){let t=r.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t);return(n?n[1]:void 0)?.trim()}var Bn,q4,FD,$4,z4,Gr=v(()=>{Bn=class{constructor(t,e,n){this.owner=t;this.debugNameSource=e;this.referenceFn=n}getDebugName(t){return G4(t,this)}},q4=new Map,FD=new WeakMap;$4=new Map,z4=new WeakMap});function jo(r,t){return r===t}function XX(){return(r,t)=>r===t}function WD(r,t,e){return Gt(r,t,e??jo)}function ZX(r){return(t,e)=>Gt(t,e,r??jo)}function zh(r,t){if(r===t)return!0;if(Array.isArray(r)&&Array.isArray(t)){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(!zh(r[e],t[e]))return!1;return!0}if(r&&typeof r=="object"&&t&&typeof t=="object"&&Object.getPrototypeOf(r)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let e=r,n=t,o=Object.keys(e),i=Object.keys(n),s=new Set(i);if(o.length!==i.length)return!1;for(let a of o)if(!s.has(a)||!zh(e[a],n[a]))return!1;return!0}return!1}function eZ(){return(r,t)=>zh(r,t)}function tZ(r,t){return JSON.stringify(r)===JSON.stringify(t)}function nZ(){return(r,t)=>JSON.stringify(r)===JSON.stringify(t)}function oZ(){return(r,t)=>r.equals(t)}function rZ(r,t,e){return r==null||t===void 0||t===null?t===r:e(r,t)}function iZ(r){return(t,e)=>t==null||e===void 0||e===null?e===t:r(t,e)}var sZ,Kx=v(()=>{Dt();(p=>(p.strict=jo,p.strictC=XX,p.array=WD,p.arrayC=ZX,p.structural=zh,p.structuralC=eZ,p.jsonStringify=tZ,p.jsonStringifyC=nZ,p.thisC=oZ,p.ifDefined=rZ,p.ifDefinedC=iZ))(sZ||={})});var sr=v(()=>{ni();Kx();xe();ue();Q()});function VD(r){let t=new Error("BugIndicatingErrorRecovery: "+r);pt(t),console.error("recovered from an error that indicates a bug",t)}var K4=v(()=>{sr()});function Gh(r){ad?ad instanceof jx?ad.loggers.push(r):ad=new jx([ad,r]):ad=r}function nn(){return ad}function j4(r){BD=r}function Q4(r){BD&&BD(r)}var ad,BD,jx,Ts=v(()=>{jx=class{constructor(t){this.loggers=t}handleObservableCreated(t,e){for(let n of this.loggers)n.handleObservableCreated(t,e)}handleOnListenerCountChanged(t,e){for(let n of this.loggers)n.handleOnListenerCountChanged(t,e)}handleObservableUpdated(t,e){for(let n of this.loggers)n.handleObservableUpdated(t,e)}handleAutorunCreated(t,e){for(let n of this.loggers)n.handleAutorunCreated(t,e)}handleAutorunDisposed(t){for(let e of this.loggers)e.handleAutorunDisposed(t)}handleAutorunDependencyChanged(t,e,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(t,e,n)}handleAutorunStarted(t){for(let e of this.loggers)e.handleAutorunStarted(t)}handleAutorunFinished(t){for(let e of this.loggers)e.handleAutorunFinished(t)}handleDerivedDependencyChanged(t,e,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(t,e,n)}handleDerivedCleared(t){for(let e of this.loggers)e.handleDerivedCleared(t)}handleBeginTransaction(t){for(let e of this.loggers)e.handleBeginTransaction(t)}handleEndTransaction(t){for(let e of this.loggers)e.handleEndTransaction(t)}}});function Ki(r,t){let e=new zl(r,t);try{r(e)}finally{e.finish()}}function qD(r,t,e){r?t(r):Ki(t,e)}var zl,Ca=v(()=>{K4();Gr();Ts();zl=class{constructor(t,e){this._fn=t;this._getDebugName=e;this._updatingObservers=[];nn()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():$h(this._fn)}updateObserver(t,e){if(!this._updatingObservers){VD("Transaction already finished!"),Ki(n=>{n.updateObserver(t,e)});return}this._updatingObservers.push({observer:t,observable:e}),t.beginUpdate(e)}finish(){let t=this._updatingObservers;if(!t){VD("transaction.finish() has already been called!");return}for(let e=0;e<t.length;e++){let{observer:n,observable:o}=t[e];n.endUpdate(o)}this._updatingObservers=null,nn()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}}});function aZ(r){let t=r.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:r};let e=r.match(/at ([^\(\)]*):(\d+):(\d+)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:r}}var vn,$D,Kr=v(()=>{(n=>{let r=!1;function t(){r=!0}n.enable=t;function e(){if(!r)return;let o=Error,i=o.stackTraceLimit;o.stackTraceLimit=3;let s=new Error().stack;return o.stackTraceLimit=i,$D.fromStack(s,2)}n.ofCaller=e})(vn||={});$D=class r{constructor(t,e,n,o){this.fileName=t;this.line=e;this.column=n;this.id=o}static fromStack(t,e){let n=t.split(`
`),o=aZ(n[e+1]);if(o)return new r(o.fileName,o.line,o.column,o.id)}}});function J4(r){zD=r}function X4(r){Y4=r}function eB(r){Z4=r}function tB(r){GD=r}var zD,Y4,Z4,GD,Kh,KD,kr,ji=v(()=>{Kr();Gr();Ts();Kh=class{get TChange(){return null}reportChanges(){this.get()}read(t){return t?t.readObservable(this):this.get()}map(t,e,n=vn.ofCaller()){let o=e===void 0?void 0:t,i=e===void 0?t:e;return zD({owner:o,debugName:()=>{let s=$h(i);if(s!==void 0)return s;let l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i.toString());if(l)return`${this.debugName}.${l[2]}`;if(!o)return`${this.debugName} (mapped)`},debugReferenceFn:i},s=>i(this.read(s),s),n)}flatten(){return zD({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},t=>this.read(t).read(t))}recomputeInitiallyAndOnChange(t,e){return t.add(Y4(this,e)),this}keepObserved(t){return t.add(Z4(this)),this}get debugValue(){return this.get()}get debug(){return new KD(this)}},KD=class{constructor(t){this.observable=t}getDependencyGraph(){return GD(this.observable,{type:"dependencies"})}getObserverGraph(){return GD(this.observable,{type:"observers"})}},kr=class extends Kh{constructor(e){super();this._observers=new Set;nn()?.handleObservableCreated(this,e)}addObserver(e){let n=this._observers.size;this._observers.add(e),n===0&&this.onFirstObserverAdded(),n!==this._observers.size&&nn()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let n=this._observers.delete(e);n&&this._observers.size===0&&this.onLastObserverRemoved(),n&&nn()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!nn();return Q4(this),e||nn()?.handleObservableCreated(this,vn.ofCaller()),this}debugGetObservers(){return this._observers}}});function qn(r,t,e=vn.ofCaller()){let n;return typeof r=="string"?n=new Bn(void 0,r,void 0):n=new Bn(r,void 0,void 0),new Ps(n,t,jo,e)}var Ps,Ea=v(()=>{Ca();ji();sr();Gr();Ts();Kr();Ps=class extends kr{constructor(e,n,o,i){super(i);this._debugNameData=e;this._equalityComparator=o;this._value=n,nn()?.handleObservableUpdated(this,{hadValue:!1,newValue:n,change:void 0,didChange:!0,oldValue:void 0})}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}get(){return this._value}set(e,n,o){if(o===void 0&&this._equalityComparator(this._value,e))return;let i;n||(n=i=new zl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),nn()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:o,didChange:!0,hadValue:!0});for(let a of this._observers)n.updateObserver(a,this),a.handleChange(this,o)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}});var Qx,nB=v(()=>{Ca();Ts();ji();Qx=class extends kr{constructor(e,n,o,i){super(i);this._debugNameData=e;this._equalityComparator=o;this._isUpToDate=!0;this._deltas=[];this._updateCounter=0;this._value=n}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){nn()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let n of this._observers)n.handleChange(this,e)}this._deltas.length=0}else{nn()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let n of e)n.endUpdate(this)}}addObserver(e){let n=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),n&&e.beginUpdate(this)}removeObserver(e){let n=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),n&&e.endUpdate(this)}set(e,n,o){if(o===void 0&&this._equalityComparator(this._value,e))return;let i;n||(n=i=new zl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),o!==void 0&&this._deltas.push(o),n.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(s,a)=>{},handlePossibleChange:s=>{}},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}});function jh(r,t,e=vn.ofCaller()){return r.lazy?new Qx(new Bn(r.owner,r.debugName,void 0),t,r.equalsFn??jo,e):new Ps(new Bn(r.owner,r.debugName,void 0),t,r.equalsFn??jo,e)}var Jx=v(()=>{Gr();sr();Ea();nB();Kr()});function lZ(r){switch(r){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var wa,Yx=v(()=>{sr();Ts();wa=class{constructor(t,e,n,o){this._debugNameData=t;this._runFn=e;this._changeTracker=n;this._state=2;this._updateCount=0;this._disposed=!1;this._dependencies=new Set;this._dependenciesToBeRemoved=new Set;this._isRunning=!1;this._iteration=0;this._store=void 0;this._delayedStore=void 0;this._changeSummary=this._changeTracker?.createChangeSummary(void 0),nn()?.handleAutorunCreated(this,o),this._run(),Va(this)}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}dispose(){if(!this._disposed){this._disposed=!0;for(let t of this._dependencies)t.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),nn()?.handleAutorunDisposed(this),Ba(this)}}_run(){let t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t,this._state=3;try{if(!this._disposed){nn()?.handleAutorunStarted(this);let e=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(o){Ha(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||nn()?.handleAutorunFinished(this);for(let e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(t){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(t){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let e of this._dependencies)if(e.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}gg(()=>this._updateCount>=0)}handlePossibleChange(t){this._state===3&&this._isDependency(t)&&(this._checkIterations(),this._state=1)}handleChange(t,e){if(this._isDependency(t)){nn()?.handleAutorunDependencyChanged(this,t,e);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:t,change:e,didChange:o=>o===t},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){Ha(n)}}}_isDependency(t){return this._dependencies.has(t)&&!this._dependenciesToBeRemoved.has(t)}_ensureNoRunning(){if(!this._isRunning)throw new Et("The reader object cannot be used outside its compute function!")}readObservable(t){if(this._ensureNoRunning(),this._disposed)return t.get();t.addObserver(this);let e=t.get();return this._dependencies.add(t),this._dependenciesToBeRemoved.delete(t),e}get store(){if(this._ensureNoRunning(),this._disposed)throw new Et("Cannot access store after dispose");return this._store===void 0&&(this._store=new re),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Et("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new re),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:lZ(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?(Ha(new Et(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}}});function Qo(r,t=vn.ofCaller()){return new wa(new Bn(void 0,void 0,r),r,void 0,t)}function jD(r,t,e=vn.ofCaller()){let n,o=!1;n=Qo(i=>{t({delayedStore:i.delayedStore,store:i.store,readObservable:i.readObservable.bind(i),dispose:()=>{n?r.delete(n):o=!0}})},e),o?n.dispose():r.add(n)}var ld=v(()=>{sr();Gr();Yx();Kr();Ea();Ca()});function cZ(r){switch(r){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var Xn,rm=v(()=>{ji();sr();Ts();Xn=class extends kr{constructor(e,n,o,i=void 0,s,a){super(a);this._debugNameData=e;this._computeFn=n;this._changeTracker=o;this._handleLastObserverRemoved=i;this._equalityComparator=s;this._state=0;this._value=void 0;this._updateCount=0;this._dependencies=new Set;this._dependenciesToBeRemoved=new Set;this._changeSummary=void 0;this._isUpdating=!1;this._isComputing=!1;this._didReportChange=!1;this._isInBeforeUpdate=!1;this._isReaderValid=!1;this._store=void 0;this._delayedStore=void 0;this._removedObserverToCallEndUpdateOn=null;this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}onLastObserverRemoved(){this._state=0,this._value=void 0,nn()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let n;try{this._isReaderValid=!0;let o;this._changeTracker&&(o=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,o)),n=this._computeFn(this,o)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),n}else{do{if(this._state===1){for(let n of this._dependencies)if(n.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let n=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=n;try{let o=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,o),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(o));let i=this._state!==0,s=this._value;this._state=3;let a=this._delayedStore;a!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,o)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),a!==void 0&&a.dispose()}e=this._didReportChange||i&&!this._equalityComparator(s,this._value),nn()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:i})}catch(o){Ha(o)}if(this._isComputing=!1,!this._didReportChange&&e)for(let o of this._observers)o.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new Et("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let n=this._updateCount===1;if(this._state===3&&(this._state=1,!n))for(let o of this._observers)o.handlePossibleChange(this);if(n)for(let o of this._observers)o.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let n=[...this._observers];for(let o of n)o.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let o=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let i of o)i.endUpdate(this)}}gg(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let n of this._observers)n.handlePossibleChange(this)}}handleChange(e,n){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){nn()?.handleDerivedDependencyChanged(this,e,n);let o=!1;try{o=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:n,didChange:s=>s===e},this._changeSummary):!0}catch(s){Ha(s)}let i=this._state===3;if(o&&(this._state===1||i)&&(this._state=2,i))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new Et("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let n=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),n}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let n of this._observers)n.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new re),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new re),this._delayedStore}addObserver(e){let n=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),n&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:cZ(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,n,o){this._value=e;let i=this._observers;n.updateObserver(this,this);for(let s of i)s.handleChange(this,o)}}});function im(r,t,e=vn.ofCaller()){return t!==void 0?new Xn(new Bn(r,void 0,t),t,void 0,void 0,jo,e):new Xn(new Bn(void 0,void 0,r),r,void 0,void 0,jo,e)}function sm(r,t,e=vn.ofCaller()){return new Xn(new Bn(r.owner,r.debugName,r.debugReferenceFn),t,void 0,r.onLastObserverRemoved,r.equalsFn??jo,e)}var Xx=v(()=>{sr();Kr();Gr();ji();rm();J4(sm)});var oB=v(()=>{ld();Ca();Xx();Ea()});var QD=v(()=>{xe();Jt()});var rB=v(()=>{Gr();QD();sr();ld();rm();Kr()});function Ii(...r){let t,e,n,o;return r.length===2?[e,n]=r:[t,e,n,o]=r,new vi(new Bn(t,void 0,n),e,n,()=>vi.globalTransaction,jo,o??vn.ofCaller())}var vi,Gl=v(()=>{Ca();sr();Gr();Ts();ji();Kr();vi=class extends kr{constructor(e,n,o,i,s,a){super(a);this._debugNameData=e;this.event=n;this._getValue=o;this._getTransaction=i;this._equalityComparator=s;this._hasValue=!1;this.handleEvent=e=>{let n=this._getValue(e),o=this._value,i=this._hasValue,s=!i||!this._equalityComparator(o,n),a=!1;s&&(this._value=n,this._hasValue=!0,i&&(a=!0,qD(this._getTransaction(),l=>{nn()?.handleObservableUpdated(this,{oldValue:o,newValue:n,change:void 0,didChange:s,hadValue:i});for(let c of this._observers)l.updateObserver(c,this),c.handleChange(this,void 0)},()=>{let l=this.getDebugName();return"Event fired"+(l?`: ${l}`:"")}))),a||nn()?.handleObservableUpdated(this,{oldValue:o,newValue:n,change:void 0,didChange:s,hadValue:i})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};(e=>{e.Observer=vi;function t(n,o){let i=!1;vi.globalTransaction===void 0&&(vi.globalTransaction=n,i=!0);try{o()}finally{i&&(vi.globalTransaction=void 0)}}e.batchEventsGlobally=t})(Ii||={})});function eC(r,t=vn.ofCaller()){return typeof r=="string"?new Zx(r,void 0,t):new Zx(void 0,r,t)}var Zx,JD=v(()=>{Ca();Gr();ji();Kr();Zx=class extends kr{constructor(e,n,o){super(o);this._debugName=e;this._owner=n}get debugName(){return new Bn(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}trigger(e,n){if(!e){Ki(o=>{this.trigger(o,n)},()=>`Trigger signal ${this.debugName}`);return}for(let o of this._observers)e.updateObserver(o,this),o.handleChange(this,n)}get(){}}});function iB(r){let t=new tC(!1,void 0);return r.addObserver(t),se(()=>{r.removeObserver(t)})}function sB(r,t){let e=new tC(!0,t);r.addObserver(e);try{e.beginUpdate(r)}finally{e.endUpdate(r)}return se(()=>{r.removeObserver(e)})}var tC,YD=v(()=>{ld();Ea();sr();Xx();Gl();JD();ji();Kr();eB(iB);X4(sB);tC=class{constructor(t,e){this._forceRecompute=t;this._handleValue=e;this._counter=0}beginUpdate(t){this._counter++}endUpdate(t){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(t.get()):t.reportChanges()),this._counter--}handlePossibleChange(t){}handleChange(t,e){}}});var aB=v(()=>{sr()});function am(r){return new XD(r)}var XD,lB=v(()=>{ji();XD=class extends Kh{constructor(e){super();this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});function e_(r,t,e=vn.ofCaller()){return new ZD(typeof r=="string"?r:new Bn(r,void 0,void 0),t,e)}var ZD,cB=v(()=>{Ca();Gr();ji();Kr();ZD=class extends kr{constructor(e,n,o){super(o);this.event=n;this.handleEvent=()=>{Ki(e=>{for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,void 0)},()=>this.debugName)};this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var dB=v(()=>{sr();Gl()});var uB=v(()=>{QD();sr();ld()});var pB=v(()=>{sr();Gr();Gl();ld();YD()});var mB=v(()=>{Jx()});var gB=v(()=>{Jx()});function fB(r){nC||(nC=new Qh,Gh(nC)),nC.addFilteredObj(r)}function gZ(r){let t=new Array,e=[],n="";function o(s){if("length"in s)for(let a of s)a&&o(a);else"text"in s?(n+=`%c${s.text}`,t.push(s.style),s.data&&e.push(...s.data)):"data"in s&&e.push(...s.data)}o(r);let i=[n,...t];return i.push(...e),i}function lm(r){return bi(r,{color:"black"})}function cm(r){return bi(vZ(`${r}: `,10),{color:"black",bold:!0})}function bi(r,t={color:"black"}){function e(o){return Object.entries(o).reduce((i,[s,a])=>`${i}${s}:${a};`,"")}let n={color:t.color};return t.strikeThrough&&(n["text-decoration"]="line-through"),t.bold&&(n["font-weight"]="bold"),{text:r,style:e(n)}}function jr(r,t){switch(typeof r){case"number":return""+r;case"string":return r.length+2<=t?`"${r}"`:`"${r.substr(0,t-7)}"+...`;case"boolean":return r?"true":"false";case"undefined":return"undefined";case"object":return r===null?"null":Array.isArray(r)?fZ(r,t):hZ(r,t);case"symbol":return r.toString();case"function":return`[[Function${r.name?" "+r.name:""}]]`;default:return""+r}}function fZ(r,t){let e="[ ",n=!0;for(let o of r){if(n||(e+=", "),e.length-5>t){e+="...";break}n=!1,e+=`${jr(o,t-e.length)}`}return e+=" ]",e}function hZ(r,t){if(typeof r.toString=="function"&&r.toString!==Object.prototype.toString){let i=r.toString();return i.length<=t?i:i.substring(0,t-3)+"..."}let e=HD(r),n=e?e+"(":"{ ",o=!0;for(let[i,s]of Object.entries(r)){if(o||(n+=", "),n.length-5>t){n+="...";break}o=!1,n+=`${i}: ${jr(s,t-n.length)}`}return n+=e?")":" }",n}function yZ(r,t){let e="";for(let n=1;n<=t;n++)e+=r;return e}function vZ(r,t){for(;r.length<t;)r+=" ";return r}var nC,Qh,oC=v(()=>{Ts();Gr();rm();Qh=class{constructor(){this.indentation=0;this.changedObservablesSets=new WeakMap}addFilteredObj(t){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(t)}_isIncluded(t){return this._filteredObjects?.has(t)??!0}textToConsoleArgs(t){return gZ([lm(yZ("| ",this.indentation)),t])}formatInfo(t){return t.hadValue?t.didChange?[lm(" "),bi(jr(t.oldValue,70),{color:"red",strikeThrough:!0}),lm(" "),bi(jr(t.newValue,60),{color:"green"})]:[lm(" (unchanged)")]:[lm(" "),bi(jr(t.newValue,60),{color:"green"}),lm(" (initial)")]}handleObservableCreated(t){if(t instanceof Xn){let e=t;if(this.changedObservablesSets.set(e,new Set),!1){let o=[];e.__debugUpdating=o;let i=e.beginUpdate;e.beginUpdate=a=>(o.push(a),i.apply(e,[a]));let s=e.endUpdate;e.endUpdate=a=>{let l=o.indexOf(a);return l===-1&&console.error("endUpdate called without beginUpdate",e.debugName,a.debugName),o.splice(l,1),s.apply(e,[a])}}}}handleOnListenerCountChanged(t,e){}handleObservableUpdated(t,e){if(this._isIncluded(t)){if(t instanceof Xn){this._handleDerivedRecomputed(t,e);return}console.log(...this.textToConsoleArgs([cm("observable value changed"),bi(t.debugName,{color:"BlueViolet"}),...this.formatInfo(e)]))}}formatChanges(t){if(t.size!==0)return bi(" (changed deps: "+[...t].map(e=>e.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(t,e,n){this._isIncluded(t)&&this.changedObservablesSets.get(t)?.add(e)}_handleDerivedRecomputed(t,e){if(!this._isIncluded(t))return;let n=this.changedObservablesSets.get(t);n&&(console.log(...this.textToConsoleArgs([cm("derived recomputed"),bi(t.debugName,{color:"BlueViolet"}),...this.formatInfo(e),this.formatChanges(n),{data:[{fn:t._debugNameData.referenceFn??t._computeFn}]}])),n.clear())}handleDerivedCleared(t){this._isIncluded(t)&&console.log(...this.textToConsoleArgs([cm("derived cleared"),bi(t.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(t,e){this._isIncluded(t)&&console.log(...this.textToConsoleArgs([cm("observable from event triggered"),bi(t.debugName,{color:"BlueViolet"}),...this.formatInfo(e),{data:[{fn:t._getValue}]}]))}handleAutorunCreated(t){this._isIncluded(t)&&this.changedObservablesSets.set(t,new Set)}handleAutorunDisposed(t){}handleAutorunDependencyChanged(t,e,n){this._isIncluded(t)&&this.changedObservablesSets.get(t).add(e)}handleAutorunStarted(t){let e=this.changedObservablesSets.get(t);e&&(this._isIncluded(t)&&console.log(...this.textToConsoleArgs([cm("autorun"),bi(t.debugName,{color:"BlueViolet"}),this.formatChanges(e),{data:[{fn:t._debugNameData.referenceFn??t._runFn}]}])),e.clear(),this.indentation++)}handleAutorunFinished(t){this.indentation--}handleBeginTransaction(t){let e=t.getDebugName();e===void 0&&(e=""),this._isIncluded(t)&&console.log(...this.textToConsoleArgs([cm("transaction"),bi(e,{color:"BlueViolet"}),{data:[{fn:t._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}}});var rC,hB=v(()=>{rC=class r{constructor(t,e){this._channelFactory=t;this._getHandler=e;this._channel=this._channelFactory({handleNotification:i=>{let s=i,a=this._getHandler().notifications[s[0]];if(!a)throw new Error(`Unknown notification "${s[0]}"!`);a(...s[1])},handleRequest:i=>{let s=i;try{return{type:"result",value:this._getHandler().requests[s[0]](...s[1])}}catch(a){return{type:"error",value:a}}}});let n=new Proxy({},{get:(i,s)=>{if(s!=="then")return async(...a)=>{let l=await this._channel.sendRequest([s,a]);if(l.type==="error")throw l.value;return l.value}}}),o=new Proxy({},{get:(i,s)=>{if(s!=="then")return(...a)=>{this._channel.sendNotification([s,a])}}});this.api={notifications:o,requests:n}}static createHost(t,e){return new r(t,e)}static createClient(t,e){return new r(t,e)}}});function yB(r,t){let e=globalThis,n=[],o,{channel:i,handler:s}=IZ({sendNotification:l=>{o?o.sendNotification(l):n.push(l)}}),a;return(e.$$debugValueEditor_debugChannels??(e.$$debugValueEditor_debugChannels={}))[r]=l=>{a=t(),o=l;for(let c of n)l.sendNotification(c);return n=[],s},rC.createClient(i,()=>{if(!a)throw new Error("Not supported");return a})}function IZ(r){let t;return{channel:n=>(t=n,{sendNotification:o=>{r.sendNotification(o)},sendRequest:o=>{throw new Error("not supported")}}),handler:{handleRequest:n=>n.type==="notification"?t?.handleNotification(n.data):t?.handleRequest(n.data)}}}var vB=v(()=>{hB()});function t_(r,t){for(let e in t)r[e]&&typeof r[e]=="object"&&t[e]&&typeof t[e]=="object"?t_(r[e],t[e]):r[e]=t[e]}function n_(r,t){for(let e in t)t[e]===null?delete r[e]:r[e]&&typeof r[e]=="object"&&t[e]&&typeof t[e]=="object"?n_(r[e],t[e]):r[e]=t[e]}var iC,IB=v(()=>{iC=class{constructor(){this._timeout=void 0}throttle(t,e){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,t()},e))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}});var sC,bB=v(()=>{Yx();oC();vB();IB();Ie();Gl();xe();rm();Ea();Kr();sC=class r{constructor(){this._declarationId=0;this._instanceId=0;this._declarations=new Map;this._instanceInfos=new WeakMap;this._aliveInstances=new Map;this._activeTransactions=new Set;this._channel=yB("observableDevTools",()=>({notifications:{setDeclarationIdFilter:t=>{},logObservableValue:t=>{console.log("logObservableValue",t)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{let t={};for(let e of this._declarations.values())t[e.id]=e;return{decls:t}},getSummarizedInstances:()=>null,getObservableValueInfo:t=>({observers:[...this._aliveInstances.get(t).debugGetObservers()].map(n=>this._formatObserver(n)).filter(oi)}),getDerivedInfo:t=>{let e=this._aliveInstances.get(t);return{dependencies:[...e.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(oi),observers:[...e.debugGetObservers()].map(n=>this._formatObserver(n)).filter(oi)}},getAutorunInfo:t=>({dependencies:[...this._aliveInstances.get(t).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(oi)}),getTransactionState:()=>this.getTransactionState(),setValue:(t,e)=>{let n=this._aliveInstances.get(t);if(n instanceof Xn)n.debugSetValue(e);else if(n instanceof Ps)n.debugSetValue(e);else if(n instanceof vi)n.debugSetValue(e);else throw new Et("Observable is not supported");let o=[...n.debugGetObservers()];for(let i of o)i.beginUpdate(n);for(let i of o)i.handleChange(n,void 0);for(let i of o)i.endUpdate(n)},getValue:t=>{let e=this._aliveInstances.get(t);if(e instanceof Xn)return jr(e.debugGetState().value,200);if(e instanceof Ps)return jr(e.debugGetState().value,200)},logValue:t=>{let e=this._aliveInstances.get(t);if(e&&"get"in e)console.log("Logged Value:",e.get());else throw new Et("Observable is not supported")},rerun:t=>{let e=this._aliveInstances.get(t);if(e instanceof Xn)e.debugRecompute();else if(e instanceof wa)e.debugRerun();else throw new Et("Observable is not supported")}}}));this._pendingChanges=null;this._changeThrottler=new iC;this._fullState={};this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)};vn.enable()}static{this._instance=void 0}static getInstance(){return r._instance===void 0&&(r._instance=new r),r._instance}getTransactionState(){let t=[],e=[...this._activeTransactions];if(e.length===0)return;let n=e.flatMap(i=>i.debugGetUpdatingObservers()??[]).map(i=>i.observer),o=new Set;for(;n.length>0;){let i=n.shift();if(o.has(i))continue;o.add(i);let s=this._getInfo(i,a=>{o.has(a)||n.push(a)});s&&t.push(s)}return{names:e.map(i=>i.getDebugName()??"tx"),affected:t}}_getObservableInfo(t){let e=this._instanceInfos.get(t);if(!e){pt(new Et("No info found"));return}return e}_getAutorunInfo(t){let e=this._instanceInfos.get(t);if(!e){pt(new Et("No info found"));return}return e}_getInfo(t,e){if(t instanceof Xn){let n=[...t.debugGetObservers()];for(let l of n)e(l);let o=this._getObservableInfo(t);if(!o)return;let i=t.debugGetState(),s={name:t.debugName,instanceId:o.instanceId,updateCount:i.updateCount},a=[...o.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(oi);if(i.isComputing)return{...s,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(i.state){case 0:return{...s,type:"observable/derived",state:"noValue"};case 3:return{...s,type:"observable/derived",state:"upToDate"};case 2:return{...s,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...s,type:"observable/derived",state:"possiblyStale"}}}else if(t instanceof wa){let n=this._getAutorunInfo(t);if(!n)return;let o={name:t.debugName,instanceId:n.instanceId,updateCount:n.updateCount},i=[...n.changedObservables].map(s=>this._instanceInfos.get(s).instanceId);if(t.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:i};switch(t.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:i};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(t){let e=this._getObservableInfo(t);if(e)return{name:t.debugName,instanceId:e.instanceId}}_formatObserver(t){if(t instanceof Xn)return{name:t.toString(),instanceId:this._getObservableInfo(t)?.instanceId};let e=this._getAutorunInfo(t);if(e)return{name:t.toString(),instanceId:e.instanceId}}_handleChange(t){n_(this._fullState,t),this._pendingChanges===null?this._pendingChanges=t:t_(this._pendingChanges,t),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(t,e){if(!e)return-1;let n=this._declarations.get(e.id);return n===void 0&&(n={id:this._declarationId++,type:t,url:e.fileName,line:e.line,column:e.column},this._declarations.set(e.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(t,e){let o={declarationId:this._getDeclarationId("observable/value",e),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(t,o)}handleOnListenerCountChanged(t,e){let n=this._getObservableInfo(t);if(n){if(n.listenerCount===0&&e>0){let o=t instanceof Xn?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,t),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:t.debugName}}})}else n.listenerCount>0&&e===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=e}}handleObservableUpdated(t,e){if(t instanceof Xn){this._handleDerivedRecomputed(t,e);return}let n=this._getObservableInfo(t);n&&e.didChange&&(n.lastValue=jr(e.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(t,e){let o={declarationId:this._getDeclarationId("autorun",e),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(t,o),this._aliveInstances.set(o.instanceId,t),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:t.debugName}}})}handleAutorunDisposed(t){let e=this._getAutorunInfo(t);e&&(this._handleChange({instances:{[e.instanceId]:null}}),this._instanceInfos.delete(t),this._aliveInstances.delete(e.instanceId))}handleAutorunDependencyChanged(t,e,n){let o=this._getAutorunInfo(t);o&&o.changedObservables.add(e)}handleAutorunStarted(t){}handleAutorunFinished(t){let e=this._getAutorunInfo(t);e&&(e.changedObservables.clear(),e.updateCount++,this._handleChange({instances:{[e.instanceId]:{runCount:e.updateCount}}}))}handleDerivedDependencyChanged(t,e,n){let o=this._getObservableInfo(t);o&&o.changedObservables.add(e)}_handleDerivedRecomputed(t,e){let n=this._getObservableInfo(t);if(!n)return;let o=jr(e.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(t){let e=this._getObservableInfo(t);e&&(e.lastValue=void 0,e.changedObservables.clear(),e.listenerCount>0&&this._handleChange({instances:{[e.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(t){this._activeTransactions.add(t)}handleEndTransaction(t){this._activeTransactions.delete(t)}}});function SB(r,t){let e=t?.debugNamePostProcessor??(i=>i),n=cd.from(r,e);if(!n)return"";let o=new Set;return t.type==="observers"?CB(n,0,o,t).trim():xB(n,0,o,t).trim()}function xB(r,t,e,n){let o=" ".repeat(t),i=[];if(e.has(r.sourceObj))return i.push(`${o}* ${r.type} ${r.name} (already listed)`),i.join(`
`);if(e.add(r.sourceObj),i.push(`${o}* ${r.type} ${r.name}:`),i.push(`${o} value: ${jr(r.value,50)}`),i.push(`${o} state: ${r.state}`),r.dependencies.length>0){i.push(`${o} dependencies:`);for(let a of r.dependencies){let l=cd.from(a,n.debugNamePostProcessor??(c=>c))??cd.unknown(a);i.push(xB(l,t+1,e,n))}}return i.join(`
`)}function CB(r,t,e,n){let o=" ".repeat(t),i=[];if(e.has(r.sourceObj))return i.push(`${o}* ${r.type} ${r.name} (already listed)`),i.join(`
`);if(e.add(r.sourceObj),i.push(`${o}* ${r.type} ${r.name}:`),i.push(`${o} value: ${jr(r.value,50)}`),i.push(`${o} state: ${r.state}`),r.observers.length>0){i.push(`${o} observers:`);for(let a of r.observers){let l=cd.from(a,n.debugNamePostProcessor??(c=>c))??cd.unknown(a);i.push(CB(l,t+1,e,n))}}return i.join(`
`)}var cd,EB=v(()=>{rm();Gl();Ea();Yx();oC();cd=class r{constructor(t,e,n,o,i,s,a){this.sourceObj=t;this.name=e;this.type=n;this.value=o;this.state=i;this.dependencies=s;this.observers=a}static from(t,e){if(t instanceof wa){let n=t.debugGetState();return new r(t,e(t.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(t instanceof Xn){let n=t.debugGetState();return new r(t,e(t.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(t.debugGetObservers()))}else if(t instanceof Ps){let n=t.debugGetState();return new r(t,e(t.debugName),"observableValue",n.value,"upToDate",[],Array.from(t.debugGetObservers()))}else if(t instanceof vi){let n=t.debugGetState();return new r(t,e(t.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(t.debugGetObservers()))}}static unknown(t){return new r(t,"(unknown)","unknown",void 0,"unknown",[],[])}}});var xZ,RB=v(()=>{Jx();ld();Ea();Xx();oB();rB();YD();aB();lB();JD();Gl();cB();Ca();dB();uB();pB();Gl();Ea();mB();gB();Kr();Ts();oC();bB();hr();ji();EB();tB(SB);j4(fB);xZ=!1;xZ&&Gh(new Qh);Qt&&Qt.VSCODE_DEV_DEBUG_OBSERVABLES&&Gh(sC.getInstance())});var ks=v(()=>{RB()});function CZ(r){return!!r&&typeof r=="object"&&"uri"in r&&r.uri instanceof S&&"version"in r&&typeof r.version=="number"&&"ranges"in r&&Array.isArray(r.ranges)&&r.ranges.every(Mn.isIRange)}function TB(r){return!!r&&typeof r=="object"&&"documents"in r&&Array.isArray(r.documents)&&r.documents.every(CZ)}function PB(r){return!!r&&typeof r=="object"&&"command"in r&&"language"in r}var t3e,Pe,EZ,kB,dm=v(()=>{ee();Mb();Q();ks();fe();Ie();te();ba();Z();t3e=Af.NumberFormat(Un,{maximumFractionDigits:1});(y=>{let r;(X=>(X[X.Streaming=0]="Streaming",X[X.WaitingForConfirmation=1]="WaitingForConfirmation",X[X.Executing=2]="Executing",X[X.WaitingForPostApproval=3]="WaitingForPostApproval",X[X.Completed=4]="Completed",X[X.Cancelled=5]="Cancelled",X[X.WaitingForAuthentication=6]="WaitingForAuthentication"))(r=y.StateKind||={});function t(h,I){if(h.kind==="toolInvocationSerialized")return h.isConfirmed===void 0||typeof h.isConfirmed=="boolean"?{type:h.isConfirmed?4:0}:h.isConfirmed;let x=h.state.read(I);if(!(x.type===0||x.type===1))return x.type===5?{type:x.reason,...x.source!==void 0?{source:x.source}:{}}:x.confirmed}y.executionConfirmedOrDenied=t;function e(h,I){let x=t(h);if(x)return Promise.resolve(x);let E=new re;return new Promise(T=>{I&&E.add(I.onCancellationRequested(()=>{T({type:0})})),E.add(Qo(P=>{let M=t(h,P);M&&(E.dispose(),T(M))}))}).finally(()=>{E.dispose()})}y.awaitConfirmation=e;function n(h,I){let x=h.state.read(I);if(x.type===4)return x.postConfirmed||{type:1};if(x.type===5)return{type:x.reason,...x.source!==void 0?{source:x.source}:{}}}function o(h,I){let x=h?.state.get();return x?.type===1||x?.type===3?(x.confirm(I),!0):!1}y.confirmWith=o;function i(h,I){let x=n(h);if(x)return Promise.resolve(x);let E=new re;return new Promise(T=>{I&&E.add(I.onCancellationRequested(()=>{T({type:0})})),E.add(Qo(P=>{let M=n(h,P);M&&(E.dispose(),T(M))}))}).finally(()=>{E.dispose()})}y.awaitPostConfirmation=i;function s(h,I){if(h.kind==="toolInvocationSerialized")return h.resultDetails;let x=h.state.read(I);if(x.type===4||x.type===3||x.type===5)return x.resultDetails}y.resultDetails=s;function a(h,I){if(h.kind==="toolInvocationSerialized")return h.resultError;let x=h.state.read(I);return x.type===4||x.type===3?x.resultError:void 0}y.resultError=a;function l(h,I){if(h.kind==="toolInvocationSerialized")return!0;let x=h.state.read(I);return x.type===4||x.type===5}y.isComplete=l;function c(h,I){return!!(h.presentation==="hidden"||h.presentation==="hiddenAfterComplete"&&l(h,I))}y.isEffectivelyHidden=c;function u(h){return h.toolSpecificData?.kind==="generatedImage"||h.toolSpecificData?.kind==="input"&&!!h.toolSpecificData.imageGeneration||h.toolId==="image_gen.imagegen"||h.toolId==="image_generation"}y.isImageGeneration=u;function p(h,I){return h.kind==="toolInvocationSerialized"?!1:h.state.read(I).type===0}y.isStreaming=p;function m(h,I){if(h.kind==="toolInvocationSerialized")return;let x=h.state.read(I);if(x.type!==0)return x.parameters}y.getParameters=m;function g(h,I){if(h.kind==="toolInvocationSerialized")return;let x=h.state.read(I);if(x.type!==0)return x.confirmationMessages}y.getConfirmationMessages=g})(Pe||={});(o=>{function r(i){return i.kind==="sent"}o.isSent=r;function t(i){return i.kind==="rejected"}o.isRejected=t;function e(i){return i.kind==="queued"}o.isQueued=e;function n(i){if(i.kind!=="sent")throw new Error(`Expected ChatSendResult to be 'sent', but was '${i.kind}'`)}o.assertSent=n})(EZ||={});kB=A("IChatService")});var s3e,a3e,l3e,c3e,AB,o_,d3e,u3e,p3e,m3e,wZ,g3e,r_=v(()=>{fe();ee();ro();s3e=new C("isMac",vt,d(4211,null)),a3e=new C("isLinux",Ke,d(4210,null)),l3e=new C("isWindows",oe,d(4215,null)),c3e=new C("isChromeOS",iv,d(4208,null)),AB=new C("isWeb",bn,d(4214,null)),o_=new C("isMacNative",vt&&!bn,d(4212,null)),d3e=new C("isIOS",L0,d(4209,null)),u3e=new C("isMobile",O0,d(4213,null)),p3e=new C("isDevelopment",!1,!0),m3e=new C("productQualityType","",d(4216,null)),wZ="inputFocus",g3e=new C(wZ,!1,d(4207,null))});var i_,DB=v(()=>{Z();i_=A("languageService")});var s_,_B=v(()=>{Z();s_=A("modelService")});var MB=v(()=>{Me();fe();te()});var V3e,B3e,q3e,$3e,z3e,G3e,LB,K3e,j3e,OB,Q3e,J3e,Y3e,X3e,Z3e,eGe,tGe,nGe,oGe,UB,RZ,rGe,iGe,sGe,aGe,lGe,cGe,dGe,uGe,pGe,mGe,gGe,fGe,hGe,yGe,vGe,IGe,bGe,SGe,xGe,CGe,EGe,wGe,RGe,TGe,PGe,kGe,TZ,AGe,DGe,_Ge,MGe,LGe,OGe,UGe,NGe,FGe,HGe,WGe,VGe,BGe,qGe,$Ge,zGe,GGe,KGe,jGe,QGe,JGe,YGe,XGe,ZGe,eKe,tKe,nKe,oKe,rKe,iKe,sKe,aKe,lKe,cKe,dKe,uKe,pKe,mKe,gKe,fKe,hKe,yKe,vKe,IKe,bKe,SKe,xKe,CKe,ar,aC,a_=v(()=>{Q();ee();ro();r_();it();DB();st();_B();Me();MB();Wh();V3e=new C("workbenchState",void 0,{type:"string",description:d(7035,null)}),B3e=new C("workspaceFolderCount",0,d(7036,null)),q3e=new C("openFolderWorkspaceSupport",!0,!0),$3e=new C("enterMultiRootWorkspaceSupport",!0,!0),z3e=new C("emptyWorkspaceSupport",!0,!0),G3e=new C("dirtyWorkingCopies",!1,d(6968,null)),LB=new C("remoteName","",d(7009,null)),K3e=new C("virtualWorkspace","",d(7034,null)),j3e=new C("temporaryWorkspace",!1,d(7026,null)),OB=new C("isSessionsWindow",!1,d(6994,null)),Q3e=new C("hasWebFileSystemAccess",!1,!0),J3e=new C("embedderIdentifier",void 0,d(6983,null)),Y3e=new C("inAutomation",!1,d(6986,null)),X3e=new C("isEnabledFileDownloads",!0,!0),Z3e=new C("isEnabledFileUploads",!0,!0),eGe=new C("isEnabledCoderGettingStarted",!0,!0),tGe=new C("isFullscreen",!1,d(6992,null)),nGe=new C("isAuxiliaryWindowFocusedContext",!1,d(6989,null)),oGe=new C("isWindowAlwaysOnTop",!1,d(6996,null)),UB=new C("isAuxiliaryWindow",!1,d(6988,null)),RZ=tt.or(o_,tt.and(tt.notEquals("config.window.menuBarVisibility","hidden"),tt.notEquals("config.window.menuBarVisibility","toggle"),tt.notEquals("config.window.menuBarVisibility","compact"))),rGe=tt.and(o_.negate(),RZ),iGe=new C("activeEditorIsDirty",!1,d(6956,null)),sGe=new C("activeEditorIsNotPreview",!1,d(6959,null)),aGe=new C("activeEditorIsFirstInGroup",!1,d(6957,null)),lGe=new C("activeEditorIsLastInGroup",!1,d(6958,null)),cGe=new C("activeEditorIsPinned",!1,d(6960,null)),dGe=new C("activeEditorIsReadonly",!1,d(6961,null)),uGe=new C("activeCompareEditorCanSwap",!1,d(6944,null)),pGe=new C("activeEditorCanToggleReadonly",!0,d(6951,null)),mGe=new C("activeEditorCanRevert",!1,d(6950,null)),gGe=new C("activeEditorCanSplitInGroup",!0),fGe=new C("activeEditorCannotClose",!1,d(6949,null)),hGe=new C("activeEditor",null,{type:"string",description:d(6947,null)}),yGe=new C("activeEditorAvailableEditorIds","",d(6948,null)),vGe=new C("textCompareEditorVisible",!1,d(7030,null)),IGe=new C("textCompareEditorActive",!1,d(7029,null)),bGe=new C("sideBySideEditorActive",!1,d(7022,null)),SGe=new C("activeCustomEditorDiffCanToggleLayout",!1,d(6945,null)),xGe=new C("activeCustomEditorTextDiff",!1,d(6946,null)),CGe=new C("groupEditorsCount",0,d(6985,null)),EGe=new C("isTopRightEditorGroup",!1,d(6995,null)),wGe=new C("activeEditorGroupEmpty",!1,d(6952,null)),RGe=new C("activeEditorGroupIndex",0,d(6953,null)),TGe=new C("activeEditorGroupLast",!1,d(6954,null)),PGe=new C("activeEditorGroupLocked",!1,d(6955,null)),kGe=new C("editorGroupLockActionsHidden",!1,d(6970,null)),TZ=new C("multipleEditorGroups",!1,d(6999,null)),AGe=TZ.toNegated(),DGe=new C("multipleEditorsSelectedInGroup",!1,d(7000,null)),_Ge=new C("twoEditorsSelectedInGroup",!1,d(7033,null)),MGe=new C("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,d(7019,null)),LGe=new C("editorPartMultipleEditorGroups",!1,d(6981,null)),OGe=new C("editorPartMaximizedEditorGroup",!1,d(6972,null)),UGe=new C("editorPartInPartGrid",!1,d(6973,null)),NGe=new C("editorPartModal",!1,d(6974,null)),FGe=new C("editorPartModalVisible",!1,d(6980,null)),HGe=new C("editorPartModalCanMoveToEditorArea",!0,d(6975,null)),WGe=new C("editorPartModalMaximized",!1,d(6976,null)),VGe=new C("editorPartModalNavigation",!1,d(6977,null)),BGe=new C("editorPartModalSidebar",!1,d(6978,null)),qGe=new C("editorPartModalSidebarVisible",!1,d(6979,null)),$Ge=new C("editorIsOpen",!1,d(6971,null)),zGe=new C("editorAreaFocus",!1,d(6969,null)),GGe=new C("inZenMode",!1,d(6987,null)),KGe=new C("isCenteredLayout",!1,d(6993,null)),jGe=new C("splitEditorsVertically",!1,d(7023,null)),QGe=new C("mainEditorAreaVisible",!0,d(6998,null)),JGe=new C("editorTabsVisible",!0,d(6982,null)),YGe=new C("sideBarVisible",!1,d(7021,null)),XGe=new C("sideBarFocus",!1,d(7020,null)),ZGe=new C("activeViewlet","",d(6963,null)),eKe=new C("statusBarFocused",!1,d(7025,null)),tKe=new C("titleBarStyle","custom",d(7031,null)),nKe=new C("titleBarVisible",!1,d(7032,null)),oKe=new C("isCompactTitleBar",!1,d(6990,null)),rKe=new C("bannerFocused",!1,d(6967,null)),iKe=new C("notificationFocus",!0,d(7002,null)),sKe=new C("notificationCenterVisible",!1,d(7001,null)),aKe=new C("notificationToastsVisible",!1,d(7003,null)),lKe=new C("activeAuxiliary","",d(6943,null)),cKe=new C("auxiliaryBarFocus",!1,d(6964,null)),dKe=new C("auxiliaryBarVisible",!1,d(6966,null)),uKe=new C("secondarySideBarVisible",!1,d(7018,null)),pKe=new C("auxiliaryBarMaximized",!1,d(6965,null)),mKe=new C("activePanel","",d(6962,null)),gKe=new C("panelFocus",!1,d(7005,null)),fKe=new C("panelPosition","bottom",d(7007,null)),hKe=new C("panelAlignment","center",d(7004,null)),yKe=new C("panelVisible",!1,d(7008,null)),vKe=new C("panelMaximized",!1,d(7006,null)),IKe=new C("layoutMode",void 0,{type:"string",description:d(6997,null)}),bKe=new C("splitLayout",void 0,{type:"string",description:d(7024,null)}),SKe=new C("terminalsVisible",void 0,{type:"boolean",description:d(7028,null)}),xKe=new C("terminalsPosition",void 0,{type:"string",description:d(7027,null)}),CKe=new C("focusedView","",d(6984,null)),ar=class{constructor(t,e,n,o){this._contextKeyService=t;this._fileService=e;this._languageService=n;this._modelService=o;this._schemeKey=ar.Scheme.bindTo(this._contextKeyService),this._filenameKey=ar.Filename.bindTo(this._contextKeyService),this._dirnameKey=ar.Dirname.bindTo(this._contextKeyService),this._pathKey=ar.Path.bindTo(this._contextKeyService),this._langIdKey=ar.LangId.bindTo(this._contextKeyService),this._resourceKey=ar.Resource.bindTo(this._contextKeyService),this._extensionKey=ar.Extension.bindTo(this._contextKeyService),this._hasResource=ar.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=ar.IsFileSystemResource.bindTo(this._contextKeyService)}static{this.Scheme=new C("resourceScheme",void 0,{type:"string",description:d(7016,null)})}static{this.Filename=new C("resourceFilename",void 0,{type:"string",description:d(7013,null)})}static{this.Dirname=new C("resourceDirname",void 0,{type:"string",description:d(7011,null)})}static{this.Path=new C("resourcePath",void 0,{type:"string",description:d(7015,null)})}static{this.LangId=new C("resourceLangId",void 0,{type:"string",description:d(7014,null)})}static{this.Resource=new C("resource",void 0,{type:"URI",description:d(7010,null)})}static{this.Extension=new C("resourceExtname",void 0,{type:"string",description:d(7012,null)})}static{this.HasResource=new C("resourceSet",void 0,{type:"boolean",description:d(7017,null)})}static{this.IsFileSystemResource=new C("isFileSystemResource",void 0,{type:"boolean",description:d(6991,null)})}_setLangId(){let t=this.get();if(!t){this._langIdKey.set(null);return}let e=this._modelService.getModel(t)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(t);this._langIdKey.set(e)}set(t){t=t??void 0,!Tn(this._value,t)&&(this._value=t,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(t?t.toString():null),this._schemeKey.set(t?t.scheme:null),this._filenameKey.set(t?xn(t):null),this._dirnameKey.set(t?this.uriToPath(Xd(t)):null),this._pathKey.set(t?this.uriToPath(t):null),this._setLangId(),this._extensionKey.set(t?xg(t):null),this._hasResource.set(!!t),this._isFileSystemResource.set(t?this._fileService.hasProvider(t):!1)}))}uriToPath(t){return t.scheme===q.file?t.fsPath:t.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}};ar=w([b(0,ss),b(1,Le),b(2,i_),b(3,s_)],ar);aC=class extends ar{constructor(e,n,o,i){super(e,n,o,i);this._disposables=new re;this._disposables.add(n.onDidChangeFileSystemProviderRegistrations(()=>{let s=this.get();this._isFileSystemResource.set(!!(s&&n.hasProvider(s)))})),this._disposables.add(i.onModelAdded(s=>{Tn(s.uri,this.get())&&this._setLangId()})),this._disposables.add(i.onModelLanguageChanged(s=>{Tn(s.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}};aC=w([b(0,ss),b(1,Le),b(2,i_),b(3,s_)],aC)});var lC,PZ,RKe,kZ,NB,cC=v(()=>{lC="chat.disableAIFeatures",PZ="^(?![A-Za-z]:[\\\\/])(?!/)(?!~(?!/))(?!.*\\\\)(?!.*[*?\\[\\]{}]).*\\S.*$",RKe=new RegExp(PZ),kZ={"**/.mcp.json":!1,"**/.npmrc":!1,"**/.vscode/*.json":!1,"**/.devcontainer.json":!1,"**/.devcontainer/devcontainer.json":!1,"**/.devcontainer/*/devcontainer.json":!1,"**/.github/agents/**":!1,"**/.github/hooks/**":!1,"**/.github/copilot/settings.json":!1,"**/.github/copilot/settings.local.json":!1,"**/.claude/agents/**":!1,"**/.claude/settings.json":!1,"**/.claude/settings.local.json":!1,"**/.codex/agents/**":!1,"**/.codex/config.toml":!1,"**/.codex/hooks.json":!1},NB={"**/*":!0,"**/.git/**":!1,"**/{package.json,server.xml,build.rs,web.config,.gitattributes,.env,Cargo.toml}":!1,"**/{.npmrc,.yarnrc,.yarnrc.yml,.pnpmfile.js,.pnpmfile.cjs,.pnpmfile.mjs,pnpm-workspace.yaml}":!1,"**/*.{code-workspace,csproj,fsproj,vbproj,vcxproj,proj,targets,props,gradle,gradle.kts}":!1,"**/gradle.properties":!1,"**/ruby_lsp/*/addon":!1,"**/*.lock":!1,"**/*-lock.{yaml,json}":!1,...kZ}});var FB,_Ke,HB=v(()=>{it();gs();ee();Z();FB=A("dialogService"),_Ke=A("fileDialogService")});var WB,FKe,VB=v(()=>{Xt();Tt();Z();WB=A("IAuthenticationService"),FKe=A("IAuthenticationExtensionsService")});var dC,l_=v(()=>{Z();dC=A("openerService")});var um,uC=v(()=>{Z();Dn();um=Ut});var BB,qB=v(()=>{Z();BB=A("lifecycleService")});function $B(r){return r.state==="pending"||r.state==="blocked"}var c_=v(()=>{});var pC,d_=v(()=>{Z();c_();pC=A("defaultAccountService")});function AZ(r){let t=r?.includes("Visual-Studio-Code"),e=r?.includes("github"),n=r?.includes("microsoft")||r?.includes("ms-copilot")||r?.includes("MicrosoftCopilot");return t?"vscode":e?"github":n?"microsoft":void 0}function zB(r,t){return r===!0||AZ(t)!==void 0}var ZKe,GB=v(()=>{fe();ZKe=3600*1e3});function _Z(r){return r===10||r===6||r===7||r===11||r===8||r===9}function u_(r,t,e){return!(r.getValue(KB)!==!0||t!==1||e.hidden||e.disabledInWorkspace)}function jB(r,t,e){e.publicLog2("chatEntitlements",{chatHidden:!!r.hidden,chatDisabled:!!r.disabled,chatEntitlement:r.entitlement,chatRegistered:!!r.registered,chatAnonymous:u_(t,r.entitlement,r)})}function MZ(r,t){let e=t.premiumChat,n=r===8||r===9,o=e?.unlimited?e.hasQuota===!1:e?.percentRemaining===0;return t.chat?.percentRemaining===0||n&&e?.hasQuota===!1||o&&(n||!t.additionalUsageEnabled)}function Jh(r,t){let e={...r,...t};for(let n of Object.keys(t))t[n]===void 0&&r?.[n]!==void 0&&(e[n]=r[n]);return e}function LZ(r){let t={resetDate:r.quota_reset_date_utc??r.quota_reset_date??r.limited_user_reset_date,resetDateHasTime:typeof r.quota_reset_date_utc=="string",usageBasedBilling:r.token_based_billing,canUpgradePlan:r.can_upgrade_plan};if(r.monthly_quotas?.chat&&typeof r.limited_user_quotas?.chat=="number"&&(t.chat={percentRemaining:Math.min(100,Math.max(0,r.limited_user_quotas.chat/r.monthly_quotas.chat*100)),unlimited:!1}),r.monthly_quotas?.completions&&typeof r.limited_user_quotas?.completions=="number"&&(t.completions={percentRemaining:Math.min(100,Math.max(0,r.limited_user_quotas.completions/r.monthly_quotas.completions*100)),unlimited:!1}),r.quota_snapshots){for(let n of["chat","completions","premium_interactions"]){let o=r.quota_snapshots[n];if(!o)continue;let i=o.entitlement!==void 0?Number(o.entitlement):void 0,s=o.credits_used!==void 0?Number(o.credits_used):void 0;if(!o.unlimited&&i===0)continue;let a=o.quota_remaining!==void 0?Number(o.quota_remaining):void 0,l={percentRemaining:Math.min(100,Math.max(0,o.percent_remaining)),unlimited:o.unlimited,hasQuota:o.has_quota,usageBasedBilling:r.token_based_billing,resetAt:o.quota_reset_at||void 0,entitlement:i!==void 0&&Number.isFinite(i)&&i>=0?i:void 0,quotaRemaining:a!==void 0&&Number.isFinite(a)&&a>=0?a:void 0,creditsUsed:s!==void 0&&Number.isFinite(s)&&s>=0?s:void 0};switch(n){case"chat":t.chat=l;break;case"completions":t.completions=l;break;case"premium_interactions":t.premiumChat=l;break}}let e=r.quota_snapshots.premium_interactions;t.additionalUsageEnabled=e?.overage_permitted??!1,t.additionalUsageCount=e?.overage_count??0,t.additionalUsageEntitlement=e?.overage_entitlement??0}return t}var he,DZ,mC,KB,Ra,Yh,Qi,p_=v(()=>{ai();Ue();Jt();ue();ns();Q();ee();dn();cC();ro();HB();Z();De();Wn();Ui();gi();_n();VB();l_();te();gs();uC();fe();qB();Gc();ks();d_();GB();(a=>(a.Setup={hidden:new C("chatSetupHidden",!1,!0),installed:new C("chatSetupInstalled",!1,!0),disabled:new C("chatSetupDisabled",!1,!0),disabledInWorkspace:new C("chatSetupDisabledInWorkspace",!1,!0),untrusted:new C("chatSetupUntrusted",!1,!0),later:new C("chatSetupLater",!1,!0),registered:new C("chatSetupRegistered",!1,!0),completed:new C("chatSetupCompleted",!1,!0)},a.Entitlement={signedOut:new C("chatEntitlementSignedOut",!1,!0),canSignUp:new C("chatPlanCanSignUp",!1,!0),planFree:new C("chatPlanFree",!1,!0),planPro:new C("chatPlanPro",!1,!0),planEdu:new C("chatPlanEdu",!1,!0),planProPlus:new C("chatPlanProPlus",!1,!0),planMax:new C("chatPlanMax",!1,!0),planBusiness:new C("chatPlanBusiness",!1,!0),planEnterprise:new C("chatPlanEnterprise",!1,!0),organisations:new C("chatEntitlementOrganisations",void 0,!0),internal:new C("chatEntitlementInternal",!1,!0),sku:new C("chatEntitlementSku",void 0,!0)},a.chatQuotaExceeded=new C("chatQuotaExceeded",!1,!0),a.completionsQuotaExceeded=new C("completionsQuotaExceeded",!1,!0),a.chatAnonymous=new C("chatAnonymous",!1,!0),a.clientByokEnabled=new C("github.copilot.clientByokEnabled",!0,!0),a.hasByokModels=new C("github.copilot.hasByokModels",!1,!0)))(he||={});DZ=A("chatEntitlementService");mC={upgradePlanUrl:Je.defaultChatAgent?.upgradePlanUrl??"",providerUriSetting:Je.defaultChatAgent?.providerUriSetting??"",entitlementSignupLimitedUrl:Je.defaultChatAgent?.entitlementSignupLimitedUrl??"",chatQuotaExceededContext:Je.defaultChatAgent?.chatQuotaExceededContext??"",completionsQuotaExceededContext:Je.defaultChatAgent?.completionsQuotaExceededContext??""},KB="chat.allowAnonymousAccess";Ra=class extends D{constructor(e,n,o,i,s,a,l,c){super();this.contextKeyService=i;this.configurationService=s;this.telemetryService=a;this.logService=l;this.storageService=c;this._onDidChangeQuotaExceeded=this._register(new R);this.onDidChangeQuotaExceeded=this._onDidChangeQuotaExceeded.event;this._onDidChangeQuotaRemaining=this._register(new R);this.onDidChangeQuotaRemaining=this._onDidChangeQuotaRemaining.event;this._onDidChangeUsageBasedBilling=this._register(new R);this.onDidChangeUsageBasedBilling=this._onDidChangeUsageBasedBilling.event;this.ExtensionQuotaContextKeys={chatQuotaExceeded:mC.chatQuotaExceededContext,completionsQuotaExceeded:mC.completionsQuotaExceededContext};this._onDidChangeAnonymous=this._register(new R);this.onDidChangeAnonymous=this._onDidChangeAnonymous.event;this.anonymousObs=Ii(this.onDidChangeAnonymous,()=>this.anonymous);let u=this.storageService.getBoolean(Ra.CACHED_UBB_STORAGE_KEY,0);if(this._quotas=u!==void 0?{usageBasedBilling:u}:{},this.chatQuotaExceededContextKey=he.chatQuotaExceeded.bindTo(this.contextKeyService),this.completionsQuotaExceededContextKey=he.completionsQuotaExceeded.bindTo(this.contextKeyService),this.anonymousContextKey=he.chatAnonymous.bindTo(this.contextKeyService),this.anonymousContextKey.set(this.anonymous),this.contextKeyService.getContextKeyValue(he.clientByokEnabled.key)===void 0&&he.clientByokEnabled.bindTo(this.contextKeyService),this.onDidChangeEntitlement=F.map(F.filter(this.contextKeyService.onDidChangeContext,m=>m.affectsSome(new Set([he.Entitlement.planEdu.key,he.Entitlement.planPro.key,he.Entitlement.planBusiness.key,he.Entitlement.planEnterprise.key,he.Entitlement.planProPlus.key,he.Entitlement.planMax.key,he.Entitlement.planFree.key,he.Entitlement.canSignUp.key,he.Entitlement.signedOut.key,he.Entitlement.organisations.key,he.Entitlement.internal.key,he.Entitlement.sku.key])),this._store),()=>{},this._store),this.entitlementObs=Ii(this.onDidChangeEntitlement,()=>this.entitlement),this.onDidChangeSentiment=F.map(F.filter(this.contextKeyService.onDidChangeContext,m=>m.affectsSome(new Set([he.Setup.completed.key,he.Setup.hidden.key,he.Setup.disabled.key,he.Setup.untrusted.key,he.Setup.installed.key,he.Setup.later.key,he.Setup.registered.key])),this._store),()=>{},this._store),this.sentimentObs=Ii(this.onDidChangeSentiment,()=>this.sentiment),bn&&!o.remoteAuthority&&!o.isSessionsWindow){he.Setup.hidden.bindTo(this.contextKeyService).set(!0);return}if(!n.defaultChatAgent)return;let p=this.context=new Yt(()=>this._register(e.createInstance(Qi)));this.requests=new Yt(()=>this._register(e.createInstance(Yh,p.value,{clearQuotas:()=>this.clearQuotas(),acceptQuotas:m=>this.acceptQuotas(m)}))),this.registerListeners()}static{this.CACHED_UBB_STORAGE_KEY="chat.usageBasedBilling"}get entitlement(){return this.contextKeyService.getContextKeyValue(he.Entitlement.planEdu.key)===!0?10:this.contextKeyService.getContextKeyValue(he.Entitlement.planPro.key)===!0?6:this.contextKeyService.getContextKeyValue(he.Entitlement.planBusiness.key)===!0?8:this.contextKeyService.getContextKeyValue(he.Entitlement.planEnterprise.key)===!0?9:this.contextKeyService.getContextKeyValue(he.Entitlement.planProPlus.key)===!0?7:this.contextKeyService.getContextKeyValue(he.Entitlement.planMax.key)===!0?11:this.contextKeyService.getContextKeyValue(he.Entitlement.planFree.key)===!0?5:this.contextKeyService.getContextKeyValue(he.Entitlement.canSignUp.key)===!0?3:this.contextKeyService.getContextKeyValue(he.Entitlement.signedOut.key)===!0?1:2}get isInternal(){return this.contextKeyService.getContextKeyValue(he.Entitlement.internal.key)===!0}get organisations(){return this.contextKeyService.getContextKeyValue(he.Entitlement.organisations.key)}get sku(){return this.contextKeyService.getContextKeyValue(he.Entitlement.sku.key)}get copilotTrackingId(){return this.context?.value.state.copilotTrackingId}get clientByokEnabled(){return this.contextKeyService.getContextKeyValue("github.copilot.clientByokEnabled")===!0}get hasByokModels(){return this.contextKeyService.getContextKeyValue("github.copilot.hasByokModels")===!0}get quotas(){return this._quotas}registerListeners(){let e=new Set([this.ExtensionQuotaContextKeys.chatQuotaExceeded,this.ExtensionQuotaContextKeys.completionsQuotaExceeded]),n=this._register(new Kn);this._register(this.contextKeyService.onDidChangeContext(s=>{s.affectsSome(e)&&(n.value&&n.value.cancel(),n.value=new _t,this.update(n.value.token))}));let o=this.anonymous,i=()=>{let s=this.anonymous;s!==o&&(o=s,this.anonymousContextKey.set(s),this.context?.hasValue&&jB(this.context.value.state,this.configurationService,this.telemetryService),this._onDidChangeAnonymous.fire())};this._register(this.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(KB)&&i()})),this._register(this.onDidChangeEntitlement(()=>i())),this._register(this.onDidChangeSentiment(()=>i()))}acceptQuotas(e){let n=this._quotas,o=this.quotaCopilotTrackingId===this.copilotTrackingId?n:{},i={...e,chat:e.chat?Jh(o.chat,e.chat):void 0,completions:e.completions?Jh(o.completions,e.completions):void 0,premiumChat:e.premiumChat?Jh(o.premiumChat,e.premiumChat):void 0,sessionRateLimit:e.sessionRateLimit?Jh(o.sessionRateLimit,e.sessionRateLimit):void 0,weeklyRateLimit:e.weeklyRateLimit?Jh(o.weeklyRateLimit,e.weeklyRateLimit):void 0};this.quotaCopilotTrackingId=this.copilotTrackingId,this._quotas=i,this.updateContextKeys(),n.usageBasedBilling!==i.usageBasedBilling&&(i.usageBasedBilling!==void 0?this.storageService.store(Ra.CACHED_UBB_STORAGE_KEY,i.usageBasedBilling,0,1):this.storageService.remove(Ra.CACHED_UBB_STORAGE_KEY,0)),this.logService.getLevel()===1&&this.logService.trace(`[chat entitlement]: acceptQuotas: ${JSON.stringify(i)}`);let{changed:s}=this.compareQuotas(n.chat,i.chat),{changed:a}=this.compareQuotas(n.completions,i.completions),{changed:l}=this.compareQuotas(n.premiumChat,i.premiumChat);(s.exceeded||a.exceeded||l.exceeded)&&this._onDidChangeQuotaExceeded.fire();let c=this.compareQuotas(n.sessionRateLimit,i.sessionRateLimit).changed.remaining,u=this.compareQuotas(n.weeklyRateLimit,i.weeklyRateLimit).changed.remaining;(s.remaining||a.remaining||l.remaining||c||u||n.usageBasedBilling!==i.usageBasedBilling||n.additionalUsageEnabled!==i.additionalUsageEnabled)&&this._onDidChangeQuotaRemaining.fire(),n.usageBasedBilling!==i.usageBasedBilling&&this._onDidChangeUsageBasedBilling.fire(),n.additionalUsageEnabled!==void 0&&i.additionalUsageEnabled!==void 0&&n.additionalUsageEnabled!==i.additionalUsageEnabled&&this.telemetryService.publicLog2("chatAdditionalSpendConfiguration",{enabled:i.additionalUsageEnabled??!1,entitlement:this.entitlement}),i.additionalUsageEnabled&&i.premiumChat?.percentRemaining===0&&n.premiumChat?.percentRemaining!==void 0&&n.premiumChat.percentRemaining>0&&this.telemetryService.publicLog2("chatAdditionalSpendActive",{entitlement:this.entitlement,additionalUsageCount:i.additionalUsageCount??0})}compareQuotas(e,n){return{changed:{exceeded:e?.percentRemaining===0!=(n?.percentRemaining===0),remaining:e?.percentRemaining!==n?.percentRemaining||e?.hasQuota!==n?.hasQuota||e?.unlimited!==n?.unlimited||e?.usageBasedBilling!==n?.usageBasedBilling||e?.creditsUsed!==n?.creditsUsed}}}clearQuotas(){this.acceptQuotas({})}updateContextKeys(){this.chatQuotaExceededContextKey.set(MZ(this.entitlement,this._quotas)),this.completionsQuotaExceededContextKey.set(this._quotas.completions?.percentRemaining===0)}get sentiment(){return{completed:this.contextKeyService.getContextKeyValue(he.Setup.completed.key)===!0,installed:this.contextKeyService.getContextKeyValue(he.Setup.installed.key)===!0,hidden:this.contextKeyService.getContextKeyValue(he.Setup.hidden.key)===!0,disabledInWorkspace:this.contextKeyService.getContextKeyValue(he.Setup.disabledInWorkspace.key)===!0,disabled:this.contextKeyService.getContextKeyValue(he.Setup.disabled.key)===!0,untrusted:this.contextKeyService.getContextKeyValue(he.Setup.untrusted.key)===!0,later:this.contextKeyService.getContextKeyValue(he.Setup.later.key)===!0,registered:this.contextKeyService.getContextKeyValue(he.Setup.registered.key)===!0}}get anonymous(){return u_(this.configurationService,this.entitlement,this.sentiment)}markAnonymousRateLimited(){this.anonymous&&(this.chatQuotaExceededContextKey.set(!0),this._onDidChangeQuotaExceeded.fire())}markSetupCompleted(){this.context?.value.update({completed:!0})}setForceHidden(e){this.context?this.context.value.setForceHidden(e):he.Setup.hidden.bindTo(this.contextKeyService).set(e)}async update(e){await this.requests?.value.forceResolveEntitlement(e)}};Ra=w([b(0,Hn),b(1,Be),b(2,um),b(3,ss),b(4,bt),b(5,Mt),b(6,z),b(7,mi)],Ra);Yh=class extends D{constructor(e,n,o,i,s,a,l,c,u,p){super();this.context=e;this.chatQuotasAccessor=n;this.telemetryService=o;this.logService=i;this.requestService=s;this.dialogService=a;this.openerService=l;this.lifecycleService=c;this.defaultAccountService=u;this.authenticationService=p;this.pendingResolveCts=new _t;this.state={entitlement:this.context.state.entitlement},this.registerListeners(),this.resolve()}registerListeners(){this._register(this.defaultAccountService.onDidChangeDefaultAccount(()=>this.resolve())),this._register(this.context.onDidChange(()=>{(this.context.state.disabled||this.context.state.entitlement===1)&&(this.state={entitlement:this.state.entitlement,quotas:void 0},this.chatQuotasAccessor.clearQuotas())}))}async resolve(){this.pendingResolveCts.dispose(!0);let e=this.pendingResolveCts=new _t,n=await this.defaultAccountService.getDefaultAccount();if(e.token.isCancellationRequested)return;let o;n?this.state.entitlement===1&&(o={entitlement:2}):o={entitlement:1},o&&this.update(o),n&&await this.resolveEntitlement(n,e.token)}async resolveEntitlement(e,n){let o=await this.doResolveEntitlement(e,n);return typeof o?.entitlement=="number"&&!n.isCancellationRequested&&this.update(o),o}async doResolveEntitlement(e,n){if(n.isCancellationRequested)return;let o=e.entitlementsData;if(!o)return this.logService.trace("[chat entitlement]: no entitlements data available on default account"),{entitlement:o===null?1:2};let i;o.access_type_sku==="free_limited_copilot"?i=5:o.access_type_sku==="free_educational_quota"?i=10:o.can_signup_for_limited?i=3:o.copilot_plan==="individual_edu"?i=10:o.copilot_plan==="individual"?i=6:o.copilot_plan==="individual_pro"?i=7:o.copilot_plan==="individual_max"?i=11:o.copilot_plan==="business"?i=8:o.copilot_plan==="enterprise"?i=9:i=4;let s={entitlement:i,organisations:o.organization_login_list,isStaff:o.is_staff,quotas:this.toQuotas(o),sku:o.access_type_sku,copilotTrackingId:o.analytics_tracking_id};return this.logService.trace(`[chat entitlement]: resolved to ${s.entitlement}, quotas: ${JSON.stringify(s.quotas)}`),this.telemetryService.publicLog2("chatInstallEntitlement",{entitlement:s.entitlement,tid:o.analytics_tracking_id,sku:s.sku,quotaChatUnlimited:s.quotas?.chat?.unlimited,quotaChatHasQuota:s.quotas?.chat?.hasQuota,quotaChatEntitlement:s.quotas?.chat?.entitlement,quotaPremiumChat:s.quotas?.premiumChat?.percentRemaining,quotaPremiumChatUnlimited:s.quotas?.premiumChat?.unlimited,quotaPremiumChatHasQuota:s.quotas?.premiumChat?.hasQuota,quotaPremiumChatEntitlement:s.quotas?.premiumChat?.entitlement,quotaCompletions:s.quotas?.completions?.percentRemaining,quotaCompletionsUnlimited:s.quotas?.completions?.unlimited,quotaCompletionsHasQuota:s.quotas?.completions?.hasQuota,quotaCompletionsEntitlement:s.quotas?.completions?.entitlement,quotaResetDate:s.quotas?.resetDate,usageBasedBilling:s.quotas?.usageBasedBilling,additionalUsageEnabled:s.quotas?.additionalUsageEnabled,additionalUsageCount:s.quotas?.additionalUsageCount,canUpgradePlan:s.quotas?.canUpgradePlan}),s}toQuotas(e){return LZ(e)}async request(e,n,o,i,s,a){let l;for(let c of i){if(s.isCancellationRequested)return l;try{let u=await this.requestService.request({type:n,url:e,data:n==="POST"?JSON.stringify(o):void 0,disableCache:!0,headers:{Authorization:`Bearer ${c.accessToken}`},callSite:a},s),p=u.res.statusCode;if(p&&p!==200){l=u;continue}return u}catch(u){s.isCancellationRequested||this.logService.error(`[chat entitlement] request: error ${u}`)}}return l}update(e){this.state=e,this.context.update({entitlement:this.state.entitlement,organisations:this.state.organisations,isStaff:this.state.isStaff,sku:this.state.sku,copilotTrackingId:this.state.copilotTrackingId}),e.quotas&&this.chatQuotasAccessor.acceptQuotas(e.quotas)}async forceResolveEntitlement(e=Ae.None){let n=await this.defaultAccountService.refresh({refreshEntitlements:!0});if(n)return this.resolveEntitlement(n,e)}async signUpFree(){let e=await this.getSessions();if(e.length!==0)return this.doSignUpFree(e)}async doSignUpFree(e){let n={restricted_telemetry:this.telemetryService.telemetryLevel===0?"disabled":"enabled",public_code_suggestions:"enabled"},o=await this.request(mC.entitlementSignupLimitedUrl,"POST",n,e,Ae.None,"chatEntitlementService.signUpFree");if(!o)return await this.onUnknownSignUpError(d(24964,null),"[chat entitlement] sign-up: no response")?this.doSignUpFree(e):{errorCode:1};if(o.res.statusCode&&o.res.statusCode!==200){if(o.res.statusCode===422)try{let l=await Cu(o);if(l){let c=JSON.parse(l);if(typeof c.message=="string"&&c.message)return this.onUnprocessableSignUpError(`[chat entitlement] sign-up: unprocessable entity (${c.message})`,c.message),{errorCode:o.res.statusCode}}}catch{}return await this.onUnknownSignUpError(d(24965,null,o.res.statusCode),`[chat entitlement] sign-up: unexpected status code ${o.res.statusCode}`)?this.doSignUpFree(e):{errorCode:o.res.statusCode}}let i=null;try{i=await Cu(o)}catch{}if(!i)return await this.onUnknownSignUpError(d(24963,null),"[chat entitlement] sign-up: response has no content")?this.doSignUpFree(e):{errorCode:2};let s;try{s=JSON.parse(i),this.logService.trace(`[chat entitlement] sign-up: response is ${i}`)}catch(a){return await this.onUnknownSignUpError(d(24962,null),`[chat entitlement] sign-up: error parsing response (${a})`)?this.doSignUpFree(e):{errorCode:3}}return this.update({entitlement:5}),!!s?.subscribed}async getSessions(){let e=await this.defaultAccountService.getDefaultAccount();if(e){let o=(await this.authenticationService.getSessions(e.authenticationProvider.id)).filter(i=>i.id===e.sessionId);if(o.length)return o}return[...await this.authenticationService.getSessions(this.defaultAccountService.getDefaultAccountAuthenticationProvider().id)]}async onUnknownSignUpError(e,n){if(this.logService.error(n),!this.lifecycleService.willShutdown){let{confirmed:o}=await this.dialogService.confirm({type:Qe.Error,message:d(24966,null),detail:e,primaryButton:d(24961,null)});return o}return!1}onUnprocessableSignUpError(e,n){this.logService.error(e),this.lifecycleService.willShutdown||this.dialogService.prompt({type:Qe.Error,message:d(24967,null),detail:n,buttons:[{label:d(24953,null),run:()=>{}},{label:d(24952,null),run:()=>this.openerService.open(S.parse(mC.upgradePlanUrl))}]})}async signIn(e){let n=await this.defaultAccountService.signIn({additionalScopes:e?.additionalScopes,extraAuthorizeParameters:{get_started_with:"copilot-vscode"},provider:e?.useSocialProvider});if(!n)return{};let o=await this.doResolveEntitlement(n,Ae.None);return{defaultAccount:n,entitlements:o}}dispose(){this.pendingResolveCts.dispose(!0),super.dispose()}};Yh=w([b(2,Mt),b(3,z),b(4,ao),b(5,FB),b(6,dC),b(7,BB),b(8,pC),b(9,WB)],Yh);Qi=class extends D{constructor(e,n,o,i,s){super();this.storageService=n;this.logService=o;this.configurationService=i;this.telemetryService=s;this.suspendedState=void 0;this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this.updateBarrier=void 0;this._forceHidden=!1;this.canSignUpContextKey=he.Entitlement.canSignUp.bindTo(e),this.signedOutContextKey=he.Entitlement.signedOut.bindTo(e),this.freeContextKey=he.Entitlement.planFree.bindTo(e),this.eduContextKey=he.Entitlement.planEdu.bindTo(e),this.proContextKey=he.Entitlement.planPro.bindTo(e),this.proPlusContextKey=he.Entitlement.planProPlus.bindTo(e),this.maxContextKey=he.Entitlement.planMax.bindTo(e),this.businessContextKey=he.Entitlement.planBusiness.bindTo(e),this.enterpriseContextKey=he.Entitlement.planEnterprise.bindTo(e),this.organisationsContextKey=he.Entitlement.organisations.bindTo(e),this.isInternalContextKey=he.Entitlement.internal.bindTo(e),this.skuContextKey=he.Entitlement.sku.bindTo(e),this.completedContext=he.Setup.completed.bindTo(e),this.hiddenContext=he.Setup.hidden.bindTo(e),this.disabledInWorkspaceContext=he.Setup.disabledInWorkspace.bindTo(e),this.laterContext=he.Setup.later.bindTo(e),this.installedContext=he.Setup.installed.bindTo(e),this.disabledContext=he.Setup.disabled.bindTo(e),this.untrustedContext=he.Setup.untrusted.bindTo(e),this.registeredContext=he.Setup.registered.bindTo(e),this._state=this.storageService.getObject(Qi.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,0)??{entitlement:1,organisations:void 0,isStaff:void 0,sku:void 0,copilotTrackingId:void 0},this.storageService.getBoolean(Qi.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,0)===!0||(this.storageService.store(Qi.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,!0,0,1),this._state.installed&&!this._state.completed&&(this._state.completed=!0,this.storageService.store(Qi.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,this._state,0,1))),this.updateContextSync(),this.registerListeners()}static{this.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY="chat.setupContext"}static{this.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY="chat.setupContext.migrated.v1"}get state(){return this.withConfiguration(this.suspendedState??this._state)}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(lC)&&this.updateContext()}))}withConfiguration(e){return this._forceHidden||this.configurationService.getValue(lC)===!0?{...e,hidden:!0}:e}setForceHidden(e){this._forceHidden!==e&&(this._forceHidden=e,this.updateContext())}async update(e){this.logService.trace(`[chat entitlement context] update(): ${JSON.stringify(e)}`);let n=JSON.stringify(this._state);if(typeof e.installed=="boolean"&&typeof e.disabled=="boolean"&&typeof e.untrusted=="boolean"&&(this._state.installed=e.installed,this._state.disabled=e.disabled,this._state.untrusted=e.untrusted,this._state.disabledInWorkspace=e.disabledInWorkspace,e.installed&&!e.disabled&&(e.hidden=!1)),typeof e.hidden=="boolean"&&(this._state.hidden=e.hidden),typeof e.later=="boolean"&&(this._state.later=e.later),typeof e.completed=="boolean"&&(this._state.completed=e.completed),typeof e.entitlement=="number"&&(this._state.entitlement=e.entitlement,this._state.organisations=e.organisations,this._state.isStaff=e.isStaff,this._state.sku=e.sku,this._state.copilotTrackingId=e.copilotTrackingId,this._state.entitlement===5||_Z(this._state.entitlement)?this._state.registered=!0:this._state.entitlement===3&&(this._state.registered=!1)),u_(this.configurationService,this._state.entitlement,this._state)&&(this._state.sku="no_auth_limited_copilot"),n!==JSON.stringify(this._state))return this.storageService.store(Qi.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,{...this._state,later:void 0},0,1),this.updateContext()}async updateContext(){await this.updateBarrier?.wait(),this.updateContextSync()}updateContextSync(){let e=this.withConfiguration(this._state);this.signedOutContextKey.set(e.entitlement===1),this.canSignUpContextKey.set(e.entitlement===3),this.freeContextKey.set(e.entitlement===5),this.eduContextKey.set(e.entitlement===10),this.proContextKey.set(e.entitlement===6),this.proPlusContextKey.set(e.entitlement===7),this.maxContextKey.set(e.entitlement===11),this.businessContextKey.set(e.entitlement===8),this.enterpriseContextKey.set(e.entitlement===9),this.organisationsContextKey.set(e.organisations),this.isInternalContextKey.set(zB(e.isStaff,e.organisations)),this.skuContextKey.set(e.sku),this.completedContext.set(!!e.completed),this.hiddenContext.set(!!e.hidden),this.disabledInWorkspaceContext.set(!!e.disabledInWorkspace),this.laterContext.set(!!e.later),this.installedContext.set(!!e.installed),this.disabledContext.set(!!e.disabled),this.untrustedContext.set(!!e.untrusted),this.registeredContext.set(!!e.registered),this.logService.trace(`[chat entitlement context] updateContext(): ${JSON.stringify(e)}`),jB(e,this.configurationService,this.telemetryService),this._onDidChange.fire()}suspend(){this.suspendedState={...this._state},this.updateBarrier=new Ur}resume(){this.suspendedState=void 0,this.updateBarrier?.open(),this.updateBarrier=void 0}};Qi=w([b(0,ss),b(1,mi),b(2,z),b(3,bt),b(4,Mt)],Qi);hi(DZ,Ra,0)});function JB(r){if(!r?.length)return;let t={};for(let e of r)if(typeof e=="string"){if(QB(e))continue;t[e]=e}else{if(QB(e.name))continue;let n=e.source,o=n.source==="github"?n.repo:n.url,i=n.ref?`${o}#${n.ref}`:o;t[e.name]=e.autoUpdate===void 0?i:JSON.stringify({source:i,autoUpdate:e.autoUpdate})}return t}function QB(r){return r==="__proto__"||r==="constructor"||r==="prototype"}var YB=v(()=>{});function m_(r,t){return r===t||r.startsWith(`${t}.`)}function gC(r){return!m_(r,pm)&&!m_(r,Iq)}function eq(r){return r!==void 0&&Object.entries(r).some(([t,e])=>t==="vscode"&&QZ(e)&&Object.hasOwn(e,"temporaryAllowLocalHarness")?Object.keys(e).some(n=>gC(`vscode.${n}`)):gC(t))}function GZ(r){return zZ.find(t=>m_(r,t))}function Ta(r){let t=XB.get(r);return t||(t=e=>e.managedSettings?.[r],XB.set(r,t)),t}function jZ(r){return r.managedSettingsActive===!0?!1:void 0}function b_(r){return r.chat_preview_features_enabled===!1||r.managedSettings?.[pm]===!1?!1:jZ(r)}function QZ(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function bq(r){let t={};for(let e in r){let n=r[e].managedSettings;if(n)for(let o in n)t[o]=n[o]}return t}function Sq(r){for(let t in r){let e=r[t].managedSettings;if(e&&!Wa(e))return!0}return!1}function xq(r,t,e){let n={};for(let o in t){let i=r[o];i!==void 0&&(typeof i===t[o].type?n[o]=i:e?.(`Ignoring managed setting "${o}": expected ${t[o].type}, got ${typeof i}`))}return n}function Cq(r,t,e){let n={nativeMdm:r,server:t,file:e},o=new Map,i=new Map,s=new Map;for(let c of fC){let u=n[c];if(u)for(let p of Object.keys(u)){let m=u[p];if(m===void 0)continue;let g=o.get(p),y=GZ(p);if(y){let h=s.get(y)??c;if(s.set(y,h),c!==h&&!g){let I=i.get(p)??[];I.push({channel:c,value:m}),i.set(p,I);continue}}g?(g.contributions.push({channel:c,value:m}),((p===rq||p===iq||p===sq)&&m===!0&&g.value!==!0||(p===cq||p===dq||p===uq||p===hq||p===aq||p===lq)&&m===!1&&g.value!==!1)&&(g.value=m,g.source=c)):o.set(p,{value:m,source:c,contributions:[{channel:c,value:m}]})}}let a=new Set,l=[];for(let[c,u]of o)l.push([c,u.value]),a.add(u.source);return{values:Object.fromEntries(l),excludedBlockContributions:i,resolutions:o,activeSources:fC.filter(c=>a.has(c))}}function ZB(r){if(!ve(r))return;let t={};for(let[e,n]of Object.entries(r))e==="__proto__"||e==="constructor"||e==="prototype"||(G(n)?t[e]=n:(typeof n=="number"||typeof n=="boolean")&&(t[e]=String(n)));return t}function JZ(r){return ve(r)?r:void 0}function dd(r){return Array.isArray(r)?r:void 0}function YZ(r,t){return JB(XZ(r,t))}function XZ(r,t){if(!ve(r))return;let e=new Set,n=[];for(let[o,i]of Object.entries(r)){if(!ve(i)||!ve(i.source)){t?.(`Skipping malformed extraKnownMarketplaces entry "${o}": expected { source: { source, repo|url } }`);continue}let s=i,a=s.source,l=typeof s.autoUpdate=="boolean"?s.autoUpdate:void 0;s.autoUpdate!==void 0&&l===void 0&&t?.(`Ignoring invalid autoUpdate for extraKnownMarketplaces entry "${o}": expected boolean`);let c;a.source==="github"&&G(a.repo)?c={name:o,...l===void 0?{}:{autoUpdate:l},source:{source:"github",repo:a.repo,...a.ref?{ref:a.ref}:{}}}:a.source==="git"&&G(a.url)?c={name:o,...l===void 0?{}:{autoUpdate:l},source:{source:"git",url:a.url,...a.ref?{ref:a.ref}:{}}}:a.source==="github"||a.source==="git"?t?.(`Skipping extraKnownMarketplaces entry "${o}": source "${a.source}" requires ${a.source==="github"?'"repo"':'"url"'}`):t?.(`Skipping extraKnownMarketplaces entry "${o}": unknown source type "${a.source}"`),c&&!e.has(o)&&(e.add(o),n.push(c))}return n}var OZ,UZ,NZ,tq,FZ,HZ,nq,WZ,VZ,BZ,g_,pm,oq,rq,iq,sq,aq,lq,cq,dq,uq,pq,mq,gq,fq,hq,qZ,yq,vq,qje,hC,f_,Xh,ud,pd,h_,y_,v_,I_,yC,vC,$Z,Iq,zZ,XB,KZ,$je,fC,zje,Gje,mm=v(()=>{ue();YB();qo();Ie();Z();OZ="permissions.disableBypassPermissionsMode",UZ="permissions.disableAssistedPermissionsMode",NZ="permissions.defaultMode",tq=["permissions.ask","permissions.allow","permissions.deny"],FZ="enabledPlugins",HZ="extraKnownMarketplaces",nq="strictKnownMarketplaces",WZ="allowedMcpServers",VZ="deniedMcpServers",BZ="forceRemoteSettingsRefresh",g_="vscode.temporaryDefaultToLocalHarness",pm="vscode.temporaryAllowLocalHarness",oq="chat.temporaryDefaultToLocalHarness",rq="sandbox.enabled",iq="sandbox.sandboxMcpServers",sq="sandbox.sandboxLspServers",aq="sandbox.auth.git",lq="sandbox.auth.gh",cq="sandbox.allowBypass",dq="sandbox.userPolicy.network.allowOutbound",uq="sandbox.userPolicy.network.allowLocalNetwork",pq="sandbox.userPolicy.network.allowedHosts",mq="sandbox.userPolicy.filesystem.readwritePaths",gq="sandbox.userPolicy.filesystem.readonlyPaths",fq="sandbox.userPolicy.filesystem.deniedPaths",hq="sandbox.allowDevToolAccess",qZ="communication.support.url",yq="autoTier",vq="fusionTier",qje={...Object.fromEntries(tq.map(r=>[r,{type:"string"}])),[NZ]:{type:"string"},[UZ]:{type:"boolean"},[OZ]:{type:"string"},"permissions.limitTo":{type:"string"},"permissions.model":{type:"string"},[BZ]:{type:"boolean"},[nq]:{type:"string"},[pm]:{type:"boolean"},[rq]:{type:"boolean"},[iq]:{type:"boolean"},[sq]:{type:"boolean"},[aq]:{type:"boolean"},[lq]:{type:"boolean"},[cq]:{type:"boolean"},[dq]:{type:"boolean"},[uq]:{type:"boolean"},[pq]:{type:"string"},[mq]:{type:"string"},[gq]:{type:"string"},[fq]:{type:"string"},[hq]:{type:"boolean"},[yq]:{type:"string"},[vq]:{type:"string"},[qZ]:{type:"string"},"telemetry.capture.prompts":{type:"boolean"},"telemetry.capture.responses":{type:"boolean"},"telemetry.capture.toolArguments":{type:"boolean"},"telemetry.capture.toolOutput":{type:"boolean"},"telemetry.capture.policyDetail":{type:"boolean"}},hC="chat.mcp.allowManagedServersOnly",f_="telemetry.enabled",Xh="telemetry.endpoint",ud="telemetry.filePath",pd="telemetry.protocol",h_="telemetry.captureContent",y_="telemetry.capture.identity",v_="telemetry.lockCaptureContent",I_="telemetry.serviceName",yC="telemetry.resourceAttributes",vC="telemetry.headers",$Z="telemetry",Iq="communication",zZ=[$Z,Iq];XB=new Map;KZ=A("managedSettingsService");$je=A("nativeManagedSettingsService");fC=["nativeMdm","server","file"];zje=[...tq.map(r=>({key:r,encode:t=>t})),{key:pq,encode:dd},{key:mq,encode:dd},{key:gq,encode:dd},{key:fq,encode:dd},{key:yq,encode:r=>r},{key:vq,encode:r=>r},{key:FZ,encode:JZ},{key:nq,encode:dd},{key:WZ,encode:dd},{key:VZ,encode:dd},{key:HZ,encode:YZ},{key:yC,encode:ZB},{key:vC,encode:ZB}];Gje=A("fileManagedSettingsService")});function wq(r){switch(r){case"nativeMdm":return"nativeMdm";case"server":return"serverManagedSettings";case"file":return"fileManagedSettings"}}function ZZ(r){let t=r;if(typeof t=="string")try{t=JSON.parse(t)}catch{}return Array.isArray(t)?t.filter(e=>typeof e=="string").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):[]}var Eq,Rq,fQe,IC,Tq=v(()=>{ue();Xt();ee();ro();Z();De();mm();c_();bu();d_();Eq="ChatApprovedAccountOrganizations",Rq=new C("chatAccountPolicyGateActive",!1,{type:"boolean",description:d(25472,null)}),fQe=A("accountPolicyGateService"),IC=class extends fI{constructor(e,n,o,i,s){super();this.logService=e;this.defaultAccountService=n;this._gateInfo={state:"inactive"};this._onDidChangeGateInfo=this._register(new R);this.onDidChangeGateInfo=this._onDidChangeGateInfo.event;this._managedSettings={};this._onDidChangeManagedSettings=this._register(new R);this.onDidChangeManagedSettings=this._onDidChangeManagedSettings.event;this.managedPolicyReader=o,this.nativeManagedSettingsService=i,this.fileManagedSettingsService=s,this._updatePolicyDefinitions(this.policyDefinitions),this._register(this.defaultAccountService.onDidChangePolicyData(()=>{this._updatePolicyDefinitions(this.policyDefinitions)})),this._register(this.defaultAccountService.onDidChangeDefaultAccount(()=>{this._updatePolicyDefinitions(this.policyDefinitions)})),this._register(this.defaultAccountService.onDidChangeManagedSettingsFreshness(()=>{this._updatePolicyDefinitions(this.policyDefinitions)})),this.managedPolicyReader&&this._register(this.managedPolicyReader.onDidChange(a=>{a.includes(Eq)&&this._updatePolicyDefinitions(this.policyDefinitions)})),this.nativeManagedSettingsService&&this._register(this.nativeManagedSettingsService.onDidChangeManagedSettings(()=>{this._updatePolicyDefinitions(this.policyDefinitions)})),this.fileManagedSettingsService&&this._register(this.fileManagedSettingsService.onDidChangeRawManagedSettings(()=>{this._updatePolicyDefinitions(this.policyDefinitions)})),this.initialization=this.initialize(),this.initialization.catch(a=>this.logService.error("AccountPolicyService: Failed to initialize account policy",a))}get gateInfo(){return this._gateInfo}getManagedSettingValue(e){return this._managedSettings[e]}getManagedSettings(){return this._managedSettings}whenInitialized(){return this.initialization}async initialize(){await this.defaultAccountService.getDefaultAccount(),await this._updatePolicyDefinitions(this.policyDefinitions)}async _updatePolicyDefinitions(e){this.logService.trace(`AccountPolicyService#_updatePolicyDefinitions: Got ${Object.keys(e).length} policy definitions`);let n=await this.updateCopilotManagedSettingDefinitions(e),o=[],i=this.getPolicyData(n),s=this._gateInfo;this._gateInfo=this.computeGateInfo();let a=!Ge(s,this._gateInfo),l=this._gateInfo.state==="restricted"&&this._gateInfo.reason!=="policyNotResolved";for(let c in e){let u=this.resolvePolicyValue(e[c],i,l);this.updatePolicyValue(c,u?.value,u?.source)&&o.push(c)}o.length&&this._onDidChange.fire(o),a&&this._onDidChangeGateInfo.fire(this._gateInfo)}resolvePolicyValue(e,n,o){if(o&&(e.value!==void 0||e.restrictedValue!==void 0))return{value:pN(e),source:"accountGate"};let i=e.value;if(!n||!i)return;let{policyData:s,managedSettingResolutions:a,activeManagedSettingsSources:l}=n,c=i(s);if(c===void 0)return;let u="account";if(e.managedSettings){let p=s.managedSettings??{},m=Object.keys(e.managedSettings).filter(g=>Object.hasOwn(p,g));if(m.length>0){let g=h=>({...s,managedSettings:Object.fromEntries(Object.entries(p).filter(([I])=>!h.has(I)))}),y=new Set(m);if(i(g(y))!==c){let h=new Set;for(let E of m){let T=a.get(E)?.source;T&&h.add(T)}let I=new Set;for(let E of h){let T=new Set(m.filter(P=>a.get(P)?.source===E));i(g(T))!==c&&I.add(E)}let x=I.size>0?I:h;u=x.size===1?wq(Array.from(x)[0]):"mixedManagedSettings"}}}return u==="account"&&s.managedSettingsActive===!0&&i({...s,managedSettings:void 0,managedSettingsActive:!1})!==c&&l.length>0&&(u=l.length===1?wq(l[0]):"mixedManagedSettings"),{value:c,source:u}}async updateCopilotManagedSettingDefinitions(e){return!this.nativeManagedSettingsService||!Sq(e)?this.nativeManagedSettingsService?.managedSettings:this.nativeManagedSettingsService.updatePolicyDefinitions(e)}getPolicyData(e){let n=this.defaultAccountService.policyData??void 0,o=e??this.nativeManagedSettingsService?.managedSettings,i=this.fileManagedSettingsService?.managedSettings,s=Cq(o,n?.managedSettings,i),a=new Set(Array.from(s.resolutions).filter(([p])=>gC(p)).map(([,p])=>p.source));n?.managedSettingsActive===!0&&a.add("server"),eq(this.fileManagedSettingsService?.rawManagedSettings)&&a.add("file");let l=fC.filter(p=>a.has(p));Ge(this._managedSettings,s.values)||(this._managedSettings=s.values,this._onDidChangeManagedSettings.fire());let c=bq(this.policyDefinitions),u=xq(s.values,c,p=>this.logService.warn(`[AccountPolicy] ${p}`));if(!(!n&&l.length===0&&Object.keys(u).length===0))return{policyData:{...n,managedSettings:u,managedSettingsActive:l.length>0},managedSettingResolutions:s.resolutions,activeManagedSettingsSources:l}}computeGateInfo(){let e=this.defaultAccountService.managedSettingsFreshness;if($B(e))return{state:"restricted",reason:"managedSettingsRefresh",managedSettingsFreshness:e};if(!this.managedPolicyReader)return{state:"inactive"};let n=this.managedPolicyReader.getPolicyValue(Eq),o=ZZ(n);if(o.length===0)return{state:"inactive"};let i=this.defaultAccountService.currentDefaultAccount;if(!i)return{state:"restricted",reason:"noAccount",approvedOrganizations:o};let s=this.defaultAccountService.getDefaultAccountAuthenticationProvider();return i.authenticationProvider.id!==s.id?{state:"restricted",reason:"wrongProvider",approvedOrganizations:o}:!o.includes("*")&&!(i.entitlementsData?.organization_login_list??[]).map(c=>c.toLowerCase()).some(c=>o.includes(c))?{state:"restricted",reason:"orgNotApproved",approvedOrganizations:o}:this.defaultAccountService.policyData===null?{state:"restricted",reason:"policyNotResolved",approvedOrganizations:o}:{state:"satisfied",approvedOrganizations:o}}};IC=w([b(0,z),b(1,pC)],IC)});var Pq=v(()=>{Me()});var kq=v(()=>{gi()});var AQe,eee,DQe,tee,nee,Aq=v(()=>{of();ee();br();ro();Z();$o();mm();AQe=new C("agentHostEnabled",!1,{type:"boolean",description:d(1909,null)}),eee="chat.editor.agentHost.existingSessionHarnessPicker.enabled",DQe=new C("agentHostExistingSessionHarnessPickerEnabled",!1,{type:"boolean",description:d(1910,null)}),tee=A("agentHostEnablementService"),nee=St.as(Jn.Configuration);nee.registerConfiguration({id:"chatAgentHost",title:d(1918,null),type:"object",properties:{[oq]:{type:"boolean",description:d(1916,null),default:!1,included:!1,scope:1,policy:{name:"ChatTemporaryDefaultToLocalHarness",category:"InteractiveSession",minimumVersion:"1.142",value:Ta(g_),managedSettings:{[g_]:{type:"boolean"}},localization:{description:{key:"chat.temporaryDefaultToLocalHarness.policy",value:d(1917,null)}}}},"chat.editor.preferCopilotHarness":{type:"boolean",description:d(1914,null),default:!0,policy:{name:"ChatEditorPreferCopilotHarness",category:"InteractiveSession",minimumVersion:"1.134",localization:{description:{key:"chat.editor.preferCopilotHarness.policy",value:d(1915,null)}}}},"chat.defaultToCopilotHarness":{type:"boolean",description:d(1911,null),default:!0},"chat.editor.localAgent.enabled":{type:"boolean",description:d(1913,null),default:!0,tags:["experimental"],experiment:{mode:"startup"}},[eee]:{type:"boolean",description:d(1912,null),default:!1,included:!1,tags:["experimental"]}}})});function Dq(r){let t=new Za;t.update(r);let e=t.digest(),n=(parseInt(e.slice(12,16),16)&4095|20480).toString(16).padStart(4,"0"),o=(parseInt(e.slice(16,20),16)&16383|32768).toString(16).padStart(4,"0");return`${e.slice(0,8)}-${e.slice(8,12)}-${n}-${o}-${e.slice(20,32)}`}var _q=v(()=>{Mi();ql()});function ree(r){return`${Vh}:/${r}`}function Mq(r,t,e,n){return r==="opaque"?ree(Dq(`${e}\0${n}`)):M4(t,n)}var S_=v(()=>{Vt();_q();ql()});function Lq(r,t){let e=r?.trim();return e?kO(e,iee):t?.trim()||"Subagent"}var iee,Oq,x_,bC=v(()=>{ue();Tt();it();te();S_();ql();iee=60;(t=>{function r(e,n){if(e.kind!=="subagent_started")return;let o=n(e.chat.toString());if(o!==void 0)return{session:S.parse(o.owner),chat:S.parse(Mq(o.format,o.owner,e.chat.toString(),e.toolCallId)),parent:{chat:e.chat,toolCallId:e.toolCallId},title:Lq(e.taskDescription,e.agentDisplayName)}}t.toSpawnEvent=r})(Oq||={});(o=>{function r(i,s){return S.from({scheme:i,path:`/${s}`})}o.uri=r;function t(i){return(typeof i=="string"?S.parse(i):i).path.substring(1)}o.id=t;function e(i){let s=typeof i=="string"?S.parse(i):i;return s.scheme==="ahp-session"?void 0:s.scheme||void 0}o.provider=e;function n(i){return!i.authority&&!i.query&&!i.fragment}o.isCanonical=n})(x_||={})});function Xq(r){let t=e=>r.inspect(e).policyValue;return{enabled:t(Zh),exporterType:t(ey),otlpProtocol:t(C_),otlpEndpoint:t(ty),captureContent:t(ny),captureIdentity:t(oy),outfile:t(ry),serviceName:t(E_),resourceAttributes:t(w_)}}function Uq(r){if(!r)return;let t=Object.entries(r).filter(([e,n])=>e!==""&&typeof n=="string").map(([e,n])=>`${e}=${n}`);return t.length>0?t.join(","):void 0}function Zq(r,t,e={},n={}){let o={},i=(u,p)=>{p===void 0||p===""||t[u]!==void 0||(o[u]=p)},s=(u,p)=>{p!==void 0&&(o[u]=p)};r.enabled&&i(ot.Enabled,"true"),i(ot.ExporterType,r.exporterType),i(ot.OtlpEndpoint,r.otlpEndpoint),i(ot.ServiceName,r.serviceName),i(ot.ResourceAttributes,Uq(r.resourceAttributes)),i(ot.FilePath,r.outfile),r.captureContent!==void 0&&i(ot.CaptureContent,r.captureContent?"true":"false"),r.captureIdentity!==void 0&&n[ot.CaptureIdentity]===void 0&&i(ot.CaptureIdentity,r.captureIdentity?"true":"false"),r.dbSpanExporterEnabled&&i(ot.DbSpanExporterEnabled,"true");let a=()=>{s(ot.OtlpEndpoint,""),s(ot.OtlpEndpointAlt,""),s(ot.OtlpTracesEndpoint,""),s(ot.OtlpMetricsEndpoint,""),s(ot.OtlpProtocol,""),s(ot.OtlpProtocolAlt,""),s(ot.OtlpTracesProtocol,""),s(ot.OtlpMetricsProtocol,""),s(ot.OtlpHeaders,""),s(ot.OtlpTracesHeaders,""),s(ot.OtlpMetricsHeaders,"")},l=e.outfile!==void 0&&(e.outfile!==""||e.exporterType==="file");e.enabled===!1?(s(ot.Enabled,"false"),a(),s(ot.FilePath,""),s(ot.DbSpanExporterEnabled,"")):l?(s(ot.Enabled,"true"),s(ot.ExporterType,"file"),s(ot.FilePath,e.outfile),a()):(s(ot.FilePath,e.outfile),e.enabled!==void 0&&s(ot.Enabled,e.enabled?"true":"false"),e.exporterType!==void 0&&(s(ot.ExporterType,e.exporterType),s(ot.FilePath,"")),e.otlpProtocol!==void 0&&e.otlpProtocol!==""&&(s(ot.OtlpProtocol,e.otlpProtocol),s(ot.OtlpTracesProtocol,e.otlpProtocol),s(ot.OtlpMetricsProtocol,e.otlpProtocol)),e.otlpEndpoint!==void 0&&(s(ot.OtlpEndpoint,e.otlpEndpoint),s(ot.FilePath,""))),e.captureContent!==void 0&&s(ot.CaptureContent,e.captureContent?"true":"false"),e.captureIdentity!==void 0&&s(ot.CaptureIdentity,e.captureIdentity?"true":"false"),e.serviceName!==void 0&&e.serviceName!==""&&s(ot.ServiceName,e.serviceName);let c=Uq(e.resourceAttributes);return c!==void 0&&s(ot.ResourceAttributes,c),l&&e.enabled!==!1?s(ot.FilePathIsManaged,"true"):t[ot.FilePathIsManaged]!==void 0&&s(ot.FilePathIsManaged,"false"),o}function e5(r,t){let e={},n=(o,i)=>{i===void 0||i===""||t[o]!==void 0||(e[o]=i)};return n(uee,r.codexSdkRoot),n(pee,r.codexHome),Array.isArray(r.codexBinaryArgs)&&r.codexBinaryArgs.length>0&&n(mee,JSON.stringify(r.codexBinaryArgs)),r.claudeAgentEnabled!==void 0&&n(lee,r.claudeAgentEnabled?"true":"false"),r.codexAgentEnabled!==void 0&&n(dee,r.codexAgentEnabled?"true":"false"),r.multipleChatProvidersEnabled===!0&&n(cee,"true"),e}var SC,uJe,Nq,Fq,Hq,Wq,Vq,Bq,qq,$q,zq,Gq,Kq,jq,Qq,Jq,xC,CC,Yq,lee,cee,dee,EC,wC,RC,uee,pee,mee,Zh,ey,C_,ty,ny,oy,ry,E_,w_,TC,ot,pJe,mJe,Kl=v(()=>{Xt();Z();bC();bC();SC="chat.agentHost.ahpJsonlLoggingEnabled",uJe=1024*1024,Nq="chat.agentHost.systemProxy.enabled",Fq="chat.agentHost.githubMcpServer.enabled",Hq="chat.agentHost.computerUse.enabled",Wq="chat.agentHost.experimental.titleGeneration",Vq="chat.agentHost.experimental.mcpToolRouting",Bq="chat.agentHost.experimental.markdownPlanRichLinks",qq="chat.experimental.workspaceSnapshot",$q="chat.agentHost.mcpSkills.enabled",zq="chat.agentHost.agentOrchestrationLimits",Gq="chat.artifactTools.enabled",Kq="chat.canvases.enabled",jq="chat.agentHost.experimental.autoAttachPullRequests",Qq="chat.agentHost.experimental.overlapProviderPreparation",Jq="chat.agentHost.experimental.prewarmSessions",xC="chat.agentHost.claudeAgent.enabled",CC="chat.agentHost.codexAgent.enabled",Yq="chat.agentHost.byokModels.enabled",lee="VSCODE_AGENT_HOST_CLAUDE_AGENT_ENABLED",cee="VSCODE_AGENT_HOST_MULTIPLE_CHAT_PROVIDERS_ENABLED",dee="VSCODE_AGENT_HOST_CODEX_AGENT_ENABLED",EC="chat.agentHost.codexAgent.sdkRoot",wC="chat.agentHost.codexAgent.codexHome",RC="chat.agentHost.codexAgent.binaryArgs",uee="VSCODE_AGENT_HOST_CODEX_SDK_ROOT",pee="CODEX_HOME",mee="VSCODE_AGENT_HOST_CODEX_APP_SERVER_ARGS",Zh="chat.agentHost.otel.enabled",ey="chat.agentHost.otel.exporterType",C_="chat.agentHost.otel.otlpProtocol",ty="chat.agentHost.otel.otlpEndpoint",ny="chat.agentHost.otel.captureContent",oy="chat.agentHost.otel.captureIdentity",ry="chat.agentHost.otel.outfile",E_="chat.agentHost.otel.serviceName",w_="chat.agentHost.otel.resourceAttributes",TC="chat.agentHost.otel.dbSpanExporter.enabled",ot=Object.freeze({Enabled:"COPILOT_OTEL_ENABLED",ExporterType:"COPILOT_OTEL_EXPORTER_TYPE",OtlpEndpoint:"OTEL_EXPORTER_OTLP_ENDPOINT",OtlpEndpointAlt:"COPILOT_OTEL_ENDPOINT",OtlpTracesEndpoint:"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",OtlpMetricsEndpoint:"OTEL_EXPORTER_OTLP_METRICS_ENDPOINT",OtlpProtocol:"OTEL_EXPORTER_OTLP_PROTOCOL",OtlpProtocolAlt:"COPILOT_OTEL_PROTOCOL",OtlpTracesProtocol:"OTEL_EXPORTER_OTLP_TRACES_PROTOCOL",OtlpMetricsProtocol:"OTEL_EXPORTER_OTLP_METRICS_PROTOCOL",OtlpHeaders:"OTEL_EXPORTER_OTLP_HEADERS",OtlpTracesHeaders:"OTEL_EXPORTER_OTLP_TRACES_HEADERS",OtlpMetricsHeaders:"OTEL_EXPORTER_OTLP_METRICS_HEADERS",CaptureContent:"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT",CaptureIdentity:"COPILOT_OTEL_CAPTURE_IDENTITY",FilePath:"COPILOT_OTEL_FILE_EXPORTER_PATH",FilePathIsManaged:"VSCODE_AGENT_HOST_OTEL_FILE_PATH_IS_MANAGED",SourceName:"COPILOT_OTEL_SOURCE_NAME",ServiceName:"OTEL_SERVICE_NAME",ResourceAttributes:"OTEL_RESOURCE_ATTRIBUTES",DbSpanExporterEnabled:"COPILOT_OTEL_DB_SPAN_EXPORTER_ENABLED"});pJe=A("agentService"),mJe=A("agentHostService")});var t5=v(()=>{Ie();ql()});var n5=v(()=>{t5()});var o5=v(()=>{bC();n5();S_()});var r5=v(()=>{ue();Q();fn();it();te();Vt();gi()});var R_,vYe,gm,IYe,bYe,SYe,xYe,CYe,iy=v(()=>{Me();$x();dn();gi();ia();Pq();ro();p_();a_();Bh();kq();Aq();MD();Kl();mm();ee();cC();o5();r5();R_=(o=>(o.Default="default",o.Assisted="assisted",o.AutoApprove="autoApprove",o.Autopilot="autopilot",o))(R_||{}),vYe=new Set(Object.values(R_)),gm=(o=>(o.Chat="panel",o.Terminal="terminal",o.Notebook="notebook",o.EditorInline="editor",o))(gm||{});(t=>{function r(e){switch(e){case"panel":return"panel";case"terminal":return"terminal";case"notebook":return"notebook";case"editor":return"editor"}return"panel"}t.fromRaw=r})(gm||={});IYe=new Set([q.vscodeChatEditor,q.vscodeChatResponseResource,q.walkThrough,q.vscodeLocalChatSession,q.vscodeSettings,q.webviewPanel,q.vscodeUserData,q.extension,"ccreq","openai-codex"]),bYe=[q.vscodeChatInput,q.sessionsChatInput],SYe=tt.and(he.Setup.hidden.negate(),he.Setup.disabledInWorkspace.negate(),OB.negate(),tt.has("config.chat.agent.enabled"),UB.negate()),xYe=new C("inModelsEditor",!1),CYe=new C("inModelsSearch",!1)});var Qr,yee,T_=v(()=>{ee();ro();r_();a_();p_();Tq();iy();(B=>{B.responseVote=new C("chatSessionResponseVote","",{type:"string",description:d(14987,null)}),B.responseDetectedAgentCommand=new C("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:d(14951,null)}),B.responseSupportsIssueReporting=new C("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:d(14942,null)}),B.responseIsFiltered=new C("chatSessionResponseFiltered",!1,{type:"boolean",description:d(14940,null)}),B.responseHasError=new C("chatSessionResponseError",!1,{type:"boolean",description:d(14938,null)}),B.responseHasFeedbackSurvey=new C("chatSessionResponseHasFeedbackSurvey",!1,{type:"boolean",description:d(14941,null)}),B.responseFeedbackSurveyOpen=new C("chatSessionResponseFeedbackSurveyOpen",!1,{type:"boolean",description:d(14939,null)}),B.requestInProgress=new C("chatSessionRequestInProgress",!1,{type:"boolean",description:d(14986,null)}),B.transcriptProgressActive=new C("chatTranscriptProgressActive",!1,{type:"boolean",description:d(14965,null)}),B.hasActiveRequest=new C("chatSessionHasActiveRequest",!1,{type:"boolean",description:d(14943,null)}),B.currentlyEditing=new C("chatSessionCurrentlyEditing",!1,{type:"boolean",description:d(14984,null)}),B.currentlyEditingInput=new C("chatSessionCurrentlyEditingInput",!1,{type:"boolean",description:d(14985,null)});let m;(Cw=>(Cw.Sent="s",Cw.Queue="q",Cw.Steer="st"))(m=B.EditingRequestType||={}),B.editingRequestType=new C("chatEditingSentRequest",void 0,{type:"string",description:d(14901,null)}),B.isResponse=new C("chatResponse",!1,{type:"boolean",description:d(14937,null)}),B.isRequest=new C("chatRequest",!1,{type:"boolean",description:d(14935,null)}),B.contextMenuIsBackground=new C("chatContextMenuIsBackground",!1,{type:"boolean",description:d(14893,null)}),B.contextMenuHasLink=new C("chatContextMenuHasLink",!1,{type:"boolean",description:d(14891,null)}),B.contextMenuHasAvailableEditors=new C("chatContextMenuHasAvailableEditors",!1,{type:"boolean",description:d(14890,null)}),B.contextMenuHasResponseSelection=new C("chatContextMenuHasResponseSelection",!1,{type:"boolean",description:d(14892,null)}),B.isFirstRequest=new C("chatFirstRequest",!1,{type:"boolean",description:d(14907,null)}),B.isPendingRequest=new C("chatRequestIsPending",!1,{type:"boolean",description:d(14936,null)}),B.itemId=new C("chatItemId","",{type:"string",description:d(14922,null)}),B.lastItemId=new C("chatLastItemId",[],{type:"string",description:d(14923,null)}),B.editApplied=new C("chatEditApplied",!1,{type:"boolean",description:d(14895,null)}),B.inputHasText=new C("chatInputHasText",!1,{type:"boolean",description:d(14983,null)}),B.inputHasSendableContent=new C("chatInputHasSendableContent",!1,{type:"boolean",description:d(14982,null)}),B.inputHasFocus=new C("chatInputHasFocus",!1,{type:"boolean",description:d(14981,null)}),B.inChatInput=new C("inChatInput",!1,{type:"boolean",description:d(14979,null)}),B.inputInlineAttachmentActive=new C("chatInputInlineAttachmentActive",!1,{type:"boolean",description:d(14917,null)}),B.inChatSessionWorkingSet=new C("inChatSessionWorkingSet",!1,{type:"boolean",description:d(14975,null)}),B.sessionWorkingSetKeepEnabled=new C("chatSessionWorkingSetKeepEnabled",!1,{type:"boolean",description:d(14958,null)}),B.sessionWorkingSetReviewEnabled=new C("chatSessionWorkingSetReviewEnabled",!0,{type:"boolean",description:d(14959,null)}),B.sessionWorkingSetHasUndo=new C("chatSessionWorkingSetHasUndo",!1,{type:"boolean",description:d(14957,null)}),B.sessionWorkingSetUndoEnabled=new C("chatSessionWorkingSetUndoEnabled",!1,{type:"boolean",description:d(14960,null)}),B.inChatSession=new C("inChat",!1,{type:"boolean",description:d(14970,null)}),B.inChatQuestionCarousel=new C("inChatQuestionCarousel",!1,{type:"boolean",description:d(14974,null)}),B.chatQuestionCarouselHasTerminal=new C("chatQuestionCarouselHasTerminal",!1,{type:"boolean",description:d(14933,null)}),B.inChatEditor=new C("inChatEditor",!1,{type:"boolean",description:d(14973,null)}),B.findSupported=new C("chatFindSupported",!1,{type:"boolean",description:d(14904,null)}),B.findWidgetVisible=new C("chatFindWidgetVisible",!1,{type:"boolean",description:d(14906,null)}),B.findInputFocused=new C("chatFindInputFocused",!1,{type:"boolean",description:d(14903,null)}),B.findWidgetFocused=new C("chatFindWidgetFocused",!1,{type:"boolean",description:d(14905,null)}),B.inChatTodoList=new C("inChatTodoList",!1,{type:"boolean",description:d(14978,null)}),B.inChatTip=new C("inChatTip",!1,{type:"boolean",description:d(14977,null)}),B.inChatComposer=new C("inChatComposer",!1,{type:"boolean",description:d(14972,null)}),B.multipleChatTips=new C("multipleChatTips",!1,{type:"boolean",description:d(14990,null)}),B.inChatTerminalToolOutput=new C("inChatTerminalToolOutput",!1,{type:"boolean",description:d(14976,null)}),B.inChatBackgroundShellOutput=new C("inChatBackgroundShellOutput",!1,{type:"boolean",description:d(14971,null)}),B.chatModeKind=new C("chatAgentKind","ask",{type:"string",description:d(14870,null)}),B.chatPermissionLevel=new C("chatPermissionLevel","default",{type:"string",description:d(14932,null)}),B.chatModeName=new C("chatModeName","",{type:"string",description:d(14926,null)}),B.agentPickerInAttachContext=new C("chatAgentPickerInAttachContext",!1,{type:"boolean",description:d(14871,null)}),B.chatModelId=new C("chatModelId","",{type:"string",description:d(14924,null)}),B.speechToTextRecording=new C("chatSpeechToTextRecording",!1,{type:"boolean",description:d(14963,null)}),B.speechToTextConfigured=new C("chatSpeechToTextConfigured",!1,{type:"boolean",description:d(14961,null)}),B.speechToTextPreparing=new C("chatSpeechToTextPreparing",!1,{type:"boolean",description:d(14962,null)}),B.speechToTextUsesMai=new C("chatSpeechToTextUsesMai",!1,{type:"boolean",description:d(14964,null)}),B.supported=tt.or(AB.negate(),LB.notEqualsTo(""),tt.has("config.chat.experimental.serverlessWebEnabled")),B.enabled=new C("chatIsEnabled",!1,{type:"boolean",description:d(14919,null)}),B.accountPolicyGateActive=Rq,B.lockedToCodingAgent=new C("lockedToCodingAgent",!1,{type:"boolean",description:d(14989,null)}),B.lockedCodingAgentId=new C("lockedCodingAgentId","",{type:"string",description:d(14988,null)}),B.inputBlocked=new C("chatInputBlocked",!1,{type:"boolean",description:d(14916,null)}),B.readOnly=new C("chatIsReadonly",!1,{type:"boolean",description:d(14921,null)}),B.chatIsAgentHostSession=new C("chatIsAgentHostSession",!1,{type:"boolean",description:d(14918,null)}),B.chatAgentHostProviderId=new C("chatAgentHostProviderId","",{type:"string",description:d(14888,null)}),B.chatAgentHostHasImmutablePrimaryWorkingDirectory=new C("chatAgentHostHasImmutablePrimaryWorkingDirectory",!1,{type:"boolean",description:d(14887,null)}),B.chatAgentHostFolderPickerVisible=new C("chatAgentHostFolderPickerVisible",!1,{type:"boolean",description:d(14886,null)}),B.chatSessionHasCustomAgentTarget=new C("chatSessionHasCustomAgentTarget",!1,{type:"boolean",description:d(14944,null)}),B.chatSessionHasTargetedModels=new C("chatSessionHasTargetedModels",!1,{type:"boolean",description:d(14948,null)}),B.agentSupportsAttachments=new C("agentSupportsAttachments",!1,{type:"boolean",description:d(14885,null)}),B.withinEditSessionDiff=new C("withinEditSessionDiff",!1,{type:"boolean",description:d(14992,null)}),B.filePartOfEditSession=new C("filePartOfEditSession",!1,{type:"boolean",description:d(14967,null)}),B.extensionParticipantRegistered=new C("chatPanelExtensionParticipantRegistered",!1,{type:"boolean",description:d(14929,null)}),B.panelParticipantRegistered=new C("chatPanelParticipantRegistered",!1,{type:"boolean",description:d(14931,null)}),B.chatEditingCanUndo=new C("chatEditingCanUndo",!1,{type:"boolean",description:d(14897,null)}),B.chatEditingCanRedo=new C("chatEditingCanRedo",!1,{type:"boolean",description:d(14896,null)}),B.languageModelsAreUserSelectable=new C("chatModelsAreUserSelectable",!1,{type:"boolean",description:d(14925,null)}),B.nonCopilotLanguageModelsAreUserSelectable=new C("chatNonCopilotModelsAreUserSelectable",!1,{type:"boolean",description:d(14928,null)}),B.chatSessionHasModels=new C("chatSessionHasModels",!1,{type:"boolean",description:d(14947,null)}),B.chatSessionOptionsValid=new C("chatSessionOptionsValid",!0,{type:"boolean",description:d(14950,null)}),B.extensionInvalid=new C("chatExtensionInvalid",!1,{type:"boolean",description:d(14902,null)}),B.inputCursorAtTop=new C("chatCursorAtTop",!1),B.inputHasAgent=new C("chatInputHasAgent",!1),B.location=new C("chatLocation",void 0),B.inQuickChat=new C("quickChatHasFocus",!1,{type:"boolean",description:d(14980,null)}),B.inAutomationsDialog=new C("inAutomationsDialog",!1,{type:"boolean",description:d(14969,null)}),B.chatSessionType=new C("chatSessionType","",{type:"string",description:d(14956,null)}),B.hasFileAttachments=new C("chatHasFileAttachments",!1,{type:"boolean",description:d(14912,null)}),B.chatSessionIsEmpty=new C("chatSessionIsEmpty",!0,{type:"boolean",description:d(14949,null)}),B.hasPendingRequests=new C("chatHasPendingRequests",!1,{type:"boolean",description:d(14914,null)}),B.chatSessionHasDebugData=new C("chatSessionHasDebugData",!1,{type:"boolean",description:d(14945,null)}),B.chatSessionHasDebugTools=new C("chatSessionHasDebugTools",!1,{type:"boolean",description:d(14946,null)}),B.remoteJobCreating=new C("chatRemoteJobCreating",!1,{type:"boolean",description:d(14934,null)}),B.hasRemoteCodingAgent=new C("hasRemoteCodingAgent",!1,d(14968,null)),B.hasCanDelegateProviders=new C("chatHasCanDelegateProviders",!1,{type:"boolean",description:d(14910,null)}),B.enableRemoteCodingAgentPromptFileOverlay=new C("enableRemoteCodingAgentPromptFileOverlay",!1,d(14966,null)),B.Setup=he.Setup,B.Entitlement=he.Entitlement,B.chatQuotaExceeded=he.chatQuotaExceeded,B.completionsQuotaExceeded=he.completionsQuotaExceeded,B.Editing={hasToolConfirmation:new C("chatHasToolConfirmation",!1,{type:"boolean",description:d(14900,null)}),hasElicitationRequest:new C("chatHasElicitationRequest",!1,{type:"boolean",description:d(14898,null)}),hasQuestionCarousel:new C("chatHasQuestionCarousel",!1,{type:"boolean",description:d(14899,null)})},B.Tools={toolsCount:new C("toolsCount",0,{type:"number",description:d(14991,null)})},B.foregroundSessionCount=new C("chatForegroundSessionCount",0,{type:"number",description:d(14908,null)}),B.Modes={hasCustomChatModes:new C("chatHasCustomAgents",!1,{type:"boolean",description:d(14909,null)}),agentModeDisabledByPolicy:new C("chatAgentModeDisabledByPolicy",!1,{type:"boolean",description:d(14889,null)})},B.panelLocation=new C("chatPanelLocation",void 0,{type:"number",description:d(14930,null)}),B.agentSessionsViewerFocused=new C("agentSessionsViewerFocused",!0,{type:"boolean",description:d(14880,null)}),B.agentSessionsViewerOrientation=new C("agentSessionsViewerOrientation",void 0,{type:"number",description:d(14881,null)}),B.agentSessionsViewerPosition=new C("agentSessionsViewerPosition",void 0,{type:"number",description:d(14882,null)}),B.agentSessionsViewerVisible=new C("agentSessionsViewerVisible",void 0,{type:"boolean",description:d(14883,null)}),B.hasCreatedSessionInAgentsWindow=new C("chatHasCreatedSessionInAgentsWindow",!1,{type:"boolean",description:d(14911,null)}),B.agentSessionType=new C("chatSessionType","",{type:"string",description:d(14884,null)}),B.isAgentSessionChild=new C("agentSessionIsChild",!1,{type:"boolean",description:d(14875,null)}),B.agentSessionChildCanArchive=new C("agentSessionChildCanArchive",!1),B.agentSessionPullRequest=new C("chatSessionPullRequest","",{type:"string",description:d(14878,null)}),B.chatSessionSupportsDelegation=new C("chatSessionSupportsDelegation",!0,{type:"boolean",description:d(14952,null)}),B.hasPendingDelegationTarget=new C("chatHasPendingDelegationTarget",!1,{type:"boolean",description:d(14913,null)}),B.chatSessionSupportsFork=new C("chatSessionSupportsFork",!1,{type:"boolean",description:d(14953,null)}),B.chatSessionSupportsSideChat=new C("chatSessionSupportsSideChat",!1,{type:"boolean",description:d(14955,null)}),B.chatSessionSupportsRename=new C("chatSessionSupportsRename",!1,{type:"boolean",description:d(14954,null)}),B.agentSessionSection=new C("agentSessionSection","",{type:"string",description:d(14879,null)}),B.isArchivedAgentSession=new C("agentSessionIsArchived",!1,{type:"boolean",description:d(14874,null)}),B.isPinnedAgentSession=new C("agentSessionIsPinned",!1,{type:"boolean",description:d(14876,null)}),B.isReadAgentSession=new C("agentSessionIsRead",!1,{type:"boolean",description:d(14877,null)}),B.hasMultipleAgentSessionsSelected=new C("agentSessionHasMultipleSelected",!1,{type:"boolean",description:d(14873,null)}),B.hasAgentSessionChanges=new C("agentSessionHasChanges",!1,{type:"boolean",description:d(14872,null)}),B.isKatexMathElement=new C("chatIsKatexMathElement",!1,{type:"boolean",description:d(14920,null)}),B.hasUsedCreateSlashCommands=new C("chatHasUsedCreateSlashCommands",!1,{type:"boolean",description:d(14915,null)}),B.contextUsageHasBeenOpened=new C("chatContextUsageHasBeenOpened",!1,{type:"boolean",description:d(14894,null)}),B.newChatButtonExperimentIcon=new C("chatNewChatButtonExperimentIcon","",{type:"string",description:d(14927,null)})})(Qr||={});(n=>(n.inEditingMode=tt.or(Qr.chatModeKind.isEqualTo("edit"),Qr.chatModeKind.isEqualTo("agent")),n.isAgentHostSession=Qr.chatIsAgentHostSession.isEqualTo(!0),n.isAgentHostSessionItem=tt.or(tt.regex(Qr.agentSessionType.key,/^agent-host-/),tt.regex(Qr.agentSessionType.key,/^remote-/))))(yee||={})});function s5(r){if(!r.startsWith(P_))return;let t=r.indexOf(":",P_.length);if(t!==-1)try{return{provider:decodeURIComponent(r.slice(P_.length,t)),modelId:decodeURIComponent(r.slice(t+1))}}catch{return}}var P_,a5=v(()=>{P_="@provider="});var l5,c5=v(()=>{ee();ue();gs();Z();l5=A("notificationService")});var k_,zYe,d5,u5=v(()=>{Z();Me();k_=class{constructor(t){this.options=t}getItemLabel(t){return t.label}getItemDescription(t){if(!this.options?.skipDescription)return t.description}getItemPath(t){if(!this.options?.skipPath)return t.resource?.scheme===q.file?t.resource.fsPath:t.resource?.path}},zYe=new k_,d5=A("quickInputService")});var p5,jYe,m5=v(()=>{Z();p5=A("encryptionService"),jYe=A("encryptionMainService")});function kC(r){return`${sy}${r}`}async function vee(r,t,e,n){let o=kC(r);n?.trace("[secrets] getting secret for key:",o);let i=t(o);if(!i){n?.trace("[secrets] no secret found for key:",o);return}n?.trace("[secrets] decrypting secret for key:",o);let s=await e(i);return n?.trace("[secrets] decrypted secret for key:",o),s}async function Iee(r,t,e,n,o){o?.trace("[secrets] encrypting secret for key:",r);let i=await n(t),s=kC(r);o?.trace("[secrets] storing encrypted secret for key:",s),e(s,i),o?.trace("[secrets] stored encrypted secret for key:",s)}var sy,bee,g5,PC,f5=v(()=>{Ue();m5();Z();gi();ue();De();Q();ns();fe();sy="secret://";bee=['{"extensionId":"vscode.github-authentication","key":"github.auth"}'],g5=A("secretStorageService"),PC=class extends D{constructor(e,n,o,i){super();this._useInMemoryStorage=e;this._storageService=n;this._encryptionService=o;this._logService=i;this.onDidChangeSecretEmitter=this._register(new R);this.onDidChangeSecret=this.onDidChangeSecretEmitter.event;this._sequencer=new Ja;this._type="unknown";this._onDidChangeValueDisposable=this._register(new re);this._lazyStorageService=new Yt(()=>this.initialize())}useSharedStorage(e){return oe&&bee.includes(e)}get type(){return this._type}get resolvedStorageService(){return this._lazyStorageService.value}get(e){return this._sequencer.queue(e,async()=>{let n=await this.resolvedStorageService;try{return await vee(e,o=>this.getValueFromStorage(e,o,n),async o=>this._type==="in-memory"||!await this._encryptionService.isEncryptionAvailable()?o:this._encryptionService.decrypt(o),this._logService)}catch(o){this._logService.error(o);let i=kC(e);this._logService.trace("[secrets] deleting invalid secret for key:",i),this.removeValueFromStorage(e,i,n),this._logService.trace("[secrets] deleted invalid secret for key:",i);return}})}set(e,n){return this._sequencer.queue(e,async()=>{let o=await this.resolvedStorageService;try{await Iee(e,n,(i,s)=>this.setValueInStorage(e,i,s,o),async i=>this._type==="in-memory"||!await this._encryptionService.isEncryptionAvailable()?i:this._encryptionService.encrypt(i),this._logService)}catch(i){throw this._logService.error(i),i}})}delete(e){return this._sequencer.queue(e,async()=>{let n=await this.resolvedStorageService,o=kC(e);this._logService.trace("[secrets] deleting secret for key:",o),this.removeValueFromStorage(e,o,n),this._logService.trace("[secrets] deleted secret for key:",o)})}keys(){return this._sequencer.queue("__keys__",async()=>{let e=await this.resolvedStorageService;this._logService.trace("[secrets] fetching keys of all secrets");let n=e.keys(-1,1);return this._logService.trace("[secrets] fetched keys of all secrets"),n.filter(o=>o.startsWith(sy)).map(o=>o.slice(sy.length))})}getValueFromStorage(e,n,o){return this.useSharedStorage(e)?(this._logService.trace(`[SecretStorageService] Fetching value for cross-app shared secret: ${n}`),o.get(n,-2)):o.get(n,-1)}removeValueFromStorage(e,n,o){let i=this.useSharedStorage(e)?-2:-1;o.remove(n,i)}setValueInStorage(e,n,o,i){if(this.useSharedStorage(e)){this._logService.trace(`[SecretStorageService] Setting value for cross-app shared secret: ${n}`),i.store(n,o,-2,1);return}i.store(n,o,-1,1)}async initialize(){let e;if(!this._useInMemoryStorage)this._logService.trace("[SecretStorageService] Using persisted storage"),this._type="persisted",e=this._storageService;else{if(this._type==="in-memory")return this._storageService;this._logService.trace("[SecretStorageService] Falling back to in-memory storage"),this._type="in-memory",e=this._register(new JI)}return this._onDidChangeValueDisposable.clear(),this._onDidChangeValueDisposable.add(F.any(e.onDidChangeValue(-1,void 0,this._onDidChangeValueDisposable),e.onDidChangeValue(-2,void 0,this._onDidChangeValueDisposable))(n=>{this.onDidChangeValue(n.key)})),e}reinitialize(){this._lazyStorageService=new Yt(()=>this.initialize())}onDidChangeValue(e){if(!e.startsWith(sy))return;let n=e.slice(sy.length);this._logService.trace(`[SecretStorageService] Notifying change in value for secret: ${n}`),this.onDidChangeSecretEmitter.fire(n)}};PC=w([b(1,mi),b(2,p5),b(3,z)],PC)});var A_,D_,__=v(()=>{xe();Yn();A_=class{constructor(){this._generators=new Map;this._cache=new WeakMap}register(t,e){this._generators.set(t,e)}readActivationEvents(t){return this._cache.has(t)||this._cache.set(t,this._readActivationEvents(t)),this._cache.get(t)}createActivationEventsMap(t){let e=Object.create(null);for(let n of t){let o=this.readActivationEvents(n);o.length>0&&(e[un.toKey(n.identifier)]=o)}return e}_readActivationEvents(t){if(typeof t.main>"u"&&typeof t.browser>"u")return[];let e=Array.isArray(t.activationEvents)?t.activationEvents.slice(0):[];for(let n=0;n<e.length;n++)e[n]==="onUri"&&(e[n]=`onUri:${un.toKey(t.identifier)}`);if(!t.contributes)return e;for(let n in t.contributes){let o=this._generators.get(n);if(!o)continue;let i=t.contributes[n],s=Array.isArray(i)?i:[i];try{e.push(...o(s))}catch(a){pt(a)}}return e}},D_=new A_});function AC(r,t){return!0}function M_(r,t){if(!AC(r,t))throw new Error(`Extension '${r.identifier.value}' CANNOT use API proposal: ${t}.
Its package.json#enabledApiProposals-property declares: ${r.enabledApiProposals?.join(", ")??"[]"} but NOT ${t}.
The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${r.identifier.value}`)}var SXe,h5,L_=v(()=>{ue();te();ui();__();Yn();Z();SXe=Object.freeze({identifier:new un("nullExtensionDescription"),name:"Null Extension Description",version:"0.0.0",publisher:"vscode",engines:{vscode:""},extensionLocation:S.parse("void:location"),isBuiltin:!1,targetPlatform:"undefined",isUserBuiltin:!1,isUnderDevelopment:!1,preRelease:!1}),h5=A("extensionService")});var See,ay,y5=v(()=>{See={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},agentEditorComments:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentEditorComments.d.ts"},agentSessionsWorkspace:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentSessionsWorkspace.d.ts"},agentsWindowConfiguration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentsWindowConfiguration.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiSettingsSearch:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts"},authIssuers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authIssuers.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authProviderSpecific:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authProviderSpecific.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},authSessionAccountIcon:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSessionAccountIcon.d.ts"},authSessionAudience:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSessionAudience.d.ts"},authSessionExpiration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSessionExpiration.d.ts"},authenticationChallenges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authenticationChallenges.d.ts"},autoClosingPairBeforeText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.autoClosingPairBeforeText.d.ts"},browser:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.browser.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatArtifactIntegrations:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatArtifactIntegrations.d.ts"},chatContextProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatContextProvider.d.ts"},chatDebug:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatDebug.d.ts"},chatHooks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatHooks.d.ts"},chatInputNotification:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatInputNotification.d.ts"},chatOutputRenderer:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatOutputRenderer.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts"},chatPromptFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts"},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatReferenceBinaryData:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts"},chatReferenceDiagnostic:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceDiagnostic.d.ts"},chatSessionCustomizationProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts"},chatSessionsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts"},chatStatusItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribChatEditorInlineGutterMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribChatEditorInlineGutterMenu.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDebugCreateConfiguration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribLanguageModelToolSets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLanguageModelToolSets.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlArtifactGroupMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactGroupMenu.d.ts"},contribSourceControlArtifactMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlHistoryTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewContainerTitle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},css:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.css.d.ts"},customEditorDiffs:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorDiffs.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},customTextEditorNavigation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customTextEditorNavigation.d.ts"},dataChannels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.dataChannels.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts"},devDeviceId:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.devDeviceId.d.ts"},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentDiff.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},documentSyntaxHighlighting:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentSyntaxHighlighting.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},envIsConnectionMetered:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envIsConnectionMetered.d.ts"},environmentPower:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.environmentPower.d.ts"},extensionAffinity:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionAffinity.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider2.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts"},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles2.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},github:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.github.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelCapabilities:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts"},languageModelPricing:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelPricing.d.ts"},languageModelProxy:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelProxy.d.ts"},languageModelRateLimit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelRateLimit.d.ts"},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageModelThinkingPart:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelThinkingPart.d.ts"},languageModelToolResultAudience:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolResultAudience.d.ts"},languageModelToolSupportsModel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolSupportsModel.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},linkPresentation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.linkPresentation.d.ts"},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},markdownAlertSyntax:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownAlertSyntax.d.ts"},mcpServerDefinitions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpServerDefinitions.d.ts"},mcpToolDefinitions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpToolDefinitions.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},nativeWindowHandle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.nativeWindowHandle.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookReplDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},notificationTelemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notificationTelemetry.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},remoteCodingAgents:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.remoteCodingAgents.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmArtifactProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmArtifactProvider.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmProviderOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmProviderOptions.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},statusBarItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskExecutionTerminal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskExecutionTerminal.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},taskProblemMatcherStatus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskProblemMatcherStatus.d.ts"},taskRunOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskRunOptions.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalCompletionProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalRemoteResolver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalRemoteResolver.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellEnv:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts"},terminalTitle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalTitle.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textDocumentChangeReason:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textDocumentChangeReason.d.ts"},textEditorDiffInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts"},textSearchComplete2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchComplete2.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider2.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},toolInvocationApproveCombination:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolInvocationApproveCombination.d.ts"},toolProgress:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolProgress.d.ts"},treeItemMarkdownLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeItemMarkdownLabel.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},valueSelectionInQuickPick:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.valueSelectionInQuickPick.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},ay=Object.freeze(See)});var H_,O_,U_,xee,v5,N_,F_,I5,b5,S5=v(()=>{ee();xe();gs();_o();Zv();$o();Yn();Wn();__();y5();H_=St.as(Rc.JSONContribution),O_=class r{constructor(t,e){this.added=t;this.removed=e}static _toSet(t){let e=new rf;for(let n=0,o=t.length;n<o;n++)e.add(t[n].description.identifier);return e}static compute(t,e){if(!t||!t.length)return new r(e,[]);if(!e||!e.length)return new r([],t);let n=this._toSet(t),o=this._toSet(e),i=e.filter(a=>!n.has(a.description.identifier)),s=t.filter(a=>!o.has(a.description.identifier));return new r(i,s)}},U_=class{constructor(t,e,n){this.name=t,this.defaultExtensionKind=e,this.canHandleResolver=n,this._handler=null,this._users=null,this._delta=null}setHandler(t){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=t,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(t){this._delta=O_.compute(this._users,t),this._users=t,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(t){pt(t)}}},xee={type:"string",enum:["ui","workspace"],enumDescriptions:[d(25251,null),d(25334,null)]},v5="vscode://schemas/vscode-extensions",N_={properties:{engines:{type:"object",description:d(25318,null),properties:{vscode:{type:"string",description:d(25319,null),default:"^1.105.0"}}},publisher:{description:d(25330,null),type:"string"},displayName:{description:d(25315,null),type:"string"},categories:{description:d(25309,null),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:kI},{type:"string",const:"Languages",deprecationMessage:d(25310,null)}]}},galleryBanner:{type:"object",description:d(25322,null),properties:{color:{description:d(25323,null),type:"string"},theme:{description:d(25324,null),type:"string",enum:["dark","light"]}}},contributes:{description:d(25311,null),type:"object",properties:{},default:{}},preview:{type:"boolean",description:d(25328,null)},enableProposedApi:{type:"boolean",deprecationMessage:d(25317,null)},enabledApiProposals:{markdownDescription:d(25316,null),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(ay).map(r=>r),markdownEnumDescriptions:Object.values(ay).map(r=>r.proposal)}},api:{markdownDescription:d(25287,null),type:"string",enum:["none"],enumDescriptions:[d(25288,null)]},activationEvents:{description:d(25252,null),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:d(25284,null),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:d(25267,null),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:d(25257,null),body:"onCommand:${2:commandId}"},{label:"onDebug",description:d(25259,null),body:"onDebug"},{label:"onDebugInitialConfigurations",description:d(25262,null),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:d(25261,null),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:d(25263,null),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:d(25260,null),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:d(25286,null),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:d(25275,null),body:"onStartupFinished"},{label:"onTaskType",description:d(25276,null),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:d(25265,null),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:d(25264,null),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:d(25274,null),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:d(25282,null)},{label:"onUri",body:"onUri",description:d(25281,null)},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:d(25272,null)},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:d(25258,null)},{label:"onNotebook",body:"onNotebook:${1:type}",description:d(25271,null)},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:d(25253,null)},{label:"onRenderer",description:d(25273,null),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:d(25278,null)},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:d(25279,null)},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:d(25283,null)},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:d(25266,null)},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:d(25256,null)},{label:"onChatArtifactIntegration",body:"onChatArtifactIntegration",description:d(25254,null)},{label:"onChatContextProvider",body:"onChatContextProvider:${1:contextProviderId}",description:d(25255,null)},{label:"onLanguageModelChatProvider",body:"onLanguageModelChatProvider:${1:vendor}",description:d(25268,null)},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolId}",description:d(25269,null)},{label:"onTerminal",body:"onTerminal:{1:shellType}",description:d(25277,null)},{label:"onTerminalShellIntegration",body:"onTerminalShellIntegration:${1:shellType}",description:d(25280,null)},{label:"onMcpCollection",description:d(25270,null),body:"onMcpCollection:${2:collectionId}"},{label:"*",description:d(25285,null),body:"*"}]}},badges:{type:"array",description:d(25289,null),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:d(25292,null)},href:{type:"string",description:d(25291,null)},description:{type:"string",description:d(25290,null)}}}},markdown:{type:"string",description:d(25327,null),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:d(25331,null),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:d(25321,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:ku}},extensionAffinity:{description:d(25320,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:ku}},extensionPack:{description:d(25312,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:ku}},extensionKind:{description:d(25244,null),type:"array",items:xee,default:["workspace"],defaultSnippets:[{body:["ui"],description:d(25246,null)},{body:["workspace"],description:d(25248,null)},{body:["ui","workspace"],description:d(25247,null)},{body:["workspace","ui"],description:d(25249,null)},{body:[],description:d(25245,null)}]},capabilities:{description:d(25293,null),type:"object",properties:{virtualWorkspaces:{description:d(25303,null),type:["boolean","object"],defaultSnippets:[{label:"limited",body:{supported:"${1:limited}",description:"${2}"}},{label:"false",body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:d(25305,null),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[d(25307,null),d(25308,null),d(25306,null)]},description:{type:"string",markdownDescription:d(25304,null)}}},untrustedWorkspaces:{description:d(25296,null),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:d(25299,null),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[d(25301,null),d(25302,null),d(25300,null)]},restrictedConfigurations:{description:d(25298,null),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:d(25297,null)}}},agentsWindow:{description:d(25294,null),type:"object",required:["supported"],defaultSnippets:[{body:{supported:!0}}],properties:{supported:{markdownDescription:d(25295,null),type:"boolean"}}}}},sponsor:{description:d(25313,null),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:d(25314,null),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:d(25332,null),type:"string"},"vscode:uninstall":{description:d(25333,null),type:"string"}}},icon:{type:"string",description:d(25325,null)},l10n:{type:"string",description:d(25326,null)},pricing:{type:"string",markdownDescription:d(25329,null),enum:["Free","Trial"],default:"Free"}}},F_=class{constructor(){this._extensionPoints=new Map}registerExtensionPoint(t){if(this._extensionPoints.has(t.extensionPoint))throw new Error("Duplicate extension point: "+t.extensionPoint);let e=new U_(t.extensionPoint,t.defaultExtensionKind,t.canHandleResolver);return this._extensionPoints.set(t.extensionPoint,e),t.activationEventsGenerator&&D_.register(t.extensionPoint,t.activationEventsGenerator),N_.properties.contributes.properties[t.extensionPoint]=t.jsonSchema,H_.registerSchema(v5,N_),e}getExtensionPoints(){return Array.from(this._extensionPoints.values())}},I5={ExtensionsRegistry:"ExtensionsRegistry"};St.add(I5.ExtensionsRegistry,new F_);b5=St.as(I5.ExtensionsRegistry);H_.registerSchema(v5,N_);H_.registerSchema(BF,{properties:{extensionEnabledApiProposals:{description:d(25250,null),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(ay),markdownEnumDescriptions:Object.values(ay).map(r=>r.proposal)}}]}}}})});function ly(r,t,e,n){return fm.registerIcon(r,t,e,n)}function Pee(){let r=DF();for(let t in r){let e="\\"+r[t].toString(16);fm.registerIcon(t,{fontCharacter:e})}}var Cee,Eee,wee,Ree,Tee,W_,fm,C5,E5,x5,JXe,YXe,XXe,ZXe,eZe,w5=v(()=>{Ue();ms();NI();ra();ue();Ie();te();ee();Zv();$o();Q();Cee={IconContribution:"base.contributions.icons"};(t=>{function r(e,n){let o=e.defaults;for(;Zt.isThemeIcon(o);){let i=fm.getIcon(o.id);if(!i)return;o=i.defaults}return o}t.getDefinition=r})(Eee||={});(e=>{function r(n){return{weight:n.weight,style:n.style,src:n.src.map(o=>({format:o.format,location:o.location.toString()}))}}e.toJSONObject=r;function t(n){let o=i=>G(i)?i:void 0;if(n&&Array.isArray(n.src)&&n.src.every(i=>G(i.format)&&G(i.location)))return{weight:o(n.weight),style:o(n.style),src:n.src.map(i=>({format:i.format,location:S.parse(i.location)}))}}e.fromJSONObject=t})(wee||={});Ree=/^([\w_-]+)$/,Tee=d(4967,null),W_=class extends D{constructor(){super();this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:d(4964,null),pattern:Ree.source,patternErrorMessage:Tee},fontCharacter:{type:"string",description:d(4963,null)}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}};this.iconReferenceSchema={type:"string",pattern:`^${Zt.iconNameExpression}$`,enum:[],enumDescriptions:[]};this.iconsById={},this.iconFontsById={}}registerIcon(e,n,o,i){let s=this.iconsById[e];if(s){if(o&&!s.description){s.description=o,this.iconSchema.properties[e].markdownDescription=`${o} $(${e})`;let c=this.iconReferenceSchema.enum.indexOf(e);c!==-1&&(this.iconReferenceSchema.enumDescriptions[c]=o),this._onDidChange.fire()}return s}let a={id:e,description:o,defaults:n,deprecationMessage:i};this.iconsById[e]=a;let l={$ref:"#/definitions/icons"};return i&&(l.deprecationMessage=i),o&&(l.markdownDescription=`${o}: $(${e})`),this.iconSchema.properties[e]=l,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(o||""),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];let n=this.iconReferenceSchema.enum.indexOf(e);n!==-1&&(this.iconReferenceSchema.enum.splice(n,1),this.iconReferenceSchema.enumDescriptions.splice(n,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(e,n){let o=this.iconFontsById[e];return o||(this.iconFontsById[e]=n,this._onDidChange.fire(),n)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){let e=(s,a)=>s.id.localeCompare(a.id),n=s=>{for(;Zt.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},o=[];o.push("| preview | identifier | default codicon ID | description"),o.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");let i=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(let s of i.filter(a=>!!a.description).sort(e))o.push(`|<i class="${n(s)}"></i>|${s.id}|${Zt.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);o.push("| preview | identifier "),o.push("| ----------- | --------------------------------- |");for(let s of i.filter(a=>!Zt.isThemeIcon(a.defaults)).sort(e))o.push(`|<i class="${n(s)}"></i>|${s.id}|`);return o.join(`
`)}},fm=new W_;St.add(Cee.IconContribution,fm);Pee();C5="vscode://schemas/icons",E5=St.as(Rc.JSONContribution);E5.registerSchema(C5,fm.getIconSchema());x5=new nr(()=>E5.notifySchemaChanged(C5),200);fm.onDidChange(()=>{x5.isScheduled()||x5.schedule()});JXe=ly("widget-close",ne.close,d(4968,null)),YXe=ly("goto-previous-location",ne.arrowUp,d(4966,null)),XXe=ly("goto-next-location",ne.arrowDown,d(4965,null)),ZXe=Zt.modify(ne.sync,"spin"),eZe=Zt.modify(ne.loading,"spin")});var hm,cZe,dZe,uZe,kee,pZe,Aee,mZe,gZe,fZe,DC=v(()=>{Ie();ee();Z();ro();te();w5();ms();hm=A("IUserDataProfileService"),cZe=A("IUserDataProfileManagementService"),dZe=A("IUserDataProfileImportExportService"),uZe=ly("defaultProfile-icon",ne.settings,d(25874,null)),kee=rg(25876,"Profiles"),pZe={...kee},Aee="code-profile",mZe=[{name:d(25875,null),extensions:[Aee]}],gZe=new C("currentProfile",""),fZe=new C("hasProfiles",!1)});var R5,T5=v(()=>{Z();R5=A("ILanguageModelsConfigurationService")});function Lee(r,t){if(!(!r||r===gd))return Dee.has(r)&&t&&Mee.some(e=>un.equals(t,e))?r:_ee}function Oee(r,t){let e=n=>{if(/[%\\]/.test(n))return;let o=ge(t,n);return Bs(o,t)?o:void 0};if(G(r)){let n=Zt.fromString(r);if(n)return n;let o=e(r);return o&&{light:o,dark:o}}if(ve(r)&&G(r.light)&&G(r.dark)){let n=e(r.light),o=e(r.dark);return n&&o&&{light:n,dark:o}}}function Uee(r,t){let e=S.parse(r);return e.scheme===q.vscode&&t?e.with({scheme:t}):e}function Fee(r,t){let e=r.metadata.modelGroup?.id??r.metadata.vendor;return _5.has(e)?!1:e!==t.getVendors().find(n=>n.isDefault)?.vendor}function Hee(r,t){return!r||Fee(r,t)?"unknown":new Sr(zN(r.metadata.id)===xI?xI:r.identifier)}function V_(r,t){return r===LC?!1:t?t.vendor===gd&&t.id===D5?!1:OC.getAgentHostByokManageModelsIdentifier(t)===void 0:!0}function Wee(r,t,e){if(!r?.properties)return[];let n=[];for(let[o,i]of Object.entries(r.properties)){if(!i.enum||!Array.isArray(i.enum)||i.enum.length<1)continue;let s=t[o]??i.default,a=(typeof i.title=="string"?i.title:void 0)??o.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,m=>m.toUpperCase()),l=i.default,c=i.enumItemLabels,u=i.enumDescriptions,p=i.enum.map((m,g)=>{let y=c?.[g]??String(m),h=m===l?d(15142,null,y):y,I=u?.[g]??"";return{id:`configureModel.${o}.${m}`,label:h,class:void 0,enabled:!i.readOnly&&i.enumItemDisabled?.[g]!==!0,tooltip:I,checked:s===m,run:()=>e(o,m)}});n.push(new Fx(`configureModel.${o}`,a,p))}return n}var gd,Dee,_ee,Mee,OC,A5,P5,Nee,_C,MC,k5,LC,D5,_5,B_,q_,md,$_=v(()=>{Ue();Jt();xe();ue();Mi();ri();Q();ks();Xt();gs();Tt();ra();pD();Ie();Me();it();te();Vt();ee();a5();ro();Yn();Z();De();c5();l_();Wn();Ui();u5();f5();gi();_n();Wr();L_();S5();DC();T_();T5();gd="copilot",Dee=new Set(["openai","anthropic","gemini","ollama","openrouter","azure","xai","customoai","customendpoint"]),_ee="3p-extension",Mee=["github.copilot-chat","github.copilot"];(I=>{function r(x){return(typeof x.capabilities?.agentMode>"u"||x.capabilities.agentMode)&&!!x.capabilities?.toolCalling}I.suitableForAgentMode=r;function t(x){return`${x.name} (${x.vendor})`}I.asQualifiedName=t;function e(x,E){return E.vendor===gd&&x===E.name?!0:x===t(E)}I.matchesQualifiedName=e;function n(x){return!!x.promo&&x.promo.discountPercent>0}I.hasPromoDiscount=n;function o(x){return!!x.promo&&x.promo.discountPercent>=0&&!!x.promo.message}I.hasPromoMessage=o;function i(x){return o(x)&&x.promo.showBanner!==!1}I.hasPromoBanner=i;function s(x){if(!x)return;let E=new Date(x);if(isNaN(E.getTime()))return;let T=E.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return d(15135,null,T)}I.getPromoEndsAtLabel=s;function a(x,E){let T=x.startsAt?Date.parse(x.startsAt):-1/0,P=x.endsAt?Date.parse(x.endsAt):1/0;return E>=T&&E<P}I.isAutoTierPromotionActive=a;function l(x,E,T=Date.now()){if(typeof E!="string")return;let P;for(let M of x.autoModelTierPromotions??[])(!P||M.discountPercent>P.discountPercent)&&M.tierIds.includes(E)&&a(M,T)&&(P=M);return P}I.getAutoTierPromotion=l;function c(x,E,T=Date.now()){let P=l(x,E,T);return P&&P.discountPercent>0?P.discountPercent:x.autoModelDiscountPercent}I.getAutoTierDiscountPercent=c,I.autoModelSelectionDocsUrl="https://docs.github.com/en/copilot/concepts/models/auto-model-selection",I.fusionDocsUrl="https://aka.ms/vscode-copilot-fusion";function m(x){if(x){let P=d(15129,null,I.fusionDocsUrl);return`${g()} ${P}`}let E=d(15126,null),T=d(15130,null,I.autoModelSelectionDocsUrl);return`${E} ${T}`}I.getAutoModelDescription=m;function g(){return d(15128,null)}I.getFusionSummary=g;function y(x,E){return E?d(15131,null,E,x):d(15127,null,x)}I.getAutoModelDiscountDescription=y;function h(x){return x.byokModelIdentifier}I.getAgentHostByokManageModelsIdentifier=h})(OC||={});A5=A("ILanguageModelsService"),P5={type:"object",required:["vendor","displayName"],properties:{vendor:{type:"string",description:d(15159,null)},displayName:{type:"string",description:d(15151,null)},configuration:{type:"object",description:d(15147,null),anyOf:[{$ref:"http://json-schema.org/draft-07/schema#"},{properties:{properties:{type:"object",additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#",properties:{secret:{type:"boolean",description:d(15148,null)}}}},additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#",properties:{secret:{type:"boolean",description:d(15148,null)}}}}}]},managementCommand:{type:"string",description:d(15157,null),deprecated:!0,deprecationMessage:d(15158,null)},icon:{markdownDescription:d(15153,null),anyOf:[{type:"string"},{type:"object",properties:{light:{description:d(15155,null),type:"string"},dark:{description:d(15154,null),type:"string"}},required:["light","dark"]}]},deprecation:{type:"object",description:d(15149,null),properties:{link:{type:"string",description:d(15150,null)}}},when:{type:"string",description:d(15161,null)}}};Nee=b5.registerExtensionPoint({extensionPoint:"languageModelChatProviders",jsonSchema:{description:d(15146,null),oneOf:[P5,{type:"array",items:P5}]},activationEventsGenerator:function*(r){for(let t of r)yield`onLanguageModelChatProvider:${t.vendor}`}}),_C="chatModelPinned",MC="chatModelVisibility",k5="chatModelPreferences.agentsWindowMigrated",LC="copilot/auto",D5="auto",_5=new Set([gd,"copilotcli"]);B_="chat.participantNameRegistry",q_="chat.modelsControl";md=class{constructor(t,e,n,o,i,s,a,l,c,u,p,m,g){this._extensionService=t;this._logService=e;this._storageService=n;this._contextKeyService=o;this._languageModelsConfigurationService=i;this._quickInputService=s;this._secretStorageService=a;this._productService=l;this._requestService=c;this._notificationService=u;this._openerService=p;this._telemetryService=m;this._store=new re;this._providers=new Map;this._vendors=new Map;this._vendorWhenClauses=new Map;this._deprecationNoticeShownVendors=new Set;this._onDidChangeLanguageModelVendors=this._store.add(new R);this.onDidChangeLanguageModelVendors=this._onDidChangeLanguageModelVendors.event;this._modelsGroups=new Map;this._modelCache=new Map;this._resolveLMSequencer=new Ja;this._queuedResolutions=new Map;this._modelConfigurations=new Map;this._onLanguageModelChange=this._store.add(new R);this.onDidChangeLanguageModels=this._onLanguageModelChange.event;this._pinnedModelIds=[];this._hiddenModelIds=new Set;this._onDidChangeModelsControlManifest=this._store.add(new R);this.onDidChangeModelsControlManifest=this._onDidChangeModelsControlManifest.event;this._onDidChangePinnedModels=this._store.add(new R);this.onDidChangePinnedModels=this._onDidChangePinnedModels.event;this._onDidChangeModelVisibility=this._store.add(new R);this.onDidChangeModelVisibility=this._onDidChangeModelVisibility.event;this._modelsControlManifest={free:{},paid:{}};this._chatControlDisposed=!1;this._restrictedChatParticipants=qn(this,Object.create(null));this.restrictedChatParticipants=this._restrictedChatParticipants;this._hasUserSelectableModels=Qr.languageModelsAreUserSelectable.bindTo(o),this._hasNonCopilotUserSelectableModels=Qr.nonCopilotLanguageModelsAreUserSelectable.bindTo(o);let y=g.currentProfile;this._modelPreferencesScope=y.isAgentsWindowProfile?-1:0,y.isAgentsWindowProfile&&this._mergeAgentsWindowModelPreferences(y),this._pinnedModelIds=this._readPinnedModels(),this._hiddenModelIds=new Set(this._readHiddenModelIds()),this._listenForModelPreferenceChanges(),this._initChatControlData(),this._store.add(this.onDidChangeLanguageModels(()=>{let h=!1,I=!1;for(let x of this._modelCache.values())if(x.isUserSelectable!==!1&&(h=!0,x.vendor!==gd)){I=!0;break}this._hasUserSelectableModels.set(h),this._hasNonCopilotUserSelectableModels.set(I),this._refreshModelsControlManifest()})),this._store.add(this._languageModelsConfigurationService.onDidChangeLanguageModelGroups(h=>this._onDidChangeLanguageModelGroups(h))),this._store.add(Nee.setHandler((h,{added:I,removed:x})=>{let E=[],T=[];for(let P of I)for(let M of sn.wrap(P.value)){if(this._vendors.has(M.vendor)){P.collector.error(d(15160,null,M.vendor));continue}if(vg(M.vendor)){P.collector.error(d(15152,null));continue}if(M.vendor.trim()!==M.vendor){P.collector.error(d(15162,null));continue}let X=M.icon!==void 0?Oee(M.icon,P.description.extensionLocation):void 0;M.icon!==void 0&&!X&&P.collector.warn(d(15156,null,M.vendor)),E.push({...M,icon:X})}for(let P of x)for(let M of sn.wrap(P.value))T.push({...M,icon:void 0});this.deltaLanguageModelChatProviderDescriptors(E,T)}))}static{this.SECRET_KEY_PREFIX="chat.lm.secret."}static{this.SECRET_INPUT="${input:{0}}"}deltaLanguageModelChatProviderDescriptors(t,e){let n=[],o=[];for(let i of t){if(this._vendors.has(i.vendor)){this._logService.error(`The vendor '${i.vendor}' is already registered and cannot be registered twice`);continue}if(vg(i.vendor)){this._logService.error("The vendor field cannot be empty.");continue}if(i.vendor.trim()!==i.vendor){this._logService.error("The vendor field cannot start or end with whitespace.");continue}let s={vendor:i.vendor,displayName:i.displayName,configuration:i.configuration,managementCommand:i.managementCommand,deprecation:i.deprecation,icon:i.icon,when:i.when,isDefault:i.vendor===gd};this._vendors.set(i.vendor,s),n.push(i.vendor)}for(let i of e)this._vendors.delete(i.vendor),this._providers.delete(i.vendor),this._clearModelCache(i.vendor),this._modelsGroups.delete(i.vendor),o.push(i.vendor);for(let[i,s]of this._providers)this._vendors.has(i)||this._providers.delete(i);if((n.length>0||o.length>0)&&(this._onDidChangeLanguageModelVendors.fire([...n,...o]),o.length>0))for(let i of o)this._onLanguageModelChange.fire(i)}async _onDidChangeLanguageModelGroups(t){let e=new Set(t.map(n=>n.vendor));await Promise.all(Array.from(e).map(n=>this._resolveAllLanguageModels(n,!0)))}getVendors(){return Array.from(this._vendors.values()).filter(t=>{if(!t.when)return!0;let e=this._vendorWhenClauses.get(t.when);return this._vendorWhenClauses.has(t.when)||(e=tt.deserialize(t.when),this._vendorWhenClauses.set(t.when,e)),e?this._contextKeyService.contextMatchesRules(e):!1})}getLanguageModelIds(){return Array.from(this._modelCache.keys())}lookupLanguageModel(t){return this._modelCache.get(t)}lookupLanguageModelByQualifiedName(t){for(let[e,n]of this._modelCache.entries())if(OC.matchesQualifiedName(t,n))return{metadata:n,identifier:e}}async _resolveAllLanguageModels(t,e){let n=this._vendors.get(t);if(!n)return;let o=this._providers.get(t);if(o||(await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${t}`),o=this._providers.get(t)),!o){this._logService.warn(`[LM] No provider registered for vendor ${t}`);return}let i=this._queuedResolutions.get(t);if(i?.provider===o&&i.silent===e)return i.promise;let s=this._resolveLMSequencer.queue(t,async()=>{if(this._queuedResolutions.get(t)?.promise===s&&this._queuedResolutions.delete(t),this._providers.get(t)!==o)return;let a=[],l=[];try{let h=await o.provideLanguageModelChatInfo({silent:e},Ae.None);if(h.length){a.push(...h);let I=[];for(let x of h)n.isDefault?x.metadata.isUserSelectable!==!1?I.push(x.identifier):this._logService.trace(`[LM] Skipping model ${x.identifier} from model picker as it is not user selectable.`):I.push(x.identifier);l.push({modelIdentifiers:I})}}catch(h){l.push({modelIdentifiers:[],status:{message:ye(h),severity:Qe.Error}})}let c=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),u=new Map;for(let h of c){if(h.vendor!==t)continue;if(!n.configuration&&a.length>0){if(h.settings)for(let x of a){let E=h.settings[x.metadata.id];E&&u.set(x.identifier,{...E})}l.push({group:h,modelIdentifiers:[]});continue}let I=await this._resolveConfiguration(h,n.configuration);try{let x=await o.provideLanguageModelChatInfo({group:h.name,silent:e,configuration:I},Ae.None);if(x.length){for(let E=0;E<x.length;E++)x[E].metadata.detail||(x[E]={...x[E],metadata:{...x[E].metadata,detail:h.name}});a.push(...x),l.push({group:h,modelIdentifiers:x.map(E=>E.identifier)})}if(h.settings)for(let E of x){let T=h.settings[E.metadata.id];T&&u.set(E.identifier,{...T})}}catch(x){l.push({group:h,modelIdentifiers:[],status:{message:ye(x),severity:Qe.Error}})}}if(this._providers.get(t)!==o)return;let p=this._modelsGroups.has(t),m=this._modelsGroups.get(t)??[];this._modelsGroups.set(t,l);let g=this._clearModelCache(t),y=!p;for(let h of a){if(this._modelCache.has(h.identifier)){this._logService.warn(`[LM] Model ${h.identifier} is already registered. Skipping.`);continue}this._modelCache.set(h.identifier,h.metadata),y=y||!Ge(g.get(h.identifier),h.metadata),g.delete(h.identifier)}this._logService.trace(`[LM] Resolved language models for vendor ${t}`,a),y=y||g.size>0,y||(y=this._hasGroupStructureChanged(m,l)),this._clearModelConfigurations(t);for(let[h,I]of u)this._modelCache.has(h)&&this._modelConfigurations.set(h,I);y?this._onLanguageModelChange.fire(t):this._logService.trace(`[LM] No changes in language models for vendor ${t}`)});return this._queuedResolutions.set(t,{provider:o,silent:e,promise:s}),s}_hasGroupStructureChanged(t,e){if(t.length!==e.length)return!0;for(let n=0;n<t.length;n++){let o=t[n],i=e[n];if(o.group?.name!==i.group?.name||o.group?.vendor!==i.group?.vendor||o.status?.message!==i.status?.message||o.status?.severity!==i.status?.severity||o.modelIdentifiers.length!==i.modelIdentifiers.length)return!0}return!1}getLanguageModelGroups(t){return this._modelsGroups.get(t)??[]}hasResolvedVendor(t){return this._modelsGroups.has(t)}async selectLanguageModels(t){if(t.vendor)await this._resolveAllLanguageModels(t.vendor,!0);else{let n=Array.from(this._vendors.keys());await Promise.all(n.map(o=>this._resolveAllLanguageModels(o,!0)))}let e=[];for(let[n,o]of this._modelCache)(t.vendor===void 0||o.vendor===t.vendor)&&(t.family===void 0||o.family===t.family)&&(t.version===void 0||o.version===t.version)&&(t.id===void 0||o.id===t.id)&&e.push(n);return this._logService.trace("[LM] selected language models",t,e),e}registerLanguageModelProvider(t,e){if(this._logService.trace("[LM] registering language model provider",t,e),!this._vendors.has(t))throw new Error(`Chat model provider uses UNKNOWN vendor ${t}.`);if(this._providers.has(t))throw new Error(`Chat model provider for vendor ${t} is already registered.`);this._providers.set(t,e);let n=e.onDidChange(()=>{this._resolveAllLanguageModels(t,!0)});return se(()=>{n.dispose(),this._providers.get(t)===e&&(this._logService.trace("[LM] UNregistered language model provider",t),this._clearModelCache(t),this._modelsGroups.delete(t),this._providers.delete(t),this._onLanguageModelChange.fire(t))})}async sendChatRequest(t,e,n,o,i){let s=this._modelCache.get(t),a=this._providers.get(s?.vendor||"");if(!a)throw new Error(`Chat provider for model ${t} is not registered.`);s&&(this._logProviderUsageTelemetry(s),this._maybeShowProviderDeprecationNotice(s));let l=this.getModelConfiguration(t),c=l?{...o,configuration:{...l,...o.configuration}}:o;return a.sendChatRequest(t,n,e,c,i)}_maybeShowProviderDeprecationNotice(t){let e=this._vendors.get(t.vendor),n=e?.deprecation?.link;if(!n||this._deprecationNoticeShownVendors.has(t.vendor))return;this._deprecationNoticeShownVendors.add(t.vendor);let o=(e.displayName||t.vendor).replace(/\s*\(deprecated\)\s*$/i,"");this._notificationService.prompt(Qe.Info,d(15137,null,o),[{label:d(15136,null),run:()=>{this._openerService.open(Uee(n,this._productService.urlProtocol))}}],{neverShowAgain:{id:`chat.providerDeprecation.${t.vendor}`,scope:2}})}_logProviderUsageTelemetry(t){let e=Lee(t?.vendor,t?.extension);e&&this._telemetryService.publicLog2("chat.languageModelRequest",{provider:e,isBYOK:!!t?.isBYOK})}_resolveModelConfigurationWithDefaults(t,e){let n=this._modelConfigurations.get(t),o=e?.configurationSchema;if(!o?.properties&&!n)return;let i={};if(o?.properties)for(let[a,l]of Object.entries(o.properties))l.default!==void 0&&(i[a]=l.default);if(!n&&Object.keys(i).length===0)return;let s={...i,...n};for(let[a,l]of Object.entries(o?.properties??{}))l.readOnly&&l.default!==void 0&&(s[a]=l.default);return s}computeTokenLength(t,e,n){let o=this._modelCache.get(t);if(!o)throw new Error(`Chat model ${t} could not be found.`);let i=this._providers.get(o.vendor);if(!i)throw new Error(`Chat provider for model ${t} is not registered.`);return i.provideTokenCount(t,e,n)}getModelConfiguration(t,e=!0){if(!e){let o=this._modelConfigurations.get(t);return o?{...o}:void 0}let n=this._modelCache.get(t);return this._resolveModelConfigurationWithDefaults(t,n)}async setModelConfiguration(t,e){let n=this._modelCache.get(t);if(!n)return;let o=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),s=this._modelsGroups.get(n.vendor)?.some(p=>!p.group&&p.modelIdentifiers.includes(t))&&!this._vendors.get(n.vendor)?.configuration?o.filter(p=>p.vendor===n.vendor&&p.settings?.[n.id]!==void 0):[],a;if(a=s.at(-1)??o.find(p=>p.vendor===n.vendor&&p.settings?.[n.id]!==void 0),!a){let m=this._modelsGroups.get(n.vendor)?.find(g=>g.modelIdentifiers.includes(t)&&g.group)?.group;m&&(a=o.find(g=>g.vendor===m.vendor&&g.name===m.name)??m)}a||(a=o.find(p=>p.vendor===n.vendor));let c={...this._modelConfigurations.get(t)??{},...e},u=n.configurationSchema;for(let[p,m]of Object.entries(c)){let g=u?.properties?.[p];(m===void 0||g?.default!==void 0&&g.default===m&&!n.configurationDefaultKeys?.includes(p))&&delete c[p]}if(a)for(let p of s.length?s:[a]){let m={...p.settings};p!==a||Object.keys(c).length===0?delete m[n.id]:m[n.id]=c;let g={...p,settings:Object.keys(m).length>0?m:void 0};!g.settings&&Object.keys(g).filter(y=>y!=="name"&&y!=="vendor"&&y!=="range"&&y!=="modelsRange"&&y!=="settings").length===0?await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(p):await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(p,g)}else if(Object.keys(c).length>0){let p=this._vendors.get(n.vendor);if(!p)return;let m={name:p.displayName,vendor:n.vendor,settings:{[n.id]:c}};await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(m)}Object.keys(c).length>0?this._modelConfigurations.set(t,c):this._modelConfigurations.delete(t),this._onLanguageModelChange.fire(n.vendor)}getModelConfigurationActions(t){let e=this._modelCache.get(t),n=this._modelConfigurations.get(t)??{};return Wee(e?.configurationSchema,n,(o,i)=>this.setModelConfiguration(t,{[o]:i}))}async configureLanguageModelsProviderGroup(t,e){let n=this.getVendors().find(({vendor:l})=>l===t);if(!n)throw new Error(`Vendor ${t} not found.`);if(n.managementCommand){await this._resolveAllLanguageModels(n.vendor,!1);return}let o=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=o.find(l=>l.vendor===t&&l.name===e),s=await this.promptForName(o,n,i);if(!s)return;let a=i?await this._resolveConfiguration(i,n.configuration):void 0;try{let l=n.configuration?await this.promptForConfiguration(s,n.configuration,a):void 0;if(n.configuration&&!l)return;let c=await this._resolveLanguageModelProviderGroup(s,t,l,n.configuration),u=i?await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,c):await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(c);if(n.configuration&&this.requireConfiguring(n.configuration)){let p=this.getSnippetForFirstUnconfiguredProperty(l??{},n.configuration);await this._languageModelsConfigurationService.configureLanguageModels({group:u,snippet:p})}}catch(l){if(on(l))return;throw l}}async renameLanguageModelsProviderGroup(t,e){let n=this.getVendors().find(({vendor:a})=>a===t);if(!n)throw new Error(`Vendor ${t} not found.`);let o=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=o.find(a=>a.vendor===t&&a.name===e);if(!i)throw new Error(`Language model provider group ${e} for vendor ${t} not found.`);let s=await this.promptForName(o,n,i);!s||s===i.name||await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,{...i,name:s})}async updateLanguageModelsProviderGroupApiKey(t,e){let n=this.getVendors().find(({vendor:a})=>a===t),o=n?.configuration,i=o?.properties?.apiKey;if(!n||!o||!i)return;let s=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(a=>a.vendor===t&&a.name===e);if(!s)throw new Error(`Language model provider group ${e} for vendor ${t} not found.`);try{let a=await this._resolveConfiguration(s,o),l=await this.promptForValue(s.name,"apiKey",i,!!o.required?.includes("apiKey"),a);if(l===void 0||l===a.apiKey)return;let c={...a,apiKey:l},u={...await this._resolveLanguageModelProviderGroup(s.name,t,c,o),settings:s.settings};await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(s,u),await this._deleteSecretsInConfiguration(s,o)}catch(a){if(on(a))return;throw a}}async addLanguageModelsProviderGroupModel(t,e){let n=this.getVendors().find(({vendor:c})=>c===t),i=n?.configuration?.properties?.models;if(!n||!i)return;let s=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(c=>c.vendor===t&&c.name===e);if(!s)throw new Error(`Language model provider group ${e} for vendor ${t} not found.`);let a=Array.isArray(s.models),l=a?this.getSnippetForArrayItem(i):this.getSnippetForProperty("models",i);l&&await this._languageModelsConfigurationService.configureLanguageModels({group:s,snippet:l,snippetTarget:a?"models":"group"})}async openLanguageModelsProviderGroupSettings(t,e){let n=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(o=>o.vendor===t&&o.name===e);if(!n)throw new Error(`Language model provider group ${e} for vendor ${t} not found.`);await this._languageModelsConfigurationService.configureLanguageModels({group:n})}async configureModel(t){let e=this._modelCache.get(t);if(!e||!e.configurationSchema)return;let n=this._modelsGroups.get(e.vendor),o;if(n){for(let s of n)if(s.modelIdentifiers.includes(t)&&s.group){o=s.group;break}}if(!o){let s=this.getVendors().find(c=>c.vendor===e.vendor);if(!s)return;let l={name:s.displayName,vendor:e.vendor,settings:{[e.id]:{}}};o=await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(l),await this._resolveAllLanguageModels(e.vendor,!0)}let i=this._getModelConfigurationSnippet(e.id,e.configurationSchema);await this._languageModelsConfigurationService.configureLanguageModels({group:o,snippet:i})}_getModelConfigurationSnippet(t,e){let n=[];if(e.properties)for(let[i,s]of Object.entries(e.properties))if(s.defaultSnippets?.[0]){let a=s.defaultSnippets[0],l=a.bodyText??JSON.stringify(a.body,null," ");l=l.replace(/"(\^[^"]*)"/g,(c,u)=>u.substring(1)),n.push(` "${i}": ${l}`)}else s.default!==void 0?n.push(` "${i}": ${JSON.stringify(s.default)}`):n.push(` "${i}": \${${i}}`);let o=n.length>0?`{
${n.join(`,
`)}
}`:`{
$0
}`;return`"settings": {
"${t}": ${o}
}`}async addLanguageModelsProviderGroup(t,e,n){let o=this.getVendors().find(({vendor:s})=>s===e);if(!o)throw new Error(`Vendor ${e} not found.`);let i=await this._resolveLanguageModelProviderGroup(t,e,n,o.configuration);await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(i)}async removeLanguageModelsProviderGroup(t,e){let n=this.getVendors().find(({vendor:s})=>s===t);if(!n)throw new Error(`Vendor ${t} not found.`);let i=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(s=>s.vendor===t&&s.name===e);if(!i)throw new Error(`Language model provider group ${e} for vendor ${t} not found.`);await this._deleteSecretsInConfiguration(i,n.configuration),await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(i)}requireConfiguring(t){if(t.additionalProperties)return!0;if(!t.properties)return!1;for(let e of Object.keys(t.properties))if(!this.canPromptForProperty(t.properties[e]))return!0;return!1}getSnippetForFirstUnconfiguredProperty(t,e){if(e.properties){for(let n of Object.keys(e.properties))if(t[n]===void 0){let o=e.properties[n],i=this.getSnippetForProperty(n,o);if(i)return i}}}getSnippetForProperty(t,e){let n=this.getDefaultSnippetBodyText(e);return n?`"${t}": ${n}`:void 0}getSnippetForArrayItem(t){return this.getDefaultSnippetBodyText(t,!0)}getDefaultSnippetBodyText(t,e=!1){let n=t.defaultSnippets?.[0];if(!n)return;let o=e?Array.isArray(n.body)&&n.body.length>0?JSON.stringify(n.body[0],null," "):void 0:n.bodyText??JSON.stringify(n.body,null," ");if(o)return o.replace(/"(\^[^"]*)"/g,(i,s)=>s.substring(1))}async promptForName(t,e,n){let o=n?.name;if(!o){o=e.displayName;let a=1;for(;t.some(l=>l.vendor===e.vendor&&l.name===o);)a++,o=`${e.displayName} ${a}`}let i,s=new re;try{await new Promise(a=>{let l=s.add(this._quickInputService.createInputBox());l.title=d(15138,null),l.placeholder=d(15141,null),l.value=o,l.ignoreFocusOut=!0,s.add(l.onDidChangeValue(c=>{if(!c){l.validationMessage=d(15139,null),l.severity=Qe.Error;return}if(t.some(u=>u!==n&&u.vendor===e.vendor&&u.name===c)){l.validationMessage=d(15143,null),l.severity=Qe.Error;return}l.validationMessage=void 0,l.severity=Qe.Ignore})),s.add(l.onDidAccept(async()=>{i=l.value,l.hide()})),s.add(l.onDidHide(()=>a())),l.show()})}finally{s.dispose()}return i}async promptForConfiguration(t,e,n){if(!e.properties)return;let o=n?{...n}:{};for(let i of Object.keys(e.properties)){let s=e.properties[i],a=!!e.required?.includes(i),l=await this.promptForValue(t,i,s,a,n);l!==void 0&&(o[i]=l)}return o}async promptForValue(t,e,n,o,i){if(!n||!this.canPromptForProperty(n))return;if(n.type==="array"&&n.items&&!Array.isArray(n.items)&&n.items.enum){let a=await this.promptForArray(t,e,n);return a===void 0?void 0:a}if(n.type==="string"&&Array.isArray(n.enum)&&n.enum.length>0)return this.promptForEnum(t,e,n,i);let s=await this.promptForInput(t,e,n,o,i);if(s!==void 0)return s}canPromptForProperty(t){return!t||typeof t=="boolean"?!1:!!(t.type==="array"&&t.items&&!Array.isArray(t.items)&&t.items.enum||t.type==="string"||t.type==="number"||t.type==="integer"||t.type==="boolean")}getDescriptionPlaintext(t){if(t.description)return t.description;let e=t.markdownDescription;if(e)return e.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1")}async promptForArray(t,e,n){if(!n.items||Array.isArray(n.items)||!n.items.enum)return;let o=n.items.enum,i=new re;try{return await new Promise(s=>{let a=i.add(this._quickInputService.createQuickPick());a.title=`${t}: ${n.title??e}`,a.items=o.map(l=>({label:l})),a.placeholder=this.getDescriptionPlaintext(n)??d(15144,null,e),a.canSelectMany=!0,a.ignoreFocusOut=!0,i.add(a.onDidAccept(()=>{s(a.selectedItems.map(l=>l.label)),a.hide()})),i.add(a.onDidHide(()=>{s(void 0)})),a.show()})}finally{i.dispose()}}async promptForEnum(t,e,n,o){let i=n.enum;if(!Array.isArray(i)||i.length===0)return;let s=n.enumDescriptions,a=Array.isArray(n.enumItemLabels)?n.enumItemLabels:void 0,l=o?.[e]!==void 0?String(o[e]):n.default!==void 0?String(n.default):void 0,c=i.map((p,m)=>({label:a?.[m]??String(p),description:s?.[m],id:String(p)})),u=new re;try{return await new Promise(p=>{let m=u.add(this._quickInputService.createQuickPick());if(m.title=`${t}: ${n.title??e}`,m.items=c,m.placeholder=this.getDescriptionPlaintext(n)??d(15144,null,e),m.ignoreFocusOut=!0,l!==void 0){let g=c.find(y=>y.id===l);g&&(m.activeItems=[g])}u.add(m.onDidAccept(()=>{let g=m.selectedItems[0];p(g?.id),m.hide()})),u.add(m.onDidHide(()=>{p(void 0)})),m.show()})}finally{u.dispose()}}async promptForInput(t,e,n,o,i){let s=new re;try{let a=c=>{if(!c&&o)return d(15145,null)},l=await new Promise((c,u)=>{let p=s.add(this._quickInputService.createInputBox());p.title=`${t}: ${n.title??e}`,p.placeholder=d(15140,null,e),p.password=!!n.secret,p.ignoreFocusOut=!0,i?.[e]?p.value=String(i?.[e]):n.default&&(p.value=String(n.default));let m=this.getDescriptionPlaintext(n);m&&(p.prompt=m),s.add(p.onDidChangeValue(g=>{let y=a(g);y?(p.validationMessage=y,p.severity=Qe.Error):(p.validationMessage=void 0,p.severity=Qe.Ignore)})),s.add(p.onDidAccept(()=>{let g=a(p.value);if(g){p.validationMessage=g,p.severity=Qe.Error;return}c(p.value),p.hide()})),s.add(p.onDidHide(g=>{g.reason===2?u(new He):c(void 0)})),p.show()});return l?n.type==="number"||n.type==="integer"?Number(l):n.type==="boolean"?l==="true":l:void 0}finally{s.dispose()}}encodeSecretKey(t){return TO(md.SECRET_INPUT,t)}decodeSecretKey(t){if(G(t))return t.substring(t.indexOf(":")+1,t.length-1)}_clearModelCache(t){let e=new Map;for(let[n,o]of this._modelCache.entries())o.vendor===t&&(e.set(n,o),this._modelCache.delete(n));return e}_clearModelConfigurations(t){for(let[e]of this._modelConfigurations)(this._modelCache.get(e)?.vendor===t||e.startsWith(`${t}/`))&&this._modelConfigurations.delete(e)}async _resolveConfiguration(t,e){if(!e)return{};let n={};for(let o in t){if(o==="vendor"||o==="name"||o==="range"||o==="modelsRange"||o==="settings")continue;let i=t[o];if(e.properties?.[o]?.secret){let s=this.decodeSecretKey(i);i=s?await this._secretStorageService.get(s):void 0}n[o]=i}return n}async _resolveLanguageModelProviderGroup(t,e,n,o){if(!o)return{name:t,vendor:e};let i={};for(let s in n){let a=n[s];if(o.properties?.[s]?.secret&&G(a)){let l=`${md.SECRET_KEY_PREFIX}${Fr(Ee()).toString(16)}`;await this._secretStorageService.set(l,s==="apiKey"?a.trim():a),a=this.encodeSecretKey(l)}i[s]=a}return{name:t,vendor:e,...i}}async _deleteSecretsInConfiguration(t,e){if(!e)return;let{vendor:n,name:o,range:i,modelsRange:s,...a}=t;for(let l in a){let c=t[l];if(e.properties?.[l]?.secret){let u=this.decodeSecretKey(c);u&&await this._secretStorageService.delete(u)}}}async migrateLanguageModelsProviderGroup(t){let{vendor:e,name:n,...o}=t;if(!this._vendors.get(e))throw new Error(`Vendor ${e} not found.`);await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${e}`);let i=this._providers.get(e);if(!i)throw new Error(`Chat model provider for vendor ${e} is not registered.`);await i.provideLanguageModelChatInfo({group:n,silent:!1,configuration:o},Ae.None),await this.addLanguageModelsProviderGroup(n,e,o)}_listenForModelPreferenceChanges(){let t=this._modelPreferencesScope;this._store.add(this._storageService.onDidChangeValue(t,_C,this._store)(()=>{let e=this._readPinnedModels();Ge(e,this._pinnedModelIds)||(this._pinnedModelIds=e,this._onDidChangePinnedModels.fire())})),this._store.add(this._storageService.onDidChangeValue(t,MC,this._store)(()=>{let e=this._readHiddenModelIds();Ge(e,Array.from(this._hiddenModelIds))||(this._hiddenModelIds=new Set(e),this._onDidChangeModelVisibility.fire())}))}_mergeAgentsWindowModelPreferences(t){if(Uu(t)||this._storageService.getBoolean(k5,-1,!1))return;let e=(n,o,i)=>{let s=o(0);if(s.length===0)return;let a=o(-1),l=[...a,...s.filter(c=>!a.includes(c))];this._storageService.store(n,i(l),-1,0)};e(_C,n=>this._readPinnedModels(n),n=>n),e(MC,n=>this._readHiddenModelIds(n),n=>({hiddenModels:n})),this._storageService.store(k5,!0,-1,1)}_readModelIds(t,e){let n=this._storageService.getObject(t,e,[]);return Array.isArray(n)?n.filter(G):[]}_readPinnedModels(t=this._modelPreferencesScope){return this._readModelIds(_C,t)}_savePinnedModels(){this._storageService.store(_C,this._pinnedModelIds,this._modelPreferencesScope,0)}_getPinIdentity(t){let e=this._modelCache.get(t);if(!e)return t;let n=OC.getAgentHostByokManageModelsIdentifier(e);if(n!==void 0)return n;if(!_5.has(e.modelGroup?.id??e.vendor))return t;let o=s5(e.id)?.modelId??e.id;return o===D5?t:`${gd}/${o}`}getPinnedModelIds(){let t=new Map;for(let e of this._modelCache.keys())if(e!==LC){let n=this._getPinIdentity(e);t.set(n,[...t.get(n)??[],e])}return[...new Set(this._pinnedModelIds.flatMap(e=>t.get(this._getPinIdentity(e))??[]))]}pinModel(t,e){t===LC||this.isModelPinned(t)||(this._pinnedModelIds.push(this._getPinIdentity(t)),this._savePinnedModels(),this._logPinChange(t,!0,e),this._onDidChangePinnedModels.fire())}unpinModel(t,e){let n=this._getPinIdentity(t),o=this._pinnedModelIds.filter(i=>this._getPinIdentity(i)!==n);o.length!==this._pinnedModelIds.length&&(this._pinnedModelIds=o,this._savePinnedModels(),this._logPinChange(t,!1,e),this._onDidChangePinnedModels.fire())}_logPinChange(t,e,n){let o=this.lookupLanguageModel(t);this._telemetryService.publicLog2("chat.modelPinChange",{model:Hee(o&&{identifier:t,metadata:o},this),pinned:e,pickerSessionId:n?.pickerSessionId})}isModelPinned(t){if(t===LC)return!1;let e=this._getPinIdentity(t);return this._pinnedModelIds.some(n=>this._getPinIdentity(n)===e)}_getGroupNameForVendor(t){return this._vendors.get(t)?.displayName??t}_getModelIdsInGroup(t,e){let n=this._modelsGroups.get(t);if(!n)return[];let o=[],i=this._getGroupNameForVendor(t);for(let s of n)if((s.group?.name??i)===e)for(let l of s.modelIdentifiers)V_(l,this._modelCache.get(l))&&o.push(l);return o}_readHiddenModelIds(t=this._modelPreferencesScope){let e=this._storageService.getObject(MC,t,{});return Array.isArray(e?.hiddenModels)?e.hiddenModels.filter(G):[]}_saveVisibility(){this._storageService.store(MC,{hiddenModels:Array.from(this._hiddenModelIds)},this._modelPreferencesScope,0)}isGroupHidden(t,e){let n=this._getModelIdsInGroup(t,e);return n.length>0&&n.every(o=>this._hiddenModelIds.has(o))}isModelHidden(t){return this._hiddenModelIds.has(t)?V_(t,this._modelCache.get(t)):!1}setGroupHidden(t,e,n){this.setModelsHidden(this._getModelIdsInGroup(t,e),n)}setModelHidden(t,e){this.setModelsHidden([t],e)}setModelsHidden(t,e){let n=!1;for(let o of t)if(e){if(!V_(o,this._modelCache.get(o)))continue;this._hiddenModelIds.has(o)||(this._hiddenModelIds.add(o),n=!0)}else this._hiddenModelIds.delete(o)&&(n=!0);n&&(this._saveVisibility(),this._onDidChangeModelVisibility.fire())}getHiddenModelIds(){return Array.from(this._hiddenModelIds)}getModelsControlManifest(){return this._modelsControlManifest}_setModelsControlManifest(t){this._modelsControlRawResponse=t,this._refreshModelsControlManifest()}_refreshModelsControlManifest(){let t=this._modelsControlRawResponse,e={},n={};if(t?.free){let o=Array.isArray(t.free)?t.free:Object.values(t.free);for(let i of o)!i||!ve(i)||(e[i.id]={label:i.label,featured:i.featured,demoted:i.demoted,exists:this._modelCache.has(`copilot/${i.id}`)})}if(t?.paid){let o=Array.isArray(t.paid)?t.paid:Object.values(t.paid);for(let i of o)!i||!ve(i)||(n[i.id]={label:i.label,featured:i.featured,demoted:i.demoted,minVSCodeVersion:i.minVSCodeVersion,exists:this._modelCache.has(`copilot/${i.id}`)})}this._modelsControlManifest={free:e,paid:n},this._onDidChangeModelsControlManifest.fire(this._modelsControlManifest)}_initChatControlData(){if(this._chatControlUrl=this._productService.chatParticipantRegistry,!this._chatControlUrl)return;let t=this._storageService.get(B_,-1);try{this._restrictedChatParticipants.set(JSON.parse(t??"{}"),void 0)}catch{this._storageService.remove(B_,-1)}let e=this._storageService.get(q_,-1);try{let n=JSON.parse(e??"{}");ve(n)&&this._setModelsControlManifest(n)}catch{this._storageService.remove(q_,-1)}this._refreshChatControlData()}_refreshChatControlData(){this._chatControlDisposed||this._fetchChatControlData().catch(t=>this._logService.warn("Failed to fetch chat control data",t)).then(()=>ko(300*1e3)).then(()=>this._refreshChatControlData())}async _fetchChatControlData(){this._logService.trace("[LM] Fetching chat control data from",this._chatControlUrl);let t;try{t=await this._requestService.request({type:"GET",url:this._chatControlUrl,callSite:"languageModels.fetchChatControlData"},Ae.None)}catch(o){this._logService.warn("[LM] Failed to request chat control data",ye(o));return}if(t.res.statusCode!==200){this._logService.warn(`[LM] Chat control data request failed with status ${t.res.statusCode}`);return}let e;try{e=await us(t)}catch(o){this._logService.warn("[LM] Failed to parse chat control response",ye(o));return}if(this._logService.trace("[LM] Received chat control response",e?Object.keys(e):"null"),!e||e.version!==1){this._logService.warn("[LM] Unexpected chat control response version",e?.version);return}let n=e.restrictedChatParticipants;this._restrictedChatParticipants.set(n,void 0),this._storageService.store(B_,JSON.stringify(n),-1,1),e.models&&(this._logService.trace("[LM] Updating models control manifest",{freeCount:Object.keys(e.models.free??{}).length,paidCount:Object.keys(e.models.paid??{}).length}),this._setModelsControlManifest(e.models),this._storageService.store(q_,JSON.stringify(e.models),-1,1))}dispose(){this._chatControlDisposed=!0,this._store.dispose(),this._providers.clear()}};md=w([b(0,h5),b(1,z),b(2,mi),b(3,ss),b(4,R5),b(5,d5),b(6,g5),b(7,Be),b(8,ao),b(9,l5),b(10,dC),b(11,Mt),b(12,hm)],md)});function dy(r,t){let e=zx(r),n=`${Bee}${e}/${t}`,o=M5.get(e);o||(o=new Set,M5.set(e,o)),o.add(n),qt(n)}var Bee,M5,cy,z_=v(()=>{Xr();Bh();Bee="code/chat/",M5=new Map,cy={RequestStart:"request/start",RequestUiUpdated:"request/uiUpdated",WillCollectInstructions:"request/willCollectInstructions",DidCollectInstructions:"request/didCollectInstructions",FirstToken:"request/firstToken",RequestComplete:"request/complete",AgentWillInvoke:"agent/willInvoke",AgentDidInvoke:"agent/didInvoke"}});function G_(r){return`${r.extensionId.value}.${r.id}`}function qee(r){return r.name!==void 0}function FC(r){let t=qee(r)?r:{...r,name:r.id};return t.extensionPublisherId||(t.extensionPublisherId=r.extensionPublisher??""),t.extensionDisplayName||(t.extensionDisplayName=""),t.extensionId||(t.extensionId=new un("")),en(t)}var L5,UC,ym,O5,NC,HC=v(()=>{$w();ue();ri();Q();fs();Tt();dn();ro();Yn();Z();T_();iy();$_();z_();L5=A("chatAgentService"),UC=class extends D{constructor(e,n){super();this.contextKeyService=e;this.configurationService=n;this._agents=new Map;this._onDidChangeAgents=this._register(new R);this.onDidChangeAgents=this._onDidChangeAgents.event;this._onWillInvokeAgent=this._register(new R);this.onWillInvokeAgent=this._onWillInvokeAgent.event;this._agentsContextKeys=new Set;this._hasToolsAgent=!1;this._chatParticipantDetectionProviders=new Map;this._agentCompletionProviders=new Map;this._hasDefaultAgent=Qr.enabled.bindTo(this.contextKeyService),this._extensionAgentRegistered=Qr.extensionParticipantRegistered.bindTo(this.contextKeyService),this._defaultAgentRegistered=Qr.panelParticipantRegistered.bindTo(this.contextKeyService),this._register(e.onDidChangeContext(o=>{o.affectsSome(this._agentsContextKeys)&&this._updateContextKeys()}))}static{this.AGENT_LEADER="@"}registerAgent(e,n){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);let i=this,s=n.slashCommands;n={...n,get slashCommands(){return s.filter(l=>!l.when||i.contextKeyService.contextMatchesRules(tt.deserialize(l.when)))}};let a={data:n};return this._agents.set(e,a),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0),se(()=>{this._agents.delete(e),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0)})}_updateAgentsContextKeys(){this._agentsContextKeys.clear();for(let e of this._agents.values())if(e.data.when){let n=tt.deserialize(e.data.when);for(let o of n?.keys()||[])this._agentsContextKeys.add(o)}}_updateContextKeys(){let e=!1,n=!1,o=!1;for(let i of this.getAgents())i.isDefault&&(i.isCore||(e=!0),i.id==="chat.setup"||i.id==="github.copilot.editsAgent"?o=!0:n=!0);this._defaultAgentRegistered.set(n),this._extensionAgentRegistered.set(e),o!==this._hasToolsAgent&&(this._hasToolsAgent=o,this._onDidChangeAgents.fire(this.getDefaultAgent("panel","agent")))}registerAgentImplementation(e,n){let o=this._agents.get(e);if(!o)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(o.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return o.data.isDefault&&this._hasDefaultAgent.set(!0),o.impl=n,this._onDidChangeAgents.fire(new ym(o.data,n)),se(()=>{o.impl=void 0,this._onDidChangeAgents.fire(void 0),o.data.isDefault&&this._hasDefaultAgent.set(sn.some(this._agents.values(),i=>i.data.isDefault&&!!i.impl))})}registerDynamicAgent(e,n){e.isDynamic=!0;let o={data:e,impl:n};return this._agents.set(e.id,o),this._onDidChangeAgents.fire(new ym(e,n)),se(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,n){return this._agentCompletionProviders.set(e,n),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,n,o){return await this._agentCompletionProviders.get(e)?.(n,o)??[]}updateAgent(e,n){let o=this._agents.get(e);if(!o?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);o.data.metadata={...o.data.metadata,...n},this._onDidChangeAgents.fire(new ym(o.data,o.impl))}getDefaultAgent(e,n="ask"){return this._preferExtensionAgent(this.getActivatedAgents().filter(o=>n&&!o.modes.includes(n)?!1:!!o.isDefault&&o.locations.includes(e)))}get hasToolsAgent(){return!!this.configurationService.getValue("chat.agent.enabled")}getContributedDefaultAgent(e){return this._preferExtensionAgent(this.getAgents().filter(n=>!!n.isDefault&&n.locations.includes(e)))}_preferExtensionAgent(e){return j0(e,n=>!n.isCore)??e.at(-1)}getAgent(e,n=!1){if(!(!this._agentIsEnabled(e)&&!n))return this._agents.get(e)?.data}_agentIsEnabled(e){let n=typeof e=="string"?this._agents.get(e):e;return!n?.data.when||this.contextKeyService.contextMatchesRules(tt.deserialize(n.data.when))}getAgentByFullyQualifiedId(e){let n=sn.find(this._agents.values(),o=>G_(o.data)===e)?.data;if(!(n&&!this._agentIsEnabled(n.id)))return n}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new ym(e.data,e.impl))}getAgentsByName(e){return this._preferExtensionAgents(this.getAgents().filter(n=>n.name===e))}_preferExtensionAgents(e){let n=e.filter(o=>!o.isCore);return n.length>0?n:e}agentHasDupeName(e){let n=this.getAgent(e);return n?this.getAgentsByName(n.name).filter(o=>o.extensionId.value!==n.extensionId.value).length>0:!1}async invokeAgent(e,n,o,i,s){dy(n.sessionResource,cy.AgentWillInvoke);let a=this._agents.get(e);if(!a?.impl)throw new Error(`No activated agent with id "${e}"`);this._onWillInvokeAgent.fire({agentId:e,request:n});let l=await a.impl.invoke(n,o,i,s);return dy(n.sessionResource,cy.AgentDidInvoke),l}setRequestTools(e,n,o){let i=this._agents.get(e);i?.impl&&i.impl.setRequestTools?.(n,o)}setYieldRequested(e,n,o){let i=this._agents.get(e);i?.impl&&i.impl.setYieldRequested?.(n,o)}async getFollowups(e,n,o,i,s){let a=this._agents.get(e);return a?.impl?.provideFollowups?a.impl.provideFollowups(n,o,i,s):[]}async getChatTitle(e,n,o){let i=this._agents.get(e);if(i?.impl?.provideChatTitle)return i.impl.provideChatTitle(n,o)}async getChatSummary(e,n,o){let i=this._agents.get(e);if(i?.impl?.provideChatSummary)return i.impl.provideChatSummary(n,o)}registerChatParticipantDetectionProvider(e,n){return this._chatParticipantDetectionProviders.set(e,n),se(()=>{this._chatParticipantDetectionProviders.delete(e)})}hasChatParticipantDetectionProviders(){return this._chatParticipantDetectionProviders.size>0}async detectAgentOrCommand(e,n,o,i){let s=sn.first(this._chatParticipantDetectionProviders.values());if(!s)return;let a=this.getAgents().reduce((p,m)=>{if(m.locations.includes(o.location)){p.push({participant:m.id,disambiguation:m.disambiguation??[]});for(let g of m.slashCommands)p.push({participant:m.id,command:g.name,disambiguation:g.disambiguation??[]})}return p},[]),l=await s.provideParticipantDetection(e,n,{...o,participants:a},i);if(!l)return;let c=this.getAgent(l.participant);if(!c)return;if(!l.command)return{agent:c};let u=c?.slashCommands.find(p=>p.name===l.command);if(u)return{agent:c,command:u}}};UC=w([b(0,ss),b(1,bt)],UC);ym=class{constructor(t,e){this.data=t;this.impl=e}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionVersion(){return this.data.extensionVersion}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get isCore(){return this.data.isCore}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get locations(){return this.data.locations}get modes(){return this.data.modes}get disambiguation(){return this.data.disambiguation}async invoke(t,e,n,o){return this.impl.invoke(t,e,n,o)}setRequestTools(t,e){this.impl.setRequestTools?.(t,e)}setYieldRequested(t,e){this.impl.setYieldRequested?.(t,e)}async provideFollowups(t,e,n,o){return this.impl.provideFollowups?this.impl.provideFollowups(t,e,n,o):[]}toJSON(){return this.data}},O5=A("chatAgentNameService"),NC=class{constructor(t){this.languageModelsService=t}getAgentNameRestriction(t){if(t.isCore)return!0;let e=this.checkAgentNameRestriction(t.name,t).get(),n=!t.fullName||this.checkAgentNameRestriction(t.fullName.replace(/\s/g,""),t).get();return e&&n}checkAgentNameRestriction(t,e){return this.languageModelsService.restrictedChatParticipants.map(o=>o[t.toLowerCase()]).map(o=>o?o.some(i=>Po(i,i.includes(".")?e.extensionId.value:e.extensionPublisherId)):!0)}};NC=w([b(0,A5)],NC)});var $ee,zee,Gee,Kee,K_,jee,vm,U5=v(()=>{De();$ee=250,zee=500,Gee=250,Kee=1e3,K_=10,jee=2,vm=class{constructor(t){this.logService=t;let e=Date.now();this._data={totalTime:0,lastUpdateTime:e,impliedWordLoadRate:0,lastWordCount:0,firstMarkdownTime:void 0,bootstrapActive:!0,wordCountAtBootstrapExit:void 0,updatesWithNewWords:0},this._publicData={impliedWordLoadRate:0,lastWordCount:0}}get data(){return this._publicData}get internalData(){return this._data}update(t){let{totalWordCount:e}=t;if(e===this._data.lastWordCount){this.trace("Update- no new words");return}let n=Date.now(),o=e-this._data.lastWordCount,i=this._data.lastWordCount===0,s=this._data.firstMarkdownTime,a=this._data.wordCountAtBootstrapExit;typeof s!="number"&&e>0&&(s=n);let l=this._data.updatesWithNewWords+1;i&&(this._data.lastUpdateTime=n);let c=o>K_?Kee:Gee,u=Math.min(n-this._data.lastUpdateTime,c),p=this._data.totalTime+u,m=i&&e>K_?zee:$ee,g=this._data.bootstrapActive;if(g){let T=s;typeof T=="number"&&l>=jee&&e>=K_?(g=!1,p=Math.max(n-T,u),a=this._data.lastWordCount,this.trace("Has stable data")):p=Math.max(p,m)}let y=typeof a=="number"?Math.max(e-a,0):e,h=p,I=g?e:y,x=h>0?I/(h/1e3):0;this._data={totalTime:p,lastUpdateTime:n,impliedWordLoadRate:x,lastWordCount:e,firstMarkdownTime:s,bootstrapActive:g,wordCountAtBootstrapExit:a,updatesWithNewWords:l},this._publicData={impliedWordLoadRate:x,lastWordCount:e};let E=g?e:y;return this.trace(`Update- got ${E} words over last ${p}ms = ${x} words/s`),this._data}trace(t){this.logService.trace(`ChatStreamStatsTracker#update: ${t}`)}};vm=w([b(0,z)],vm)});var j_,Qee,Jee,Yee,Xee,N5=v(()=>{Tt();j_=/(?<![a-zA-Z0-9])(?<dollars>\${1,2})(?!\.|\(["'])((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\k<dollars>(?![a-zA-Z0-9])/,Qee="vscode-katex-container",Jee="data-latex",Yee=new RegExp("^"+j_.source);(i=>{let r=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function t(s,a={}){return{extensions:[n(a,e(s,a,!1)),o(a,e(s,a,!0))]}}i.extension=t;function e(s,a,l){return c=>{let u;try{let p=s.renderToString(c.text,{...a,throwOnError:!0,displayMode:c.displayMode});u=`<span class="${Qee}" ${Jee}="${wv(c.text).replaceAll("$","$")}">${p}</span>`}catch{u=PO(c.raw)}return u+(l?`
`:"")}}function n(s,a){let l=Yee;return{name:"inlineKatex",level:"inline",start(c){let u,p=c;for(;p;){if(u=p.indexOf("$"),u===-1)return;if(p.substring(u).match(l))return u;p=p.substring(u+1).replace(/^\$+/,"")}},tokenizer(c,u){let p=c.match(l);if(p)return{type:"inlineKatex",raw:p[0],text:p[2].trim(),displayMode:p[1].length===2}},renderer:a}}function o(s,a){return{name:"blockKatex",level:"block",start(l){return l.match(new RegExp(r.source,"m"))?.index},tokenizer(l,c){let u=l.match(r);if(u)return{type:"blockKatex",raw:u[0],text:u[2].trim(),displayMode:u[1].length===2}},renderer:a}}})(Xee||={})});function tte(r,t){let n=new RegExp("(?:"+ete+")|(?:"+j_.source+Jo`)|\p{sc=Han}|=+|\++|-+|[^\s\|\p{sc=Han}|=|\+|\-|${"`"}]+`,"gu"),o=Array.from(r.matchAll(n)),i=o.slice(0,t),s=t>=o.length?r.length:i.length?i.at(-1).index+i.at(-1)[0].length:0,a=r.substring(0,s);return{value:a,returnedWordCount:i.length===0?a.length?1:0:i.length,isFullString:s>=r.length,totalWordCount:o.length}}function F5(r){return tte(r,Number.MAX_SAFE_INTEGER).returnedWordCount}var Jo,ete,H5=v(()=>{N5();Jo=String.raw,ete=Jo`(?<!\\)`+Jo`(!?\[`+Jo`(?:`+Jo`[^\[\]\\]|`+Jo`\\.|`+Jo`\[[^\[\]]*\]`+Jo`)*`+Jo`\])`+Jo`(\(\s*)`+Jo`(`+Jo`[^\s\(\)<](?:[^\s\(\)]|\([^\s\(\)]*?\))*|`+Jo`<(?:\\[<>]|[^<>])+>`+Jo`)`+Jo`\s*(?:"[^"]*"|'[^']*'|\([^\(\)]*\))?\s*`+Jo`\)`});function BC(r){return!!r&&typeof r=="object"&&"message"in r}function WC(r){return!!r&&typeof r.setVote<"u"}var VC,fd,uy,W5=v(()=>{ms();ue();Q();xe();Ue();ks();Z();dm();HC();U5();H5();VC=class extends D{constructor(e,n,o){super();this._model=e;this._options=n;this.instantiationService=o;this._onDidDisposeModel=this._register(new R);this.onDidDisposeModel=this._onDidDisposeModel.event;this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this._onDidChangeEditing=this._register(new R);this.onDidChangeEditing=this._onDidChangeEditing.event;this._items=[];this._responseDisposables=this._register(new Wo);this._inputPlaceholder=void 0;this._editing=void 0;this._register(this._onDidChange.event(()=>this._visibleItemsCache=void 0)),e.getRequests().forEach((s,a)=>{let l=this.instantiationService.createInstance(fd,s);this._items.push(l),s.response&&this.onAddResponse(s.response)});let i=!1;this._register(e.onDidDispose(()=>{i=!0,this._onDidDisposeModel.fire()})),this._register(e.onDidChangePendingRequests(()=>this._onDidChange.fire(null))),this._register(Qo(s=>{e.pendingRequestHandoffs.read(s),i||this._onDidChange.fire(null)})),this._register(e.onDidChange(s=>{if(s.kind==="addRequest"){s.replacedRequest&&this.removeRequest(s.replacedRequest.id,s.replacedRequest.response?.id);let l=s.index===void 0?void 0:e.getRequests()[s.index+1],c=l?this._items.findIndex(p=>BC(p)&&p.id===l.id):this._items.length;if(c<0)throw new Et("Chat request insertion anchor is missing from the view");let u=this.instantiationService.createInstance(fd,s.request);this._visibleItemsCache=void 0,this._items.splice(c,0,u),s.request.response&&this.onAddResponse(s.request.response,c+1)}else s.kind==="addResponse"?this.onAddResponse(s.response):s.kind==="removeRequest"&&this.removeRequest(s.requestId,s.responseId);let a=s.kind==="addRequest"?{kind:"addRequest"}:s.kind==="initialize"?{kind:"initialize"}:s.kind==="setHidden"?{kind:"setHidden"}:null;this._onDidChange.fire(a)}))}get inputPlaceholder(){return this._inputPlaceholder}get model(){return this._model}setInputPlaceholder(e){this._inputPlaceholder=e,this._onDidChange.fire({kind:"changePlaceholder"})}resetInputPlaceholder(){this._inputPlaceholder=void 0,this._onDidChange.fire({kind:"changePlaceholder"})}get sessionResource(){return this._model.sessionResource}removeRequest(e,n){this._visibleItemsCache=void 0;let o=this._items.findIndex(i=>BC(i)&&i.id===e);if(o>=0&&this._items.splice(o,1),n!==void 0){let i=this._items.findIndex(s=>WC(s)&&s.id===n);i>=0&&(this._items.splice(i,1),this._responseDisposables.deleteAndDispose(n))}}onAddResponse(e,n=this._items.length){let o=new re;this._responseDisposables.set(e.id,o);let i=o.add(this.instantiationService.createInstance(uy,e,this));o.add(i.onDidChange(()=>this._onDidChange.fire({kind:"changeResponse",response:i}))),this._visibleItemsCache=void 0,this._items.splice(n,0,i)}getItems(){return this._visibleItemsCache??=this.computeItems()}computeItems(){let e=this._items.filter((i,s)=>!(i.isHiddenFromTranscript||BC(i)&&i.isRequestHiddenFromTranscript||i.shouldBeRemovedOnSend&&!i.shouldBeRemovedOnSend.afterUndoStop||WC(i)&&s<this._items.length-1&&i.isComplete&&!i.isCanceled&&!i.errorDetails&&i.response.value.length===0&&i.contentReferences.length===0&&i.codeCitations.length===0&&!i.replyFollowups?.length&&!i.result?.details));if(this._options?.latestRequestOnly){let i=e.at(-1),s=i&&(WC(i)?i.requestId:i.id);e=e.filter(a=>(WC(a)?a.requestId:a.id)===s)}this._options?.maxVisibleItems!==void 0&&e.length>this._options.maxVisibleItems&&(e=e.slice(-this._options.maxVisibleItems));let n=this._model.getPendingRequests().filter(i=>!i.request.isRequestHiddenFromTranscript),o=this._model.pendingRequestHandoffs.get().filter(i=>!i.isHiddenFromTranscript&&!i.isRequestHiddenFromTranscript&&!n.some(s=>s.request.id===i.id));if(n.length>0||o.length>0){let i=n.filter(a=>a.kind==="steering"),s=n.filter(a=>a.kind==="queued");if(i.length>0||o.length>0){let a=i.every(l=>l.request.isSystemInitiated)&&o.every(l=>l.isSystemInitiated);e.push({kind:"pendingDivider",id:"pending-divider-steering",sessionResource:this._model.sessionResource,isComplete:!0,dividerKind:"steering",isSystemInitiated:a,currentRenderedHeight:void 0});for(let l of o)e.push(this.instantiationService.createInstance(fd,l,"steering",!0));for(let l of i){let c=this.instantiationService.createInstance(fd,l.request,l.kind);e.push(c)}}if(s.length>0){e.push({kind:"pendingDivider",id:"pending-divider-queued",sessionResource:this._model.sessionResource,isComplete:!0,dividerKind:"queued",currentRenderedHeight:void 0});for(let a of s){let l=this.instantiationService.createInstance(fd,a.request,a.kind);e.push(l)}}}return e}get editing(){return this._editing}setEditing(e){e?.isPendingRequestHandoff||this._editing?.id===e?.id||(this._editing=e,this._onDidChangeEditing.fire())}dispose(){super.dispose(),this._visibleItemsCache=void 0,this._items.length=0}};VC=w([b(2,Hn)],VC);fd=class{constructor(t,e,n=!1){this._model=t;this._pendingKind=e;this.isPendingRequestHandoff=n}get id(){return this._model.id}get dataId(){return`${this.id}_${this._model.response?.id}_${this._model.version+(this._model.response?.isComplete?1:0)}${this.isPendingRequestHandoff?"_handoff":""}`}get sessionResource(){return this._model.session.sessionResource}get username(){return"User"}get avatarIcon(){return ne.account}get message(){return this._model.message}get messageText(){return this.message.text}get attempt(){return this._model.attempt}get variables(){return this._model.variableData.variables}get contentReferences(){return this._model.response?.contentReferences}get confirmation(){return this._model.confirmation}get isComplete(){return this._model.response?.isComplete??!1}get isCompleteAddedRequest(){return this._model.isCompleteAddedRequest}get isTerminalCommand(){return this._model.isTerminalCommand}get shouldBeRemovedOnSend(){return this._model.shouldBeRemovedOnSend}get isHiddenFromTranscript(){return this._model.isHiddenFromTranscript}get isRequestHiddenFromTranscript(){return this._model.isRequestHiddenFromTranscript}get shouldBeBlocked(){return this._model.shouldBeBlocked}get slashCommand(){return this._model.response?.slashCommand}get agentOrSlashCommandDetected(){return this._model.response?.agentOrSlashCommandDetected??!1}get attachedContext(){return this._model.attachedContext}get modelId(){return this._model.modelId}get modelConfiguration(){return this._model.modelConfiguration}get resolvedModelId(){let t=this._model.response?.result?.metadata?.resolvedModel;return typeof t=="string"?t:void 0}get timestamp(){return this._model.timestamp}get requestTimestamp(){return this._model.requestTimestamp}get origin(){return this._model.origin}get pendingKind(){return this._pendingKind}get isSystemInitiated(){return this._model.isSystemInitiated}get requestSource(){return this._model.requestSource}get artifactRequest(){return this._model.artifactRequest}get systemInitiatedLabel(){return this._model.systemInitiatedLabel}},uy=class extends D{constructor(e,n,o,i){super();this._model=e;this.session=n;this.instantiationService=o;this.chatAgentNameService=i;this._modelChangeCount=0;this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this.renderData=void 0;this._vulnerabilitiesListExpanded=!1;e.isComplete||(this.liveUpdateTracker=this.instantiationService.createInstance(vm));let s=this.liveUpdateTracker?this._register(new nr(()=>{let a=F5(e.entireResponse.getMarkdown());this.liveUpdateTracker.update({totalWordCount:a})},0)):void 0;this._register(e.onDidChange(()=>{s?.schedule(),this._modelChangeCount++,this._onDidChange.fire()}))}get model(){return this._model}get id(){return this._model.id}get dataId(){return this._model.id+`_${this._modelChangeCount}`}get sessionResource(){return this._model.session.sessionResource}get username(){return this.agent?this.chatAgentNameService.getAgentNameRestriction(this.agent)?this.agent.fullName||this.agent.name:G_(this.agent):this._model.username}get agent(){return this._model.agent}get slashCommand(){return this._model.slashCommand}get agentOrSlashCommandDetected(){return this._model.agentOrSlashCommandDetected}get response(){return this._model.response}get usedContext(){return this._model.usedContext}get contentReferences(){return this._model.contentReferences}get codeCitations(){return this._model.codeCitations}get progressMessages(){return this._model.progressMessages}get isComplete(){return this._model.isComplete}get isCanceled(){return this._model.isCanceled}get shouldBeBlocked(){return this._model.shouldBeBlocked}get shouldBeRemovedOnSend(){return this._model.shouldBeRemovedOnSend}get isHiddenFromTranscript(){return this._model.isHiddenFromTranscript}get isCompleteAddedRequest(){return this._model.isCompleteAddedRequest}get isTerminalCommand(){return this._model.request?.isTerminalCommand??!1}get replyFollowups(){return this._model.followups?.filter(e=>e.kind==="reply")}get result(){return this._model.result}get errorDetails(){return this.result?.errorDetails}get vote(){return this._model.vote}get requestId(){return this._model.requestId}get isStale(){return this._model.isStale}get isLast(){return this.session.getItems().at(-1)===this}get usedReferencesExpanded(){if(typeof this._usedReferencesExpanded=="boolean")return this._usedReferencesExpanded}set usedReferencesExpanded(e){this._usedReferencesExpanded=e}get vulnerabilitiesListExpanded(){return this._vulnerabilitiesListExpanded}set vulnerabilitiesListExpanded(e){this._vulnerabilitiesListExpanded=e}get contentUpdateTimings(){return this.liveUpdateTracker?.data}get confirmationAdjustedTimestamp(){return this._model.confirmationAdjustedTimestamp}get usageObs(){return this._model.usageObs}get completionTokenCountObs(){return this._model.completionTokenCountObs}setVote(e){this._modelChangeCount++,this._model.setVote(e)}setEditApplied(e,n){this._modelChangeCount++,this._model.setEditApplied(e,n)}};uy=w([b(2,Hn),b(3,O5)],uy)});var lr,Q_=v(()=>{xe();lr=class r{constructor(t,e){this.start=t;this.endExclusive=e;if(t>e)throw new Et(`Invalid range: ${this.toString()}`)}static fromTo(t,e){return new r(t,e)}static equals(t,e){return t.start===e.start&&t.endExclusive===e.endExclusive}static addRange(t,e){let n=0;for(;n<e.length&&e[n].endExclusive<t.start;)n++;let o=n;for(;o<e.length&&e[o].start<=t.endExclusive;)o++;if(n===o)e.splice(n,0,t);else{let i=Math.min(t.start,e[n].start),s=Math.max(t.endExclusive,e[o-1].endExclusive);e.splice(n,o-n,new r(i,s))}}static tryCreate(t,e){if(!(t>e))return new r(t,e)}static ofLength(t){return new r(0,t)}static ofStartAndLength(t,e){return new r(t,t+e)}static emptyAt(t){return new r(t,t)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new r(this.start+t,this.endExclusive+t)}deltaStart(t){return new r(this.start+t,this.endExclusive)}deltaEnd(t){return new r(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(t){return this.start===t.start&&this.endExclusive===t.endExclusive}containsRange(t){return this.start<=t.start&&t.endExclusive<=this.endExclusive}contains(t){return this.start<=t&&t<this.endExclusive}join(t){return new r(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))}intersect(t){let e=Math.max(this.start,t.start),n=Math.min(this.endExclusive,t.endExclusive);if(e<=n)return new r(e,n)}intersectionLength(t){let e=Math.max(this.start,t.start),n=Math.min(this.endExclusive,t.endExclusive);return Math.max(0,n-e)}intersects(t){let e=Math.max(this.start,t.start),n=Math.min(this.endExclusive,t.endExclusive);return e<n}intersectsOrTouches(t){let e=Math.max(this.start,t.start),n=Math.min(this.endExclusive,t.endExclusive);return e<=n}isBefore(t){return this.endExclusive<=t.start}isAfter(t){return this.start>=t.endExclusive}slice(t){return t.slice(this.start,this.endExclusive)}substring(t){return t.substring(this.start,this.endExclusive)}clip(t){if(this.isEmpty)throw new Et(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,t))}clipCyclic(t){if(this.isEmpty)throw new Et(`Invalid clipping range: ${this.toString()}`);return t<this.start?this.endExclusive-(this.start-t)%this.length:t>=this.endExclusive?this.start+(t-this.start)%this.length:t}map(t){let e=[];for(let n=this.start;n<this.endExclusive;n++)e.push(t(n));return e}forEach(t){for(let e=this.start;e<this.endExclusive;e++)t(e)}joinRightTouching(t){if(this.endExclusive!==t.start)throw new Et(`Invalid join: ${this.toString()} and ${t.toString()}`);return new r(this.start,t.endExclusive)}withMargin(t,e){return e===void 0&&(e=t),new r(this.start-t,this.endExclusive+e)}}});function G5(r){return r===X_?"":r.startsWith(qC)?r.slice(qC.length):r}function ote(r){return r.split(`
`).map(G5).join(`
`)}function rte(r){return r.split(`
`).some(t=>t.startsWith(qC)||t===X_)}function j5(r){let t=r.indexOf(J_);if(t===-1)return;let e=r.lastIndexOf(V5);if(e<t+J_.length)return;let n=r.slice(t+J_.length,e).trim().split(`
`),o=n.find(a=>a.startsWith(B5));if(o===void 0)return;let i=ate(n),s=ite.exec(i.get("Head:")?.trim()??"")?.groups;return{actions:lte(o.slice(B5.length)),pullRequestUrl:i.get("Pull request:")?.trim()??"",title:i.get("Title:")?.trim()??"",headRef:s?.ref??"",headSha:s?.sha??"",baseRef:i.get("Base:")?.trim()??"",reviewThreads:dte(i.get("Unresolved authorized review threads:")),reviewSummaries:z5(i.get("Changes-requested reviews:")),newComments:z5(i.get("New authorized comments:")),failedChecks:cte(i.get("Failed required checks:")),behind:i.get("Behind base:")?.trim()==="yes",conflicting:i.get("Conflicting:")?.trim()==="yes",agentMessage:r.slice(e+V5.length).trim()}}function ate(r){let t=new Map,e=r.length;for(let i=Y_.length-1;i>=0;i--){let s=Y_[i];for(let a=e-1;a>=0;a--)if(r[a].startsWith(s)){t.set(s,a),e=a;break}}let n=Y_.filter(i=>t.has(i)),o=new Map;for(let i=0;i<n.length;i++){let s=n[i],a=t.get(s),l=i+1<n.length?t.get(n[i+1]):r.length,c=[r[a].slice(s.length),...r.slice(a+1,l)].join(`
`);o.set(s,c.replace(/^[^\S\n]+/,"").replace(/^\n+/,""))}return o}function lte(r){let t=new Set(r.split(",").map(n=>n.trim()).filter(Boolean));return Object.keys($5).filter(n=>t.has($5[n]))}function cte(r){let t=r?.trim();return!t||t==="none"?[]:rte(t)?t.split(`
`).map(G5).map(e=>e.trim()).filter(Boolean):t.split(",").map(e=>e.trim()).filter(Boolean)}function dte(r){let t=r?.trim();return!t||t==="none"?[]:J5(t,e=>e.startsWith("Thread ")).map(ute).filter(e=>!!e)}function ute(r){let t=r.split(`
`);if(!t[0]?.startsWith("Thread "))return;let e=t[0].slice(7).trim(),n=1,o,i;if(t[n]?.startsWith("File: ")){let a=ste.exec(t[n].slice(6).trim());o=a?.groups?.path||void 0;let l=Number(a?.groups?.line);i=Number.isSafeInteger(l)?l:void 0,n++}t[n]==="Feedback:"&&n++;let s=t.slice(n).join(`
`).trim();return{id:e,...o!==void 0?{path:o}:{},...i!==void 0?{line:i}:{},comments:s?[Q5(s)]:[]}}function z5(r){let t=r?.trim();return!t||t==="none"?[]:J5(t,n=>{let o=n.split(`
`)[0]??"";return o.startsWith(qC)||o===X_||K5.test(o)}).map(Q5)}function Q5(r){let t=ote(r).trim(),e=K5.exec(t);return e?.groups?{author:e.groups.author,body:e.groups.body.trim()}:{body:t}}function J5(r,t){let e=[];for(let n of r.split(`
${q5}
`))e.length===0||t(n)?e.push(n):e[e.length-1]+=`
${q5}
${n}`;return e.map(n=>n.trim()).filter(Boolean)}var J_,V5,B5,q5,qC,X_,$5,Y_,K5,ite,ste,Y5=v(()=>{J_="<agent_merge_state>",V5="</agent_merge_state>",B5="Authorized actions this run: ",q5="---",qC="> ",X_=">";$5={addressReviews:"address review feedback",fixCI:"fix failed required CI checks",resolveConflicts:"resolve conflicts or update the behind branch"},Y_=["Pull request:","Title:","Head:","Base:","Unresolved authorized review threads:","Changes-requested reviews:","New authorized comments:","Failed required checks:","Behind base:","Conflicting:"],K5=/^(?<author>[A-Za-z0-9-_.]+(?:\[bot\])?): (?<body>[\s\S]*)$/,ite=/^(?<ref>.*?) \((?<sha>[^()]*)\)$/,ste=/^(?<path>.*?)(?::(?<line>\d+))?$/});function As(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function jl(r,...t){return t.every(e=>typeof r[e]=="string"&&r[e].length>0)}function pte(r){return As(r)&&(r.kind==="loading"||r.kind==="available"||["stale","authenticationRequired","unavailable","error"].includes(String(r.kind))&&typeof r.reason=="string")&&(r.observedAt===void 0||typeof r.observedAt=="number"&&Number.isFinite(r.observedAt))&&(r.authorizationUrl===void 0||r.kind==="authenticationRequired"&&mte(r.authorizationUrl))}function mte(r){if(typeof r!="string")return!1;try{let t=new URL(r);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Z_(r){return As(r)&&typeof r.id=="string"&&/^[a-zA-Z0-9-]+$/.test(r.id)&&(r.colorId===void 0||typeof r.colorId=="string"&&/^[a-zA-Z0-9.-]+$/.test(r.colorId))}function gte(r){return As(r)&&jl(r,"id","label")&&Z_({id:r.iconId})&&(r.actionId===void 0||typeof r.actionId=="string"&&r.actionId.length>0)}function fte(r){return Array.isArray(r)&&r.every(t=>typeof t=="string"&&t.length>0)&&new Set(r).size===r.length}function hte(r){if(!As(r))return!1;let t=r.itemActions??[];if(!Array.isArray(t)||!t.every(gte))return!1;let e=new Set(t.map(n=>n.id));return pte(r.availability)&&typeof r.title=="string"&&(r.description===void 0||typeof r.description=="string")&&(r.descriptionFormat===void 0||r.descriptionFormat==="plaintext"||r.descriptionFormat==="markdown")&&(r.completeness==="complete"||r.completeness==="partial")&&(r.facts===void 0||Array.isArray(r.facts)&&r.facts.every(n=>As(n)&&jl(n,"id","label")&&typeof n.value=="string"))&&Array.isArray(r.links)&&r.links.every(n=>As(n)&&(n.kind==="action"?jl(n,"actionId"):n.kind==="automation"&&jl(n,"optionId")))&&e.size===t.length&&Array.isArray(r.items)&&r.items.length<=200&&r.items.every(n=>As(n)&&jl(n,"id","label","resource")&&Z_(n.icon)&&(n.description===void 0||typeof n.description=="string")&&(n.actions===void 0||fte(n.actions)&&n.actions.every(o=>e.has(o))))&&new Set(r.items.map(n=>n.id)).size===r.items.length}function X5(r){return As(r)&&r.version===1&&jl(r,"integrationLabel")&&(r.source==="manual"||r.source==="automation")&&As(r.action)&&jl(r.action,"label","iconId")&&As(r.artifact)&&jl(r.artifact,"resource","label")&&(r.artifact.description===void 0||typeof r.artifact.description=="string")&&(r.artifact.icon===void 0||Z_(r.artifact.icon))&&Array.isArray(r.details)&&r.details.every(hte)}var Z5=v(()=>{});var e7,Wtt,Vtt,Btt,qtt,$tt,ztt,Gtt,Ktt,eM=v(()=>{Ve();xe();ks();Ie();te();ee();ro();Z();e7=A("chatEditingService"),Wtt=new C("chatEditingWidgetFileState",void 0,d(15124,null)),Vtt=new C("chatEditingAgentSupportsReadonlyReferences",void 0,d(15123,null)),Btt=new C("decidedChatEditingResource",[]),qtt=new C("chatEditingResource",void 0),$tt=new C("inChatEditingSession",void 0),ztt=new C("hasUndecidedChatEditingResource",!1),Gtt=new C("hasAppliedChatEdits",!1),Ktt=new C("applyingChatEditsFailed",!1)});function tM(r){return PB(r)&&(r={kind:"terminal",commandLine:{original:r.command,toolEdited:void 0,userEdited:void 0},language:r.language}),r}var t7=v(()=>{fn();eM();dm()});function n7(r,t){return typeof r=="string"&&r?d(15105,null,r):t!==void 0&&t!==0?d(15104,null,t):r?d(15103,null):void 0}var rnt,int,snt,o7=v(()=>{ee();Mb();fe();rnt=1440*60*1e3,int=Af.DateTimeFormat(Fw,{hour:"numeric",minute:"2-digit"}),snt=Af.DateTimeFormat(Fw,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"})});function r7(r){return{kind:r.kind,sourceSessionResource:r.sourceSessionResource.toJSON(),...r.delegationScope?{delegationScope:r.delegationScope}:{}}}function i7(r){if(r?.kind!=="delegation")return;let t=S.revive(r.sourceSessionResource);return t?{kind:r.kind,sourceSessionResource:t,...r.delegationScope?{delegationScope:r.delegationScope}:{}}:void 0}var mnt,s7=v(()=>{Q();te();Z();mnt=A("chatRequestOriginService")});var a7=v(()=>{});function nM(r){return typeof r=="object"&&typeof r?.input=="string"&&(typeof r?.output=="string"||Array.isArray(r?.output))}function oM(r){return typeof r=="object"&&typeof r?.output=="object"&&typeof r?.output?.mimeType=="string"&&r?.output?.type==="data"}var py,Dnt,yte,vte,my=v(()=>{ri();Q();Me();ks();te();ee();st();Z();a7();(i=>{i.Internal={type:"internal",label:"Built-In"},i.External={type:"external",label:"External"};function e(s){switch(s.type){case"extension":return`extension:${s.extensionId.value}`;case"mcp":return`mcp:${s.collectionId}:${s.definitionId}`;case"user":return`user:${s.file.toString()}`;case"internal":return"internal";case"external":return"external"}}i.toKey=e;function n(s,a){return e(s)===e(a)}i.equals=n;function o(s){return s.type==="internal"?{ordinal:1,label:d(15792,null)}:s.type==="mcp"?{ordinal:2,label:s.serverLabel||s.label}:s.type==="user"?{ordinal:0,label:d(15794,null)}:{ordinal:3,label:s.label}}i.classify=o})(py||={});Dnt=A("ILanguageModelToolsService");(a=>(a.execute="execute",a.edit="edit",a.search="search",a.agent="agent",a.read="read",a.web="web",a.todo="todo"))(yte||={});(e=>(e.runSubagent="runSubagent",e.vscode="vscode"))(vte||={})});var Im,c7=v(()=>{Ve();ks();ra();ee();dm();my();Im=class r{constructor(t,e,n,o,i,s={},a){this.toolCallId=n;this.kind="toolInvocation";this.isAttachedToThinking=!1;this._startedAt=Date.now();this._toolSpecificDataKind=qn(this,void 0);this.toolSpecificDataKind=this._toolSpecificDataKind;this._progress=qn(this,{progress:0});this._partialInput=qn(this,void 0);this._streamingMessage=qn(this,void 0);let l="";s.startInStreaming?l=e.displayName:s.startInCancelled&&(l=s.cancelReasonMessage??d(15176,null,e.displayName)),this.invocationMessage=t?.invocationMessage??l,this.pastTenseMessage=t?.pastTenseMessage,this.originMessage=t?.originMessage,this.confirmationMessages=t?.confirmationMessages,this.presentation=t?.presentation,this.toolSpecificData=t?.toolSpecificData,this.toolId=e.id,this.icon=t?.icon??(e.icon&&Zt.isThemeIcon(e.icon)?e.icon:void 0),this.source=e.source,this.subAgentInvocationId=o,this.parameters=i,this.chatRequestId=a,s.startInCancelled?(this._completedAt=this.startedAt,this._state=qn(this,{type:Pe.StateKind.Cancelled,reason:s.cancelReason?.type??0,...s.cancelReason?.source!==void 0?{source:s.cancelReason.source}:{},reasonMessage:s.cancelReasonMessage,parameters:this.parameters,confirmationMessages:this.confirmationMessages})):s.startInStreaming?this._state=qn(this,{type:Pe.StateKind.Streaming,partialInput:this._partialInput,streamingMessage:this._streamingMessage}):this.confirmationMessages?.title?this._state=qn(this,{type:Pe.StateKind.WaitingForConfirmation,parameters:this.parameters,confirmationMessages:this.confirmationMessages,confirm:c=>this._confirm(c)}):(this._executionStartedAt=Date.now(),this._state=qn(this,{type:Pe.StateKind.Executing,confirmed:{type:1,reason:this.confirmationMessages?.confirmationNotNeededReason},progress:this._progress,parameters:this.parameters,confirmationMessages:this.confirmationMessages}))}get startedAt(){return this._startedAt}get completedAt(){return this._completedAt}get toolSpecificData(){return this._toolSpecificData}set toolSpecificData(t){this._toolSpecificData=t,this._toolSpecificDataKind.set(t?.kind,void 0)}get state(){return this._state}static createStreaming(t){return new r(void 0,t.toolData,t.toolCallId,t.subagentInvocationId,void 0,{startInStreaming:!0},t.chatRequestId)}static createCancelled(t,e,n,o){return new r(void 0,t.toolData,t.toolCallId,t.subagentInvocationId,e,{startInCancelled:!0,cancelReason:n,cancelReasonMessage:o},t.chatRequestId)}_confirm(t){t.type===0||t.type===5?(this._recordCompletion(),this._state.set({type:Pe.StateKind.Cancelled,reason:t.type,...t.source!==void 0?{source:t.source}:{},parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0)):(this._executionStartedAt??=Date.now(),this._state.set({type:Pe.StateKind.Executing,confirmed:t,progress:this._progress,parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0))}updatePartialInput(t){this._state.get().type===Pe.StateKind.Streaming&&this._partialInput.set(t,void 0)}updateStreamingMessage(t){this._state.get().type===Pe.StateKind.Streaming&&this._streamingMessage.set(t,void 0)}notifyToolSpecificDataChanged(){let t=this._state.get();this._state.set({...t},void 0)}updateConfirmationMessages(t){let e=this._state.get();e.type===Pe.StateKind.WaitingForConfirmation&&(this.confirmationMessages=t,this._state.set({...e,confirmationMessages:t},void 0))}cancelFromStreaming(t,e){return this._state.get().type!==Pe.StateKind.Streaming?!1:(this.didCancelTool(t,e),!0)}didCancelTool(t,e,n){Pe.isComplete(this)||(this._stopExecutionTimer(),this._recordCompletion(),this._state.set({type:Pe.StateKind.Cancelled,reason:t.type,...t.source!==void 0?{source:t.source}:{},reasonMessage:e,parameters:this.parameters,confirmationMessages:this.confirmationMessages,...n?{resultDetails:n}:{}},void 0))}transitionFromStreaming(t,e,n){if(this._state.get().type!==Pe.StateKind.Streaming)return;let i=this._streamingMessage.get();i&&!t?.invocationMessage&&(this.invocationMessage=i),this._updatePreparedInvocation(t,e),n?this._confirm(n):this.confirmationMessages?.title?this._state.set({type:Pe.StateKind.WaitingForConfirmation,parameters:this.parameters,confirmationMessages:this.confirmationMessages,confirm:s=>this._confirm(s)},void 0):(this._executionStartedAt??=Date.now(),this._state.set({type:Pe.StateKind.Executing,confirmed:{type:1,reason:this.confirmationMessages?.confirmationNotNeededReason},progress:this._progress,parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0))}updatePreparedInvocation(t,e){let n=this._state.get();return n.type===Pe.StateKind.Streaming||n.type===Pe.StateKind.Completed||n.type===Pe.StateKind.Cancelled?!1:(this._updatePreparedInvocation(t,e),this._state.set({...n,parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0),!0)}_updatePreparedInvocation(t,e){this.parameters=e,t&&(t.invocationMessage&&(this.invocationMessage=t.invocationMessage),this.originMessage=t.originMessage??this.originMessage,this.pastTenseMessage=t.pastTenseMessage,this.confirmationMessages=t.confirmationMessages,this.presentation=t.presentation,this.toolSpecificData=t.toolSpecificData)}requestConfirmation(t){let e=this._state.get().type;if(e===Pe.StateKind.Streaming){this.transitionFromStreaming(t,this.parameters,void 0);return}e===Pe.StateKind.Completed||e===Pe.StateKind.Cancelled||e===Pe.StateKind.WaitingForConfirmation||(t.invocationMessage&&(this.invocationMessage=t.invocationMessage),this.originMessage=t.originMessage??this.originMessage,this.pastTenseMessage=t.pastTenseMessage,this.confirmationMessages=t.confirmationMessages,this.presentation=t.presentation,this.toolSpecificData=t.toolSpecificData,this.confirmationMessages?.title&&(this._stopExecutionTimer(),this._state.set({type:Pe.StateKind.WaitingForConfirmation,parameters:this.parameters,confirmationMessages:this.confirmationMessages,confirm:n=>this._confirm(n)},void 0)))}_stopExecutionTimer(){this._executionStartedAt!==void 0&&(this._executionDurationMs=(this._executionDurationMs??0)+Math.max(0,Date.now()-this._executionStartedAt),this._executionStartedAt=void 0)}forgetTiming(){this._startedAt=void 0,this._completedAt=void 0}_recordCompletion(){this._startedAt!==void 0&&(this._completedAt??=Date.now())}_setCompleted(t,e){if(this._recordCompletion(),e&&(e.type===0||e.type===5)){this._state.set({type:Pe.StateKind.Cancelled,reason:e.type,...e.source!==void 0?{source:e.source}:{},parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0);return}this._state.set({type:Pe.StateKind.Completed,confirmed:Pe.executionConfirmedOrDenied(this)||{type:1},resultDetails:t?.toolResultDetails,resultError:t?.toolResultError,postConfirmed:e,contentForModel:t?.content||[],parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0)}async didExecuteTool(t,e,n){let o=this._state.get();if(o.type===Pe.StateKind.Completed||o.type===Pe.StateKind.Cancelled)return o;if(this._stopExecutionTimer(),t?.toolSpecificData&&(this.toolSpecificData=t.toolSpecificData),this.toolSpecificData?.kind==="generatedImage"&&this.toolSpecificData.durationMs===void 0&&this._executionDurationMs!==void 0&&(this.toolSpecificData={...this.toolSpecificData,durationMs:this._executionDurationMs}),t?.toolResultMessage?this.pastTenseMessage=t.toolResultMessage:this._progress.get().message&&(this.pastTenseMessage=this._progress.get().message),this.confirmationMessages?.confirmResults&&!t?.toolResultError&&t?.confirmResults!==!1&&!e){let i=await n?.();i?this._setCompleted(t,i):this._state.set({type:Pe.StateKind.WaitingForPostApproval,confirmed:Pe.executionConfirmedOrDenied(this)||{type:1},resultDetails:t?.toolResultDetails,contentForModel:t?.content||[],confirm:s=>this._setCompleted(t,s),parameters:this.parameters,confirmationMessages:this.confirmationMessages},void 0)}else this._setCompleted(t);return this._state.get()}setAuthenticationRequired(t,e=()=>{}){let n=this._state.get();n.type!==Pe.StateKind.Executing&&n.type!==Pe.StateKind.WaitingForAuthentication||(this._stopExecutionTimer(),this._state.set({type:Pe.StateKind.WaitingForAuthentication,server:t,cancel:n.type===Pe.StateKind.WaitingForAuthentication?n.cancel:e,confirmed:n.confirmed,parameters:n.parameters,confirmationMessages:n.confirmationMessages},void 0))}setAuthenticationResolved(){let t=this._state.get();t.type===Pe.StateKind.WaitingForAuthentication&&(this._executionStartedAt=Date.now(),this._state.set({type:Pe.StateKind.Executing,confirmed:t.confirmed,progress:this._progress,parameters:t.parameters,confirmationMessages:t.confirmationMessages},void 0))}acceptProgress(t){let e=this._progress.get();this._progress.set({progress:t.progress||e.progress||0,message:t.message},void 0)}toJSON(){let t=this.state.get().type===Pe.StateKind.WaitingForPostApproval,e=t?void 0:Pe.resultDetails(this),n=Pe.isComplete(this)?this.summary:{kind:"incomplete"};return{kind:"toolInvocationSerialized",presentation:this.presentation,invocationMessage:this.invocationMessage,pastTenseMessage:this.pastTenseMessage,originMessage:this.originMessage,isConfirmed:t?{type:5}:Pe.executionConfirmedOrDenied(this),isComplete:!0,source:this.source,...this.icon?{icon:this.icon}:{},resultError:Pe.resultError(this),resultDetails:oM(e)?{output:{type:"data",mimeType:e.output.mimeType,base64Data:oo(e.output.value)}}:e,toolSpecificData:this.toolSpecificData?.kind==="automationConfiguration"?void 0:this.toolSpecificData,toolCallId:this.toolCallId,toolId:this.toolId,subAgentInvocationId:this.subAgentInvocationId,...n?{summary:n}:{},...this._startedAt!==void 0?{startedAt:this._startedAt}:{},...this._completedAt!==void 0?{completedAt:this._completedAt}:{},generatedTitle:this.generatedTitle}}}});var $C,d7=v(()=>{Ue();ue();$C=class{constructor(t,e,n,o,i,s,a,l,c,u){this.title=t;this.content=e;this.actions=n;this.canProvideFeedback=o;this.planUri=i;this.resolveId=s;this.data=a;this.isUsed=l;this.source=c;this.isOutdated=u;this.kind="planReview";this.completion=new jn;this._onDidDismiss=new R;this.onDidDismiss=this._onDidDismiss.event}dismiss(){this.isUsed||(this.isUsed=!0,this.draftFeedback=void 0,this.draftCollapsed=void 0,this.completion.complete(void 0),this._onDidDismiss.fire())}toJSON(){return{kind:this.kind,title:this.title,content:this.content,actions:this.actions,canProvideFeedback:this.canProvideFeedback,planUri:this.planUri,resolveId:this.resolveId,data:this.data,isUsed:this.isUsed,isOutdated:this.isOutdated,source:this.source}}}});var zC,u7=v(()=>{Ue();zC=class{constructor(t,e,n,o,i,s,a,l,c){this.questions=t;this.allowSkip=e;this.resolveId=n;this.data=o;this.isUsed=i;this.message=s;this.source=a;this.terminalId=l;this.answerPresentation=c;this.kind="questionCarousel";this.completion=new jn}dismiss(t){this.isUsed||(this.data=t??{},this.isUsed=!0,this.draftAnswers=void 0,this.draftCurrentIndex=void 0,this.draftCollapsed=void 0,this.completion.complete({answers:t}))}toJSON(){return{kind:this.kind,questions:this.questions,allowSkip:this.allowSkip,resolveId:this.resolveId,data:this.data,isUsed:this.isUsed,answeredExternally:this.answeredExternally,autoReply:this.autoReply,message:this.message,source:this.source,terminalId:this.terminalId,answerPresentation:this.answerPresentation}}}});function p7(r){return{text:r.text,parts:r.parts.map(t=>{if(t.kind===bm.Kind)return new bm(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.text);if(t.kind===GC.Kind)return new GC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.variableName,t.variableArg,t.variableId||"");if(t.kind===KC.Kind)return new KC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.toolName,t.toolId,t.displayName,t.icon);if(t.kind===jC.Kind)return new jC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.id,t.name,t.icon,t.tools??[]);if(t.kind===QC.Kind){let e=t.agent;return e=FC(e),new QC(new lr(t.range.start,t.range.endExclusive),t.editorRange,e)}else{if(t.kind===JC.Kind)return new JC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.command);if(t.kind===YC.Kind)return new YC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.slashCommand);if(t.kind===XC.Kind)return new XC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.name,t.displayText);if(t.kind===ZC.Kind)return new ZC(new lr(t.range.start,t.range.endExclusive),t.editorRange,t.text,t.id,t.modelDescription,en(t.data),t.fullName,t.icon,t.isFile,t.isDirectory,t._meta,t.isAttachmentReference,t.promptTextOverride);throw new Error(`Unknown chat request part: ${t.kind}`)}})}}var Ite,bm,eE,bte,gy,GC,KC,jC,QC,JC,YC,XC,ZC,m7=v(()=>{fs();te();ra();Q_();ba();HC();qh();Kx();(t=>{function r(e,n){return e.text===n.text&&WD(e.parts,n.parts,(o,i)=>o.kind===i.kind&&lr.equals(o.range,i.range)&&Mn.equalsRange(o.editorRange,i.editorRange)&&o.text===i.text)}t.equals=r})(Ite||={});bm=class r{constructor(t,e,n){this.range=t;this.editorRange=e;this.text=n;this.kind=r.Kind}static{this.Kind="text"}get promptText(){return this.text}},eE="#",bte="@",gy="/",GC=class r{constructor(t,e,n,o,i){this.range=t;this.editorRange=e;this.variableName=n;this.variableArg=o;this.variableId=i;this.kind=r.Kind}static{this.Kind="var"}get text(){let t=this.variableArg?`:${this.variableArg}`:"";return`${eE}${this.variableName}${t}`}get promptText(){return this.text}},KC=class r{constructor(t,e,n,o,i,s){this.range=t;this.editorRange=e;this.toolName=n;this.toolId=o;this.displayName=i;this.icon=s;this.kind=r.Kind}static{this.Kind="tool"}get text(){return`${eE}${this.toolName}`}get promptText(){return this.text}toVariableEntry(){return{kind:"tool",id:this.toolId,name:this.toolName,range:this.range,value:void 0,icon:Zt.isThemeIcon(this.icon)?this.icon:void 0,fullName:this.displayName}}},jC=class r{constructor(t,e,n,o,i,s){this.range=t;this.editorRange=e;this.id=n;this.name=o;this.icon=i;this.tools=s;this.kind=r.Kind}static{this.Kind="toolset"}get text(){return`${eE}${this.name}`}get promptText(){return this.text}toVariableEntry(){return{kind:"toolset",id:this.id,name:this.name,range:this.range,icon:this.icon,value:this.tools}}},QC=class r{constructor(t,e,n){this.range=t;this.editorRange=e;this.agent=n;this.kind=r.Kind}static{this.Kind="agent"}get text(){return`${bte}${this.agent.name}`}get promptText(){return""}},JC=class r{constructor(t,e,n){this.range=t;this.editorRange=e;this.command=n;this.kind=r.Kind}static{this.Kind="subcommand"}get text(){return`${gy}${this.command.name}`}get promptText(){return""}},YC=class r{constructor(t,e,n){this.range=t;this.editorRange=e;this.slashCommand=n;this.kind=r.Kind}static{this.Kind="slash"}get text(){return`${gy}${this.slashCommand.command}`}get promptText(){return`${gy}${this.slashCommand.command}`}},XC=class r{constructor(t,e,n,o){this.range=t;this.editorRange=e;this.name=n;this.kind=r.Kind;o!==void 0&&(this.displayText=o)}static{this.Kind="prompt"}get text(){return this.displayText??`${gy}${this.name}`}get promptText(){return this.displayText??`${gy}${this.name}`}},ZC=class r{constructor(t,e,n,o,i,s,a,l,c,u,p,m,g){this.range=t;this.editorRange=e;this.text=n;this.id=o;this.modelDescription=i;this.data=s;this.fullName=a;this.icon=l;this.isFile=c;this.isDirectory=u;this._meta=p;this.isAttachmentReference=m;this.promptTextOverride=g;this.kind=r.Kind}static{this.Kind="dynamic"}get referenceText(){return this.text.replace(eE,"")}get promptText(){return this.promptTextOverride??this.text}toVariableEntry(){if(this.id==="vscode.problems")return UD.toEntry(this.data.filter);if(this.id===L4&&S.isUri(this.data))return{kind:"sessionReference",id:this.data.toString(),name:this.fullName??this.referenceText,value:this.data,range:this.range,icon:this.icon,_meta:this._meta};if(O4(this.data)){let t=U4(this.data,this.id,this.fullName??this.referenceText,this.range,this._meta);if(t)return t}return{kind:this.isDirectory?"directory":this.isFile?"file":"generic",id:this.id,name:this.referenceText,range:this.range,value:this.data,fullName:this.fullName,icon:this.icon,_meta:this._meta}}}});function Ste(r,t){if(r.requestSource!==void 0)return r.requestSource;if(r.isSystemInitiated&&r.systemInitiatedLabel===void 0&&j5(t))return"agentMerge"}function rM(r){return r.kind==="toolInvocation"||r.kind==="confirmation"||r.kind==="questionCarousel"||r.kind==="planReview"||r.kind==="elicitation2"}function xte(r){return r?.reduce((t,e)=>t+e.outputTokens,0)}function Cte(r){return{attachments:(r.attachments??[]).map(om.fromExport),mode:r.mode,selectedModel:r.selectedModel&&{identifier:r.selectedModel.identifier,metadata:r.selectedModel.metadata},modelConfiguration:r.selectedModel?r.selectedModel.modelConfiguration??r.modelConfiguration:void 0,modelConfigurationIsTransient:r.selectedModel?.modelConfigurationIsTransient,contrib:r.contrib,inputText:r.inputText,selections:r.selections,permissionLevel:r.permissionLevel}}function f7(r){return!!r&&Array.isArray(r.requests)&&typeof r.responderUsername=="string"}function Ete(r){let t=r;return f7(r)&&typeof t.creationDate=="number"&&typeof t.sessionId=="string"&&r.requests.every(e=>!e.usedContext||TB(e.usedContext))}function fy(r,t){return r-t>2*Number.EPSILON*Math.max(Math.abs(r),Math.abs(t))}function rE(r,t){if(r.baseUri&&t.baseUri){if(!(r.baseUri.scheme===t.baseUri.scheme&&r.baseUri.authority===t.baseUri.authority&&r.baseUri.path===t.baseUri.path&&r.baseUri.query===t.baseUri.query&&r.baseUri.fragment===t.baseUri.fragment))return!1}else if(r.baseUri||t.baseUri)return!1;return Ge(r.isTrusted,t.isTrusted)&&r.supportHtml===t.supportHtml&&r.supportThemeIcons===t.supportThemeIcons}function Cm(r){return"subAgentInvocationId"in r&&!!r.subAgentInvocationId}function h7(r){let t=new Map;if(!r.some(y=>y.kind==="codeblockUri"&&y.subAgentInvocationId&&!y.isStandalone))return t;let e="vscode_subagent_scaffold_";for(;r.some(y=>y.kind==="markdownContent"&&y.content.value.includes(e));)e+="_";let n=new RegExp(`${e}(?<index>\\d+)`,"g"),o=[],i=[],s="",a=0,l,c=()=>{s.length>a&&i.push({start:a,end:s.length}),a=s.length,l=void 0};for(let[y,h]of r.entries())if(h.kind==="markdownContent"){l&&!rE(l,h.content)&&c();let I=h.content.value.replace(/\r\n?/g,`
`);o.push({index:y,start:s.length,end:s.length+I.length,value:I}),s+=I,l=h.content}else h.kind==="codeblockUri"?s+=`
${e}${y}
`:h.kind==="markdownVuln"||h.kind==="inlineReference"?s+=`${e}content`:h.kind!=="textEditGroup"&&h.kind!=="notebookEditGroup"&&h.kind!=="undoStop"&&h.kind!=="voiceProgress"&&!Cm(h)&&c();c();let u=[],p=[],m=!1,g=()=>{m&&u.push(...p),p=[],m=!1};for(let y of i){let h=y.start;for(let I of Ft.lexer(s.slice(y.start,y.end))){let x=s.indexOf(I.raw,h);if(x<0||x>=y.end)return t;h=x+I.raw.length;let E=I.type==="code"?I.text:I.raw,T=Array.from(E.matchAll(n),X=>r[Number(X.groups?.index)]),P=!E.replace(n,"").trim()&&T.every(X=>X?.kind==="codeblockUri"&&X.subAgentInvocationId&&!X.isStandalone),M=I.type==="code"&&!I.lang&&/^ {0,3}```(?:\s*\n|$)/.test(I.raw);P&&(M||I.type==="paragraph"||I.type==="space")?(m||=T.length>0,M&&p.push({start:x,end:h})):g()}g()}for(let y of o){let h=u.filter(E=>E.start<y.end&&E.end>y.start);if(!h.length)continue;let I="",x=0;for(let E of h)I+=y.value.slice(x,Math.max(0,E.start-y.start)),x=Math.min(y.value.length,E.end-y.start);t.set(y.index,I+y.value.slice(x))}return t}function tE(r,t){let e=typeof t=="string"?t:t.value;return{value:r.value+e,isTrusted:r.isTrusted,supportThemeIcons:r.supportThemeIcons,supportHtml:r.supportHtml,baseUri:r.baseUri}}function wte(r){if(r.length===0)return"";let t=r.reduce((n,o)=>n.add(o.license),new Set);return t.size===1?d(15167,null,t.size):d(15168,null,t.size)}function Rte(r,t,e,n){if(!UR(e.getLevel(),2)||r?.selectedModel?.identifier===t?.selectedModel?.identifier)return;let o=new Error().stack,i=`[ChatModelChanged] ChatModel Input State model changed: ${r?.selectedModel?.identifier} (was: ${t?.selectedModel?.identifier}) in session ${n} ${o}`;e.debug(i)}var g7,Si,nE,oE,iM,sM,Sm,aM,xm,y7,lM=v(()=>{Dt();ni();Ve();xe();ue();xr();Q();fn();fs();Ka();Ax();Me();Xt();ks();it();Ie();te();Vt();Q_();ee();Y5();Z5();De();th();qh();t7();o7();s7();z_();dm();iy();c7();d7();u7();my();eM();HC();m7();Bh();(t=>{function r(e){return{variables:e.variables.map(om.toExport)}}t.toExport=r})(g7||={});Si={reason:"other"},nE=class{constructor(t){this._shouldBeBlocked=qn(this,!1);this._version=0;this._agentHostMetadata=t.agentHostMetadata,this._session=t.session,this.message=t.message,this._variableData=t.variableData,this.requestTimestamp=t.timestamp,this.timestamp=t.timestamp??t.fallbackTimestamp??Date.now(),this._attempt=t.attempt??0,this.modeInfo=t.modeInfo,this._confirmation=t.confirmation,this._locationData=t.locationData,this._attachedContext=t.attachedContext,this.isCompleteAddedRequest=t.isCompleteAddedRequest??!1,this._modelId=t.modelId,this.modelConfiguration=t.modelConfiguration,this.id=t.restoredId??"request_"+Ee();let e=t.version;this._version=e!==void 0&&Number.isSafeInteger(e)&&e>=0?e:0,this._editedFileEvents=t.editedFileEvents,this.userSelectedTools=t.userSelectedTools,this.isSystemInitiated=t.isSystemInitiated,this.requestSource=t.requestSource,this.artifactRequest=t.isSystemInitiated&&t.requestSource==="artifactIntegration"&&X5(t.artifactRequest)?t.artifactRequest:void 0,this.isHiddenFromTranscript=t.isHiddenFromTranscript??!1,this.isRequestHiddenFromTranscript=this.isHiddenFromTranscript||t.isRequestHiddenFromTranscript===!0,this.systemInitiatedLabel=t.systemInitiatedLabel,this.terminalExecutionId=t.terminalExecutionId,this.isTerminalCommand=t.isTerminalCommand??!1,this.origin=t.origin}get shouldBeBlocked(){return this._shouldBeBlocked}setShouldBeBlocked(t){this._shouldBeBlocked.set(t,void 0)}get session(){return this._session}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(t){this._version++,this._variableData=t}get modelId(){return this._modelId}set modelId(t){this._version++,this._modelId=t}get agentHostMetadata(){return this._agentHostMetadata}set agentHostMetadata(t){this._version++,this._agentHostMetadata=t}get confirmation(){return this._confirmation}get locationData(){return this._locationData}get attachedContext(){return this._attachedContext}get editedFileEvents(){return this._editedFileEvents}get version(){return this._version}adoptTo(t){this._session=t}},oE=class{get value(){return this._responseParts}constructor(t){this._responseParts=t}toString(){return this._responseRepr===void 0&&(this._responseRepr=this.computeRepr()),this._responseRepr}getMarkdown(){return this._markdownContent===void 0&&(this._markdownContent=this.computeMarkdownContent()),this._markdownContent}getFinalResponse(){let t=this._responseParts,e=t.length-1;for(;e>=0;){let s=t[e];if(s.kind==="markdownContent"||s.kind==="markdownVuln"){if(s.content.value.length>0)break}else if(s.kind==="inlineReference")break;e--}if(e<0)return"";let n=e;for(;e>=0;){let s=t[e];if(s.kind==="markdownContent"||s.kind==="markdownVuln"||s.kind==="inlineReference")e--;else break}let o=e+1,i=[];for(let s=o;s<=n;s++){let a=t[s];a.kind==="inlineReference"?i.push(this.inlineRefToRepr(a)):(a.kind==="markdownContent"||a.kind==="markdownVuln")&&a.content.value.length>0&&i.push(a.content.value)}return i.join("")}_invalidateRepr(){this._responseRepr=void 0,this._markdownContent=void 0}computeMarkdownContent(){let t=[];for(let e of this._responseParts)e.kind==="inlineReference"?t.push(this.inlineRefToRepr(e)):(e.kind==="markdownContent"||e.kind==="markdownVuln")&&e.content.value.length>0&&t.push(e.content.value);return t.join("")}computeRepr(){return this.partsToRepr(this._responseParts)}partsToRepr(t){let e=[],n=[],o=[],i=!1,s=h7(t);for(let[a,l]of t.entries()){let c=s.get(a);if(c!==void 0&&!c.trim())continue;let u;switch(l.kind){case"clearToPreviousToolInvocation":n=[],e.length=0,o.length=0,i=!1;continue;case"treeData":case"progressMessage":case"extensions":case"pullRequest":case"undoStop":case"workspaceEdit":case"externalEdit":case"elicitation2":case"elicitationSerialized":case"thinking":case"hook":case"voiceProgress":case"multiDiffData":case"mcpServersStarting":case"mcpAuthenticationRequired":case"mcpServersStartingSlow":case"questionCarousel":case"planReview":case"disabledClaudeHooks":case"autoModeResolution":continue;case"systemNotification":u={text:l.content.value,isBlock:!0};break;case"codeblockUri":if(!l.subAgentInvocationId&&!l.isStandalone)continue;o.push(l.uri.toString());continue;case"toolInvocation":case"toolInvocationSerialized":if(u=this.getToolInvocationText(l),l.subAgentInvocationId){o.push(u.text);continue}break;case"inlineReference":u={text:this.inlineRefToRepr(l)};break;case"command":u={text:l.command.title,isBlock:!0};break;case"textEditGroup":case"notebookEditGroup":i=!0;continue;case"confirmation":if(l.message instanceof at){u={text:`${l.title}
${l.message.value}`,isBlock:!0};break}u={text:`${l.title}
${l.message}`,isBlock:!0};break;case"markdownContent":case"markdownVuln":case"progressTask":case"progressTaskSerialized":case"warning":case"info":u={text:s.get(a)??l.content.value};break;default:continue}u.isBlock?(n.length&&(e.push(n.join("")),n=[]),e.push(u.text)):n.push(u.text)}return n.length&&e.push(n.join("")),e.push(...o),i&&e.push(d(15170,null)),e.join(`
`)}inlineRefToRepr(t){return"uri"in t.inlineReference?this.uriToRepr(t.inlineReference.uri,t.inlineReference.range):"name"in t.inlineReference?cf(t.inlineReference.name):this.uriToRepr(t.inlineReference)}getToolInvocationText(t){if(Pe.isStreaming(t)&&Pe.isImageGeneration(t))return{text:""};let e=c=>c.presentationOverrides?.commandLine??c.commandLine.forDisplay??c.commandLine.userEdited??c.commandLine.toolEdited??c.commandLine.original,n="",o="",i;if(t.pastTenseMessage?n=typeof t.pastTenseMessage=="string"?t.pastTenseMessage:t.pastTenseMessage.value:n=typeof t.invocationMessage=="string"?t.invocationMessage:t.invocationMessage.value,t.toolSpecificData&&t.toolSpecificData.kind==="terminal"){n="Ran terminal command";let c=tM(t.toolSpecificData);o=e(c),i=c.terminalCommandState?.exitCode}let s=n;o&&(s+=`: ${o}`);let a=Pe.resultDetails(t);if((t.kind==="toolInvocationSerialized"||t.kind==="toolInvocation"&&Pe.isComplete(t))&&a&&"input"in a){let c=t.kind==="toolInvocationSerialized"||Pe.isComplete(t)?"Completed":"Errored",u=t.toolSpecificData?.kind==="terminal"?e(tM(t.toolSpecificData)):a.input;s+=`
${c} with input: ${u}`}let l=n7(Pe.resultError(t)||nM(a)&&a.isError,i);return l&&(s+=`
`+l),{text:s,isBlock:!0}}uriToRepr(t,e){if(t.scheme===q.http||t.scheme===q.https)return t.toString(!1);let n=e?e.startLineNumber===e.endLineNumber?`:${e.startLineNumber}`:`:${e.startLineNumber}-${e.endLineNumber}`:"";return cf(xn(t)+n)}},iM=class extends oE{constructor(e,n){let o=e.value.findIndex(s=>s.kind==="undoStop"&&s.id===n),i=e.value[o+1];i?.kind==="codeblockUri"&&!i.isStandalone&&e.value[o-1]?.kind==="markdownContent"&&o--;super(o===-1?e.value.slice():e.value.slice(0,o));this.undoStop=n}};sM=class extends oE{constructor(e){super(qd(e).map(n=>"kind"in n?n:Ni(n)?{content:n,kind:"markdownContent"}:{kind:"treeData",treeData:n}));this._store=new re;this._toolInvocationDisposables=this._store.add(new re);this._pendingConfirmationCandidates=new Set;this._onDidChangeValue=this._store.add(new R);this._citations=[];for(let n of this._responseParts)rM(n)&&this._pendingConfirmationCandidates.add(n)}get onDidChangeValue(){return this._onDidChangeValue.event}dispose(){this._store.dispose()}getPendingConfirmations(e){let n=[];for(let o of this._pendingConfirmationCandidates)if(o.kind==="toolInvocation"){let i=o.state.read(e);i.type===Pe.StateKind.Completed||i.type===Pe.StateKind.Cancelled?this._pendingConfirmationCandidates.delete(o):(i.type===Pe.StateKind.WaitingForConfirmation||i.type===Pe.StateKind.WaitingForPostApproval||i.type===Pe.StateKind.WaitingForAuthentication)&&n.push(o)}else o.kind==="elicitation2"?o.state.read(e)==="pending"?n.push(o):this._pendingConfirmationCandidates.delete(o):o.isUsed?this._pendingConfirmationCandidates.delete(o):n.push(o);return n}clear(){this._toolInvocationDisposables.clear(),this._pendingConfirmationCandidates.clear(),this._responseParts=[],this._contentChanged(!0)}clearToPreviousToolInvocation(e){let n=-1;for(let o=this._responseParts.length-1;o>=0;o--){let i=this._responseParts[o];if(i.kind==="toolInvocation"||i.kind==="toolInvocationSerialized"){n=o;break}}for(let o=n+1;o<this._responseParts.length;o++){let i=this._responseParts[o];rM(i)&&this._pendingConfirmationCandidates.delete(i)}n!==-1?this._responseParts=this._responseParts.slice(0,n+1):this._responseParts=[],e&&this._responseParts.push({kind:"warning",content:new at(e)}),this._contentChanged(!0)}updateContent(e,n,o){if(e.kind==="clearToPreviousToolInvocation"){e.reason===2?this.clearToPreviousToolInvocation(d(15169,null)):e.reason===1?this.clearToPreviousToolInvocation(d(15171,null)):this.clearToPreviousToolInvocation();return}else if(e.kind==="markdownContent"){let i=this._responseParts.filter(s=>s.kind!=="textEditGroup"&&(s.kind==="codeblockUri"&&!s.isStandalone||!Cm(s))).at(-1);if(!i||i.kind!=="markdownContent"||!rE(i.content,e.content))this._responseParts.push(e);else{let s=this._responseParts.indexOf(i);this._responseParts[s]={...i,content:tE(i.content,e.content)}}this._contentChanged(n)}else if(e.kind==="systemNotification"){let i=this._responseParts.at(-1);i?.kind==="toolInvocation"&&Pe.isStreaming(i)&&!Pe.isEffectivelyHidden(i)?this._responseParts.splice(this._responseParts.length-1,0,e):this._responseParts.push(e),this._contentChanged(n)}else if(e.kind==="thinking"){let i=Array.isArray(e.value)?e.value.join(""):e.value??"",s=e.reasoningStartedAt!==void 0||e.reasoningDurationMs!==void 0,a=e.reasoningTimingSource==="provider",l={...a?{reasoningTimingSource:e.reasoningTimingSource}:{},...e.reasoningStartedAt!==void 0?{reasoningStartedAt:e.reasoningStartedAt}:{},...e.reasoningDurationMs!==void 0?{reasoningDurationMs:e.reasoningDurationMs}:{}};if((s||a)&&e.id!==void 0){let g=this._responseParts.findLastIndex(I=>I.kind==="thinking"&&I.id===e.id),y=this._responseParts[g],h=this._responseParts.slice(g+1).some(I=>!Cm(I)&&(I.kind==="markdownContent"||I.kind==="toolInvocation"||I.kind==="toolInvocationSerialized"));if(y?.kind==="thinking"&&(!i||!h)){if(i){let I=Array.isArray(y.value)?y.value.join(""):y.value??"";this._responseParts[g]={...y,...l,value:tE(new at(I),new at(i)).value}}else Object.assign(y,l);this._contentChanged(n);return}}if(!i&&e.id===void 0&&!s&&!a){let g=this._responseParts.findLast(y=>!Cm(y)&&(y.kind==="thinking"||y.kind==="markdownContent"||y.kind==="toolInvocation"||y.kind==="toolInvocationSerialized"));if(g?.kind==="thinking"&&(g.reasoningTimingSource==="provider"||g.reasoningStartedAt!==void 0||g.reasoningDurationMs!==void 0))return}let c=this._responseParts.filter(g=>g.kind!=="textEditGroup"&&!Cm(g)).at(-1),u=c&&c.kind==="thinking"?Array.isArray(c.value)?c.value.join(""):c.value||"":"",p=c?.kind==="thinking"&&e.id!==void 0&&c.id!==void 0&&e.id!==c.id&&(s||a||c.reasoningTimingSource==="provider"||c.reasoningStartedAt!==void 0||c.reasoningDurationMs!==void 0),m=g=>g.length===0;if(!c||c.kind!=="thinking"||m(i)||m(u)||p||!rE(new at(u),new at(i)))this._responseParts.push(e);else{let g=this._responseParts.indexOf(c),y={...c,...l,value:tE(new at(u),new at(i)).value};this._responseParts[g]=y}this._contentChanged(n)}else if(e.kind==="textEdit"||e.kind==="notebookEdit"){let i=Yk.parse(e.uri)?.notebook,s=i??e.uri,a=e.isExternalEdit,l=e.autoTier!==void 0?{autoTier:e.autoTier}:void 0;if(e.kind==="textEdit"&&!i)this._mergeOrPushTextEditGroup(s,e.edits,e.done,a,l);else if(e.kind==="textEdit"){let c=e.edits.map(u=>({uri:e.uri,edit:u}));this._mergeOrPushNotebookEditGroup(s,c,e.done,a,l)}else this._mergeOrPushNotebookEditGroup(s,e.edits,e.done,a,l);this._contentChanged(n)}else if(e.kind==="progressTask"){let i=this._responseParts.push(e)-1;this._contentChanged(n);let s=e.onDidAddProgress(()=>{this._contentChanged(!1)});e.task?.().then(a=>{s.dispose(),typeof a=="string"&&(this._responseParts[i].content=new at(a)),this._contentChanged(!1)})}else if(e.kind==="toolInvocation")o&&e instanceof Im&&e.forgetTiming(),this._toolInvocationDisposables.add(Qo(i=>{Pe.isComplete(e)||e.state.read(i),e.toolSpecificDataKind.read(i),this._contentChanged(!1)})),this._responseParts.push(e),this._pendingConfirmationCandidates.add(e),this._contentChanged(n);else if(e.kind==="mcpAuthenticationRequired"){this._responseParts.push(e);let i=!0;jD(this._store,s=>{e.servers.read(s),this._contentChanged(i?n:!1),i=!1,e.isUsed&&s.dispose()})}else if(e.kind==="externalToolInvocationUpdate")this._handleExternalToolInvocationUpdate(e,o),this._contentChanged(n);else if(e.kind==="progressMessage"&&e.id!==void 0){let i=this._responseParts.findIndex(s=>s.kind==="progressMessage"&&s.id===e.id);e.remove?i!==-1&&(this._responseParts.splice(i,1),this._contentChanged(n)):(i===-1?this._responseParts.push(e):this._responseParts[i]=e,this._contentChanged(n))}else if(e.kind==="autoModeResolution"){let i=this._responseParts.findIndex(s=>s.kind==="autoModeResolution"&&!s.resolved);i===-1?this._responseParts.push(e):this._responseParts[i]=e,this._contentChanged(n)}else this._responseParts.push(e),rM(e)&&this._pendingConfirmationCandidates.add(e),this._contentChanged(n)}replaceAutoModeResolutions(e){Ge(this._responseParts.filter(n=>n.kind==="autoModeResolution"),e)||(this._responseParts=[...e,...this._responseParts.filter(n=>n.kind!=="autoModeResolution")],this._contentChanged())}addCitation(e){this._citations.push(e),this._contentChanged()}resolveInlineReference(e,n){for(let o=0;o<this._responseParts.length;o++){let i=this._responseParts[o];if(!(i.kind!=="inlineReference"||i.resolveId!==e))return this._responseParts[o]={...i,inlineReference:n.inlineReference,name:n.name??i.name},this._contentChanged(),!0}return!1}_mergeOrPushTextEditGroup(e,n,o,i,s){for(let a of this._responseParts)if(a.kind==="textEditGroup"&&!a.done&&Tn(a.uri,e)){s&&(a.editMetadata??=a.edits.map(()=>({}))),a.editMetadata?.push(s??{}),a.edits.push(n),a.done=o;return}this._responseParts.push({kind:"textEditGroup",uri:e,edits:[n],done:o,isExternalEdit:i,...s?{editMetadata:[s]}:{}})}_mergeOrPushNotebookEditGroup(e,n,o,i,s){for(let a of this._responseParts)if(a.kind==="notebookEditGroup"&&!a.done&&Tn(a.uri,e)){s&&(a.editMetadata??=a.edits.map(()=>({}))),a.editMetadata?.push(s??{}),a.edits.push(n),a.done=o;return}this._responseParts.push({kind:"notebookEditGroup",uri:e,edits:[n],done:o,isExternalEdit:i,...s?{editMetadata:[s]}:{}})}_handleExternalToolInvocationUpdate(e,n){let o=this._responseParts.findLast(a=>a.kind==="toolInvocation"&&a.toolCallId===e.toolCallId);if(o){e.toolSpecificData!==void 0&&(o.toolSpecificData=e.toolSpecificData),e.isComplete&&o.didExecuteTool({content:[],toolResultMessage:e.pastTenseMessage,toolResultError:e.errorMessage,toolResultDetails:e.resultDetails});return}let i={id:e.toolName,source:py.External,displayName:e.toolName,modelDescription:e.toolName},s=new Im({invocationMessage:e.invocationMessage,pastTenseMessage:e.pastTenseMessage,toolSpecificData:e.toolSpecificData},i,e.toolCallId,e.subagentInvocationId,void 0,{},void 0);n&&s.forgetTiming(),e.isComplete&&(e.toolSpecificData!==void 0&&(s.toolSpecificData=e.toolSpecificData),s.didExecuteTool({content:[],toolResultMessage:e.pastTenseMessage,toolResultError:e.errorMessage,toolResultDetails:e.resultDetails})),this._responseParts.push(s),this._pendingConfirmationCandidates.add(s)}computeRepr(){let e=super.computeRepr();return this._citations.length&&(e+=`
`+wte(this._citations)),e}_contentChanged(e){this._invalidateRepr(),e||this._onDidChangeValue.fire()}};Sm=class extends D{constructor(e){super();this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this._requestIndexHint=0;this._modelState=qn(this,{value:0});this._usageObs=qn(this,void 0);this._subagentCopilotCredits=new Map;this._completionTokenCountObs=qn(this,void 0);this._shouldBeBlocked=qn(this,!1);this._timingChanged=eC(this);this._lastCallCompletionTokensKnown=!0;this._contentReferences=[];this._codeCitations=[];this._progressMessages=[];this._isStale=!1;this._session=e.session,this._agent=e.agent,this._slashCommand=e.slashCommand,this.requestId=e.requestId,this._timestamp=e.timestamp||Date.now(),e.modelState&&this._modelState.set(e.modelState,void 0),this._completionTimestamp=e.completionTimestamp===null?void 0:e.completionTimestamp??(e.modelState&&"completedAt"in e.modelState?e.modelState.completedAt:void 0),this._timeSpentWaitingAccumulator=e.timeSpentWaiting||0,this._elapsedMs=e.elapsedMs,this._vote=e.vote,this._result=e.result,this._followups=e.followups?[...e.followups]:void 0,this.isCompleteAddedRequest=e.isCompleteAddedRequest??!1,this._shouldBeRemovedOnSend=e.shouldBeRemovedOnSend,this._shouldBeBlocked.set(e.shouldBeBlocked??!1,void 0),this._isStale=Array.isArray(e.responseContent)&&(e.responseContent.length!==0||Ni(e.responseContent)&&e.responseContent.value.length!==0),this._response=this._register(new sM(e.responseContent)),this._codeBlockInfos=e.codeBlockInfos?[...e.codeBlockInfos]:void 0;let n=e_(this,this.onDidChange),o=sm({owner:this,equalsFn:Gt},c=>(n.read(c),this._response.getPendingConfirmations(c))),i=new WeakMap;this.pendingToolInvocations=sm({owner:this,equalsFn:Gt},c=>{n.read(c);let u=o.read(c),p=this.response,m;return p!==this._response&&u.length&&(m=i.get(p),m||(m=new Set(p.value),i.set(p,m))),u.filter(g=>g.kind==="toolInvocation"&&(!m||m.has(g)))});let s=n.map((c,u)=>{let p=o.read(u).at(0);switch(p?.kind){case"toolInvocation":{let m=p.state.read(u);if(m.type===Pe.StateKind.WaitingForConfirmation){let g=m.confirmationMessages?.title;return g?Ni(g)?g.value:g:void 0}return m.type===Pe.StateKind.WaitingForPostApproval?d(15173,null):m.type===Pe.StateKind.WaitingForAuthentication?d(15174,null,m.server.name):void 0}case"confirmation":return p.title;case"questionCarousel":return d(15172,null);case"planReview":return d(15175,null);case"elicitation2":{let m=p.title;return Ni(m)?m.value:m}}}),a=s.map(c=>!!c).map(c=>c?Date.now():void 0);this.isPendingConfirmation=a.map((c,u)=>c?{startedWaitingAt:c,detail:s.read(u)}:void 0),this.isInProgress=n.map((c,u)=>(n.read(u),!s.read(u)&&!this.shouldBeRemovedOnSend&&(this._modelState.read(u).value===0||this._modelState.read(u).value===4))),this.isIncomplete=this._modelState.map(c=>c.value===0||c.value===4),this._register(this._response.onDidChangeValue(()=>this._onDidChange.fire(Si))),this.id=e.restoredId??"response_"+Ee();let l;this.confirmationAdjustedTimestamp=im(c=>{this._timingChanged.read(c);let u=this.isPendingConfirmation.read(c);return u?(this._modelState.set({value:4},void 0),l||(l=u.startedWaitingAt)):l&&(this._modelState.read(c).value===4&&this._modelState.set({value:0},void 0),this._timeSpentWaitingAccumulator+=Date.now()-l,l=void 0),this._timestamp+this._timeSpentWaitingAccumulator}).recomputeInitiallyAndOnChange(this._store)}get shouldBeBlocked(){return this._shouldBeBlocked}get request(){let e=this.session.getRequests(),n=e[this._requestIndexHint];if(n?.id===this.requestId)return n;let o=e.findIndex(i=>i.id===this.requestId);if(o!==-1)return this._requestIndexHint=o,e[o]}get session(){return this._session}get shouldBeRemovedOnSend(){return this._shouldBeRemovedOnSend}get isHiddenFromTranscript(){return this.request?.isHiddenFromTranscript??!1}get isComplete(){return this._modelState.get().value!==0&&this._modelState.get().value!==4}get timestamp(){return this._timestamp}set shouldBeRemovedOnSend(e){this._shouldBeRemovedOnSend!==e&&(this._shouldBeRemovedOnSend=e,this._onDidChange.fire(Si))}get isCanceled(){return this._modelState.get().value===2}get completedAt(){let e=this._modelState.get();if(e.value===1||e.value===2||e.value===3)return e.completedAt}get completionTimestamp(){return this._completionTimestamp}get state(){let e=this._modelState.get().value;return e===1&&this._result?.errorDetails&&this.result?.errorDetails?.code!=="canceled"?3:e}get stateT(){return this._modelState.get()}get vote(){return this._vote}get followups(){return this._followups}get entireResponse(){return this._finalizedResponse||this._response}get result(){return this._result}get usage(){return this._usageObs.get()}get usageObs(){return this._usageObs}get completionTokenCount(){return this._completionTokenCountObs.get()}get completionTokenCountObs(){return this._completionTokenCountObs}get lastCallCompletionTokensKnown(){return this._lastCallCompletionTokensKnown}get elapsedMs(){return this._elapsedMs}get username(){return this.session.responderUsername}get agent(){return this._agent}get slashCommand(){return this._slashCommand}get agentOrSlashCommandDetected(){return this._agentOrSlashCommandDetected??!1}get usedContext(){return this._usedContext}get contentReferences(){return Array.from(this._contentReferences)}get codeCitations(){return this._codeCitations}get progressMessages(){return this._progressMessages}get isStale(){return this._isStale}get response(){let e=this._shouldBeRemovedOnSend?.afterUndoStop;return e?(this._responseView?.undoStop!==e&&(this._responseView=new iM(this._response,e)),this._responseView):this._finalizedResponse||this._response}get codeBlockInfos(){return this._codeBlockInfos}initializeCodeBlockInfos(e){if(this._codeBlockInfos)throw new Et("Code block infos have already been initialized");this._codeBlockInfos=[...e]}setBlockedState(e){this._shouldBeBlocked.set(e,void 0)}updateContent(e,n,o){this._response.updateContent(e,n,o)}resolveInlineReference(e,n){return this._response.resolveInlineReference(e,n)}addUndoStop(e){this._onDidChange.fire({reason:"undoStop",id:e.id}),this._response.updateContent(e,!0)}applyReference(e){e.kind==="usedContext"?this._usedContext=e:e.kind==="reference"&&(this._contentReferences.push(e),this._onDidChange.fire(Si))}applyCodeCitation(e){this._codeCitations.push(e),this._response.addCitation(e),this._onDidChange.fire(Si)}setAgent(e,n){this._agent=e,this._slashCommand=n,this._agentOrSlashCommandDetected=!e.isDefault||!!n,this._onDidChange.fire(Si)}setResult(e){if(this.isCanceled&&e.errorDetails){let{errorDetails:n,...o}=e;this._result=o}else this._result=e;this._onDidChange.fire(Si)}setUsage(e){this._parentUsage=e,this._lastCallCompletionTokensKnown=!0,this._setUsage(this._withSubagentCopilotCredits(e),!0)}restoreUsage(e,n,o){this._parentUsage=e,this._setUsage(this._withSubagentCopilotCredits(e),!o),o&&this._completionTokenCountObs.get()===void 0&&n!==void 0&&this._completionTokenCountObs.set(n,void 0),this._lastCallCompletionTokensKnown=o}updateHistoryMetadata(e,n){Ki(o=>{this._parentUsage=void 0,this._usageObs.set(void 0,o),this._completionTokenCountObs.set(void 0,o);for(let i of n)i.kind==="usage"&&this.setUsage(i);this._response.replaceAutoModeResolutions(n.filter(i=>i.kind==="autoModeResolution")),this.setResult({...this._result,details:e})})}setSubagentCopilotCredits(e,n){let o=this._subagentCopilotCredits.get(e);if(!Number.isFinite(n)||n<0||o!==void 0&&n<=o)return;this._subagentCopilotCredits.set(e,n);let i=this._parentUsage??{kind:"usage",promptTokens:0,completionTokens:0};this._setUsage(this._withSubagentCopilotCredits(i),!1)}_withSubagentCopilotCredits(e){let n=0;for(let o of this._subagentCopilotCredits.values())n+=o;return n===0?e:{...e,copilotCredits:(e.copilotCredits??0)+n}}_setUsage(e,n){let o=this._usageObs.get();if(o&&this.isSameUsage(o,e))return;let i=!o||o.promptTokens!==e.promptTokens||o.completionTokens!==e.completionTokens||o.outputBuffer!==e.outputBuffer;this._usageObs.set(e,void 0);let s=xte(e.modelTotals);if(s!==void 0)this._completionTokenCountObs.set(s,void 0);else if(n&&i){let a=this._completionTokenCountObs.get()??0;this._completionTokenCountObs.set(a+e.completionTokens,void 0)}this._onDidChange.fire(Si)}setElapsedMs(e){this._elapsedMs=Math.max(0,e)}isSameUsage(e,n){return e.promptTokens===n.promptTokens&&e.completionTokens===n.completionTokens&&e.outputBuffer===n.outputBuffer&&e.copilotCredits===n.copilotCredits&&e.sessionCopilotCredits===n.sessionCopilotCredits&&e.sessionCopilotCreditsStatus===n.sessionCopilotCreditsStatus&&Ge(e.promptTokenDetails,n.promptTokenDetails)&&Ge(e.contextUsage,n.contextUsage)&&Ge(e.latestModelCall,n.latestModelCall)&&Ge(e.modelTotals,n.modelTotals)}complete(e=Date.now()){this._complete(e,e)}completeWithoutTimestamp(){this._complete(Date.now(),void 0)}reopen(){if(this.isComplete){if(this._response.clear(),this._result?.errorDetails){let{errorDetails:e,...n}=this._result;this._result=n}this.completedAt!==void 0&&(this._timeSpentWaitingAccumulator+=Math.max(0,Date.now()-this.completedAt),this._timingChanged.trigger(void 0)),this._completionTimestamp=void 0,this._elapsedMs=void 0,this._modelState.set({value:0},void 0),this._onDidChange.fire(Si)}}_complete(e,n){if(this.isComplete)return;this._result?.errorDetails?.responseIsRedacted&&this._response.clear(),this._elapsedMs??=Math.max(0,e-this.confirmationAdjustedTimestamp.get());let o=this._result?.errorDetails&&this._result.errorDetails.code!=="canceled"?3:1;this._completionTimestamp=n,this._modelState.set({value:o,completedAt:e},void 0),this._onDidChange.fire({reason:"completedRequest"})}cancel(e=Date.now()){this._cancel(e,e)}cancelWithoutTimestamp(){this._cancel(Date.now(),void 0)}_cancel(e,n){for(let o of this._response.value)o.kind==="toolInvocation"&&o instanceof Im?o.cancelFromStreaming({type:5}):o instanceof $C?o.dismiss():o instanceof zC&&o.dismiss(void 0);this._elapsedMs??=Math.max(0,e-this.confirmationAdjustedTimestamp.get()),this._completionTimestamp=n,this._modelState.set({value:2,completedAt:e},void 0),this._onDidChange.fire({reason:"completedRequest"})}setFollowups(e){this._followups=e,this._onDidChange.fire(Si)}setVote(e){this._vote=e,this._onDidChange.fire(Si)}setEditApplied(e,n){return!this.response.value.includes(e)||!e.state?!1:(e.state.applied=n,this._onDidChange.fire(Si),!0)}adoptTo(e){this._session=e,this._onDidChange.fire(Si)}finalizeUndoState(){this._finalizedResponse=this.response,this._responseView=void 0,this._shouldBeRemovedOnSend=void 0}dispose(){super.dispose(),this._response.clear(),this._codeBlockInfos&&(this._codeBlockInfos.length=0)}toJSON(){let e=this._modelState.get(),n=this.isPendingConfirmation.get();return{responseId:this.id,result:this.result,responseMarkdownInfo:this.codeBlockInfos?.map(o=>({suggestionId:o.suggestionId})),followups:this.followups,modelState:e.value===0||e.value===4?{value:2,completedAt:Date.now()}:e,vote:this.vote,slashCommand:this.slashCommand,usedContext:this.usedContext,contentReferences:this.contentReferences,codeCitations:this.codeCitations,responseTimestamp:this._timestamp,timeSpentWaiting:(n?Date.now()-n.startedWaitingAt:0)+this._timeSpentWaitingAccumulator,promptTokens:this.usage?.promptTokens,completionTokens:this.completionTokenCount,lastCallCompletionTokens:this.usage&&this._lastCallCompletionTokensKnown?this.usage.completionTokens:void 0,outputBuffer:this.usage?.outputBuffer,promptTokenDetails:this.usage?.promptTokenDetails,...this.usage?.latestModelCall?{latestModelCall:this.usage.latestModelCall}:{},...this.usage?.contextUsage?{contextUsage:this.usage.contextUsage}:{},copilotCredits:this.usage?.copilotCredits,modelTotals:this.usage?.modelTotals,sessionCopilotCredits:this.usage?.sessionCopilotCredits,sessionCopilotCreditsStatus:this.usage?.sessionCopilotCreditsStatus,elapsedMs:this.elapsedMs??(this.completedAt?Math.max(0,this.completedAt-this.confirmationAdjustedTimestamp.get()):void 0)}}};aM=class{constructor(t,e,n){this.logger=e;this.sessionId=n;this._state=jh({debugName:"inputModelState",equalsFn:Ge},t),this.state=this._state}get intendedModel(){return this._intendedModel}setIntendedModel(t){this._intendedModel=t}setState(t){let e=this._state.get();Rte(t,e,this.logger,this.sessionId),this._state.set({attachments:[],mode:{id:"agent",kind:"agent"},selectedModel:void 0,inputText:"",selections:[],...e,...t,contrib:{...e?.contrib,...t.contrib},origin:t.origin},void 0)}clearState(){this._state.set(void 0,void 0)}toJSON(){let t=this.state.get();if(!t)return;let e=t.attachments.filter(n=>!(F4(n)||N4(n)&&V4(n.value)));return{contrib:t.contrib,attachments:e.map(om.toExport),mode:t.mode,selectedModel:t.selectedModel?{identifier:t.selectedModel.identifier,metadata:t.selectedModel.metadata,modelConfiguration:t.modelConfiguration,modelConfigurationIsTransient:t.modelConfigurationIsTransient}:void 0,inputText:t.inputText,selections:t.selections,permissionLevel:t.permissionLevel}}};xm=class extends D{constructor(e,n,o,i,s,a){super();this.logService=o;this.chatAgentService=i;this.chatEditingService=s;this.chatService=a;this._onDidDispose=this._register(new R);this.onDidDispose=this._onDidDispose.event;this._onDidChange=this._register(new R);this.onDidChange=this._onDidChange.event;this._pendingRequests=[];this._onDidChangePendingRequests=this._register(new R);this.onDidChangePendingRequests=this._onDidChangePendingRequests.event;this.pendingRequestHandoffs=qn(this,[]);this._isImported=!1;this._isDeleted=!1;this._canUseTools=!0;this.currentEditedFileEvents=new je;this._checkpoint=void 0;let l=e?.value,c=f7(l),u=c&&Ete(l);l&&!c&&this.logService.warn(`ChatModel#constructor: Loaded malformed session data: ${JSON.stringify(l)}`),this._isImported=!!l&&c&&!u,n.resource?(this._sessionId=zx(n.resource),this._sessionResource=n.resource):u?(this._sessionId=l.sessionId,this._sessionResource=$l.forSession(l.sessionId)):(this._sessionId=Ee(),this._sessionResource=$l.forSession(this._sessionId)),this._disableBackgroundKeepAlive=n.disableBackgroundKeepAlive??!1,this._timestamp=u&&l.creationDate||Date.now(),this._requests=l?this._deserialize(l):[],this._customTitle=u?l.customTitle:void 0,u&&l.sessionCostInfo&&this.setSessionCost(l.sessionCostInfo);let p=n.inputState||(u&&l.inputState?l.inputState:void 0);if(this.inputModel=new aM(p&&Cte(p),this.logService,this._sessionId),this.dataSerializer=e?.serializer,this._initialResponderUsername=l?.responderUsername,this._repoData=u&&l.repoData?l.repoData:void 0,this._workingDirectory=u&&l.workingDirectory?S.parse(l.workingDirectory):void 0,u&&l.pendingRequests&&(this._pendingRequests=this._deserializePendingRequests(l.pendingRequests)),this._initialLocation=l?.initialLocation??n.initialLocation,this.sessionTypeSelectionReason=n.sessionTypeSelectionReason,this._canUseTools=n.canUseTools,this.isReadOnly=n.isReadOnly??am(!1),this.isInputBlocked=n.isInputBlocked??am(!1),this.historyStatus=n.historyStatus??am(void 0),this.modelConfigurationState=n.modelConfigurationState,this.backgroundShellCount=n.backgroundShellCount,this.canvasContext=n.canvasContext,this.lastRequestObs=Ii(this,this.onDidChange,()=>this._requests.at(-1)),this._register(Qo(m=>{let g=this.lastRequestObs.read(m);g?.response&&m.store.add(g.response.onDidChange(async y=>{!this._editingSession||y.reason!=="completedRequest"||this._onDidChange.fire({kind:"completedRequest",request:g})}))})),this.requestInProgress=this.lastRequestObs.map((m,g)=>m?.response?.isInProgress.read(g)??!1),this.hasActiveRequest=this.lastRequestObs.map((m,g)=>m?.response?.isIncomplete.read(g)??!1),this.requestNeedsInput=this.lastRequestObs.map((m,g)=>{let y=m?.response?.isPendingConfirmation.read(g);if(y)return{title:this.title,detail:y.detail}}),this.initialLocation==="panel"&&!n.disableBackgroundKeepAlive){let m=this._register(new Kn);this._register(Qo(g=>{let y=this.requestInProgress.read(g),h=this.requestNeedsInput.read(g),I=y||!!h;I&&!m.value?m.value=a.acquireExistingSession(this._sessionResource,"ChatModel#requestInProgressKeepAlive"):!I&&m.value&&m.clear()}))}}static getDefaultTitle(e){let n=e.at(0)?.message??"";return(typeof n=="string"?n:n.text).split(`
`)[0].substring(0,200)}setPendingRequestHandoffs(e){Gt(this.pendingRequestHandoffs.get(),e)||this.pendingRequestHandoffs.set(e,void 0)}get repoData(){return this._repoData}setRepoData(e){this._repoData=e}get workingDirectory(){return this._workingDirectory}setWorkingDirectory(e){this._workingDirectory=e}getPendingRequests(){return this._pendingRequests}setPendingRequests(e){let n=new Map(this._pendingRequests.map(i=>[i.request.id,i])),o=[];for(let{requestId:i,kind:s}of e){let a=n.get(i);a&&o.push(a.kind===s?a:{request:a.request,kind:s,sendOptions:a.sendOptions})}this._pendingRequests.length=0,this._pendingRequests.push(...o),this._onDidChangePendingRequests.fire()}replacePendingRequests(e){this._pendingRequests.length===e.length&&e.every((n,o)=>this._pendingRequests[o]===n)||(this._pendingRequests.length=0,this._pendingRequests.push(...e),this._onDidChangePendingRequests.fire())}addPendingRequest(e,n,o){let i={request:e,kind:n,sendOptions:o};if(n==="steering"){let s=0;for(let a=0;a<this._pendingRequests.length&&this._pendingRequests[a].kind==="steering";a++)s=a+1;this._pendingRequests.splice(s,0,i)}else this._pendingRequests.push(i);return this._onDidChangePendingRequests.fire(),i}removePendingRequest(e){let n=this._pendingRequests.findIndex(o=>o.request.id===e);n!==-1&&(this._pendingRequests.splice(n,1),this._onDidChangePendingRequests.fire())}dequeuePendingRequest(){let e=this._pendingRequests.shift();return e&&this._onDidChangePendingRequests.fire(),e}dequeueSteeringBatch(){let e=!!this._pendingRequests.at(0)?.sendOptions.isSystemInitiated,n=[];for(;this._pendingRequests.at(0)?.kind==="steering"&&!!this._pendingRequests[0].sendOptions.isSystemInitiated===e;)n.push(this._pendingRequests.shift());return n.length>0&&this._onDidChangePendingRequests.fire(),n}clearPendingRequests(){this._pendingRequests.length>0&&(this._pendingRequests.length=0,this._onDidChangePendingRequests.fire())}get sessionId(){return this._sessionId}get sessionResource(){return this._sessionResource}get hasRequests(){return this._requests.length>0}get lastRequest(){return this._requests.at(-1)}get sessionCostInfo(){return this._sessionCostInfo?{credits:this.sessionCost,status:this.sessionCostStatus}:void 0}setSessionCost(e){if(typeof e.credits!="number"||!Number.isFinite(e.credits)||e.credits<0)return;let n=this.sessionCostInfo,o=e.status==="complete"||e.status==="partial"||e.status==="unavailable"?e.status:void 0,i=Math.max(e.credits,this._sessionCostInfo?.credits??0);this._sessionCostInfo={credits:i,status:o==="complete"&&fy(i,e.credits)?"partial":o},this._sessionCostResponseStatus=this._lastReportedSessionUsage()?.sessionCopilotCreditsStatus,(n?.credits!==this.sessionCost||n?.status!==this.sessionCostStatus)&&this._onDidChange.fire({kind:"setSessionCost"})}_resetSessionCost(){this._sessionCostInfo=void 0,this._sessionCostResponseStatus=void 0}get sessionCost(){let e=0,n=0,o=0;for(let i of this._requests){let s=i.response?.usage;if(typeof s?.copilotCredits=="number"){let a=s.copilotCredits-n,l=e+a;n=l-e-a,e=l}typeof s?.sessionCopilotCredits=="number"&&(o=Math.max(o,s.sessionCopilotCredits))}return Math.max(e,o,this._sessionCostInfo?.credits??0)}_lastReportedSessionUsage(){for(let e=this._requests.length-1;e>=0;e--){let n=this._requests[e].response?.usage;if(n?.sessionCopilotCreditsStatus!==void 0)return n}}get sessionCostStatus(){let e=this._lastReportedSessionUsage(),n=this._sessionCostInfo,o=this.sessionCost;if(!n){let i=e?.sessionCopilotCreditsStatus;return i==="unavailable"&&o>0||i==="complete"&&fy(o,e?.sessionCopilotCredits??-1)?"partial":i}if(e?.sessionCopilotCreditsStatus!==this._sessionCostResponseStatus){if(e?.sessionCopilotCreditsStatus==="partial"||e?.sessionCopilotCreditsStatus==="unavailable")return o>0?"partial":e.sessionCopilotCreditsStatus;if(e?.sessionCopilotCreditsStatus==="complete"&&!fy(o,e.sessionCopilotCredits??-1))return"complete"}return fy(o,n.credits)?fy(o,e?.sessionCopilotCredits??-1)?n.status!==void 0||e?.sessionCopilotCreditsStatus!==void 0?"partial":void 0:e?.sessionCopilotCreditsStatus:n.status==="unavailable"&&o>0?"partial":n.status}get timestamp(){return this._timestamp}get timing(){let e=this._requests.at(-1),n=e?.response,o=e?.timestamp,i=n?.completedAt??n?.timestamp;return{created:this._timestamp,lastRequestStarted:o,lastRequestEnded:i}}get lastMessageDate(){return this._requests.at(-1)?.timestamp??this._timestamp}get _defaultAgent(){return this.chatAgentService.getDefaultAgent("panel","ask")}get responderUsername(){return this._defaultAgent?.fullName??this._initialResponderUsername??""}get isImported(){return this._isImported}get isDeleted(){return this._isDeleted}markDeleted(){this._isDeleted=!0}get customTitle(){return this._customTitle}get title(){return this._customTitle||xm.getDefaultTitle(this._requests)}get hasCustomTitle(){return this._customTitle!==void 0}get editingSession(){return this._editingSession}get initialLocation(){return this._initialLocation}get canUseTools(){return this._canUseTools}get willKeepAlive(){return!this._disableBackgroundKeepAlive}startEditingSession(e,n){let o=this._editingSession??=this._register(n?this.chatEditingService.transferEditingSession(this,n):e?this.chatEditingService.startOrContinueGlobalEditingSession(this):this.chatEditingService.createEditingSession(this));if(!this._disableBackgroundKeepAlive){let i=this._register(new Kn);this._register(Qo(s=>{let a=o.entries.read(s).some(l=>l.state.read(s)===0);a&&!i.value?i.value=this.chatService.acquireExistingSession(this._sessionResource,"ChatModel#modifiedEditsKeepAlive"):!a&&i.value&&i.clear()}))}this._register(Qo(i=>{this._setDisabledRequests(o.requestDisablement.read(i))}))}notifyEditingAction(e){let n=e.outcome==="accepted"?1:e.outcome==="rejected"?2:e.outcome==="userModified"?3:null;n!==null&&(!this.currentEditedFileEvents.has(e.uri)||this.currentEditedFileEvents.get(e.uri)?.eventKind===1)&&this.currentEditedFileEvents.set(e.uri,{eventKind:n,uri:e.uri})}_deserialize(e){let n=Rn(e,{serializer:!0})?e.value.requests:e.requests;if(!Array.isArray(n))return this.logService.error(`Ignoring malformed session data: ${JSON.stringify(e)}`),[];try{return n.map(o=>this._deserializeRequest(o))}catch(o){return this.logService.error("Failed to parse chat data",o),[]}}_deserializeRequest(e){let n=typeof e.message=="string"?this.getParsedRequestFromString(e.message):p7(e.message),o=this.reviveVariableData(e.variableData),i=typeof e.timestamp=="number"&&e.timestamp>0?e.timestamp:void 0,s=new nE({session:this,message:n,variableData:o,timestamp:i,fallbackTimestamp:this._timestamp,restoredId:e.requestId,agentHostMetadata:e.agentHostMetadata,confirmation:e.confirmation,editedFileEvents:e.editedFileEvents,modelId:e.modelId,modelConfiguration:e.modelConfiguration,modeInfo:e.modeInfo,isSystemInitiated:e.isSystemInitiated,requestSource:Ste(e,n.text),artifactRequest:e.artifactRequest,isHiddenFromTranscript:e.hiddenFromTranscript,isRequestHiddenFromTranscript:e.requestHiddenFromTranscript,systemInitiatedLabel:e.systemInitiatedLabel,terminalExecutionId:e.terminalExecutionId,origin:i7(e.origin)});if(s.shouldBeRemovedOnSend=e.isHidden?{requestId:e.requestId}:e.shouldBeRemovedOnSend,e.response||e.result||e.responseErrorDetails){let a=e.agent&&"metadata"in e.agent?FC(e.agent):void 0,l="responseErrorDetails"in e?{errorDetails:e.responseErrorDetails}:e.result,c=e.modelState||{value:e.isCanceled?2:1,completedAt:Date.now()};if((c.value===0||c.value===4)&&(c={value:2,completedAt:Date.now()}),e.response)for(let u of e.response)Rn(u,{kind:!0})&&(u.kind==="questionCarousel"||u.kind==="planReview")&&(u.isUsed=!0);s.response=new Sm({responseContent:e.response??[new at(e.response)],session:this,agent:a,slashCommand:e.slashCommand,requestId:s.id,modelState:c,completionTimestamp:e.modelState&&"completedAt"in e.modelState&&Number.isFinite(e.modelState.completedAt)&&e.modelState.completedAt>0?e.modelState.completedAt:null,vote:e.vote,timestamp:typeof e.responseTimestamp=="number"&&e.responseTimestamp>0?e.responseTimestamp:i,result:l,followups:e.followups,restoredId:e.responseId,timeSpentWaiting:e.timeSpentWaiting,elapsedMs:e.elapsedMs,shouldBeBlocked:s.shouldBeBlocked.get(),codeBlockInfos:e.responseMarkdownInfo?.map(u=>({suggestionId:u.suggestionId}))}),s.response.shouldBeRemovedOnSend=e.isHidden?{requestId:e.requestId}:e.shouldBeRemovedOnSend,(typeof e.completionTokens=="number"||typeof e.promptTokens=="number"||typeof e.copilotCredits=="number"||typeof e.sessionCopilotCredits=="number")&&s.response.restoreUsage({kind:"usage",promptTokens:e.promptTokens??0,completionTokens:e.lastCallCompletionTokens??(e.modelTotals===void 0?e.completionTokens??0:0),outputBuffer:e.outputBuffer,promptTokenDetails:e.promptTokenDetails,latestModelCall:e.latestModelCall,contextUsage:e.contextUsage,copilotCredits:e.copilotCredits,modelTotals:e.modelTotals,sessionCopilotCredits:e.sessionCopilotCredits,sessionCopilotCreditsStatus:e.sessionCopilotCreditsStatus},e.completionTokens,e.lastCallCompletionTokens!==void 0),e.usedContext&&s.response.applyReference(en(e.usedContext)),e.contentReferences?.forEach(u=>s.response.applyReference(en(u))),e.codeCitations?.forEach(u=>s.response.applyCodeCitation(en(u)))}return s}reviveVariableData(e){let n=e&&Array.isArray(e.variables)?e:{variables:[]};return n.variables=n.variables.map(om.fromExport),n}getParsedRequestFromString(e){let n=[new bm(new lr(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:n}}_deserializePendingRequests(e){try{return e.map(n=>({id:n.id,request:this._deserializeRequest(n.request),kind:n.kind,sendOptions:{...n.sendOptions,userSelectedTools:n.sendOptions.userSelectedTools?am(n.sendOptions.userSelectedTools):void 0}}))}catch(n){return this.logService.error("Failed to parse pending chat requests",n),[]}}getRequests(){return this._requests}resetCheckpoint(){for(let e of this._requests)e.setShouldBeBlocked(!1),e.response&&e.response.setBlockedState(!1)}setCheckpoint(e){let n,o=-1;if(!(e!==void 0&&(this._requests.forEach((i,s)=>{i.id===e&&(o=s,n=i,i.setShouldBeBlocked(!0))}),!n))){for(let i=this._requests.length-1;i>=0;i-=1){let s=this._requests[i];this._checkpoint&&!n?(s.setShouldBeBlocked(!1),s.response&&s.response.setBlockedState(!1)):n&&i>=o?(s.setShouldBeBlocked(!0),s.response&&s.response.setBlockedState(!0)):n&&i<o&&(s.setShouldBeBlocked(!1),s.response&&s.response.setBlockedState(!1))}this._checkpoint=n}}get checkpoint(){return this._checkpoint}_setDisabledRequests(e){this._requests.forEach(n=>{let o=e.find(i=>i.requestId===n.id);n.shouldBeRemovedOnSend=o,n.response&&(n.response.shouldBeRemovedOnSend=o)}),this._onDidChange.fire({kind:"setHidden"})}addRequest(e,n,o,i,s,a,l,c,u,p,m,g,y,h,I,x,E,T,P,M,X,N,ae,Y,W,J){let we=W?.index??this._requests.length;if(!Number.isInteger(we)||we<0||we>this._requests.length||W?.replace&&we===this._requests.length)throw new Et("Invalid chat request insertion index");let In=W?.replace?this._requests[we]:void 0,Wt=[...this.currentEditedFileEvents.values()];this.currentEditedFileEvents.clear();let de=T===void 0?Date.now():typeof T=="number"&&Number.isFinite(T)&&T>0?T:void 0,j=new nE({restoredId:y,session:this,message:e,variableData:n,timestamp:de,fallbackTimestamp:this._timestamp,attempt:o,modeInfo:i,confirmation:l,locationData:c,attachedContext:u,isCompleteAddedRequest:p,modelId:m,modelConfiguration:ae,agentHostMetadata:Y,editedFileEvents:Wt.length?Wt:void 0,userSelectedTools:g,isSystemInitiated:h,requestSource:N,artifactRequest:J,isHiddenFromTranscript:P,isRequestHiddenFromTranscript:X,systemInitiatedLabel:I,terminalExecutionId:x,isTerminalCommand:E,origin:M});return j.response=new Sm({responseContent:[],session:this,agent:s,slashCommand:a,requestId:j.id,isCompleteAddedRequest:p,codeBlockInfos:void 0}),this._requests.splice(we,In?1:0,j),dy(this.sessionResource,cy.RequestUiUpdated),this._onDidChange.fire({kind:"addRequest",request:j,...W?{index:we,replacedRequest:In}:{}}),In?.response?.dispose(),j}setCustomTitle(e){this._customTitle=e,this._onDidChange.fire({kind:"setCustomTitle",title:e})}updateRequest(e,n,o){e.variableData=n,o!==void 0&&(e.agentHostMetadata=o),this._onDidChange.fire({kind:"changedRequest",request:e})}updateRequestModelId(e,n){e.modelId!==n&&(e.modelId=n,this._onDidChange.fire({kind:"changedRequest",request:e}))}adoptRequest(e){let n=e.session,o=n._requests.findIndex(i=>i.id===e.id);o!==-1&&(n._requests.splice(o,1),n._resetSessionCost(),e.adoptTo(this),e.response?.adoptTo(this),this._requests.push(e),n._onDidChange.fire({kind:"removeRequest",requestId:e.id,responseId:e.response?.id,reason:2}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,n,o,i){if(e.response||(e.response=new Sm({responseContent:[],session:this,requestId:e.id,codeBlockInfos:void 0})),e.response.isComplete)throw new Error("acceptResponseProgress: Adding progress to a completed response");n.kind==="usage"?e.response.setUsage(n):n.kind==="usedContext"||n.kind==="reference"?e.response.applyReference(n):n.kind==="codeCitation"?e.response.applyCodeCitation(n):n.kind==="move"?this._onDidChange.fire({kind:"move",target:n.uri,range:n.range}):n.kind==="codeblockUri"&&n.isEdit?(e.response.addUndoStop({id:n.undoStopId??Ee(),kind:"undoStop"}),e.response.updateContent(n,o,i)):n.kind==="progressTaskResult"?this.logService.error(`Couldn't handle progress: ${JSON.stringify(n)}`):e.response.updateContent(n,o,i)}removeRequest(e,n=0){let o=this._requests.findIndex(s=>s.id===e),i=this._requests[o];o!==-1&&(this._requests.splice(o,1),n!==3&&this._resetSessionCost(),this._onDidChange.fire({kind:"removeRequest",requestId:i.id,responseId:i.response?.id,reason:n}),i.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,n){e.response||(e.response=new Sm({responseContent:[],session:this,requestId:e.id,codeBlockInfos:void 0})),e.response.setResult(n)}setFollowups(e,n){e.response&&e.response.setFollowups(n)}setResponseModel(e,n){e.response=n,this._onDidChange.fire({kind:"addResponse",response:n})}toExport(){return{responderUsername:this.responderUsername,initialLocation:this.initialLocation,requests:this._requests.map(e=>{let n={...e.message,parts:e.message.parts.map(s=>s&&"toJSON"in s?s.toJSON():s)},o=e.response?.agent,i=o&&"toJSON"in o?o.toJSON():o?{...o}:void 0;return{requestId:e.id,message:n,variableData:g7.toExport(e.variableData),response:e.response?e.response.entireResponse.value.filter(s=>s.kind!=="voiceProgress").map(s=>s.kind==="treeData"?s.treeData:s.kind==="markdownContent"?s.content:s):void 0,shouldBeRemovedOnSend:e.shouldBeRemovedOnSend,agent:i,timestamp:e.requestTimestamp,confirmation:e.confirmation,editedFileEvents:e.editedFileEvents,modelId:e.modelId,modelConfiguration:e.modelConfiguration,...e.agentHostMetadata?{agentHostMetadata:e.agentHostMetadata}:{},modeInfo:e.modeInfo,isSystemInitiated:e.isSystemInitiated||void 0,...e.requestSource!==void 0?{requestSource:e.requestSource}:{},...e.artifactRequest?{artifactRequest:e.artifactRequest}:{},hiddenFromTranscript:e.isHiddenFromTranscript||void 0,...e.isRequestHiddenFromTranscript&&!e.isHiddenFromTranscript?{requestHiddenFromTranscript:!0}:{},systemInitiatedLabel:e.systemInitiatedLabel,terminalExecutionId:e.terminalExecutionId,origin:e.origin?r7(e.origin):void 0,...e.response?.toJSON()}})}}toJSON(){return{version:3,...this.toExport(),sessionId:this.sessionId,creationDate:this._timestamp,customTitle:this._customTitle,inputState:this.inputModel.toJSON(),workingDirectory:this._workingDirectory?.toString(),sessionCostInfo:this.sessionCostInfo}}dispose(){this._requests.forEach(e=>e.response?.dispose()),this._onDidDispose.fire(),this.setPendingRequestHandoffs([]),super.dispose(),this._requests.length=0,this.dataSerializer=void 0,this._editingSession=void 0}};xm=w([b(2,z),b(3,L5),b(4,e7),b(5,kB)],xm);(i=>{i.scheme=q.vscodeChatResponseResource;function t(s,a,l,c){return e(s,`/tool/${a}/${l}`+(c?`/${c}`:""))}i.createUri=t;function e(s,a,l){return S.from({scheme:i.scheme,authority:Gs(O.fromString(s.toString())),path:a,query:l})}function n(s){if(s.scheme!==i.scheme)return;let a=s.path.split("/");if(a.length<4)return;let[,l,c,u]=a;if(l==="tool")return{sessionResource:o(s),toolCallId:c,index:Number(u)}}i.parseUri=n;function o(s){try{return S.parse(Dg(s.authority).toString())}catch(a){if(a instanceof SyntaxError)return $l.forSession(s.authority);throw a}}})(y7||={})});var v7,Yit,I7=v(()=>{xr();it();te();Nh();lM();v7="http://_vscodecontentref_",Yit=new RegExp(`^(\\[.*?\\]\\(${v7}/\\d+\\))+$`)});function b7(r){if(r instanceof Uint8Array)return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(!r||typeof r!="object"||Array.isArray(r))return;let t=r,e=Object.keys(t).sort((o,i)=>Number(o)-Number(i));if(e.length===0)return;let n=new Uint8Array(e.length);for(let o=0;o<e.length;o++){let i=t[e[o]];if(e[o]!==String(o)||typeof i!="number"||!Number.isInteger(i)||i<0||i>255)return;n[o]=i}return n}var S7=v(()=>{Ve();si();Mi();xr();Ax();Kc();Me();it();te();ee();Nh();B4();W5();lM();dm();my();qh();I7()});function Em(r,t=oe){return Rv(r,t)?r.charAt(0).toUpperCase()+r.slice(1):r}var cM=v(()=>{si();Oe();fe();it();Tt()});var dM=v(()=>{ee()});var Pa=v(()=>{});var x7=v(()=>{});var C7=v(()=>{});var E7=v(()=>{C7()});var w7=v(()=>{te()});var R7=v(()=>{w7()});var T7=v(()=>{qo();it()});function Lte(r,t){let e=_4(r.toString());return t?`${e.replace(/#/g,"%23")}#${t}`:e}function Ote(r){return{type:"hook",id:Lte(r),uri:r.toString(),name:xn(r)}}function fM(r){if(!r||typeof r!="object")return;let t=r,e=typeof t.type=="string"?t.type:void 0,n=t.transport==="sse"||t.transport==="http"?t.transport:void 0,o=typeof t.command=="string"?t.command:void 0,i=typeof t.url=="string"?t.url:void 0,s=Array.isArray(t.args)?t.args.filter(h=>typeof h=="string"):void 0,a=t.env&&typeof t.env=="object"?Object.fromEntries(Object.entries(t.env).filter(([,h])=>typeof h=="string"||typeof h=="number"||h===null).map(([h,I])=>[h,I])):void 0,l=typeof t.envFile=="string"?t.envFile:void 0,c=typeof t.cwd=="string"?t.cwd:void 0,u=t.headers&&typeof t.headers=="object"?Object.fromEntries(Object.entries(t.headers).filter(([,h])=>typeof h=="string").map(([h,I])=>[h,I])):void 0,p=t.oauth&&typeof t.oauth=="object"?t.oauth:void 0,m=(typeof p?.clientId=="string"?p.clientId:void 0)??(typeof t.oauthClientId=="string"?t.oauthClientId:void 0),g=m?{clientId:m}:void 0,y=t.dev&&typeof t.dev=="object"?t.dev:void 0;if(e!=="ws"){if(e==="stdio"||!e&&o)return o?{type:"stdio",command:o,args:s,env:a,envFile:l,cwd:c,dev:y}:void 0;if(e==="http"||e==="streamable-http"||e==="sse"||!e&&i)return i?{type:"http",...e==="sse"||n==="sse"?{transport:"sse"}:{},url:i,headers:u,...g?{oauth:g}:{},dev:y}:void 0}}function Fte(r,t,e,n="posix"){if(!r.includes(e))return r;if((n==="powershell"?Nte:Ute).test(t))return r.replaceAll(e,t);let i=yo(e),s=new RegExp(`(["']?)`+i+"([\\w./\\\\~:-]*)\\1","g");return r.replace(s,(a,l,c)=>{let u=t+c;return n==="powershell"?`'${u.replace(/'/g,"''")}'`:`'${u.replace(/'/g,"'\\''")}'`})}function Hte(r,t,e){let n=t.fsPath,o=so(r,i=>typeof i=="string"?i.replaceAll(e.token,n):void 0);for(let i of["command","windows","linux","osx","bash","powershell"])if(typeof r[i]=="string"){let s=i==="windows"||i==="powershell"||i==="command"&&oe?"powershell":"posix";o[i]=Fte(r[i],n,e.token,s)}return o.env={...o.env&&typeof o.env=="object"&&!Array.isArray(o.env)?o.env:{},[e.envVar]:n},o}function Vte(r){if(r.type!==void 0&&r.type!=="command")return;let t=typeof r.command=="string"&&r.command.length>0,e=typeof r.bash=="string"&&r.bash.length>0,n=typeof r.powershell=="string"&&r.powershell.length>0,o=typeof r.windows=="string"&&r.windows.length>0,i=typeof r.linux=="string"&&r.linux.length>0,s=typeof r.osx=="string"&&r.osx.length>0;if(!t&&!e&&!n&&!o&&!i&&!s)return;let a=o?r.windows:n?r.powershell:void 0,l=i?r.linux:e?r.bash:void 0,c=s?r.osx:e?r.bash:void 0,u=typeof r.timeout=="number"?r.timeout:typeof r.timeoutSec=="number"?r.timeoutSec:void 0;return{...t&&{command:r.command},...a&&{windows:a},...l&&{linux:l},...c&&{osx:c},...typeof r.env=="object"&&r.env!==null&&{env:r.env},...u!==void 0&&{timeout:u}}}function P7(r,t,e){let n=Vte(r);if(!n)return;let o,i=typeof r.cwd=="string"?r.cwd:void 0;return i?i.startsWith("~/")?o=S.joinPath(e,i.substring(2)):Gn(i)?o=S.file(i):t&&(o=ge(t,i)):o=t,{...n,cwd:o}}function Bte(r,t,e){if(!r||typeof r!="object")return[];let n=r,o=[],i=n.hooks;if(i!==void 0&&Array.isArray(i))for(let s of i){if(!s||typeof s!="object")continue;let a=P7(s,t,e);a&&o.push(a)}else{let s=P7(n,t,e);s&&o.push(s)}return o}function qte(r,t,e,n){if(!t||typeof t!="object")return[];let o=t;if(o.disableAllHooks===!0)return[];let i=o.hooks,s=i&&typeof i=="object"&&!Array.isArray(i)?i:o,a=[],l=Ote(r);for(let c of Object.keys(s)){let u=Wte[c];if(!u)continue;let p=s[c];if(!Array.isArray(p))continue;let m=[];for(let g of p)m.push(...Bte(g,e,n));m.length>0&&a.push({type:u,commands:m,uri:r,originalId:c,customization:l})}return a}function iE(r,t,e,n,o,i){let s=t,a=c=>{Object.assign(c,Hte(c,e,i))};for(let c of Object.values(s.hooks??{}))if(Array.isArray(c))for(let u of c){if(!u||typeof u!="object")continue;let p=u;if(Array.isArray(p.hooks))for(let m of p.hooks)a(m);else a(p)}return qte(r,so(t,c=>typeof c=="string"?c.replaceAll(i.token,e.fsPath):void 0),n,o)}var pM,hd,uM,k7,mM,gM,A7,kte,Ate,Dte,wm,_te,Mte,Pat,Ute,Nte,Wte,hM=v(()=>{qo();Xt();Oe();fe();it();Tt();Ie();te();dM();Pa();Bl();x7();ql();E7();R7();T7();(t=>{function r(e,n){return e===n?!0:!e||!n?!1:e.command===n.command&&e.windows===n.windows&&e.linux===n.linux&&e.osx===n.osx&&Tn(e.cwd,n.cwd)&&Ge(e.env,n.env)&&e.timeout===n.timeout&&Tn(e.sourceUri,n.sourceUri)}t.isEquals=r})(pM||={});hd={token:"${PLUGIN_ROOT}",envVar:"PLUGIN_ROOT"},uM={token:"${CLAUDE_PLUGIN_ROOT}",envVar:"CLAUDE_PLUGIN_ROOT"},k7=[hd,uM],mM=k7.map(r=>r.token),gM=k7.map(r=>r.envVar),A7={format:0,manifestPath:"plugin.json",hookConfigPath:"hooks.json",pluginRootTokens:mM,pluginRootEnvVars:gM,hookPluginRoot:hd,parseHooks(r,t,e,n,o){return iE(r,t,e,n,o,hd)}},kte={...A7,manifestPath:".github/plugin/plugin.json"},Ate={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootTokens:mM,pluginRootEnvVars:gM,hookPluginRoot:uM,parseHooks(r,t,e,n,o){return iE(r,t,e,n,o,uM)}},Dte={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootTokens:mM,pluginRootEnvVars:gM,hookPluginRoot:hd,parseHooks(r,t,e,n,o){return iE(r,t,e,n,o,hd)}},wm="com.github.copilot",_te={format:3,manifestPath:"plugin.json",hookConfigPath:`${wm}/hooks/hooks.json`,componentPaths:{commands:`${wm}/commands`,skills:"skills",agents:`${wm}/agents`,rules:`${wm}/rules`,hooks:`${wm}/hooks/hooks.json`,mcpServers:"mcp.json",automations:"automations"},manifestExtensionNamespace:wm,requiresManifest:!0,pluginRootTokens:[],pluginRootEnvVars:[],hookPluginRoot:hd,parseHooks(r,t,e,n,o){return iE(r,t,e,n,o,hd)}},Mte={0:A7,1:Ate,2:Dte,3:_te},Pat=Object.freeze([...new Set([kte,...Object.values(Mte)].map(r=>r.manifestPath))].sort((r,t)=>t.length-r.length));Ute=/^[a-zA-Z0-9_./:-]+$/,Nte=/^[a-zA-Z0-9_./\\:-]+$/;Wte={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",UserPromptTransformed:"UserPromptTransformed",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",userPromptTransformed:"UserPromptTransformed",preToolUse:"PreToolUse",postToolUse:"PostToolUse",preCompact:"PreCompact",subagentStart:"SubagentStart",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"}});var yM=v(()=>{ee()});var vM,D7,Jr,Mat,_7=v(()=>{ee();yM();vM=(p=>(p.SessionStart="SessionStart",p.SessionEnd="SessionEnd",p.UserPromptSubmit="UserPromptSubmit",p.UserPromptTransformed="UserPromptTransformed",p.PreToolUse="PreToolUse",p.PostToolUse="PostToolUse",p.PreCompact="PreCompact",p.SubagentStart="SubagentStart",p.SubagentStop="SubagentStop",p.Stop="Stop",p.ErrorOccurred="ErrorOccurred",p))(vM||{}),D7={vscode:{SessionStart:"SessionStart",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop"},"github-copilot":{sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",userPromptTransformed:"UserPromptTransformed",preToolUse:"PreToolUse",postToolUse:"PostToolUse",preCompact:"PreCompact",subagentStart:"SubagentStart",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"},claude:{SessionStart:"SessionStart",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop"},undefined:{SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred"}},Jr={SessionStart:{label:d(15282,null),description:d(15281,null)},UserPromptSubmit:{label:d(15290,null),description:d(15289,null)},UserPromptTransformed:{label:d(15292,null),description:d(15291,null)},PreToolUse:{label:d(15278,null),description:d(15277,null)},PostToolUse:{label:d(15270,null),description:d(15269,null)},PreCompact:{label:d(15274,null),description:d(15273,null)},SubagentStart:{label:d(15286,null),description:d(15285,null)},SubagentStop:{label:d(15288,null),description:d(15287,null)},Stop:{label:d(15284,null),description:d(15283,null)},SessionEnd:{label:d(15280,null),description:d(15279,null)},ErrorOccurred:{label:d(15264,null),description:d(15263,null)}},Mat={sessionStart:Jr.SessionStart,sessionEnd:Jr.SessionEnd,userPromptSubmitted:Jr.UserPromptSubmit,userPromptTransformed:Jr.UserPromptTransformed,preToolUse:Jr.PreToolUse,preMcpToolCall:{label:d(15276,null),description:d(15275,null)},postToolUse:Jr.PostToolUse,postToolUseFailure:{label:d(15272,null),description:d(15271,null)},errorOccurred:Jr.ErrorOccurred,agentStop:Jr.Stop,subagentStart:Jr.SubagentStart,subagentStop:Jr.SubagentStop,preCompact:Jr.PreCompact,permissionRequest:{label:d(15268,null),description:d(15267,null)},notification:{label:d(15266,null),description:d(15265,null)}}});function M7(r,t){return Object.fromEntries(Object.entries(D7[r]).map(([e,n])=>[e,{...t,description:Jr[n]?.description}]))}function L7(r,t){return t===1&&r.windows?r.windows:t===2&&r.osx?r.osx:t===3&&r.linux?r.linux:r.command}var zte,cr,Gte,Kte,jte,Qte,Jte,Yte,Gat,O7=v(()=>{ee();te();it();Oe();cM();fe();hM();_7();yM();(t=>{function r(e,n){if(e===n)return!0;if(!e||!n)return!1;for(let o of Object.values(vM)){let i=e[o],s=n[o];if(i?.length!==s?.length)return!1;if(i&&s){for(let a=0;a<i.length;a++)if(!pM.isEquals(i[a],s[a]))return!1}}return!0}t.isEquals=r})(zte||={});cr={type:d(15254,null),command:d(15241,null),windows:d(15256,null),linux:d(15247,null),osx:d(15249,null),bash:d(15239,null),powershell:d(15250,null),exec:d(15245,null),args:d(15238,null),cwd:d(15243,null),env:d(15244,null),timeout:d(15252,null),timeoutSec:d(15253,null),matcher:d(15248,null),url:d(15255,null),headers:d(15246,null),allowedEnvVars:d(15237,null),prompt:d(15251,null)},Gte={type:"object",additionalProperties:!0,required:["type"],anyOf:[{required:["command"]},{required:["windows"]},{required:["linux"]},{required:["osx"]},{required:["bash"]},{required:["powershell"]}],errorMessage:d(15242,null),properties:{type:{type:"string",enum:["command"],description:cr.type},command:{type:"string",description:cr.command},windows:{type:"string",description:cr.windows},linux:{type:"string",description:cr.linux},osx:{type:"string",description:cr.osx},cwd:{type:"string",description:cr.cwd},env:{type:"object",additionalProperties:{type:"string"},description:cr.env},timeout:{type:"number",default:30,description:cr.timeout}}},Kte={type:"array",items:Gte};jte=M7("vscode",Kte),Qte={type:"object",additionalProperties:!0,required:["type"],anyOf:[{required:["command"]},{required:["bash"]},{required:["powershell"]}],errorMessage:d(15240,null),properties:{type:{type:"string",enum:["command"],description:cr.type},command:{type:"string",description:cr.command},bash:{type:"string",description:cr.bash},powershell:{type:"string",description:cr.powershell},cwd:{type:"string",description:cr.cwd},env:{type:"object",additionalProperties:{type:"string"},description:cr.env},timeoutSec:{type:"number",default:10,description:cr.timeoutSec}}},Jte={type:"array",items:Qte},Yte=M7("github-copilot",Jte),Gat={$schema:"http://json-schema.org/draft-07/schema#",type:"object",description:d(15257,null),additionalProperties:!0,required:["hooks"],properties:{hooks:{type:"object",description:d(15258,null),additionalProperties:!0}},if:{required:["version"],properties:{version:{type:"number"}}},then:{properties:{version:{type:"number",description:d(15262,null)},hooks:{properties:Yte}}},else:{properties:{hooks:{deprecationMessage:d(15259,null),properties:jte}}},defaultSnippets:[{label:d(15260,null),description:d(15261,null),body:{version:1,hooks:{sessionStart:[{type:"command",command:'${1:echo "Session started" >> session.log}'}],preToolUse:[{type:"command",command:"${2:./scripts/validate.sh}",timeoutSec:15}]}}}]}});var Zat,elt,tlt,Xte,nlt,olt,rlt,ilt,slt,alt,llt,clt,dlt,ult,plt,mlt,glt,flt,hlt,ylt,vlt,Ilt,blt,Slt,xlt,Clt,Elt,wlt,Rlt,Tlt,Plt,klt,Alt,Dlt,_lt,Mlt,Llt,Olt,Ult,Nlt,Flt,Hlt,Wlt,Vlt,Blt,qlt,$lt,zlt,Glt,Klt,jlt,Qlt,Jlt,Ylt,Xlt,Zlt,ect,tct,nct,oct,rct,ict,sct,act,lct,cct,dct,Zte,ene,U7=v(()=>{te();ee();ro();Z();Zat=new C("debugType",void 0,{type:"string",description:d(16968,null)}),elt=new C("debugConfigurationType",void 0,{type:"string",description:d(16959,null)}),tlt=new C("debugState","inactive",{type:"string",description:d(16967,null)}),Xte="debugUx",nlt=new C(Xte,"default",{type:"string",description:d(16969,null)}),olt=new C("hasDebugged",!1,{type:"boolean",description:d(16977,null)}),rlt=new C("inDebugMode",!1,{type:"boolean",description:d(16979,null)}),ilt=new C("inDebugRepl",!1,{type:"boolean",description:d(16980,null)}),slt=new C("breakpointWidgetVisible",!1,{type:"boolean",description:d(16949,null)}),alt=new C("inBreakpointWidget",!1,{type:"boolean",description:d(16978,null)}),llt=new C("breakpointsFocused",!0,{type:"boolean",description:d(16947,null)}),clt=new C("watchExpressionsFocused",!0,{type:"boolean",description:d(17006,null)}),dlt=new C("watchExpressionsExist",!1,{type:"boolean",description:d(17005,null)}),ult=new C("variablesFocused",!0,{type:"boolean",description:d(17002,null)}),plt=new C("expressionSelected",!1,{type:"boolean",description:d(16973,null)}),mlt=new C("breakpointInputFocused",!1,{type:"boolean",description:d(16943,null)}),glt=new C("callStackItemType",void 0,{type:"string",description:d(16955,null)}),flt=new C("callStackSessionIsAttach",!1,{type:"boolean",description:d(16957,null)}),hlt=new C("callStackItemStopped",!1,{type:"boolean",description:d(16954,null)}),ylt=new C("callStackSessionHasOneThread",!1,{type:"boolean",description:d(16956,null)}),vlt=new C("callStackFocused",!0,{type:"boolean",description:d(16953,null)}),Ilt=new C("watchItemType",void 0,{type:"string",description:d(17007,null)}),blt=new C("canViewMemory",void 0,{type:"boolean",description:d(16958,null)}),Slt=new C("breakpointItemType",void 0,{type:"string",description:d(16945,null)}),xlt=new C("breakpointItemBytes",void 0,{type:"boolean",description:d(16944,null)}),Clt=new C("breakpointHasModes",!1,{type:"boolean",description:d(16942,null)}),Elt=new C("breakpointSupportsCondition",!1,{type:"boolean",description:d(16948,null)}),wlt=new C("loadedScriptsSupported",!1,{type:"boolean",description:d(16985,null)}),Rlt=new C("loadedScriptsItemType",void 0,{type:"string",description:d(16984,null)}),Tlt=new C("focusedSessionIsAttach",!1,{type:"boolean",description:d(16974,null)}),Plt=new C("focusedSessionIsNoDebug",!1,{type:"boolean",description:d(16975,null)}),klt=new C("stepBackSupported",!1,{type:"boolean",description:d(16990,null)}),Alt=new C("restartFrameSupported",!1,{type:"boolean",description:d(16988,null)}),Dlt=new C("stackFrameSupportsRestart",!1,{type:"boolean",description:d(16989,null)}),_lt=new C("jumpToCursorSupported",!1,{type:"boolean",description:d(16982,null)}),Mlt=new C("stepIntoTargetsSupported",!1,{type:"boolean",description:d(16991,null)}),Llt=new C("breakpointsExist",!1,{type:"boolean",description:d(16946,null)}),Olt=new C("debuggersAvailable",!1,{type:"boolean",description:d(16962,null)}),Ult=new C("debugExtensionAvailable",!0,{type:"boolean",description:d(16960,null)}),Nlt=new C("debugProtocolVariableMenuContext",void 0,{type:"string",description:d(16963,null)}),Flt=new C("debugSetVariableSupported",!1,{type:"boolean",description:d(16966,null)}),Hlt=new C("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:d(16964,null)}),Wlt=new C("debugSetExpressionSupported",!1,{type:"boolean",description:d(16965,null)}),Vlt=new C("breakWhenValueChangesSupported",!1,{type:"boolean",description:d(16950,null)}),Blt=new C("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:d(16951,null)}),qlt=new C("breakWhenValueIsReadSupported",!1,{type:"boolean",description:d(16952,null)}),$lt=new C("terminateDebuggeeSupported",!1,{type:"boolean",description:d(16993,null)}),zlt=new C("suspendDebuggeeSupported",!1,{type:"boolean",description:d(16992,null)}),Glt=new C("terminateThreadsSupported",!1,{type:"boolean",description:d(16994,null)}),Klt=new C("variableEvaluateNamePresent",!1,{type:"boolean",description:d(16996,null)}),jlt=new C("variableIsReadonly",!1,{type:"boolean",description:d(16999,null)}),Qlt=new C("variableValue",!1,{type:"string",description:d(17004,null)}),Jlt=new C("variableType",!1,{type:"string",description:d(17003,null)}),Ylt=new C("variableInterfaces",!1,{type:"array",description:d(16998,null)}),Xlt=new C("variableName",!1,{type:"string",description:d(17001,null)}),Zlt=new C("variableLanguage",!1,{type:"string",description:d(17000,null)}),ect=new C("variableExtensionId",!1,{type:"string",description:d(16997,null)}),tct=new C("exceptionWidgetVisible",!1,{type:"boolean",description:d(16972,null)}),nct=new C("multiSessionRepl",!1,{type:"boolean",description:d(16987,null)}),oct=new C("multiSessionDebug",!1,{type:"boolean",description:d(16986,null)}),rct=new C("disassembleRequestSupported",!1,{type:"boolean",description:d(16970,null)}),ict=new C("disassemblyViewFocus",!1,{type:"boolean",description:d(16971,null)}),sct=new C("languageSupportsDisassembleRequest",!1,{type:"boolean",description:d(16983,null)}),act=new C("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:d(16976,null)}),lct=new C("threadHasMultipleStackFrames",!1,{type:"boolean",description:d(16995,null)}),cct={enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:d(16981,null)},dct=A("debugService");(e=>(e.deserialize=n=>n,e.serialize=n=>n))(Zte||={});(e=>(e.deserialize=n=>({id:n.id,name:n.name,iconPath:n.iconPath&&{light:S.revive(n.iconPath.light),dark:S.revive(n.iconPath.dark)},iconClass:n.iconClass,visualization:n.visualization}),e.serialize=n=>n))(ene||={})});function Ql(r,t){let[e,n]=t.split("/");for(let o of r.resources){let[i,s]=o.type.split("/");if(i===e){if(!n||s===n)return o.id;break}}}var sE,hy=v(()=>{Z();sE=A("IMcpGalleryManifestService")});function yy(r,t={}){let e=Object.keys(t);if(!e.length)return r;let n=new RegExp(e.map(o=>yo(`{${o}}`)).join("|"),"g");return r.replace(n,o=>{let i=o.slice(1,-1);return t[i].value??`\${input:${i}}`})}var ka,vy,dr,aE,Iy,lE,Jl=v(()=>{Tt();Z();ka=A("IMcpGalleryService"),vy=A("IMcpManagementService"),dr=A("IAllowedMcpServersService"),aE="chat.mcp.access",Iy="chat.mcp.allowedServers",lE="chat.mcp.deniedServers"});function cE(r,t){if(r[t]!=="$"||r[t+1]!=="{")return;let e=t+2,n=1;for(;e<r.length;){if(r[e]==="{")n++;else if(r[e]==="}"&&(n--,n===0))break;e++}if(n!==0)return;let o=r.slice(t,e+1),i=r.substring(t+2,e),s=i.indexOf(":");return{replacement:s===-1?{id:o,name:i,inner:i}:{id:o,inner:i,name:i.slice(0,s),arg:i.slice(s+1)},end:e}}function IM(r){let t=0;for(let e=r.length-1;e>=0;e--)if(r[e]==="}")t++;else if(r[e]==="{"&&t>0&&(t--,e>0&&r[e-1]==="$"))return!0;return!1}var dE=v(()=>{});function bM(r,t=r.type==="stdio"?r.cwd:void 0){return r.type==="stdio"?{type:"stdio",command:r.command,args:r.args?[...r.args]:[],tools:["*"],...r.env&&{env:tne(r.env)},...t?{cwd:t}:{}}:{type:r.transport==="sse"?"sse":"http",url:r.url,tools:["*"],...r.headers&&{headers:{...r.headers}},...r.oauth?.clientId&&{oauthClientId:r.oauth.clientId}}}function uE(r){return r&&typeof r=="object"&&r.type==="local"?fM({...r,type:"stdio"}):fM(r)}function tne(r){return Object.fromEntries(Object.entries(r).filter(([,t])=>t!==null).map(([t,e])=>[t,String(e)]))}var pE=v(()=>{hM();Pa()});function SM({config:r,inputs:t}){if(t!==void 0&&(!Array.isArray(t)||t.length>0))return d(4546,null);if(!vd(r)||r.type!=="stdio"&&r.type!=="http")return d(4544,null);let e=r.type==="stdio"?nne:one;for(let[o,i]of Object.entries(r))if(i!==void 0&&!e.has(o))return d(4548,null,o);if(!(r.type==="stdio"?typeof r.command=="string"&&!!r.command.trim()&&(r.args===void 0||Array.isArray(r.args)&&r.args.every(o=>typeof o=="string"))&&(r.cwd===void 0||typeof r.cwd=="string")&&(r.env===void 0||vd(r.env)&&Object.values(r.env).every(o=>o===null||typeof o=="string"||typeof o=="number"&&Number.isFinite(o))):typeof r.url=="string"&&!!r.url.trim()&&(r.transport===void 0||r.transport==="http"||r.transport==="sse")&&(r.headers===void 0||vd(r.headers)&&Object.values(r.headers).every(o=>typeof o=="string"))&&(r.oauth===void 0||vd(r.oauth)&&Object.entries(r.oauth).every(([o,i])=>o==="clientId"&&typeof i=="string"))))return d(4544,null);if(JSON.stringify(r).includes("${input:"))return d(4547,null)}function N7(r){let t;try{t=JSON.parse(r)}catch(o){throw new Error(d(4543,null,o instanceof Error?o.message:String(o)))}let e=vd(t)?t.mcpServers:void 0;if(!vd(t)||e!==void 0&&!vd(e))throw new Error(d(4545,null));let n=[];for(let[o,i]of Object.entries(e??{})){let s=uE(i);s&&n.push([o,s])}return Object.fromEntries(n)}function vd(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}var nne,one,F7=v(()=>{te();ee();pE();Pa();nne=new Set(["type","command","args","env","cwd"]),one=new Set(["type","url","headers","transport","oauth"])});function by(r){let t=i=>d(4571,null,i);if(r.inputs!==void 0&&(!Array.isArray(r.inputs)||r.inputs.length>0))return t("inputs");let e=r.config;if(!Id(e))return t("configuration");let n=e.type??(typeof e.command=="string"?"stdio":"http");if(n!=="stdio"&&n!=="http")return t("type");let o=n==="stdio"?new Set(["type","command","args","env"]):new Set(["type","url","headers","transport"]);for(let i of Object.keys(e))if(!o.has(i)&&e[i]!==void 0)return t(i);if(n==="stdio"){if(typeof e.command!="string"||!e.command.trim())return t("command");if(e.args!==void 0&&(!Array.isArray(e.args)||e.args.some(i=>typeof i!="string")))return t("args");if(e.env!==void 0&&(!Id(e.env)||Object.values(e.env).some(i=>typeof i!="string"&&(typeof i!="number"||!Number.isFinite(i)))))return t("env")}else{if(typeof e.url!="string"||!e.url.trim())return t("url");if(e.transport!==void 0&&e.transport!=="http")return t("transport");if(e.headers!==void 0&&(!Id(e.headers)||Object.values(e.headers).some(i=>typeof i!="string")))return t("headers")}if(xM(e))return t("${...}")}function xM(r){return typeof r=="string"?r.includes("${"):Array.isArray(r)?r.some(xM):Id(r)&&Object.values(r).some(xM)}function Id(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function H7(r){let t=[],e=bo(r,t,{allowTrailingComma:!0,allowEmptyContent:!1});if(t.length||!Id(e))throw new Error(d(4569,null));let n=Object.hasOwn(e,"mcpServers"),o=n?e.mcpServers:e;if(!Id(o))throw new Error(d(4570,null));let i=[];for(let[s,a]of Object.entries(o)){let l=Id(a)?uE(a):void 0;l&&i.push([s,l])}return{wrapped:n,servers:Object.fromEntries(i)}}var bd,CM,Sy=v(()=>{qo();ee();pE();Pa();bd=".mcp.json",CM="workspace-dot-mcp."});function Aa(r,t){if(typeof r=="string"){let e=r.indexOf("${");for(;e!==-1;){let n=cE(r,e);n?.replacement.name==="input"&&n.replacement.arg!==void 0&&t.add(n.replacement.arg),e=r.indexOf("${",n?n.end+1:e+2)}}else if(Array.isArray(r))for(let e of r)Aa(e,t);else if(ve(r))for(let[e,n]of Object.entries(r))Aa(e,t),Aa(n,t)}function W7(r,t){let e=new Set(EM(r,t).map(([o])=>o)),n={...t};for(let o of Object.keys(n)){if(o==="type"||o==="command"||o==="url")continue;if(!e.has(o)){Reflect.deleteProperty(n,o);continue}let i=Reflect.get(r,o),s=Reflect.get(n,o);if(Array.isArray(i)&&Array.isArray(s)){let a=[...i];Reflect.set(n,o,s.filter(l=>{let c=a.findIndex(u=>Ge(u,l));return c===-1?!0:(a.splice(c,1),!1)}))}else ve(i)&&ve(s)&&Reflect.set(n,o,Object.fromEntries(Object.entries(s).filter(([a,l])=>!Ge(l,Reflect.get(i,a)))))}return n}function V7(r){let t=bM(r);return r.type==="stdio"?{...t,env:r.env}:t}function B7(r,t,e,n,o){return q7(t)===q7(e)?r:[...r.filter(([i])=>i!=="type"&&i!=="transport"),["type",n],["transport",o]]}function q7(r){return r.type==="stdio"?"stdio":r.transport==="sse"?"sse":"http"}function EM(r,t){let e=r,n=t;return[...new Set([...Object.keys(e),...Object.keys(n)])].filter(i=>!Ge(e[i],n[i])).map(i=>[i,n[i]])}var Ji,Sd,xy=v(()=>{ni();Ue();Ve();qo();fP();GR();Q();fn();Xt();Ie();ee();dn();dE();st();Gc();Z();co();pE();F7();Pa();Sy();Ji=A("IMcpResourceScannerService"),Sd=class extends D{constructor(e,n){super();this.fileService=e;this.uriIdentityService=n;this.resourcesAccessQueueMap=new je}async scanMcpServers(e,n,o="vscode"){return o==="workspaceRoot"?this.withWorkspaceRootMcpServers(e):o==="copilotGlobal"?this.withCopilotGlobalMcpServers(e):this.withProfileMcpServers(e,n)}async addMcpServers(e,n,o,i="vscode"){if(i==="workspaceRoot"){for(let s of e){let a=by(s);if(a)throw new Error(a)}await this.withWorkspaceRootMcpServers(n,(s,a)=>{for(let{name:l,config:c}of e){if(!a&&l==="mcpServers")throw new Error(d(4565,null));s=this.editWorkspaceRootMcpServer(s,a,l,c)}return s});return}if(i==="copilotGlobal"){let s=e.map(a=>{let l=SM(a);if(l)throw new Error(d(4563,null,a.name,l));return{name:a.name,config:bM(a.config)}});await this.withCopilotGlobalMcpServers(n,a=>{for(let{name:l,config:c}of s)a=this.editJsonProperty(a,["mcpServers",l],c);return a});return}await this.withProfileMcpServers(n,o,s=>{let a=s.inputs??[],l=s.servers??{};for(let{name:c,config:u,inputs:p}of e)if(l[c]=u,p){let m=new Set(a.map(y=>y.id)),g=p.filter(y=>!m.has(y.id));a=[...a,...g]}return{servers:l,inputs:a,sandbox:s.sandbox}})}async updateMcpServer(e,n,o,i,s,a="vscode"){let l=()=>new Error(d(4564,null,e,i.toString(!0)));if(a==="copilotGlobal"){let c=SM({name:e,config:W7(n,o)});if(c)throw new Error(c);let u=V7(o),p=B7(EM(V7(n),u),n,o,Reflect.get(u,"type"),void 0);await this.withCopilotGlobalMcpServers(i,(m,g)=>{if(!Object.hasOwn(g,e))throw l();for(let[y,h]of p)m=this.editJsonProperty(m,["mcpServers",e,y],h);return m});return}if(a==="workspaceRoot"){let c=by({name:e,config:W7(n,o)});if(c)throw new Error(c);let u=B7(EM(n,o),n,o,o.type,o.type==="http"?o.transport:void 0);await this.withWorkspaceRootMcpServers(i,(p,m,g)=>{if(!Object.hasOwn(g,e))throw l();for(let[y,h]of u)p=this.editJsonProperty(p,m?["mcpServers",e,y]:[e,y],h);return p});return}await this.withProfileMcpServers(i,s,c=>{if(!c.servers?.[e])throw l();return c.servers[e]=o,c})}async updateSandboxConfig(e,n,o,i="vscode"){if(i==="workspaceRoot")throw new Error(d(4567,null));if(i==="copilotGlobal")throw new Error(d(4566,null));await this.withProfileMcpServers(n,o,e)}async removeMcpServers(e,n,o,i="vscode",s){if(i==="copilotGlobal"){await this.withCopilotGlobalMcpServers(n,a=>{for(let l of e)a=this.editJsonProperty(a,["mcpServers",l],void 0);return a});return}if(i==="workspaceRoot"){await this.withWorkspaceRootMcpServers(n,(a,l)=>{for(let c of e)a=this.editWorkspaceRootMcpServer(a,l,c,void 0);return a});return}await this.withProfileMcpServers(n,o,a=>{let l=new Set;for(let c of e)a.servers?.[c]&&(Aa(a.servers[c],l),delete a.servers[c]);if(l.size&&a.inputs){let c=new Set(s);for(let u of Object.values(a.servers??{}))Aa(u,c);Aa(a.sandbox,c);for(let u of a.inputs)l.has(u.id)||c.add(u.id);for(let u of c)Aa(a.inputs.filter(p=>p.id===u),c);a.inputs=a.inputs.filter(u=>!l.has(u.id)||c.has(u.id))}return a})}withWorkspaceRootMcpServers(e,n){return this.withSharedMcpServersFile(e,H7,d(4568,null),n&&((o,{wrapped:i,servers:s})=>n(o,i,s)))}withCopilotGlobalMcpServers(e,n){return this.withSharedMcpServersFile(e,o=>({servers:N7(o)}),d(4562,null),n&&((o,{servers:i})=>n(o,i)))}withSharedMcpServersFile(e,n,o,i){return this.getResourceAccessQueue(this.uriIdentityService.asCanonicalUri(e)).queue(async()=>{let s;try{s=await this.fileService.readFile(e)}catch(u){if(wt(u)!==1)throw u}let a=s?.value.toString()??`{
"mcpServers": {}
}
`,l=n(a),c=i?.(a,l)??a;if(c!==a)if(l=n(c),s){let u=await this.fileService.readFile(e);if(u.value.toString()!==a)throw new kn(o,3);await this.fileService.writeFile(e,O.fromString(c),{etag:u.etag,mtime:u.mtime})}else await this.fileService.createFile(e,O.fromString(c),{overwrite:!1});return{servers:l.servers}})}editWorkspaceRootMcpServer(e,n,o,i){return this.editJsonProperty(e,n?["mcpServers",o]:[o],i)}editJsonProperty(e,n,o){let i=/^(?<indentation>[ \t]+)"/m.exec(e)?.groups?.indentation,s=i!==void 0&&!i.includes(" ");return Jv(e,Qv(e,n,o,{insertSpaces:s,tabSize:s?i.length:1,eol:e.includes(`\r
`)?`\r
`:`
`}))}async withProfileMcpServers(e,n,o){return this.getResourceAccessQueue(e).queue(async()=>{n=n??2;let i={};try{let s=await this.fileService.readFile(e),a=[],l=bo(s.value.toString(),a,{allowTrailingComma:!0,allowEmptyContent:!0})||{};if(a.length>0)throw new Error("Failed to parse scanned MCP servers: "+a.map(c=>`[${c.offset}, ${c.length}] ${Wc(c.error)}`).join(", "));if(n===2)i=this.fromUserMcpServers(l);else if(n===6)i=this.fromWorkspaceFolderMcpServers(l);else if(n===5){let c=l;c.settings?.mcp&&(i=this.fromWorkspaceFolderMcpServers(c.settings?.mcp))}}catch(s){if(wt(s)!==1)throw s}return o&&(i=o(i??{}),n===2?await this.writeScannedMcpServers(e,i):n===6?await this.writeScannedMcpServersToWorkspaceFolder(e,i):n===5?await this.writeScannedMcpServersToWorkspace(e,i):lc(n,`Invalid Target: ${jU(n)}`)),i})}async writeScannedMcpServers(e,n){n.servers&&Object.keys(n.servers).length>0||n.inputs&&n.inputs.length>0||n.sandbox!==void 0?await this.fileService.writeFile(e,O.fromString(JSON.stringify(n,null," "))):await this.fileService.del(e)}async writeScannedMcpServersToWorkspaceFolder(e,n){await this.fileService.writeFile(e,O.fromString(JSON.stringify(n,null," ")))}async writeScannedMcpServersToWorkspace(e,n){let o;try{let i=await this.fileService.readFile(e),s=[];if(o=bo(i.value.toString(),s,{allowTrailingComma:!0,allowEmptyContent:!0}),s.length>0)throw new Error("Failed to parse scanned MCP servers: "+s.map(a=>`[${a.offset}, ${a.length}] ${Wc(a.error)}`).join(", "))}catch(i){if(wt(i)!==1)throw i;o={settings:{}}}o.settings||(o.settings={}),o.settings.mcp=n,await this.fileService.writeFile(e,O.fromString(JSON.stringify(o,null," ")))}fromUserMcpServers(e){let n={inputs:e.inputs,sandbox:e.sandbox},o=Object.entries(e.servers??{});if(o.length>0){n.servers={};for(let[i,s]of o)n.servers[i]=this.sanitizeServer(s)}return n}fromWorkspaceFolderMcpServers(e){let n={inputs:e.inputs,sandbox:e.sandbox},o=Object.entries(e.servers??{});if(o.length>0){n.servers={};for(let[i,s]of o){let a=this.sanitizeServer(s);n.servers[i]=a}}return n}sanitizeServer(e){let n;if(e.config){let o=e;n={...o.config,version:o.version,gallery:o.gallery}}else n=e;return(n.type===void 0||n.type!=="http"&&n.type!=="stdio")&&(n.type=n.command?"stdio":"http"),n}getResourceAccessQueue(e){let n=this.resourcesAccessQueueMap.get(e);return n||(n=new Nr,this.resourcesAccessQueueMap.set(e,n)),n}};Sd=w([b(0,Le),b(1,Ye)],Sd);hi(Ji,Sd,1)});var gE,rne,fdt,hdt,ydt,ine,vdt,Idt,bdt,Sdt,mE,z7,xi,Yi,G7,K7,wM=v(()=>{br();dn();Z();gE=".vscode",rne="settings",fdt=`${gE}/${rne}.json`,hdt=[1,3],ydt=[2,4,5,6,7],ine=[4,5,6],vdt=[1,...ine],Idt=[2,3,4,5,6,7],bdt=[4,5,6,7],Sdt=[5,6,7],mE="tasks",z7="launch",xi="mcp",Yi=Object.create(null);Yi[mE]=`${gE}/${mE}.json`;Yi[z7]=`${gE}/${z7}.json`;Yi[xi]=`${gE}/${xi}.json`;G7=Object.create(null);G7[mE]=`${mE}.json`;G7[xi]=`${xi}.json`;K7=bt});var fE,wdt,RM=v(()=>{Z();Ue();fE=A("remoteAgentService"),wdt=new class{constructor(){this.maxSampleCount=5;this.sampleDelay=2e3;this.initial=[];this.maxInitialCount=3;this.average=[];this.maxAverageCount=100;this.highLatencyMultiple=2;this.highLatencyMinThreshold=500;this.highLatencyMaxThreshold=1500;this.lastMeasurement=void 0}get latency(){return this.lastMeasurement}async measure(r){let t=1/0;for(let n=0;n<this.maxSampleCount;n++){let o=await r.getRoundTripTime();if(o===void 0)return;t=Math.min(t,o/2),await ko(this.sampleDelay)}this.average.push(t),this.average.length>this.maxAverageCount&&this.average.shift();let e;return this.initial.length<this.maxInitialCount?this.initial.push(t):e=this.initial.reduce((n,o)=>n+o,0)/this.initial.length,this.lastMeasurement={initial:e,current:t,average:this.average.reduce((n,o)=>n+o,0)/this.average.length,high:typeof e>"u"?!1:t>this.highLatencyMaxThreshold||t>this.highLatencyMinThreshold&&t>e*this.highLatencyMultiple},this.lastMeasurement}}});var Rm,Cy,xd,Cd,Ds,Tm,Ey=v(()=>{Ue();Ve();Jt();ue();xr();Q();fn();Xt();Ie();te();ee();dn();Dn();st();Z();De();co();xo();Jl();Pa();xy();Sy();Rm=class extends D{constructor(e){super();this.logService=e}getMcpServerConfigurationFromManifest(e,n){return new Cy().getMcpServerConfigurationFromManifest(e,n)}};Rm=w([b(0,z)],Rm);Cy=class{getMcpServerConfigurationFromManifest(t,e){if(e==="remote"&&t.remotes?.length){let l=t.remotes[0],c=l.variables?this.getVariables(l.variables):[],u=yy(l.url,l.variables),p=l.headers??[],m=this.processKeyValueInputs(u.startsWith("https://api.githubcopilot.com/mcp")?p.filter(y=>y.name.toLowerCase()!=="authorization"):p),g=[...c];return this.appendVariables(g,m.variables),{mcpServerConfiguration:{config:{type:"http",url:u,headers:Object.keys(m.inputs).length?m.inputs:void 0},inputs:g.length?g:void 0},notices:m.notices}}let n=t.packages?.find(l=>l.registryType===e)??t.packages?.[0];if(!n)throw new Error("No server package found");let o=[],i=[],s={},a=[];if(n.registryType==="oci"&&(o.push("run"),o.push("-i"),o.push("--rm")),n.runtimeArguments?.length){let l=this.processArguments(n.runtimeArguments??[]);o.push(...l.args),i.push(...l.variables),a.push(...l.notices)}if(n.environmentVariables?.length){let{inputs:l,variables:c,notices:u}=this.processKeyValueInputs(n.environmentVariables??[]);i.push(...c),a.push(...u);for(let[p,m]of Object.entries(l))s[p]=m,n.registryType==="oci"&&(o.push("-e"),o.push(p))}switch(n.registryType){case"npm":n.registryBaseUrl&&o.push("--registry",n.registryBaseUrl),o.push(n.version?`${n.identifier}@${n.version}`:n.identifier);break;case"pypi":n.registryBaseUrl&&o.push("--index-url",n.registryBaseUrl),o.push(n.version?`${n.identifier}@${n.version}`:n.identifier);break;case"oci":{let l=n.registryBaseUrl?`${n.registryBaseUrl}/${n.identifier}`:n.identifier;o.push(n.version?`${l}:${n.version}`:l);break}case"nuget":o.push(n.version?`${n.identifier}@${n.version}`:n.identifier),o.push("--yes"),n.registryBaseUrl&&o.push("--source",n.registryBaseUrl),n.packageArguments?.length&&o.push("--");break}if(n.packageArguments?.length){let l=this.processArguments(n.packageArguments);o.push(...l.args),i.push(...l.variables),a.push(...l.notices)}return{notices:a,mcpServerConfiguration:{config:{type:"stdio",command:this.getCommandName(n.registryType),args:o.length?o:void 0,env:Object.keys(s).length?s:void 0},inputs:i.length?i:void 0}}}getCommandName(t){switch(t){case"npm":return"npx";case"oci":return"docker";case"pypi":return"uvx";case"nuget":return"dnx";default:throw new Error(`Unsupported MCP server package registry type: ${t}`)}}getVariables(t){let e=[];for(let[n,o]of Object.entries(t))o.value===void 0&&e.push({id:n,type:o.choices?"pickString":"promptString",description:o.description??"",password:!!o.isSecret,default:o.default,options:o.choices});return e}appendVariables(t,e){for(let n of e){let o=t.find(i=>i.id===n.id);if(!o)t.push(n);else if(!Ge(o,n))throw new Error(d(4560,null,n.id))}}processKeyValueInputs(t){let e=[],n={},o=[];for(let i of t){let s=i.value||"";i.variables&&Object.keys(i.variables).length?(s=yy(s,i.variables),o.push(...this.getVariables(i.variables))):!s&&(i.isRequired||i.isSecret||i.description||i.choices||i.default!==void 0)&&(o.push({id:i.name,type:i.choices?"pickString":"promptString",description:i.description??"",password:!!i.isSecret,default:i.default,options:i.choices}),s=`\${input:${i.name}}`),n[i.name]=s}return{inputs:n,variables:o,notices:e}}processArguments(t){let e=[],n=[],o=[];for(let i of t){let s=i.variables?this.getVariables(i.variables):[];if(i.type==="positional"){let a=i.value;a?(a=yy(a,i.variables),e.push(a),s.length&&n.push(...s)):i.valueHint&&(i.description||i.default!==void 0)?(n.push({id:i.valueHint,type:"promptString",description:i.description??"",password:!1,default:i.default}),e.push(`\${input:${i.valueHint}}`)):e.push(i.valueHint??"")}else if(i.type==="named"){if(!i.name){o.push(`Named argument is missing a name. ${JSON.stringify(i)}`);continue}if(e.push(i.name),i.value){let a=yy(i.value,i.variables);e.push(a),s.length&&n.push(...s)}else if(i.description||i.default!==void 0){let a=i.name.replace(/^--?/,"");n.push({id:a,type:"promptString",description:i.description??"",password:!1,default:i.default}),e.push(`\${input:${a}}`)}}}return{args:e,variables:n,notices:o}}},xd=class extends Rm{constructor(e,n,o,i,s,a,l,c,u){super(l);this.mcpResource=e;this.target=n;this.format=o;this.mcpGalleryService=i;this.fileService=s;this.uriIdentityService=a;this.mcpResourceScannerService=c;this.allowedMcpServersService=u;this.local=new Map;this._onInstallMcpServer=this._register(new R);this.onInstallMcpServer=this._onInstallMcpServer.event;this._onDidInstallMcpServers=this._register(new R);this._onDidUpdateMcpServers=this._register(new R);this._onUninstallMcpServer=this._register(new R);this._onDidUninstallMcpServer=this._register(new R);this.reloadConfigurationScheduler=this._register(new nr(()=>this.updateLocal(),50))}get onDidInstallMcpServers(){return this._onDidInstallMcpServers.event}get onDidUpdateMcpServers(){return this._onDidUpdateMcpServers.event}get onUninstallMcpServer(){return this._onUninstallMcpServer.event}get onDidUninstallMcpServer(){return this._onDidUninstallMcpServer.event}ensureServerAllowed(e){let n=this.allowedMcpServersService.isAllowed(e);if(n!==!0)throw new Error(n.value)}initialize(){return this.initializePromise||(this.initializePromise=(async()=>{try{this.local=await this.populateLocalServers()}finally{this.startWatching()}})()),this.initializePromise}async populateLocalServers(){this.logService.trace("AbstractMcpResourceManagementService#populateLocalServers",this.mcpResource.toString());let e=new Map;try{let n=await this.mcpResourceScannerService.scanMcpServers(this.mcpResource,this.target,this.format);n.servers&&await Promise.allSettled(Object.entries(n.servers).map(async([o,i])=>{let s=await this.scanLocalServer(o,i,n.sandbox);e.set(o,s)}))}catch(n){throw this.logService.debug("Could not read user MCP servers:",n),n}return e}startWatching(){this._register(this.fileService.watch(this.mcpResource)),this._register(this.fileService.onDidFilesChange(e=>{e.affects(this.mcpResource)&&this.reloadConfigurationScheduler.schedule()}))}async updateLocal(e){try{let n=await this.populateLocalServers(),o=[],i=[],s=[...this.local.keys()].filter(a=>!n.has(a));for(let a of s)this.local.delete(a);for(let[a,l]of n){let c=this.local.get(a);c?Ge(c,l)||(i.push(l),this.local.set(a,l)):(o.push(l),this.local.set(a,l))}for(let a of s)this.local.delete(a),this._onDidUninstallMcpServer.fire({name:a,mcpResource:this.mcpResource});i.length&&this._onDidUpdateMcpServers.fire(i.map(a=>({name:a.name,local:a,source:e?.name===a.name?e:void 0,mcpResource:this.mcpResource}))),o.length&&this._onDidInstallMcpServers.fire(o.map(a=>({name:a.name,local:a,source:e?.name===a.name?e:void 0,mcpResource:this.mcpResource})))}catch(n){this.logService.error("Failed to load installed MCP servers:",n)}}async getInstalled(){return await this.initialize(),Array.from(this.local.values())}async scanLocalServer(e,n,o){let i=await this.getLocalServerInfo(e,n);return i||(i={name:e,version:n.version,galleryUrl:G(n.gallery)?n.gallery:void 0}),{name:e,config:n,rootSandbox:o,mcpResource:this.mcpResource,version:i.version,location:i.location,displayName:i.displayName,description:i.description,publisher:i.publisher,publisherDisplayName:i.publisherDisplayName,galleryUrl:i.galleryUrl,galleryId:i.galleryId,repositoryUrl:i.repositoryUrl,readmeUrl:i.readmeUrl,icon:i.icon,codicon:i.codicon,manifest:i.manifest,source:n.gallery?"gallery":"local"}}async install(e,n){if(this.logService.trace("MCP Management Service: install",e.name),this.format==="workspaceRoot"){let o=by(e);if(o)throw new Error(o)}this.ensureServerAllowed(e),this._onInstallMcpServer.fire({name:e.name,mcpResource:this.mcpResource});try{await this.mcpResourceScannerService.addMcpServers([e],this.mcpResource,this.target,this.format),await this.updateLocal();let o=this.local.get(e.name);if(!o)throw new Error(`Failed to install MCP server: ${e.name}`);return o}catch(o){throw this._onDidInstallMcpServers.fire([{name:e.name,error:o,mcpResource:this.mcpResource}]),o}}async uninstall(e,n){this.logService.trace("MCP Management Service: uninstall",e.name),this._onUninstallMcpServer.fire({name:e.name,mcpResource:this.mcpResource});try{if(!(await this.mcpResourceScannerService.scanMcpServers(this.mcpResource,this.target,this.format)).servers)return;await this.mcpResourceScannerService.removeMcpServers([e.name],this.mcpResource,this.target,this.format,n?.preserveInputIds),e.location&&await this.fileService.del(S.revive(e.location),{recursive:!0}),await this.updateLocal()}catch(o){throw this._onDidUninstallMcpServer.fire({name:e.name,error:o,mcpResource:this.mcpResource}),o}}};xd=w([b(3,ka),b(4,Le),b(5,Ye),b(6,z),b(7,Ji),b(8,dr)],xd);Cd=class extends xd{constructor(t,e,n,o,i,s,a,l){super(t,2,"vscode",e,n,o,i,s,a),this.mcpLocation=o.extUri.joinPath(l.userRoamingDataHome,"mcp")}async installFromGallery(t,e){throw new Error("Not supported")}async uninstall(t,e){if(t.location&&!this.uriIdentityService.extUri.isEqual(S.revive(t.location),this.getLocation(t.name,t.version)))throw new Error(`Invalid MCP server location for ${t.name}`);await super.uninstall(t,e)}async updateMetadata(t,e){await this.updateMetadataFromGallery(e),await this.updateLocal(e);let n=(await this.getInstalled()).find(o=>o.name===t.name);if(!n)throw new Error(`Failed to find MCP server: ${t.name}`);return n}async updateMetadataFromGallery(t){let e=t.configuration,n=this.getLocation(t.name,t.version),o=this.uriIdentityService.extUri.joinPath(n,"manifest.json"),i={galleryUrl:t.galleryUrl,galleryId:t.id,name:t.name,displayName:t.displayName,description:t.description,version:t.version,publisher:t.publisher,publisherDisplayName:t.publisherDisplayName,repositoryUrl:t.repositoryUrl,licenseUrl:t.license,icon:t.icon,codicon:t.codicon,manifest:e};if(await this.fileService.writeFile(o,O.fromString(JSON.stringify(i))),t.readmeUrl||t.readme){let s=t.readme?t.readme:await this.mcpGalleryService.getReadme(t,Ae.None);await this.fileService.writeFile(this.uriIdentityService.extUri.joinPath(n,"README.md"),O.fromString(s))}return e}async getLocalServerInfo(t,e){let n,o,i;if(e.gallery){o=this.getLocation(t,e.version);let s=this.uriIdentityService.extUri.joinPath(o,"manifest.json");try{let a=await this.fileService.readFile(s);n=JSON.parse(a.value.toString()),n.galleryUrl?.includes("/v0/")&&(n.galleryUrl=n.galleryUrl.substring(0,n.galleryUrl.indexOf("/v0/")),await this.fileService.writeFile(s,O.fromString(JSON.stringify(n)))),n.location=o,i=this.uriIdentityService.extUri.joinPath(o,"README.md"),await this.fileService.exists(i)||(i=void 0),n.readmeUrl=i}catch(a){wt(a)===1?this.logService.trace("MCP Management Service: manifest not found",s.toString()):this.logService.error("MCP Management Service: failed to read manifest",o.toString(),a)}}return n}getLocation(t,e){let n=e?`${t.replace("/",".")}-${e}`:t.replace("/","."),o=this.uriIdentityService.extUri.joinPath(this.mcpLocation,n);if(this.uriIdentityService.extUri.basename(o)!==n||this.uriIdentityService.extUri.isEqual(o,this.mcpLocation)||!this.uriIdentityService.extUri.isEqualOrParent(o,this.mcpLocation))throw new Error(`Invalid MCP server location for ${t}`);return o}installFromUri(t,e){throw new Error("Method not supported.")}canInstall(){throw new Error("Not supported")}};Cd=w([b(1,ka),b(2,Le),b(3,Ye),b(4,z),b(5,Ji),b(6,dr),b(7,Ut)],Cd);Ds=class extends Rm{constructor(e,n){super(n);this.allowedMcpServersService=e}canInstall(e){let n=this.allowedMcpServersService.isAllowed(e);return n!==!0?new at(d(4561,null,n.value)):!0}};Ds=w([b(0,dr),b(1,z)],Ds);Tm=class extends Ds{constructor(e,n,o,i){super(e,n);this.userDataProfilesService=o;this.instantiationService=i;this._onInstallMcpServer=this._register(new R);this.onInstallMcpServer=this._onInstallMcpServer.event;this._onDidInstallMcpServers=this._register(new R);this.onDidInstallMcpServers=this._onDidInstallMcpServers.event;this._onDidUpdateMcpServers=this._register(new R);this.onDidUpdateMcpServers=this._onDidUpdateMcpServers.event;this._onUninstallMcpServer=this._register(new R);this.onUninstallMcpServer=this._onUninstallMcpServer.event;this._onDidUninstallMcpServer=this._register(new R);this.onDidUninstallMcpServer=this._onDidUninstallMcpServer.event;this.mcpResourceManagementServices=new je}getMcpResourceManagementService(e){let n=this.mcpResourceManagementServices.get(e);if(!n){let o=new re,i=o.add(this.createMcpResourceManagementService(e));o.add(i.onInstallMcpServer(s=>this._onInstallMcpServer.fire(s))),o.add(i.onDidInstallMcpServers(s=>this._onDidInstallMcpServers.fire(s))),o.add(i.onDidUpdateMcpServers(s=>this._onDidUpdateMcpServers.fire(s))),o.add(i.onUninstallMcpServer(s=>this._onUninstallMcpServer.fire(s))),o.add(i.onDidUninstallMcpServer(s=>this._onDidUninstallMcpServer.fire(s))),this.mcpResourceManagementServices.set(e,n={service:i,dispose:()=>o.dispose()})}return n.service}async getInstalled(e){let n=e||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(n).getInstalled()}async install(e,n){let o=n?.mcpResource||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(o).install(e,n)}async uninstall(e,n){let o=n?.mcpResource||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(o).uninstall(e,n)}async installFromGallery(e,n){let o=n?.mcpResource||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(o).installFromGallery(e,n)}async updateMetadata(e,n,o){return this.getMcpResourceManagementService(o||this.userDataProfilesService.defaultProfile.mcpResource).updateMetadata(e,n)}dispose(){this.mcpResourceManagementServices.forEach(e=>e.dispose()),this.mcpResourceManagementServices.clear(),super.dispose()}createMcpResourceManagementService(e){return this.instantiationService.createInstance(Cd,e)}};Tm=w([b(0,dr),b(1,z),b(2,Bt),b(3,Hn)],Tm)});function Ed(r,t){return r?S.revive(t?t.transformIncoming(r):r):void 0}function Yl(r,t){t=t||Ip;let e=r.manifest;return{...bp({...r,manifest:void 0},t),manifest:e}}function TM(r,t){return r?.mcpResource?bp(r,t??Ip):r}function PM(r,t){return t?so(r,e=>e instanceof S?t.transformOutgoingURI(e):void 0):r}function wy(r,t){return t?t.transformOutgoingURI(r):r}var yE,Pm,kM=v(()=>{ue();Xt();te();Ll();De();Jl();Ey();yE=class{constructor(t,e){this.service=t;this.getUriTransformer=e;this.onInstallMcpServer=F.buffer(t.onInstallMcpServer,"onInstallMcpServer",!0),this.onDidInstallMcpServers=F.buffer(t.onDidInstallMcpServers,"onDidInstallMcpServers",!0),this.onDidUpdateMcpServers=F.buffer(t.onDidUpdateMcpServers,"onDidUpdateMcpServers",!0),this.onUninstallMcpServer=F.buffer(t.onUninstallMcpServer,"onUninstallMcpServer",!0),this.onDidUninstallMcpServer=F.buffer(t.onDidUninstallMcpServer,"onDidUninstallMcpServer",!0)}listen(t,e){let n=this.getUriTransformer(t);switch(e){case"onInstallMcpServer":return F.map(this.onInstallMcpServer,o=>({...o,mcpResource:wy(o.mcpResource,n)}));case"onDidInstallMcpServers":return F.map(this.onDidInstallMcpServers,o=>o.map(i=>({...i,local:i.local?PM(i.local,n):i.local,mcpResource:wy(i.mcpResource,n)})));case"onDidUpdateMcpServers":return F.map(this.onDidUpdateMcpServers,o=>o.map(i=>({...i,local:i.local?PM(i.local,n):i.local,mcpResource:wy(i.mcpResource,n)})));case"onUninstallMcpServer":return F.map(this.onUninstallMcpServer,o=>({...o,mcpResource:wy(o.mcpResource,n)}));case"onDidUninstallMcpServer":return F.map(this.onDidUninstallMcpServer,o=>({...o,mcpResource:wy(o.mcpResource,n)}))}throw new Error("Invalid listen")}async call(t,e,n){let o=this.getUriTransformer(t),i=Array.isArray(n)?n:[];switch(e){case"getInstalled":return(await this.service.getInstalled(Ed(i[0],o))).map(a=>PM(a,o));case"install":return this.service.install(i[0],TM(i[1],o));case"installFromGallery":return this.service.installFromGallery(i[0],TM(i[1],o));case"uninstall":return this.service.uninstall(Yl(i[0],o),TM(i[1],o));case"updateMetadata":return this.service.updateMetadata(Yl(i[0],o),i[1],Ed(i[2],o))}throw new Error("Invalid call")}},Pm=class extends Ds{constructor(e,n,o){super(n,o);this.channel=e;this._onInstallMcpServer=this._register(new R);this._onDidInstallMcpServers=this._register(new R);this._onUninstallMcpServer=this._register(new R);this._onDidUninstallMcpServer=this._register(new R);this._onDidUpdateMcpServers=this._register(new R);this._register(this.channel.listen("onInstallMcpServer")(i=>this._onInstallMcpServer.fire({...i,mcpResource:Ed(i.mcpResource,null)}))),this._register(this.channel.listen("onDidInstallMcpServers")(i=>this._onDidInstallMcpServers.fire(i.map(s=>({...s,local:s.local?Yl(s.local,null):s.local,mcpResource:Ed(s.mcpResource,null)}))))),this._register(this.channel.listen("onDidUpdateMcpServers")(i=>this._onDidUpdateMcpServers.fire(i.map(s=>({...s,local:s.local?Yl(s.local,null):s.local,mcpResource:Ed(s.mcpResource,null)}))))),this._register(this.channel.listen("onUninstallMcpServer")(i=>this._onUninstallMcpServer.fire({...i,mcpResource:Ed(i.mcpResource,null)}))),this._register(this.channel.listen("onDidUninstallMcpServer")(i=>this._onDidUninstallMcpServer.fire({...i,mcpResource:Ed(i.mcpResource,null)})))}get onInstallMcpServer(){return this._onInstallMcpServer.event}get onDidInstallMcpServers(){return this._onDidInstallMcpServers.event}get onUninstallMcpServer(){return this._onUninstallMcpServer.event}get onDidUninstallMcpServer(){return this._onDidUninstallMcpServer.event}get onDidUpdateMcpServers(){return this._onDidUpdateMcpServers.event}install(e,n){return Promise.resolve(this.channel.call("install",[e,n])).then(o=>Yl(o,null))}installFromGallery(e,n){return Promise.resolve(this.channel.call("installFromGallery",[e,n])).then(o=>Yl(o,null))}uninstall(e,n){return Promise.resolve(this.channel.call("uninstall",[e,n]))}getInstalled(e){return Promise.resolve(this.channel.call("getInstalled",[e])).then(n=>n.map(o=>Yl(o,null)))}updateMetadata(e,n,o){return Promise.resolve(this.channel.call("updateMetadata",[e,n,o])).then(i=>Yl(i,null))}};Pm=w([b(1,dr),b(2,z)],Pm)});var vE,IE,AM=v(()=>{ue();xo();Ll();Q();vE=class{constructor(t,e){this.service=t;this.getUriTransformer=e}listen(t,e){let n=this.getUriTransformer(t);if(e==="onDidChangeProfiles")return F.map(this.service.onDidChangeProfiles,o=>({all:o.all.map(i=>$r({...i},n)),added:o.added.map(i=>$r({...i},n)),removed:o.removed.map(i=>$r({...i},n)),updated:o.updated.map(i=>$r({...i},n))}));throw new Error(`Invalid listen ${e}`)}async call(t,e,n){let o=this.getUriTransformer(t);switch(e){case"createProfile":{let i=await this.service.createProfile(n[0],n[1],n[2]);return $r({...i},o)}case"updateProfile":{let i=pi(Ek(n[0],o),this.service.profilesHome.scheme);return i=await this.service.updateProfile(i,n[1]),$r({...i},o)}case"removeProfile":{let i=pi(Ek(n[0],o),this.service.profilesHome.scheme);return this.service.removeProfile(i)}}throw new Error(`Invalid call ${e}`)}},IE=class extends D{constructor(e,n,o){super();this.profilesHome=n;this.channel=o;this._profiles=[];this._onDidChangeProfiles=this._register(new R);this.onDidChangeProfiles=this._onDidChangeProfiles.event;this._profiles=e.map(i=>pi(i,this.profilesHome.scheme)),this._register(this.channel.listen("onDidChangeProfiles")(i=>{let s=i.added.map(c=>pi(c,this.profilesHome.scheme)),a=i.removed.map(c=>pi(c,this.profilesHome.scheme)),l=i.updated.map(c=>pi(c,this.profilesHome.scheme));this._profiles=i.all.map(c=>pi(c,this.profilesHome.scheme)),this._onDidChangeProfiles.fire({added:s,removed:a,updated:l,all:this.profiles})})),this.onDidResetWorkspaces=this.channel.listen("onDidResetWorkspaces")}get defaultProfile(){return this.profiles[0]}get profiles(){return this._profiles}async createNamedProfile(e,n,o){let i=await this.channel.call("createNamedProfile",[e,n,o]);return pi(i,this.profilesHome.scheme)}async createProfile(e,n,o,i){let s=await this.channel.call("createProfile",[e,n,o,i]);return pi(s,this.profilesHome.scheme)}async createTransientProfile(e){let n=await this.channel.call("createTransientProfile",[e]);return pi(n,this.profilesHome.scheme)}async setProfileForWorkspace(e,n){await this.channel.call("setProfileForWorkspace",[e,n])}removeProfile(e){return this.channel.call("removeProfile",[e])}async updateProfile(e,n){let o=await this.channel.call("updateProfile",[e,n]);return pi(o,this.profilesHome.scheme)}resetWorkspaces(){return this.channel.call("resetWorkspaces")}cleanUp(){return this.channel.call("cleanUp")}cleanUpTransientProfiles(){return this.channel.call("cleanUpTransientProfiles")}}});var DM,_M,Ry,j7=v(()=>{Q();Gc();Z();xo();RM();gi();De();DC();Dt();uC();AM();xe();DM="associatedRemoteProfiles",_M=A("IRemoteUserDataProfilesService"),Ry=class extends D{constructor(e,n,o,i,s,a){super();this.environmentService=e;this.remoteAgentService=n;this.userDataProfilesService=o;this.userDataProfileService=i;this.storageService=s;this.logService=a;this.initPromise=this.init()}async init(){let e=this.remoteAgentService.getConnection();if(!e)return;let n=await this.remoteAgentService.getEnvironment();if(!n)return;this.remoteUserDataProfilesService=new IE(n.profiles.all,n.profiles.home,e.getChannel("userDataProfiles")),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.onDidChangeLocalProfiles(i)));let o=await this.getAssociatedRemoteProfile(this.userDataProfileService.currentProfile,this.remoteUserDataProfilesService);o.isDefault||this.setAssociatedRemoteProfiles([...this.getAssociatedRemoteProfiles(),o.id]),this.cleanUp()}async onDidChangeLocalProfiles(e){for(let n of e.removed){let o=this.remoteUserDataProfilesService?.profiles.find(i=>i.id===n.id);o&&await this.remoteUserDataProfilesService?.removeProfile(o)}}async getRemoteProfiles(){if(await this.initPromise,!this.remoteUserDataProfilesService)throw new eo("Remote profiles service not available in the current window");return this.remoteUserDataProfilesService.profiles}async getRemoteProfile(e){if(await this.initPromise,!this.remoteUserDataProfilesService)throw new eo("Remote profiles service not available in the current window");return this.getAssociatedRemoteProfile(e,this.remoteUserDataProfilesService)}async getAssociatedRemoteProfile(e,n){if(e.isDefault)return n.defaultProfile;let o=n.profiles.find(i=>i.id===e.id);return o||(o=await n.createProfile(e.id,e.name,{transient:e.isTransient,useDefaultFlags:e.useDefaultFlags}),this.setAssociatedRemoteProfiles([...this.getAssociatedRemoteProfiles(),this.userDataProfileService.currentProfile.id])),o}getAssociatedRemoteProfiles(){return this.environmentService.remoteAuthority?this.parseAssociatedRemoteProfiles()[this.environmentService.remoteAuthority]??[]:[]}setAssociatedRemoteProfiles(e){if(this.environmentService.remoteAuthority){let n=this.parseAssociatedRemoteProfiles();e=rn(e),e.length?n[this.environmentService.remoteAuthority]=e:delete n[this.environmentService.remoteAuthority],Object.keys(n).length?this.storageService.store(DM,JSON.stringify(n),-1,1):this.storageService.remove(DM,-1)}}parseAssociatedRemoteProfiles(){if(this.environmentService.remoteAuthority){let e=this.storageService.get(DM,-1);try{return e?JSON.parse(e):{}}catch(n){this.logService.error(n)}}return{}}async cleanUp(){let e=[];for(let n of this.getAssociatedRemoteProfiles()){let o=this.remoteUserDataProfilesService?.profiles.find(s=>s.id===n);if(!o)continue;let i=this.userDataProfilesService.profiles.find(s=>s.id===n);if(i){i.name!==o.name&&await this.remoteUserDataProfilesService?.updateProfile(o,{name:i.name}),e.push(n);continue}o&&await this.remoteUserDataProfilesService?.removeProfile(o)}this.setAssociatedRemoteProfiles(e)}};Ry=w([b(0,um),b(1,fE),b(2,Bt),b(3,hm),b(4,mi),b(5,z)],Ry);hi(_M,Ry,1)});var MM,Ty,Q7=v(()=>{dn();Gc();Z();ia();MM=A("mcpWorkspaceInstallTargetService"),Ty=class{constructor(t){this.workspaceService=t}getTargets(){let t=this.workspaceService.getWorkbenchState();if(t===1)return[];let e=this.workspaceService.getWorkspace();return t===3&&e.configuration?[...e.folders,5]:e.folders}};Ty=w([b(0,fl)],Ty);hi(MM,Ty,1)});var sne,ane,lne,LM,smt,bE,Py,ky,J7=v(()=>{Q();Jl();Z();DC();ue();xe();xy();ia();co();wM();De();RM();dn();kM();xo();j7();Ey();st();fn();Sy();ee();Q7();sne="usrlocal",ane="usrremote",lne="workspace",LM="ws",smt=vy,bE=class extends Ds{constructor(e,n,o,i,s,a,l,c,u,p,m,g){super(n,o);this.mcpManagementService=e;this.userDataProfileService=i;this.uriIdentityService=s;this.workspaceContextService=a;this.userDataProfilesService=c;this.remoteUserDataProfilesService=u;this.workspaceInstallTargetService=m;this.mcpResourceScannerService=g;this._onInstallMcpServer=this._register(new R);this.onInstallMcpServer=this._onInstallMcpServer.event;this._onDidInstallMcpServers=this._register(new R);this.onDidInstallMcpServers=this._onDidInstallMcpServers.event;this._onDidUpdateMcpServers=this._register(new R);this.onDidUpdateMcpServers=this._onDidUpdateMcpServers.event;this._onUninstallMcpServer=this._register(new R);this.onUninstallMcpServer=this._onUninstallMcpServer.event;this._onDidUninstallMcpServer=this._register(new R);this.onDidUninstallMcpServer=this._onDidUninstallMcpServer.event;this._onInstallMcpServerInCurrentProfile=this._register(new R);this.onInstallMcpServerInCurrentProfile=this._onInstallMcpServerInCurrentProfile.event;this._onDidInstallMcpServersInCurrentProfile=this._register(new R);this.onDidInstallMcpServersInCurrentProfile=this._onDidInstallMcpServersInCurrentProfile.event;this._onDidUpdateMcpServersInCurrentProfile=this._register(new R);this.onDidUpdateMcpServersInCurrentProfile=this._onDidUpdateMcpServersInCurrentProfile.event;this._onUninstallMcpServerInCurrentProfile=this._register(new R);this.onUninstallMcpServerInCurrentProfile=this._onUninstallMcpServerInCurrentProfile.event;this._onDidUninstallMcpServerInCurrentProfile=this._register(new R);this.onDidUninstallMcpServerInCurrentProfile=this._onDidUninstallMcpServerInCurrentProfile.event;this._onDidChangeProfile=this._register(new R);this.onDidChangeProfile=this._onDidChangeProfile.event;this.workspaceMcpManagementService=this._register(p.createInstance(ky));let y=l.getConnection();y&&(this.remoteMcpManagementService=this._register(p.createInstance(Pm,y.getChannel("mcpManagement")))),this._register(this.mcpManagementService.onInstallMcpServer(h=>{this._onInstallMcpServer.fire(h),s.extUri.isEqual(h.mcpResource,this.userDataProfileService.currentProfile.mcpResource)&&this._onInstallMcpServerInCurrentProfile.fire({...h,scope:"user"})})),this._register(this.mcpManagementService.onDidInstallMcpServers(h=>{let{mcpServerInstallResult:I,mcpServerInstallResultInCurrentProfile:x}=this.createInstallMcpServerResultsFromEvent(h,"user");this._onDidInstallMcpServers.fire(I),x.length&&this._onDidInstallMcpServersInCurrentProfile.fire(x)})),this._register(this.mcpManagementService.onDidUpdateMcpServers(h=>{let{mcpServerInstallResult:I,mcpServerInstallResultInCurrentProfile:x}=this.createInstallMcpServerResultsFromEvent(h,"user");this._onDidUpdateMcpServers.fire(I),x.length&&this._onDidUpdateMcpServersInCurrentProfile.fire(x)})),this._register(this.mcpManagementService.onUninstallMcpServer(h=>{this._onUninstallMcpServer.fire(h),s.extUri.isEqual(h.mcpResource,this.userDataProfileService.currentProfile.mcpResource)&&this._onUninstallMcpServerInCurrentProfile.fire({...h,scope:"user"})})),this._register(this.mcpManagementService.onDidUninstallMcpServer(h=>{this._onDidUninstallMcpServer.fire(h),s.extUri.isEqual(h.mcpResource,this.userDataProfileService.currentProfile.mcpResource)&&this._onDidUninstallMcpServerInCurrentProfile.fire({...h,scope:"user"})})),this._register(this.workspaceMcpManagementService.onInstallMcpServer(async h=>{this._onInstallMcpServer.fire(h),this._onInstallMcpServerInCurrentProfile.fire({...h,scope:"workspace"})})),this._register(this.workspaceMcpManagementService.onDidInstallMcpServers(async h=>{let{mcpServerInstallResult:I}=this.createInstallMcpServerResultsFromEvent(h,"workspace");this._onDidInstallMcpServers.fire(I),this._onDidInstallMcpServersInCurrentProfile.fire(I)})),this._register(this.workspaceMcpManagementService.onUninstallMcpServer(async h=>{this._onUninstallMcpServer.fire(h),this._onUninstallMcpServerInCurrentProfile.fire({...h,scope:"workspace"})})),this._register(this.workspaceMcpManagementService.onDidUninstallMcpServer(async h=>{this._onDidUninstallMcpServer.fire(h),this._onDidUninstallMcpServerInCurrentProfile.fire({...h,scope:"workspace"})})),this._register(this.workspaceMcpManagementService.onDidUpdateMcpServers(h=>{let{mcpServerInstallResult:I}=this.createInstallMcpServerResultsFromEvent(h,"workspace");this._onDidUpdateMcpServers.fire(I),this._onDidUpdateMcpServersInCurrentProfile.fire(I)})),this.remoteMcpManagementService&&(this._register(this.remoteMcpManagementService.onInstallMcpServer(async h=>{this._onInstallMcpServer.fire(h);let I=await this.getRemoteMcpResource(this.userDataProfileService.currentProfile.mcpResource);(I?s.extUri.isEqual(h.mcpResource,I):this.userDataProfileService.currentProfile.isDefault)&&this._onInstallMcpServerInCurrentProfile.fire({...h,scope:"remoteUser"})})),this._register(this.remoteMcpManagementService.onDidInstallMcpServers(h=>this.handleRemoteInstallMcpServerResultsFromEvent(h,this._onDidInstallMcpServers,this._onDidInstallMcpServersInCurrentProfile))),this._register(this.remoteMcpManagementService.onDidUpdateMcpServers(h=>this.handleRemoteInstallMcpServerResultsFromEvent(h,this._onDidInstallMcpServers,this._onDidInstallMcpServersInCurrentProfile))),this._register(this.remoteMcpManagementService.onUninstallMcpServer(async h=>{this._onUninstallMcpServer.fire(h);let I=await this.getRemoteMcpResource(this.userDataProfileService.currentProfile.mcpResource);(I?s.extUri.isEqual(h.mcpResource,I):this.userDataProfileService.currentProfile.isDefault)&&this._onUninstallMcpServerInCurrentProfile.fire({...h,scope:"remoteUser"})})),this._register(this.remoteMcpManagementService.onDidUninstallMcpServer(async h=>{this._onDidUninstallMcpServer.fire(h);let I=await this.getRemoteMcpResource(this.userDataProfileService.currentProfile.mcpResource);(I?s.extUri.isEqual(h.mcpResource,I):this.userDataProfileService.currentProfile.isDefault)&&this._onDidUninstallMcpServerInCurrentProfile.fire({...h,scope:"remoteUser"})}))),this._register(i.onDidChangeCurrentProfile(h=>{this.uriIdentityService.extUri.isEqual(h.previous.mcpResource,h.profile.mcpResource)||this._onDidChangeProfile.fire()}))}createInstallMcpServerResultsFromEvent(e,n){let o=[],i=[];for(let s of e){let a={...s,local:s.local?this.toWorkspaceMcpServer(s.local,n):void 0};o.push(a),this.uriIdentityService.extUri.isEqual(s.mcpResource,this.userDataProfileService.currentProfile.mcpResource)&&i.push(a)}return{mcpServerInstallResult:o,mcpServerInstallResultInCurrentProfile:i}}async handleRemoteInstallMcpServerResultsFromEvent(e,n,o){let i=[],s=[],a=await this.getRemoteMcpResource(this.userDataProfileService.currentProfile.mcpResource);for(let l of e){let c={...l,local:l.local?this.toWorkspaceMcpServer(l.local,"remoteUser"):void 0};i.push(c),(a?this.uriIdentityService.extUri.isEqual(l.mcpResource,a):this.userDataProfileService.currentProfile.isDefault)&&s.push(c)}n.fire(i),s.length&&o.fire(s)}async getInstalled(){let e=[],[n,o,i]=await Promise.all([this.mcpManagementService.getInstalled(this.userDataProfileService.currentProfile.mcpResource),this.remoteMcpManagementService?.getInstalled(await this.getRemoteMcpResource())??Promise.resolve([]),this.workspaceMcpManagementService?.getInstalled()??Promise.resolve([])]);for(let s of n)e.push(this.toWorkspaceMcpServer(s,"user"));for(let s of o)e.push(this.toWorkspaceMcpServer(s,"remoteUser"));for(let s of i)e.push(this.toWorkspaceMcpServer(s,"workspace"));return e}toWorkspaceMcpServer(e,n){let o=n==="workspace"?this.workspaceContextService.getWorkspace().folders.find(i=>this.uriIdentityService.extUri.isEqual(i.toResource(bd),e.mcpResource)):void 0;return{...e,id:o?`${CM}${o.index}.${e.name}`:`mcp.config.${this.getConfigId(e,n)}.${e.name}`,scope:n,format:o?"workspaceRoot":"vscode"}}getConfigId(e,n){if(n==="user")return sne;if(n==="remoteUser")return ane;if(n==="workspace"){let o=this.workspaceContextService.getWorkspace();if(o.configuration&&this.uriIdentityService.extUri.isEqual(o.configuration,e.mcpResource))return lne;let i=o.folders;for(let s=0;s<i.length;s++){let a=i[s];if(this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.joinPath(a.uri,Yi[xi]),e.mcpResource))return`${LM}${s}`}}return"unknown"}async install(e,n){if(n=n??{},this.validateWorkspaceConfigOptions(n),n.target===5||Lu(n.target)){let i=n.target===5?this.workspaceContextService.getWorkspace().configuration:n.target.toResource(n.workspaceConfig==="root"?bd:Yi[xi]);if(!i)throw new Error(`Illegal target: ${n.target}`);n.mcpResource=i;let s=await this.workspaceMcpManagementService.install(e,n);return this.toWorkspaceMcpServer(s,"workspace")}if(n.target===4){if(!this.remoteMcpManagementService)throw new Error(`Illegal target: ${n.target}`);n.mcpResource=await this.getRemoteMcpResource(n.mcpResource);let i=await this.remoteMcpManagementService.install(e,n);return this.toWorkspaceMcpServer(i,"remoteUser")}if(n.target&&n.target!==2&&n.target!==3)throw new Error(`Illegal target: ${n.target}`);n.mcpResource=this.userDataProfileService.currentProfile.mcpResource;let o=await this.mcpManagementService.install(e,n);return this.toWorkspaceMcpServer(o,"user")}async installFromGallery(e,n){if(n=n??{},this.validateWorkspaceConfigOptions(n),n.workspaceConfig==="root"||n.mcpResource&&this.isWorkspaceRootResource(n.mcpResource))throw new Error(d(25441,null));if(n.target===5||Lu(n.target)){let i=n.target===5?this.workspaceContextService.getWorkspace().configuration:n.target.toResource(Yi[xi]);if(!i)throw new Error(`Illegal target: ${n.target}`);n.mcpResource=i;let s=await this.workspaceMcpManagementService.installFromGallery(e,n);return this.toWorkspaceMcpServer(s,"workspace")}if(n.target===4){if(!this.remoteMcpManagementService)throw new Error(`Illegal target: ${n.target}`);n.mcpResource=await this.getRemoteMcpResource(n.mcpResource);let i=await this.remoteMcpManagementService.installFromGallery(e,n);return this.toWorkspaceMcpServer(i,"remoteUser")}if(n.target&&n.target!==2&&n.target!==3)throw new Error(`Illegal target: ${n.target}`);n.mcpResource||(n.mcpResource=this.userDataProfileService.currentProfile.mcpResource);let o=await this.mcpManagementService.installFromGallery(e,n);return this.toWorkspaceMcpServer(o,"user")}validateWorkspaceConfigOptions(e){let n=this.workspaceInstallTargetService.getTargets(),o=this.workspaceContextService.getWorkspace().configuration;if((e.target===5||e.mcpResource&&o&&this.uriIdentityService.extUri.isEqual(e.mcpResource,o))&&!n.includes(5))throw new Error(d(25443,null));let i=e.target;if(Lu(i)&&!n.some(s=>Lu(s)&&this.uriIdentityService.extUri.isEqual(s.uri,i.uri)))throw new Error(d(25442,null));if(e.workspaceConfig!==void 0&&!Lu(e.target))throw new Error(d(25444,null))}isWorkspaceRootResource(e){return this.workspaceContextService.getWorkspace().folders.some(n=>this.uriIdentityService.extUri.isEqual(n.toResource(bd),e))}async updateMetadata(e,n,o){if(e.scope==="workspace"){let s=await this.workspaceMcpManagementService.updateMetadata(e,n,o);return this.toWorkspaceMcpServer(s,"workspace")}if(e.scope==="remoteUser"){if(!this.remoteMcpManagementService)throw new Error(`Illegal target: ${e.scope}`);let s=await this.remoteMcpManagementService.updateMetadata(e,n,o);return this.toWorkspaceMcpServer(s,"remoteUser")}let i=await this.mcpManagementService.updateMetadata(e,n,o);return this.toWorkspaceMcpServer(i,"user")}async uninstall(e){let n=e.mcpResource,o={preserveInputIds:e.format===void 0||e.format==="vscode"?await this.getInputIdsReferencedByOtherResources(n):void 0};if(e.scope==="workspace")return this.workspaceMcpManagementService.uninstall(e,o);if(e.scope==="remoteUser"){if(!this.remoteMcpManagementService)throw new Error(`Illegal target: ${e.scope}`);return this.remoteMcpManagementService.uninstall(e,{...o,mcpResource:n})}return this.mcpManagementService.uninstall(e,{...o,mcpResource:n})}async getInputIdsReferencedByOtherResources(e){let n=new je(a=>this.uriIdentityService.extUri.getComparisonKey(a)),o=this.userDataProfileService.currentProfile.mcpResource;if(n.set(o,2),this.remoteMcpManagementService){let a=await this.getRemoteMcpResource(o);a&&n.set(a,2)}let i=this.workspaceContextService.getWorkspace();i.configuration&&n.set(i.configuration,5);for(let a of i.folders)n.set(a.toResource(Yi[xi]),6);n.delete(e);let s=new Set;return await Promise.all(Array.from(n,async([a,l])=>{try{let c=await this.mcpResourceScannerService.scanMcpServers(a,l);Aa(c,s)}catch(c){throw new Error(d(25440,null,a.toString(),ye(c)),{cause:c})}})),[...s]}async getRemoteMcpResource(e){if(!e&&this.userDataProfileService.currentProfile.isDefault)return;e=e??this.userDataProfileService.currentProfile.mcpResource;let n=this.userDataProfilesService.profiles.find(o=>this.uriIdentityService.extUri.isEqual(o.mcpResource,e));return n?n=await this.remoteUserDataProfilesService.getRemoteProfile(n):n=(await this.remoteUserDataProfilesService.getRemoteProfiles()).find(o=>this.uriIdentityService.extUri.isEqual(o.mcpResource,e)),n?.mcpResource}};bE=w([b(1,dr),b(2,z),b(3,hm),b(4,Ye),b(5,fl),b(6,fE),b(7,Bt),b(8,_M),b(9,Hn),b(10,MM),b(11,Ji)],bE);Py=class extends xd{constructor(t,e,n,o,i,s,a,l,c){super(t,e,n,o,i,s,a,l,c)}async installFromGallery(t,e){if(this.format==="workspaceRoot")throw new Error(d(25441,null));this.logService.trace("MCP Management Service: installGallery",t.name,t.galleryUrl),this._onInstallMcpServer.fire({name:t.name,mcpResource:this.mcpResource});try{let n=e?.packageType??t.configuration.packages?.[0]?.registryType??"remote",{mcpServerConfiguration:o,notices:i}=this.getMcpServerConfigurationFromManifest(t.configuration,n);i.length>0&&this.logService.warn(`MCP Management Service: Warnings while installing ${t.name}`,i);let s={name:t.name,config:{...o.config,gallery:t.galleryUrl??!0,version:t.version},inputs:o.inputs};this.ensureServerAllowed(s),await this.mcpResourceScannerService.addMcpServers([s],this.mcpResource,this.target,this.format),await this.updateLocal(t);let a=(await this.getInstalled()).find(l=>l.name===t.name);if(!a)throw new Error(`Failed to install MCP server: ${t.name}`);return a}catch(n){throw this._onDidInstallMcpServers.fire([{name:t.name,source:t,error:n,mcpResource:this.mcpResource}]),n}}updateMetadata(){throw new Error("Not supported")}installFromUri(){throw new Error("Not supported")}async getLocalServerInfo(t,e){if(!e.gallery)return;let[n]=await this.mcpGalleryService.getMcpServersFromGallery([{name:t}]);if(n)return{name:n.name,version:e.version,displayName:n.displayName,description:n.description,galleryUrl:n.galleryUrl,manifest:n.configuration,publisher:n.publisher,publisherDisplayName:n.publisherDisplayName,repositoryUrl:n.repositoryUrl,icon:n.icon}}canInstall(t){throw new Error("Not supported")}};Py=w([b(3,ka),b(4,Le),b(5,Ye),b(6,z),b(7,Ji),b(8,dr)],Py);ky=class extends Ds{constructor(e,n,o,i,s){super(e,o);this.uriIdentityService=n;this.workspaceContextService=i;this.instantiationService=s;this._onInstallMcpServer=this._register(new R);this.onInstallMcpServer=this._onInstallMcpServer.event;this._onDidInstallMcpServers=this._register(new R);this.onDidInstallMcpServers=this._onDidInstallMcpServers.event;this._onDidUpdateMcpServers=this._register(new R);this.onDidUpdateMcpServers=this._onDidUpdateMcpServers.event;this._onUninstallMcpServer=this._register(new R);this.onUninstallMcpServer=this._onUninstallMcpServer.event;this._onDidUninstallMcpServer=this._register(new R);this.onDidUninstallMcpServer=this._onDidUninstallMcpServer.event;this.allMcpServers=[];this.workspaceMcpManagementServices=new je(a=>this.uriIdentityService.extUri.getComparisonKey(a)),this.workspaceUpdatePromise=this.initialize(),this._register(this.workspaceContextService.onDidChangeWorkspaceFolders(a=>{this.workspaceUpdatePromise=this.workspaceUpdatePromise.then(()=>this.onDidChangeWorkspaceFolders(a))})),this._register(this.workspaceContextService.onDidChangeWorkbenchState(()=>{this.workspaceUpdatePromise=this.workspaceUpdatePromise.then(()=>this.onDidChangeWorkbenchState())}))}async initialize(){try{await this.onDidChangeWorkbenchState(),await this.onDidChangeWorkspaceFolders({added:this.workspaceContextService.getWorkspace().folders,removed:[],changed:[]})}catch(e){this.logService.error("Failed to initialize workspace folders",e)}}async onDidChangeWorkbenchState(){this.workspaceConfiguration&&await this.removeWorkspaceService(this.workspaceConfiguration),this.workspaceConfiguration=this.workspaceContextService.getWorkspace().configuration,this.workspaceConfiguration&&await this.addWorkspaceService(this.workspaceConfiguration,5)}async onDidChangeWorkspaceFolders(e){try{await Promise.allSettled(e.removed.flatMap(n=>[this.removeWorkspaceService(n.toResource(Yi[xi])),this.removeWorkspaceService(n.toResource(bd))]))}catch(n){this.logService.error(n)}try{await Promise.allSettled(e.added.flatMap(o=>[this.addWorkspaceService(o.toResource(Yi[xi]),6),this.addWorkspaceService(o.toResource(bd),6,"workspaceRoot")]));let n=this.allMcpServers.filter(o=>e.changed.some(i=>this.uriIdentityService.extUri.isEqual(o.mcpResource,i.toResource(Yi[xi]))||this.uriIdentityService.extUri.isEqual(o.mcpResource,i.toResource(bd))));n.length&&this._onDidUpdateMcpServers.fire(n.map(o=>({name:o.name,local:o,mcpResource:o.mcpResource})))}catch(n){this.logService.error(n)}}async addWorkspaceService(e,n,o="vscode"){if(this.workspaceMcpManagementServices.has(e))return;let i=new re,s=i.add(this.instantiationService.createInstance(Py,e,n,o));this.workspaceMcpManagementServices.set(e,{service:s,dispose:()=>i.dispose()});try{let a=await s.getInstalled();if(this._store.isDisposed)return;if(this.allMcpServers.push(...a),a.length>0){let l=a.map(c=>({name:c.name,local:c,mcpResource:c.mcpResource}));this._onDidInstallMcpServers.fire(l)}}catch(a){this.logService.warn("Failed to get installed servers from",e.toString(),a)}this._store.isDisposed||(i.add(s.onInstallMcpServer(a=>this._onInstallMcpServer.fire(a))),i.add(s.onDidInstallMcpServers(a=>{for(let{local:l}of a)l&&this.allMcpServers.push(l);this._onDidInstallMcpServers.fire(a)})),i.add(s.onDidUpdateMcpServers(a=>{for(let{local:l,mcpResource:c}of a)if(l){let u=this.allMcpServers.findIndex(p=>this.uriIdentityService.extUri.isEqual(p.mcpResource,c)&&p.name===l.name);u!==-1&&this.allMcpServers.splice(u,1,l)}this._onDidUpdateMcpServers.fire(a)})),i.add(s.onUninstallMcpServer(a=>this._onUninstallMcpServer.fire(a))),i.add(s.onDidUninstallMcpServer(a=>{let l=this.allMcpServers.findIndex(c=>this.uriIdentityService.extUri.isEqual(c.mcpResource,a.mcpResource)&&c.name===a.name);l!==-1&&(this.allMcpServers.splice(l,1),this._onDidUninstallMcpServer.fire(a))})))}async removeWorkspaceService(e){let n=this.workspaceMcpManagementServices.get(e);if(n){try{let o=await n.service.getInstalled();this.allMcpServers=this.allMcpServers.filter(i=>!o.some(s=>this.uriIdentityService.extUri.isEqual(s.mcpResource,i.mcpResource)));for(let i of o)this._onDidUninstallMcpServer.fire({name:i.name,mcpResource:i.mcpResource})}catch(o){this.logService.warn("Failed to get installed servers from",e.toString(),o)}this.workspaceMcpManagementServices.delete(e),n.dispose()}}async getInstalled(){return await this.workspaceUpdatePromise,this.allMcpServers}async install(e,n){if(await this.workspaceUpdatePromise,!n?.mcpResource)throw new Error("MCP resource is required");let o=this.workspaceMcpManagementServices.get(n?.mcpResource);if(!o)throw new Error(`No MCP management service found for resource: ${n?.mcpResource.toString()}`);return o.service.install(e,n)}async uninstall(e,n){await this.workspaceUpdatePromise;let o=e.mcpResource,i=this.workspaceMcpManagementServices.get(o);if(!i)throw new Error(`No MCP management service found for resource: ${o.toString()}`);return i.service.uninstall(e,n)}async installFromGallery(e,n){if(await this.workspaceUpdatePromise,!n?.mcpResource)throw new Error("MCP resource is required");let o=this.workspaceMcpManagementServices.get(n?.mcpResource);if(!o)throw new Error(`No MCP management service found for resource: ${n?.mcpResource.toString()}`);return o.service.installFromGallery(e,n)}updateMetadata(){throw new Error("Not supported")}dispose(){this.workspaceMcpManagementServices.forEach(e=>e.dispose()),this.workspaceMcpManagementServices.clear(),super.dispose()}};ky=w([b(0,dr),b(1,Ye),b(2,z),b(3,fl),b(4,Hn)],ky)});var OM,Y7=v(()=>{(l=>(l.LATEST_PROTOCOL_VERSION="2025-11-25",l.JSONRPC_VERSION="2.0",l.PARSE_ERROR=-32700,l.INVALID_REQUEST=-32600,l.METHOD_NOT_FOUND=-32601,l.INVALID_PARAMS=-32602,l.INTERNAL_ERROR=-32603,l.URL_ELICITATION_REQUIRED=-32042))(OM||={})});var X7=v(()=>{Y7()});function Ay(r,t){if(r===t)return!0;if(S.isUri(r)||S.isUri(t))return S.isUri(r)&&S.isUri(t)&&Tn(r,t);if(r==null||t===null||t===void 0||typeof r!=typeof t||typeof r!="object"||Array.isArray(r)!==Array.isArray(t))return!1;if(Array.isArray(r)&&Array.isArray(t))return Gt(r,t,Ay);let e=[];for(let o in r)e.push(o);e.sort();let n=[];for(let o in t)n.push(o);if(n.sort(),!Gt(e,n))return!1;for(let o of e)if(!Ay(Reflect.get(r,o),Reflect.get(t,o)))return!1;return!0}var cne,dne,une,t9,pne,Fmt,mne,Dy,gne,Z7,fne,SE,Hmt,Wmt,hne,Vmt,Bmt,n9=v(()=>{Dt();ni();Ve();Q();Xt();ks();it();te();ee();dn();ro();Yn();Z();hy();Pa();J7();X7();Sy();cne="mcp.config.";(n=>{function r(o,i){return o.id===i.id&&o.remoteAuthority===i.remoteAuthority&&o.label===i.label&&o.provenance===i.provenance&&o.discoverySource===i.discoverySource&&o.trustBehavior===i.trustBehavior&&Ge(o.sandbox,i.sandbox)}n.equals=r;function t(o){return o.configTarget===5||o.configTarget===6}n.isWorkspaceDiscovered=t;function e(o){return o.id.startsWith(`${cne}${LM}`)}n.isVscodeMcpJson=e})(dne||={});(n=>{function r(o){return o}n.toSerialized=r;function t(o){return{id:o.id,label:o.label,cacheNonce:o.cacheNonce,staticMetadata:o.staticMetadata,launch:Dy.fromSerialized(o.launch),defaultCwd:o.defaultCwd?S.revive(o.defaultCwd):void 0,sandboxEnabled:o.sandboxEnabled,version:o.version,gallery:o.gallery,variableReplacement:o.variableReplacement?t9.fromSerialized(o.variableReplacement):void 0,environmentVariableExpansion:o.environmentVariableExpansion}}n.fromSerialized=t;function e(o,i){return o.id===i.id&&o.label===i.label&&o.cacheNonce===i.cacheNonce&&Tn(o.defaultCwd,i.defaultCwd)&&Gt(o.roots,i.roots,(s,a)=>s.toString()===a.toString())&&Ay(o.launch,i.launch)&&Ay(o.presentation,i.presentation)&&Ay(o.variableReplacement,i.variableReplacement)&&Ge(o.environmentVariableExpansion,i.environmentVariableExpansion)&&Ge(o.devMode,i.devMode)&&o.version===i.version&&o.gallery===i.gallery&&o.sandboxEnabled===i.sandboxEnabled}n.equals=e})(une||={});(e=>{function r(n){return n}e.toSerialized=r;function t(n){return{section:n.section,folder:n.folder?{...n.folder,uri:S.revive(n.folder.uri)}:void 0,target:n.target}}e.fromSerialized=t})(t9||={});(t=>t.Empty={working:!1,starting:[],serversRequiringInteraction:[]})(pne||={});Fmt=A("IMcpService");(t=>{let r;(s=>(s[s.Trusted=0]="Trusted",s[s.TrustedOnNonce=1]="TrustedOnNonce",s[s.Untrusted=2]="Untrusted",s[s.Unknown=3]="Unknown"))(r=t.Kind||={})})(mne||={});(i=>{function r(s){return s}i.toSerialized=r;function t(s){switch(s.type){case 2:return{type:s.type,transport:s.transport,uri:S.revive(s.uri),headers:s.headers,oauth:s.oauth,authentication:s.authentication};case 1:return{type:s.type,cwd:s.cwd,command:s.command,args:s.args,env:s.env,envFile:s.envFile,sandbox:s.sandbox}}}i.fromSerialized=t;function e(s,a){if(s.type==="stdio")return{type:1,command:s.command,args:s.args?[...s.args]:[],env:s.env?{...s.env}:{},envFile:s.envFile,cwd:s.cwd,sandbox:o(a,s.sandbox)};try{return{type:2,...s.transport==="sse"?{transport:"sse"}:{},uri:S.parse(s.url),headers:Object.entries(s.headers??{}),oauth:s.oauth}}catch{return}}i.fromServerConfiguration=e;async function n(s){let a=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(s)));return Gs(O.wrap(new Uint8Array(a)))}i.hash=n;function o(s,a){return s?{network:{allowedDomains:rn(a?.network?.allowedDomains??[]),deniedDomains:rn([...s.network?.deniedDomains??[],...a?.network?.deniedDomains??[]])},filesystem:{allowWrite:rn(a?.filesystem?.allowWrite??[]),denyRead:rn([...s.filesystem?.denyRead??[],...a?.filesystem?.denyRead??[]]),denyWrite:rn([...s.filesystem?.denyWrite??[],...a?.filesystem?.denyWrite??[]])}}:a}})(Dy||={});(i=>{let r;(u=>(u[u.Stopped=0]="Stopped",u[u.Starting=1]="Starting",u[u.Running=2]="Running",u[u.Error=3]="Error"))(r=i.Kind||={}),i.toString=s=>{switch(s.state){case 0:return d(19382,null);case 1:return d(19381,null);case 2:return d(19380,null);case 3:return d(19379,null,s.message);default:lc(s)}},i.toKindString=s=>{switch(s){case 0:return"stopped";case 1:return"starting";case 2:return"running";case 3:return"error";default:lc(s)}},i.canBeStarted=s=>s===3||s===0,i.isRunning=s=>!(0,i.canBeStarted)(s.state)})(gne||={});Z7=class r extends Error{constructor(e){super(`${r.prefix}${e}`);this.reason=e}static{this.prefix="User interaction required: "}static is(e){return e.message.startsWith(this.prefix)}},fne=A("IMcpWorkbenchService"),SE=class extends D{constructor(e,n){super();this.containers=e;this._register(n.onChange(this.update,this))}set mcpServer(e){this.containers.forEach(n=>n.mcpServer=e)}update(e){for(let n of this.containers)e&&n.mcpServer?e.id===n.mcpServer.id&&(n.mcpServer=e):n.update()}};SE=w([b(1,fne)],SE);Hmt=new C("mcpServersGalleryStatus","unavailable"),Wmt=new C("hasInstalledMcpServers",!0);(o=>{o.scheme="mcp-resource";let t="dylo78gyp";function e(i,s){return typeof s=="string"&&(s=S.parse(s)),s.with({scheme:o.scheme,authority:Gs(O.fromString(i.id)),path:["",s.scheme,s.authority||t].join("/")+s.path})}o.fromServer=e;function n(i){if(typeof i=="string"&&(i=S.parse(i)),i.scheme!==o.scheme)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);let s=i.path.split("/");if(s.length<3)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);let[,a,l,...c]=s,u=new URL(`${a}://${l.toLowerCase()===t?"":l}`);return u.pathname=c.length?"/"+c.join("/"):"",u.search=i.query,u.hash=i.fragment,{definitionId:Dg(i.authority).toString(),resourceURL:u}}o.toServer=n})(hne||={});Vmt=A("IMcpServerSampling"),Bmt=A("IMcpElicitationService")});var Kmt,jmt,o9=v(()=>{Z();Kmt=A("scm"),jmt=A("scmView")});var Xi,_y=v(()=>{Xi=class r{constructor(t,e=t.length){this.path=t;this.viewEnd=e;if(t.length===0||e<1)throw new Error("cannot create test with empty path")}static fromExtHostTestItem(t,e,n=t.parent){if(t._isRoot)return new r([e]);let o=[t.id];for(let i=n;i&&i.id!==e;i=i.parent)o.push(i.id);return o.push(e),new r(o.reverse())}static isRoot(t){return!t.includes("\0")}static root(t){let e=t.indexOf("\0");return e===-1?t:t.slice(0,e)}static fromString(t){return new r(t.split("\0"))}static join(t,e){return new r([...t.path,e])}static split(t){return t.split("\0")}static joinToString(t,e){return t.toString()+"\0"+e}static parentId(t){let e=t.lastIndexOf("\0");return e===-1?void 0:t.slice(0,e)}static localId(t){let e=t.lastIndexOf("\0");return e===-1?t:t.slice(e+1)}static isChild(t,e){return e[t.length]==="\0"&&e.startsWith(t)}static compare(t,e){return t===e?0:r.isChild(t,e)?2:r.isChild(e,t)?3:1}static getLengthOfCommonPrefix(t,e){if(t===0)return 0;let n=0;for(;n<t-1;){for(let o=1;o<t;o++){let i=e(o-1),s=e(o);if(i.path[n]!==s.path[n])return n}n++}return n}get rootId(){return new r(this.path,1)}get parentId(){return this.viewEnd>1?new r(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let t=1;t<=this.viewEnd;t++)yield new r(this.path,t)}*idsToRoot(){for(let t=this.viewEnd;t>0;t--)yield new r(this.path,t)}compare(t){if(typeof t=="string")return r.compare(this.toString(),t);for(let e=0;e<t.viewEnd&&e<this.viewEnd;e++)if(t.path[e]!==this.path[e])return 1;return t.viewEnd>this.viewEnd?2:t.viewEnd<this.viewEnd?3:0}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let t=1;t<this.viewEnd;t++)this.stringifed+="\0",this.stringifed+=this.path[t]}return this.stringifed}}});function KM(r){return{...r,location:r.location?.toJSON()}}function jM(r){return r.location=r.location?Gi.isIPosition(r.location)?Gi.lift(r.location):Mn.lift(r.location):void 0,r}var igt,My,UM,NM,FM,HM,xE,r9,zM,GM,WM,km,VM,yne,i9,vne,Ine,BM,qM,$M,bne,CE=v(()=>{te();Lx();ba();ee();_y();igt={2:d(23739,null),4:d(23738,null),8:d(23737,null)};(e=>(e.serialize=n=>({range:n.range.toJSON(),uri:n.uri.toJSON()}),e.deserialize=(n,o)=>({range:Mn.lift(o.range),uri:n.asCanonicalUri(S.revive(o.uri))})))(My||={});(e=>(e.serialize=n=>({label:n.label,uri:n.uri?.toJSON(),position:n.position?.toJSON()}),e.deserialize=(n,o)=>({label:o.label,uri:o.uri?n.asCanonicalUri(S.revive(o.uri)):void 0,position:o.position?Gi.lift(o.position):void 0})))(UM||={});(e=>(e.serialize=n=>({message:n.message,type:0,expected:n.expected,actual:n.actual,contextValue:n.contextValue,location:n.location&&My.serialize(n.location),stackTrace:n.stackTrace?.map(UM.serialize)}),e.deserialize=(n,o)=>({message:o.message,type:0,expected:o.expected,actual:o.actual,contextValue:o.contextValue,location:o.location&&My.deserialize(n,o.location),stackTrace:o.stackTrace&&o.stackTrace.map(i=>UM.deserialize(n,i))})))(NM||={});(e=>(e.serialize=n=>({message:n.message,type:1,offset:n.offset,length:n.length,location:n.location&&My.serialize(n.location)}),e.deserialize=(n,o)=>({message:o.message,type:1,offset:o.offset,length:o.length,location:o.location&&My.deserialize(n,o.location)})))(FM||={});(n=>(n.serialize=o=>o.type===0?NM.serialize(o):FM.serialize(o),n.deserialize=(o,i)=>i.type===0?NM.deserialize(o,i):FM.deserialize(o,i),n.isDiffable=o=>o.type===0&&o.actual!==void 0&&o.expected!==void 0))(HM||={});(n=>(n.serializeWithoutMessages=o=>({state:o.state,duration:o.duration,messages:[]}),n.serialize=o=>({state:o.state,duration:o.duration,messages:o.messages.map(HM.serialize)}),n.deserialize=(o,i)=>({state:i.state,duration:i.duration,messages:i.messages.map(s=>HM.deserialize(o,s))})))(xE||={});r9="\0",zM=(r,t)=>r+r9+t,GM=r=>{let t=r.indexOf(r9);return{ctrlId:r.slice(0,t),tagId:r.slice(t+1)}};(e=>(e.serialize=n=>({extId:n.extId,label:n.label,tags:n.tags,busy:n.busy,children:void 0,uri:n.uri?.toJSON(),range:n.range?.toJSON()||null,description:n.description,error:n.error,sortText:n.sortText}),e.deserialize=(n,o)=>({extId:o.extId,label:o.label,tags:o.tags,busy:o.busy,children:void 0,uri:o.uri?n.asCanonicalUri(S.revive(o.uri)):void 0,range:o.range?Mn.lift(o.range):null,description:o.description,error:o.error,sortText:o.sortText})))(WM||={});(e=>(e.serialize=n=>({expand:n.expand,item:WM.serialize(n.item)}),e.deserialize=(n,o)=>({controllerId:Xi.root(o.item.extId),expand:o.expand,item:WM.deserialize(n,o.item)})))(km||={});(e=>(e.serialize=n=>{let o;return n.item&&(o={},n.item.label!==void 0&&(o.label=n.item.label),n.item.tags!==void 0&&(o.tags=n.item.tags),n.item.busy!==void 0&&(o.busy=n.item.busy),n.item.uri!==void 0&&(o.uri=n.item.uri?.toJSON()),n.item.range!==void 0&&(o.range=n.item.range?.toJSON()),n.item.description!==void 0&&(o.description=n.item.description),n.item.error!==void 0&&(o.error=n.item.error),n.item.sortText!==void 0&&(o.sortText=n.item.sortText)),{extId:n.extId,expand:n.expand,item:o}},e.deserialize=n=>{let o;return n.item&&(o={},n.item.label!==void 0&&(o.label=n.item.label),n.item.tags!==void 0&&(o.tags=n.item.tags),n.item.busy!==void 0&&(o.busy=n.item.busy),n.item.range!==void 0&&(o.range=n.item.range?Mn.lift(n.item.range):null),n.item.description!==void 0&&(o.description=n.item.description),n.item.error!==void 0&&(o.error=n.item.error),n.item.sortText!==void 0&&(o.sortText=n.item.sortText)),{extId:n.extId,expand:n.expand,item:o}}))(VM||={});(n=>(n.serializeWithoutMessages=o=>({...km.serialize(o),ownComputedState:o.ownComputedState,computedState:o.computedState,tasks:o.tasks.map(xE.serializeWithoutMessages)}),n.serialize=o=>({...km.serialize(o),ownComputedState:o.ownComputedState,computedState:o.computedState,tasks:o.tasks.map(xE.serialize)}),n.deserialize=(o,i)=>({...km.deserialize(o,i),ownComputedState:i.ownComputedState,computedState:i.computedState,tasks:i.tasks.map(s=>xE.deserialize(o,s)),retired:!0})))(yne||={});(e=>(e.empty=()=>({covered:0,total:0}),e.sum=(n,o)=>{n.covered+=o.covered,n.total+=o.total}))(i9||={});(n=>(n.serialize=o=>({id:o.id,statement:o.statement,branch:o.branch,declaration:o.declaration,testIds:o.testIds,uri:o.uri.toJSON()}),n.deserialize=(o,i)=>({id:i.id,statement:i.statement,branch:i.branch,declaration:i.declaration,testIds:i.testIds,uri:o.asCanonicalUri(S.revive(i.uri))}),n.empty=(o,i)=>({id:o,uri:i,statement:i9.empty()})))(vne||={});(e=>(e.serialize=n=>n.type===0?qM.serialize(n):$M.serialize(n),e.deserialize=n=>n.type===0?qM.deserialize(n):$M.deserialize(n)))(Ine||={});(e=>(e.serialize=KM,e.deserialize=jM))(BM||={});(e=>(e.serialize=KM,e.deserialize=jM))(qM||={});(e=>(e.serialize=n=>({...KM(n),branches:n.branches?.map(BM.serialize)}),e.deserialize=n=>({...jM(n),branches:n.branches?.map(BM.deserialize)})))($M||={});(e=>(e.deserialize=(n,o)=>o.op===0?{op:o.op,item:km.deserialize(n,o.item)}:o.op===1?{op:o.op,item:VM.deserialize(o.item)}:o.op===2?{op:o.op,uri:n.asCanonicalUri(S.revive(o.uri)),docv:o.docv}:o,e.serialize=n=>n.op===0?{op:n.op,item:km.serialize(n.item)}:n.op===1?{op:n.op,item:VM.serialize(n.item)}:n))(bne||={})});var lgt,s9=v(()=>{Z();lgt=A("IAiSettingsSearchService")});var Pgt,a9=v(()=>{Z();Wh();Pgt=A("editorGroupsService")});var l9,c9,d9,QM=v(()=>{Z();a9();l9=A("editorService"),c9=-1,d9=-2});function L(r){let t=new JM(r);return Sne[t.nid]=t,t}var JM,Sne,Am,EE=v(()=>{JM=class r{constructor(t){this._proxyIdentifierBrand=void 0;this.sid=t,this.nid=++r.count}static{this.count=0}},Sne=[];Am=class{constructor(t){this.value=t}}});var Ly,xne,Xgt,YM,Dm,XM,u9,ZM=v(()=>{Ue();ue();Q();ni();CE();_y();$s();Ly=(r,t)=>r===t,xne={range:(r,t)=>r===t?!0:!r||!t?!1:r.equalsRange(t),busy:Ly,label:Ly,description:Ly,error:Ly,sortText:Ly,tags:(r,t)=>!(r.length!==t.length||r.some(e=>!t.includes(e)))},Xgt=Object.entries(xne),YM=class extends Error{constructor(t){super(`Attempted to insert a duplicate test item ID ${t}`)}},Dm=class extends Error{constructor(t){super(`TestItem with ID "${t}" is invalid. Make sure to create it from the createTestItem method.`)}},XM=class extends Error{constructor(t,e,n){super(`TestItem with ID "${t}" is from controller "${e}" and cannot be added as a child of an item from controller "${n}".`)}},u9=(r,t,e)=>{let n=new Map;return{get size(){return n.size},forEach(o,i){for(let s of n.values())o.call(i,s,this)},[Symbol.iterator](){return n.entries()},replace(o){let i=new Map,s=new Set(n.keys()),a={op:5,ops:[]};for(let l of o){if(!(l instanceof e))throw new Dm(l.id);let c=t(l).controllerId;if(c!==r.controllerId)throw new XM(l.id,c,r.controllerId);if(i.has(l.id))throw new YM(l.id);i.set(l.id,l),s.delete(l.id),a.ops.push({op:0,item:l})}for(let l of s.keys())a.ops.push({op:3,id:l});r.listener?.(a),n=i},add(o){if(!(o instanceof e))throw new Dm(o.id);n.set(o.id,o),r.listener?.({op:0,item:o})},delete(o){n.delete(o)&&r.listener?.({op:3,id:o})},get(o){return n.get(o)},toJSON(){return Array.from(n.values())}}}});var p9,m9,wE,eL=v(()=>{ZM();p9=new WeakMap,m9=(r,t)=>{let e={controllerId:t};return p9.set(r,e),e},wE=r=>{let t=p9.get(r);if(!t)throw new Dm(r?.id||"<unknown>");return t}});function SL(r){return typeof r>"u"?r:typeof r=="string"?S.file(r):r}function E9(r){switch(typeof r.mimeType=="string"?r.mimeType.toLowerCase():""){case"image/png":case"image/jpeg":case"image/jpg":case"image/gif":case"image/webp":case"image/bmp":return!0;default:return!1}}var bL,be,Da,Cne,_a,g9,Ene,tL,wne,nL,TE,Rne,yt,Oy,oL,f9,Tne,Ms,Pne,Ma,wd,rL,kne,Fy,Ane,Dne,Xl,_ne,Mne,Lne,One,Une,iL,Nne,h9,Fne,y9,Hne,v9,Wne,sL,aL,Vne,Bne,I9,b9,qne,$ne,zne,Gne,Kne,jne,lL,Qne,Jne,cL,Yne,_s,Xne,xL,dL,uL,Zne,Uy,pL,mL,eoe,toe,noe,ooe,roe,S9,Zl,CL,x9,Hy,ioe,soe,aoe,EL,loe,RE,coe,C9,Ny,doe,uoe,gL,w9,R9,T9,P9,fL,k9,hL,A9,D9,_9,M9,L9,O9,U9,N9,F9,H9,W9,poe,moe,yL,V9,B9,q9,$9,vL,z9,goe,foe,G9,hoe,K9,PE,wL,j9,yoe,Q9,voe,Ioe,IL,boe,J9,Soe,Y9,xoe,Coe,Eoe,woe,Roe,X9,Toe,Poe,koe,Z9,e$,Aoe,RL=v(()=>{Dt();Ve();jW();mg();xr();fn();Ax();fs();Ka();Kc();Xt();fe();pV();it();ra();Ie();te();Vt();xV();ba();lD();Nh();RV();TV();kV();Wh();Bh();qh();S7();$x();iy();O7();my();$_();U7();n9();th();th();o9();_y();CE();s9();QM();L_();EE();eL();wx();wx();(e=>{function r(n){let{selectionStartLineNumber:o,selectionStartColumn:i,positionLineNumber:s,positionColumn:a}=n,l=new qe(o-1,i-1),c=new qe(s-1,a-1);return new Bi(l,c)}e.to=r;function t(n){let{anchor:o,active:i}=n;return{selectionStartLineNumber:o.line+1,selectionStartColumn:o.character+1,positionLineNumber:i.line+1,positionColumn:i.character+1}}e.from=t})(bL||={});(e=>{function r(n){if(!n)return;let{start:o,end:i}=n;return{startLineNumber:o.line+1,startColumn:o.character+1,endLineNumber:i.line+1,endColumn:i.character+1}}e.from=r;function t(n){if(!n)return;let{startLineNumber:o,startColumn:i,endLineNumber:s,endColumn:a}=n;return new Xe(o-1,i-1,s-1,a-1)}e.to=t})(be||={});(e=>{function r(n){return{uri:n.uri,range:be.from(n.range)}}e.from=r;function t(n){return new Oo(S.revive(n.uri),be.to(n.range))}e.to=t})(Da||={});(t=>{function r(e){switch(e){case 1:return 1;case 0:return 0;case 3:return 3;case 2:return 2}}t.to=r})(Cne||={});(e=>{function r(n){return new qe(n.lineNumber-1,n.column-1)}e.to=r;function t(n){return{lineNumber:n.line+1,column:n.character+1}}e.from=t})(_a||={});(n=>{function r(o,i,s){return Zo(qd(o).map(a=>t(a,i,s)))}n.from=r;function t(o,i,s){if(typeof o=="string")return{$serialized:!0,language:o,isBuiltin:s?.isBuiltin};if(o)return{$serialized:!0,language:o.language,scheme:e(o.scheme,i),pattern:_s.from(o.pattern)??void 0,exclusive:o.exclusive,notebookType:o.notebookType,isBuiltin:s?.isBuiltin}}function e(o,i){return i&&typeof o=="string"?i.transformOutgoingScheme(o):o}})(g9||={});(e=>{function r(n){return n.viewType!==void 0}function t(n,o,i){return r(n)?{viewType:n.viewType}:{uri:g9.from(n.uri,o,i)}}e.from=t})(Ene||={});(e=>{function r(n){switch(n){case 1:return 1;case 2:return 2}}e.from=r;function t(n){switch(n){case 1:return 1;case 2:return 2;default:return}}e.to=t})(tL||={});(e=>{function r(n){let o;return n.code&&(G(n.code)||to(n.code)?o=String(n.code):o={value:String(n.code.value),target:n.code.target}),{...be.from(n.range),message:n.message,source:n.source,code:o,severity:TE.from(n.severity),relatedInformation:n.relatedInformation&&n.relatedInformation.map(nL.from),tags:Array.isArray(n.tags)?Zo(n.tags.map(tL.from)):void 0}}e.from=r;function t(n){let o=new jc(be.to(n),n.message,TE.to(n.severity));return o.source=n.source,o.code=G(n.code)?n.code:n.code?.value,o.relatedInformation=n.relatedInformation&&n.relatedInformation.map(nL.to),o.tags=n.tags&&Zo(n.tags.map(tL.to)),o}e.to=t})(wne||={});(e=>{function r(n){return{...be.from(n.location.range),message:n.message,resource:n.location.uri}}e.from=r;function t(n){return new Ul(new Oo(n.resource,be.to(n)),n.message)}e.to=t})(nL||={});(e=>{function r(n){switch(n){case 0:return 8;case 1:return 4;case 2:return 2;case 3:return 1}return 8}e.from=r;function t(n){switch(n){case 2:return 2;case 4:return 1;case 8:return 0;case 1:return 3;default:return 0}}e.to=t})(TE||={});(e=>{function r(n){return typeof n=="number"&&n>=1?n-1:n===-2?d9:c9}e.from=r;function t(n){if(typeof n=="number"&&n>=0)return n+1;throw new Error("invalid 'EditorGroupColumn'")}e.to=t})(Rne||={});(s=>{function r(a){return a.map(s.from)}s.fromMany=r;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function e(a){let l;if(t(a)){let{language:p,value:m}=a;l={value:"```"+p+`
`+m+"\n```\n"}}else Lo.isMarkdownString(a)?l={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,supportAlertSyntax:a.supportAlertSyntax,baseUri:a.baseUri}:typeof a=="string"?l={value:a}:l={value:""};let c=Object.create(null);l.uris=c;let u=({href:p})=>{try{let m=S.parse(p,!0);m=m.with({query:n(m.query,c)}),c[p]=m}catch{}return""};return Ft.walkTokens(Ft.lexer(l.value),p=>{p.type==="link"?u({href:p.href}):p.type==="image"&&typeof p.href=="string"&&u(QT(p.href))}),l}s.from=e;function n(a,l){if(!a)return a;let c;try{c=$I(a)}catch{}if(!c)return a;let u=!1;return c=so(c,p=>{if(S.isUri(p)){let m=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[m]=p,u=!0,m}else return}),u?JSON.stringify(c):a}function o(a){let l=new Lo(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.supportAlertSyntax=a.supportAlertSyntax,l.baseUri=a.baseUri?S.from(a.baseUri):void 0,l}s.to=o;function i(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=i})(yt||={});(t=>{function r(e){return typeof e>"u"?e:{contentText:e.contentText,contentIconPath:e.contentIconPath?SL(e.contentIconPath):void 0,border:e.border,borderColor:e.borderColor,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,color:e.color,backgroundColor:e.backgroundColor,margin:e.margin,width:e.width,height:e.height}}t.from=r})(Oy||={});(t=>{function r(e){return typeof e>"u"?e:{backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?SL(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?Oy.from(e.before):void 0,after:e.after?Oy.from(e.after):void 0}}t.from=r})(oL||={});(t=>{function r(e){if(typeof e>"u")return e;switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3}}t.from=r})(f9||={});(t=>{function r(e){return{isWholeLine:e.isWholeLine,rangeBehavior:e.rangeBehavior?f9.from(e.rangeBehavior):void 0,overviewRulerLane:e.overviewRulerLane,light:e.light?oL.from(e.light):void 0,dark:e.dark?oL.from(e.dark):void 0,backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?SL(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?Oy.from(e.before):void 0,after:e.after?Oy.from(e.after):void 0}}t.from=r})(Tne||={});(e=>{function r(n){return{text:n.newText,eol:n.newEol&&lL.from(n.newEol),range:be.from(n.range)}}e.from=r;function t(n){let o=new Uo(be.to(n.range),n.text);return o.newEol=typeof n.eol>"u"?void 0:lL.to(n.eol),o}e.to=t})(Ms||={});(e=>{function r(n,o){let i={edits:[]};if(n instanceof Nl){let s=new Ws;for(let a of n._allEntries())a._type===1&&S.isUri(a.to)&&a.from===void 0&&s.add(a.to);for(let a of n._allEntries())if(a._type===1){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:oo(O.wrap(a.options.contents))}:l={type:"dataTransferItem",id:a.options.contents._itemId}),i.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:l},metadata:a.metadata})}else a._type===2?i.edits.push({resource:a.uri,textEdit:Ms.from(a.edit),versionId:s.has(a.uri)?void 0:o?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===6?i.edits.push({resource:a.uri,textEdit:{range:be.from(a.range),text:a.edit.value,insertAsSnippet:!0,keepWhitespace:a.keepWhitespace},versionId:s.has(a.uri)?void 0:o?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===3?i.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:o?.getNotebookDocumentVersion(a.uri)}):a._type===5&&i.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:o?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:1,index:a.index,count:a.count,cells:a.cells.map(Uy.from)}})}return i}e.from=r;function t(n){let o=new Nl,i=new je;for(let s of n.edits)if(s.textEdit){let a=s,l=S.revive(a.resource),c=be.to(a.textEdit.range),u=a.textEdit.text,p=a.textEdit.insertAsSnippet,m;p?(m=Qc.replace(c,new zo(u)),m.keepWhitespace=a.textEdit.keepWhitespace):m=Uo.replace(c,u);let g=i.get(l);g?g.push(m):i.set(l,[m])}else o.renameFile(S.revive(s.oldResource),S.revive(s.newResource),s.options);for(let[s,a]of i)o.set(s,a);return o}e.to=t})(Pne||={});(n=>{let r=Object.create(null);r[0]=0,r[1]=1,r[2]=2,r[3]=3,r[4]=4,r[5]=5,r[6]=6,r[7]=7,r[8]=8,r[9]=9,r[10]=10,r[11]=11,r[12]=12,r[13]=13,r[14]=14,r[15]=15,r[16]=16,r[17]=17,r[18]=18,r[19]=19,r[20]=20,r[21]=21,r[22]=22,r[23]=23,r[24]=24,r[25]=25;function t(o){return typeof r[o]=="number"?r[o]:6}n.from=t;function e(o){for(let i in r)if(r[i]===o)return Number(i);return 6}n.to=e})(Ma||={});(e=>{function r(n){if(n===1)return 1}e.from=r;function t(n){if(n===1)return 1}e.to=t})(wd||={});(e=>{function r(n){return{name:n.name,kind:Ma.from(n.kind),tags:n.tags&&n.tags.map(wd.from),containerName:n.containerName,location:Xl.from(n.location)}}e.from=r;function t(n){let o=new ma(n.name,Ma.to(n.kind),n.containerName,Xl.to(n.location));return o.tags=n.tags&&n.tags.map(wd.to),o}e.to=t})(rL||={});(e=>{function r(n){let o={name:n.name||"!!MISSING: name!!",detail:n.detail,range:be.from(n.range),selectionRange:be.from(n.selectionRange),kind:Ma.from(n.kind),tags:n.tags?.map(wd.from)??[]};return n.children&&(o.children=n.children.map(r)),o}e.from=r;function t(n){let o=new ha(n.name,n.detail,Ma.to(n.kind),be.to(n.range),be.to(n.selectionRange));return ac(n.tags)&&(o.tags=n.tags.map(wd.to)),n.children&&(o.children=n.children.map(t)),o}e.to=t})(kne||={});(e=>{function r(n){let o=new jp(Ma.to(n.kind),n.name,n.detail||"",S.revive(n.uri),be.to(n.range),be.to(n.selectionRange));return o._sessionId=n._sessionId,o._itemId=n._itemId,o}e.to=r;function t(n,o,i){if(o=o??n._sessionId,i=i??n._itemId,o===void 0||i===void 0)throw new Error("invalid item");return{_sessionId:o,_itemId:i,name:n.name,detail:n.detail,kind:Ma.from(n.kind),uri:n.uri,range:be.from(n.range),selectionRange:be.from(n.selectionRange),tags:n.tags?.map(wd.from)}}e.from=t})(Fy||={});(t=>{function r(e){return new ZS(Fy.to(e.from),e.fromRanges.map(n=>be.to(n)))}t.to=r})(Ane||={});(t=>{function r(e){return new ex(Fy.to(e.to),e.fromRanges.map(n=>be.to(n)))}t.to=r})(Dne||={});(e=>{function r(n){return{range:n.range&&be.from(n.range),uri:n.uri}}e.from=r;function t(n){return new Oo(S.revive(n.uri),be.to(n.range))}e.to=t})(Xl||={});(e=>{function r(n){let o=n,i=n;return{originSelectionRange:o.originSelectionRange?be.from(o.originSelectionRange):void 0,uri:o.targetUri?o.targetUri:i.uri,range:be.from(o.targetRange?o.targetRange:i.range),targetSelectionRange:o.targetSelectionRange?be.from(o.targetSelectionRange):void 0}}e.from=r;function t(n){return{targetUri:S.revive(n.uri),targetRange:be.to(n.range),targetSelectionRange:n.targetSelectionRange?be.to(n.targetSelectionRange):void 0,originSelectionRange:n.originSelectionRange?be.to(n.originSelectionRange):void 0}}e.to=t})(_ne||={});(e=>{function r(n){return{range:be.from(n.range),contents:yt.fromMany(n.contents),canIncreaseVerbosity:n.canIncreaseVerbosity,canDecreaseVerbosity:n.canDecreaseVerbosity}}e.from=r;function t(n){let o=n.contents.map(yt.to),i=be.to(n.range),s=n.canIncreaseVerbosity,a=n.canDecreaseVerbosity;return new _p(o,i,s,a)}e.to=t})(Mne||={});(e=>{function r(n){return{range:be.from(n.range),expression:n.expression}}e.from=r;function t(n){return new qp(be.to(n.range),n.expression)}e.to=t})(Lne||={});(e=>{function r(n){if(n instanceof $p)return{type:"text",range:be.from(n.range),text:n.text};if(n instanceof zp)return{type:"variable",range:be.from(n.range),variableName:n.variableName,caseSensitiveLookup:n.caseSensitiveLookup};if(n instanceof Gp)return{type:"expression",range:be.from(n.range),expression:n.expression};throw new Error("Unknown 'InlineValue' type")}e.from=r;function t(n){switch(n.type){case"text":return{range:be.to(n.range),text:n.text};case"variable":return{range:be.to(n.range),variableName:n.variableName,caseSensitiveLookup:n.caseSensitiveLookup};case"expression":return{range:be.to(n.range),expression:n.expression}}}e.to=t})(One||={});(e=>{function r(n){return{frameId:n.frameId,stoppedLocation:be.from(n.stoppedLocation)}}e.from=r;function t(n){return new Kp(n.frameId,be.to(n.stoppedLocation))}e.to=t})(Une||={});(e=>{function r(n){return{range:be.from(n.range),kind:n.kind}}e.from=r;function t(n){return new Mp(be.to(n.range),n.kind)}e.to=t})(iL||={});(e=>{function r(n){return{uri:n.uri,highlights:n.highlights.map(iL.from)}}e.from=r;function t(n){return new Lp(S.revive(n.uri),n.highlights.map(iL.to))}e.to=t})(Nne||={});(t=>{function r(e){switch(e){case 1:return 1;case 2:return 2;case 0:default:return 0}}t.to=r})(h9||={});(t=>{function r(e){return{triggerKind:h9.to(e.triggerKind),triggerCharacter:e.triggerCharacter}}t.to=r})(Fne||={});(e=>{function r(n){if(n===1)return 1}e.from=r;function t(n){if(n===1)return 1}e.to=t})(y9||={});(t=>{function r(e,n,o){return"icon"in e&&"command"in e?{command:n.toInternal(e.command,o),icon:X9.fromThemeIcon(e.icon)}:{command:n.toInternal(e,o)}}t.from=r})(Hne||={});(o=>{let r=new Map([[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,7],[21,6],[8,8],[9,9],[10,12],[11,13],[20,14],[12,15],[19,16],[13,17],[14,28],[0,18],[15,19],[16,20],[17,21],[18,23],[22,10],[23,11],[24,24],[26,26],[25,25]]);function t(i){return r.get(i)??9}o.from=t;let e=new Map([[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[7,7],[6,21],[8,8],[9,9],[12,10],[13,11],[14,20],[15,12],[16,19],[17,13],[28,14],[18,0],[19,15],[20,16],[21,17],[23,18],[10,22],[11,23],[24,24],[25,25],[26,26]]);function n(i){return e.get(i)??9}o.to=n})(v9||={});(t=>{function r(e,n){let o=new Fp(e.label);return o.insertText=e.insertText,o.kind=v9.to(e.kind),o.tags=e.tags?.map(y9.to),o.detail=e.detail,o.documentation=Ni(e.documentation)?yt.to(e.documentation):e.documentation,o.sortText=e.sortText,o.filterText=e.filterText,o.preselect=e.preselect,o.commitCharacters=e.commitCharacters,Mn.isIRange(e.range)?o.range=be.to(e.range):typeof e.range=="object"&&(o.range={inserting:be.to(e.range.insert),replacing:be.to(e.range.replace)}),o.keepWhitespace=typeof e.insertTextRules>"u"?!1:!!(e.insertTextRules&1),typeof e.insertTextRules<"u"&&e.insertTextRules&4?o.insertText=new zo(e.insertText):(o.insertText=e.insertText,o.textEdit=o.range instanceof Xe?new Uo(o.range,o.insertText):void 0),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(o.additionalTextEdits=e.additionalTextEdits.map(i=>Ms.to(i))),o.command=n&&e.command?n.fromInternal(e.command):void 0,o}t.to=r})(Wne||={});(e=>{function r(n){if(typeof n.label!="string"&&!Array.isArray(n.label))throw new TypeError("Invalid label");return{label:n.label,documentation:yt.fromStrict(n.documentation)}}e.from=r;function t(n){return{label:n.label,documentation:Ni(n.documentation)?yt.to(n.documentation):n.documentation}}e.to=t})(sL||={});(e=>{function r(n){return{label:n.label,documentation:yt.fromStrict(n.documentation),parameters:Array.isArray(n.parameters)?n.parameters.map(sL.from):[],activeParameter:n.activeParameter}}e.from=r;function t(n){return{label:n.label,documentation:Ni(n.documentation)?yt.to(n.documentation):n.documentation,parameters:Array.isArray(n.parameters)?n.parameters.map(sL.to):[],activeParameter:n.activeParameter}}e.to=t})(aL||={});(e=>{function r(n){return{activeSignature:n.activeSignature,activeParameter:n.activeParameter,signatures:Array.isArray(n.signatures)?n.signatures.map(aL.from):[]}}e.from=r;function t(n){return{activeSignature:n.activeSignature,activeParameter:n.activeParameter,signatures:Array.isArray(n.signatures)?n.signatures.map(aL.to):[]}}e.to=t})(Vne||={});(t=>{function r(e,n){let o=new Np(_a.to(n.position),typeof n.label=="string"?n.label:n.label.map(I9.to.bind(void 0,e)),n.kind&&b9.to(n.kind));return o.textEdits=n.textEdits&&n.textEdits.map(Ms.to),o.tooltip=Ni(n.tooltip)?yt.to(n.tooltip):n.tooltip,o.paddingLeft=n.paddingLeft,o.paddingRight=n.paddingRight,o}t.to=r})(Bne||={});(t=>{function r(e,n){let o=new Up(n.label);return o.tooltip=Ni(n.tooltip)?yt.to(n.tooltip):n.tooltip,dD.is(n.command)&&(o.command=e.fromInternal(n.command)),n.location&&(o.location=Xl.to(n.location)),o}t.to=r})(I9||={});(e=>{function r(n){return n}e.from=r;function t(n){return n}e.to=t})(b9||={});(e=>{function r(n){return{range:be.from(n.range),url:n.target,tooltip:n.tooltip}}e.from=r;function t(n){let o;if(n.url)try{o=typeof n.url=="string"?S.parse(n.url,!0):S.revive(n.url)}catch{}let i=new Hp(be.to(n.range),o);return i.tooltip=n.tooltip,i}e.to=t})(qne||={});(e=>{function r(n){let o=new Wp(n.label);return n.textEdit&&(o.textEdit=Ms.to(n.textEdit)),n.additionalTextEdits&&(o.additionalTextEdits=n.additionalTextEdits.map(i=>Ms.to(i))),o}e.to=r;function t(n){return{label:n.label,textEdit:n.textEdit?Ms.from(n.textEdit):void 0,additionalTextEdits:n.additionalTextEdits?n.additionalTextEdits.map(o=>Ms.from(o)):void 0}}e.from=t})($ne||={});(e=>{function r(n){return new Jc(n[0],n[1],n[2],n[3])}e.to=r;function t(n){return[n.red,n.green,n.blue,n.alpha]}e.from=t})(zne||={});(e=>{function r(n){return{range:be.from(n.range)}}e.from=r;function t(n){return new Op(be.to(n.range))}e.to=t})(Gne||={});(t=>{function r(e){switch(e){case 2:return 2;case 1:return 1;case 3:case 4:return 3}}t.to=r})(Kne||={});(e=>{function r(n){switch(n){case 0:return 0;case 2:return 2;case 3:return 3;case 1:default:return 1}}e.from=r;function t(n){switch(n){case 0:return 0;case 2:return 2;case 3:return 3;case 1:default:return 1}}e.to=t})(jne||={});(e=>{function r(n){if(n===2)return 1;if(n===1)return 0}e.from=r;function t(n){if(n===1)return 2;if(n===0)return 1}e.to=t})(lL||={});(t=>{function r(e){if(typeof e=="object")return e.viewId;switch(e){case 1:return 3;case 10:return 10;case 15:return 15}throw new Error("Unknown 'ProgressLocation'")}t.from=r})(Qne||={});(e=>{function r(n){let o={start:n.start+1,end:n.end+1};return n.kind&&(o.kind=cL.from(n.kind)),o}e.from=r;function t(n){let o={start:n.start-1,end:n.end-1};return n.kind&&(o.kind=cL.to(n.kind)),o}e.to=t})(Jne||={});(e=>{function r(n){if(n)switch(n){case 1:return Sa.Comment;case 2:return Sa.Imports;case 3:return Sa.Region}}e.from=r;function t(n){if(n)switch(n.value){case Sa.Comment.value:return 1;case Sa.Imports.value:return 2;case Sa.Region.value:return 3}}e.to=t})(cL||={});(t=>{function r(e){if(e)return{pinned:typeof e.preview=="boolean"?!e.preview:void 0,inactive:e.background,preserveFocus:e.preserveFocus,selection:typeof e.selection=="object"?be.from(e.selection):void 0,override:typeof e.override=="boolean"?vD.id:void 0}}t.from=r})(Yne||={});(o=>{function r(i){return i instanceof Fl?i.toJSON():typeof i=="string"?i:t(i)||e(i)?new Fl(i.baseUri??i.base,i.pattern).toJSON():i}o.from=r;function t(i){let s=i;return s?S.isUri(s.baseUri)&&typeof s.pattern=="string":!1}function e(i){let s=i;return s?typeof s.base=="string"&&typeof s.pattern=="string":!1}function n(i){return typeof i=="string"?i:new Fl(S.revive(i.baseUri),i.pattern)}o.to=n})(_s||={});(t=>{function r(e){if(e){if(Array.isArray(e))return e.map(r);if(typeof e=="string")return e;{let n=e;return{language:n.language,scheme:n.scheme,pattern:_s.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType}}}else return}t.from=r})(Xne||={});(e=>{function r(n){return{start:n.start,end:n.end}}e.from=r;function t(n){return new Vi(n.start,n.end)}e.to=t})(xL||={});(e=>{function r(n){return{timing:typeof n.runStartTime=="number"&&typeof n.runEndTime=="number"?{startTime:n.runStartTime,endTime:n.runEndTime}:void 0,executionOrder:n.executionOrder,success:n.lastRunSuccess}}e.to=r;function t(n){return{lastRunSuccess:n.success,runStartTime:n.timing?.startTime,runEndTime:n.timing?.endTime,executionOrder:n.executionOrder}}e.from=t})(dL||={});(e=>{function r(n){switch(n){case 1:return 1;case 2:default:return 2}}e.from=r;function t(n){switch(n){case 1:return 1;case 2:default:return 2}}e.to=t})(uL||={});(e=>{function r(n){let o={metadata:n.metadata??Object.create(null),cells:[]};for(let i of n.cells)Dp.validate(i),o.cells.push(Uy.from(i));return o}e.from=r;function t(n){let o=new Xf(n.cells.map(Uy.to));return Wa(n.metadata)||(o.metadata=n.metadata),o}e.to=t})(Zne||={});(e=>{function r(n){return{cellKind:uL.from(n.kind),language:n.languageId,mime:n.mime,source:n.value,metadata:n.metadata,internalMetadata:dL.from(n.executionSummary??{}),outputs:n.outputs?n.outputs.map(mL.from):[]}}e.from=r;function t(n){return new Dp(uL.to(n.cellKind),n.source,n.language,n.mime,n.outputs?n.outputs.map(mL.to):void 0,n.metadata,n.internalMetadata?dL.to(n.internalMetadata):void 0)}e.to=t})(Uy||={});(e=>{function r(n){return{mime:n.mime,valueBytes:O.wrap(n.data)}}e.from=r;function t(n){return new Zf(n.valueBytes.buffer,n.mime)}e.to=t})(pL||={});(e=>{function r(n){return{outputId:n.id,items:n.items.map(pL.from),metadata:n.metadata}}e.from=r;function t(n){let o=n.items.map(pL.to);return new eh(o,n.outputId,n.metadata)}e.to=t})(mL||={});(n=>{function r(o){return e(o)?{include:_s.from(o.include)??void 0,exclude:_s.from(o.exclude)??void 0}:_s.from(o)??void 0}n.from=r;function t(o){return e(o)?{include:_s.to(o.include),exclude:_s.to(o.exclude)}:_s.to(o)}n.to=t;function e(o){let i=o;return i?!Kt(i.include)&&!Kt(i.exclude):!1}})(eoe||={});(t=>{function r(e,n,o){let i=typeof e.command=="string"?{title:"",command:e.command}:e.command;return{alignment:e.alignment===1?1:2,command:n.toInternal(i,o),text:e.text,tooltip:e.tooltip,accessibilityInformation:e.accessibilityInformation,priority:e.priority}}t.from=r})(toe||={});(t=>{function r(e,n,o){let i=typeof e.command=="string"?{title:"",command:e.command}:e.command;return{command:n.toInternal(i,o),label:e.label,description:e.description,detail:e.detail,documentation:e.documentation}}t.from=r})(noe||={});(t=>{function r(e){return{transientOutputs:e?.transientOutputs??!1,transientCellMetadata:e?.transientCellMetadata??{},transientDocumentMetadata:e?.transientDocumentMetadata??{},cellContentMetadata:e?.cellContentMetadata??{}}}t.from=r})(ooe||={});(e=>{function r(n){return{uri:n.uri,provides:n.provides}}e.from=r;function t(n){return new ox(S.revive(n.uri),n.provides)}e.to=t})(roe||={});(e=>{function r(n){return{message:yt.fromStrict(n.message)||"",type:0,expected:n.expectedOutput,actual:n.actualOutput,contextValue:n.contextValue,location:n.location&&{range:be.from(n.location.range),uri:n.location.uri},stackTrace:n.stackTrace?.map(o=>({label:o.label,position:o.position&&_a.from(o.position),uri:o.uri&&S.revive(o.uri).toJSON()}))}}e.from=r;function t(n){let o=new Hl(typeof n.message=="string"?n.message:yt.to(n.message));return o.actualOutput=n.actual,o.expectedOutput=n.expected,o.contextValue=n.contextValue,o.location=n.location?Xl.to(n.location):void 0,o}e.to=t})(S9||={});(e=>(e.namespace=zM,e.denamespace=GM))(Zl||={});(t=>{function r(e){return{controllerId:e.controllerId,profileId:e.profileId,group:x9.from(e.kind)}}t.from=r})(CL||={});(e=>{let r={3:8,2:4,1:2};function t(n){return r.hasOwnProperty(n)?r[n]:2}e.from=t})(x9||={});(e=>{function r(n){let o=wE(n).controllerId;return{extId:Xi.fromExtHostTestItem(n,o).toString(),label:n.label,uri:S.revive(n.uri),busy:n.busy,tags:n.tags.map(i=>Zl.namespace(o,i.id)),range:Mn.lift(be.from(n.range)),description:n.description||null,sortText:n.sortText||null,error:n.error&&yt.fromStrict(n.error)||null}}e.from=r;function t(n){return{parent:void 0,error:void 0,id:Xi.fromString(n.extId).localId,label:n.label,uri:S.revive(n.uri),tags:(n.tags||[]).map(o=>{let{tagId:i}=Zl.denamespace(o);return new Xc(i)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:be.to(n.range||void 0),canResolveChildren:!1,busy:n.busy,description:n.description||void 0,sortText:n.sortText||void 0}}e.toPlain=t})(Hy||={});(e=>{function r(n){return{id:n.id}}e.from=r;function t(n){return new Xc(n.id)}e.to=t})(Zl||={});(e=>{let r=(n,o)=>{let i=n.value;if(!i)return;let s={...Hy.toPlain(i.item),parent:o,taskStates:i.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===0).map(S9.to)})),children:[]};if(n.children)for(let a of n.children.values()){let l=r(a,s);l&&s.children.push(l)}return s};function t(n){let o=new Dx;for(let a of n.items)o.insert(Xi.fromString(a.item.extId).path,a);let i=[o.nodes],s=[];for(;i.length;)for(let a of i.pop())a.value?s.push(a):a.children&&i.push(a.children.values());return{completedAt:n.completedAt,results:s.map(a=>r(a)).filter(oi)}}e.to=t})(ioe||={});(s=>{function r(a){return{covered:a.covered,total:a.total}}function t(a){return"line"in a?_a.from(a):be.from(a)}function e(a){if(a)return"endLineNumber"in a?be.to(a):_a.to(a)}function n(a){if(a.type===1){let l=[];if(a.branches)for(let c of a.branches)l.push({executed:c.count,location:e(c.location),label:c.label});return new sx(a.count,e(a.location),a.branches?.map(c=>new ax(c.count,e(c.location),c.label)))}else return new lx(a.name,a.count,e(a.location))}s.to=n;function o(a){if(typeof a.executed=="number"&&a.executed<0)throw new Error(`Invalid coverage count ${a.executed}`);return"branches"in a?{count:a.executed,location:t(a.location),type:1,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&t(l.location),label:l.label})):void 0}:{type:0,name:a.name,count:a.executed,location:t(a.location)}}s.fromDetails=o;function i(a,l,c){return kh(c.statementCoverage),kh(c.branchCoverage),kh(c.declarationCoverage),{id:l,uri:c.uri,statement:r(c.statementCoverage),branch:c.branchCoverage&&r(c.branchCoverage),declaration:c.declarationCoverage&&r(c.declarationCoverage),testIds:c instanceof ix&&c.includesTests.length?c.includesTests.map(u=>Xi.fromExtHostTestItem(u,a).toString()):void 0}}s.fromFile=i})(soe||={});(t=>{function r(e){switch(e){case 1:return 1;case 2:return 2}}t.to=r})(aoe||={});(e=>{function r(n){let o=new Jp(Ma.to(n.kind),n.name,n.detail||"",S.revive(n.uri),be.to(n.range),be.to(n.selectionRange));return o._sessionId=n._sessionId,o._itemId=n._itemId,o}e.to=r;function t(n,o,i){if(o=o??n._sessionId,i=i??n._itemId,o===void 0||i===void 0)throw new Error("invalid item");return{_sessionId:o,_itemId:i,kind:Ma.from(n.kind),name:n.name,detail:n.detail??"",uri:n.uri,range:be.from(n.range),selectionRange:be.from(n.selectionRange),tags:n.tags?.map(wd.from)}}e.from=t})(EL||={});(t=>{function r(e){if(e)return{value:e.value,tooltip:e.tooltip}}t.from=r})(loe||={});(o=>{function r(i,s,a){let l=s.fileData;return l?new tx(new nx(l.name,S.revive(l.uri),l.id,sc(()=>a(l.id)))):i===wr.uriList&&s.uriListData?new Qp(n(s.uriListData)):new Qp(s.asString)}o.to=r;async function t(i,s,a=Ee()){let l=await s.asString();if(i===wr.uriList)return{id:a,asString:l,fileData:void 0,uriListData:e(l)};let c=s.asFile();return{id:a,asString:l,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}o.from=t;function e(i){return Rx.split(i).map(s=>{if(s.startsWith("#"))return s;try{return S.parse(s)}catch{}return s})}function n(i){return Rx.create(i.map(s=>typeof s=="string"?s:S.revive(s)))}})(RE||={});(n=>{function r(o,i){let s=o.items.map(([a,l])=>[a,RE.to(a,l,i)]);return new Bp(s)}n.toDataTransfer=r;async function t(o){return{items:await Promise.all(Array.from(o,async([s,a])=>[s,await RE.from(s,a)]))}}n.from=t;async function e(o){return{items:await Promise.all(Array.from(o,async([s,a])=>[s,await RE.from(s,a,a.id)]))}}n.fromList=e})(coe||={});(e=>{function r(n,o){return{kind:"reply",agentId:n.participant??o?.agentId??"",subCommand:n.command??o?.command,message:n.prompt,title:n.label}}e.from=r;function t(n){return{prompt:n.message,label:n.title,participant:n.agentId,command:n.subCommand}}e.to=t})(C9||={});(e=>{function r(n){switch(n){case 0:return 3;case 1:return 1;case 2:return 2}}e.to=r;function t(n){switch(n){case 3:return 0;case 1:return 1;case 2:return 2}return 1}e.from=t})(Ny||={});(e=>{function r(n){let o=n.content.map(a=>{if(a.type==="text")return new zn(a.value,a.audience);if(a.type==="tool_result"){let l=Zo(a.value.map(c=>c.type==="text"?new zn(c.value,c.audience):c.type==="data"?new Go(c.data.buffer,c.mimeType):c.type==="prompt_tsx"?new Rs(c.value):void 0));return new td(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return new Go(a.value.data.buffer,a.value.mimeType);if(a.type==="data")return new Go(a.data.buffer,a.mimeType);if(a.type==="tool_use")return new nd(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),i=Ny.to(n.role);return new Ix(i,o,n.name)}e.to=r;function t(n){let o=Ny.from(n.role),i=n.name,s=n.content;typeof s=="string"&&(s=[new zn(s)]);let a=s.map(l=>{if(l instanceof td)return{type:"tool_result",toolCallId:l.callId,value:Zo(l.content.map(c=>c instanceof zn?{type:"text",value:c.value,audience:c.audience}:c instanceof Rs?{type:"prompt_tsx",value:c.value}:c instanceof Go?{type:"data",mimeType:c.mimeType,data:O.wrap(c.data),audience:c.audience}:void 0)),isError:l.isError};if(l instanceof Go)return E9(l)?{type:"image_url",value:{mimeType:l.mimeType,data:O.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:O.wrap(l.data),audience:l.audience};if(l instanceof nd)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof zn)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type");return{type:"text",value:l}});return{role:o,name:i,content:a}}e.from=t})(doe||={});(e=>{function r(n){let o=n.content.map(a=>{if(a.type==="text")return new zn(a.value,a.audience);if(a.type==="tool_result"){let l=a.value.map(c=>c.type==="text"?new zn(c.value,c.audience):c.type==="data"?new Go(c.data.buffer,c.mimeType):new Rs(c.value));return new td(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new Go(a.value.data.buffer,a.value.mimeType):a.type==="data"?new Go(a.data.buffer,a.mimeType):a.type==="thinking"?new Yp(a.value,a.id,a.metadata):new nd(a.toolCallId,a.name,a.parameters)}),i=Ny.to(n.role);return new bx(i,o,n.name)}e.to=r;function t(n){let o=Ny.from(n.role),i=n.name,s=n.content;typeof s=="string"&&(s=[new zn(s)]);let a=s.map(l=>{if(l instanceof td)return{type:"tool_result",toolCallId:l.callId,value:Zo(l.content.map(c=>c instanceof zn?{type:"text",value:c.value,audience:c.audience}:c instanceof Rs?{type:"prompt_tsx",value:c.value}:c instanceof Go?{type:"data",mimeType:c.mimeType,data:O.wrap(c.data),audience:c.audience}:void 0)),isError:l.isError};if(l instanceof Go)return E9(l)?{type:"image_url",value:{mimeType:l.mimeType,data:O.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:O.wrap(l.data),audience:l.audience};if(l instanceof nd)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof zn)return{type:"text",value:l.value};if(l instanceof Yp)return{type:"thinking",value:l.value,id:l.id,metadata:l.metadata};if(typeof l!="string")throw new Error("Unexpected chat message content type llm 2");return{type:"text",value:l}});return{role:o,name:i,content:a}}e.from=t})(uoe||={});(e=>{function r(n){return{kind:"markdownContent",content:yt.from(n.value)}}e.from=r;function t(n){return new ch(yt.to(n.content))}e.to=t})(gL||={});(e=>{function r(n){return{kind:"codeblockUri",uri:n.value,isEdit:n.isEdit,undoStopId:n.undoStopId}}e.from=r;function t(n){return new xh(S.revive(n.uri),n.isEdit,n.undoStopId)}e.to=t})(w9||={});(e=>{function r(n){return{kind:"markdownVuln",content:yt.from(n.value),vulnerabilities:n.vulnerabilities}}e.from=r;function t(n){return new dh(yt.to(n.content),n.vulnerabilities)}e.to=t})(R9||={});(t=>{function r(e){return{kind:"confirmation",title:e.title,message:yt.from(e.message),data:e.data,buttons:e.buttons}}t.from=r})(T9||={});(o=>{function r(i){switch(i){case 1:return"text";case 2:return"singleSelect";case 3:return"multiSelect";default:return"text"}}function t(i){switch(i){case"text":return 1;case"singleSelect":return 2;case"multiSelect":return 3;default:return 1}}function e(i){return{kind:"questionCarousel",questions:i.questions.map(s=>({id:s.id,type:r(s.type),title:s.title,message:s.message?yt.from(s.message):void 0,options:s.options?.map(a=>({id:a.id,label:a.label,value:String(a.value)})),defaultValue:s.defaultValue,allowFreeformInput:s.allowFreeformInput})),allowSkip:i.allowSkip}}o.from=e;function n(i){let s=i.questions.map(a=>new fx(a.id,t(a.type),a.title,{message:a.message?typeof a.message=="string"?new Lo(a.message):yt.to(a.message):void 0,options:a.options?.map(l=>({id:l.id,label:l.label,value:l.value})),defaultValue:a.defaultValue,allowFreeformInput:a.allowFreeformInput}));return new Eh(s,i.allowSkip)}o.to=n})(P9||={});(e=>{function r(n){let{value:o,baseUri:i}=n;function s(a,l){return a.map(c=>{let u=S.joinPath(l,c.name);return{label:c.name,uri:u,children:c.children&&s(c.children,u)}})}return{kind:"treeData",treeData:{label:xn(i),uri:i,children:s(o,i)}}}e.from=r;function t(n){let o=en(n.treeData);function i(l){return l.map(c=>({name:c.label,children:c.children&&i(c.children)}))}let s=o.uri,a=o.children?i(o.children):[];return new uh(a,s)}e.to=t})(fL||={});(e=>{function r(n){return{kind:"multiDiffData",multiDiffData:{title:n.title,resources:n.value.map(o=>({originalUri:o.originalUri,modifiedUri:o.modifiedUri,goToFileUri:o.goToFileUri,added:o.added,removed:o.removed}))},readOnly:n.readOnly}}e.from=r;function t(n){let o=n.multiDiffData.resources.map(i=>({originalUri:i.originalUri?S.revive(i.originalUri):void 0,modifiedUri:i.modifiedUri?S.revive(i.modifiedUri):void 0,goToFileUri:i.goToFileUri?S.revive(i.goToFileUri):void 0,added:i.added,removed:i.removed}));return new ph(o,n.multiDiffData.title,n.readOnly)}e.to=t})(k9||={});(e=>{function r(n){let o=s=>S.isUri(s),i=s=>"name"in s;return{kind:"inlineReference",name:n.title,inlineReference:o(n.value)?n.value:i(n.value)?rL.from(n.value):Da.from(n.value)}}e.from=r;function t(n){let o=en(n);return new mh(S.isUri(o.inlineReference)?o.inlineReference:"location"in o.inlineReference?rL.to(o.inlineReference):Da.to(o.inlineReference),n.name)}e.to=t})(hL||={});(e=>{function r(n){return{kind:"progressMessage",content:yt.from(n.value)}}e.from=r;function t(n){return new gh(n.content.value)}e.to=t})(A9||={});(e=>{function r(n){return{kind:"thinking",value:n.value,id:n.id,metadata:n.metadata}}e.from=r;function t(n){return new fh(n.value??"",n.id,n.metadata)}e.to=t})(D9||={});(e=>{function r(n){return{kind:"hook",hookType:n.hookType,stopReason:n.stopReason,systemMessage:n.systemMessage,metadata:n.metadata}}e.from=r;function t(n){return new hh(n.hookType,n.stopReason,n.systemMessage,n.metadata)}e.to=t})(_9||={});(t=>{function r(e){return{kind:"voiceProgress",id:e.id,value:e.value}}t.from=r})(M9||={});(e=>{function r(n){return{kind:"autoModeResolution",resolved:n.resolvedModel}}e.from=r;function t(n){return new yh(n.resolved)}e.to=t})(L9||={});(e=>{function r(n){return{kind:"warning",content:yt.from(n.value)}}e.from=r;function t(n){return new vh(n.content.value)}e.to=t})(O9||={});(e=>{function r(n){return{kind:"info",content:yt.from(n.value)}}e.from=r;function t(n){return new Ih(n.content.value)}e.to=t})(U9||={});(t=>{function r(e){return{kind:"extensions",extensions:e.extensions}}t.from=r})(N9||={});(t=>{function r(e,n,o){let i;if(e.command)i=n.toInternal(e.command,o);else{if(!e.uri)throw new Error("Pull request part must have a command if URI is provided");i={title:"Open Pull Request",id:"vscode.open",arguments:[e.uri]}}return{kind:"pullRequest",author:e.author,title:e.title,description:e.description,uri:e.uri,linkTag:e.linkTag,command:i}}t.from=r})(F9||={});(e=>{function r(n){return{kind:"move",uri:n.uri,range:be.from(n.range)}}e.from=r;function t(n){return new Ch(S.revive(n.uri),be.to(n.range))}e.to=t})(H9||={});(l=>{function r(c){let u,p;c.toolSpecificData&&t(c.toolSpecificData)?(u=e(c.toolSpecificData,c.isError),p=void 0):p=c.toolSpecificData?n(c.toolSpecificData):void 0;let m=c.presentation==="hidden"?"hidden":c.presentation==="hiddenAfterComplete"?"hiddenAfterComplete":void 0;return c.enablePartialUpdate?{kind:"externalToolInvocationUpdate",toolCallId:c.toolCallId,toolName:c.toolName,isComplete:!!c.isComplete,invocationMessage:c.invocationMessage?yt.from(c.invocationMessage):void 0,pastTenseMessage:c.pastTenseMessage?yt.from(c.pastTenseMessage):void 0,toolSpecificData:p,subagentInvocationId:c.subAgentInvocationId,resultDetails:u}:{kind:"toolInvocationSerialized",toolCallId:c.toolCallId,toolId:c.toolName,invocationMessage:c.invocationMessage?yt.from(c.invocationMessage):c.toolName,originMessage:c.originMessage?yt.from(c.originMessage):void 0,pastTenseMessage:c.pastTenseMessage?yt.from(c.pastTenseMessage):void 0,isConfirmed:c.isConfirmed,isComplete:!0,source:py.External,toolSpecificData:p,resultDetails:u,presentation:m,subAgentInvocationId:c.subAgentInvocationId}}l.from=r;function t(c){return c!==null&&typeof c=="object"&&"input"in c&&typeof c.input=="string"&&"output"in c&&Array.isArray(c.output)}function e(c,u){return{input:c.input,output:c.output.map(p=>{let m=p.mimeType.startsWith("text/");return{type:"embed",mimeType:p.mimeType,value:m?O.wrap(p.data).toString():oo(O.wrap(p.data)),isText:m}}),isError:u??!1}}function n(c){return"command"in c&&"language"in c?{kind:"terminal",command:c.command,language:c.language}:"commandLine"in c&&"language"in c?{kind:"terminal",presentationOverrides:c.presentationOverrides&&typeof c.presentationOverrides.commandLine=="string"?{commandLine:c.presentationOverrides.commandLine,language:c.presentationOverrides.language}:void 0,commandLine:c.commandLine,language:c.language,terminalCommandOutput:typeof c.output?.text=="string"?{text:c.output.text}:void 0,terminalCommandState:c.state?{exitCode:c.state.exitCode,duration:c.state.duration}:void 0}:"todoList"in c&&Array.isArray(c.todoList)?{kind:"todoList",todoList:c.todoList.map(u=>({id:String(u.id),title:u.title,status:o(u.status)}))}:"input"in c&&"output"in c&&!Array.isArray(c.output)?{kind:"simpleToolInvocation",input:typeof c.input=="string"?c.input:"",output:typeof c.output=="string"?c.output:""}:c&&"values"in c&&Array.isArray(c.values)?{kind:"resources",values:c.values.map(u=>u instanceof Oo?Da.from(u):S.revive(u))}:c instanceof dx?{kind:"subagent",description:c.description,agentName:c.agentName,prompt:c.prompt,result:c.result,modelName:c.modelName}:c}function o(c){switch(c){case 1:return"not-started";case 2:return"in-progress";case 3:return"completed";default:return"not-started"}}function i(c){switch(c){case"not-started":return 1;case"in-progress":return 2;case"completed":return 3;default:return 1}}function s(c){let u=new Rh(c.toolId||c.toolName,c.toolCallId,c.errorMessage);return c.invocationMessage&&(u.invocationMessage=c.invocationMessage),c.originMessage&&(u.originMessage=c.originMessage),c.pastTenseMessage&&(u.pastTenseMessage=c.pastTenseMessage),c.isConfirmed!==void 0&&(u.isConfirmed=c.isConfirmed),c.isComplete!==void 0&&(u.isComplete=c.isComplete),c.toolSpecificData&&(u.toolSpecificData=a(c.toolSpecificData)),u.subAgentInvocationId=c.subAgentInvocationId,u.subAgentName=c.subAgentName,u}l.to=s;function a(c){if(c.kind==="terminal")if(c.commandLine){let u={commandLine:c.commandLine,language:c.language};return c.terminalCommandOutput&&(u.output={text:c.terminalCommandOutput.text,truncated:c.terminalCommandOutput.truncated,lineCount:c.terminalCommandOutput.lineCount}),c.terminalCommandState&&(u.state={exitCode:c.terminalCommandState.exitCode,duration:c.terminalCommandState.duration}),u}else return{command:c.command,language:c.language};else{if(c.kind==="terminal2")return{commandLine:c.commandLine,language:c.language};if(c.kind==="todoList")return{todoList:c.todoList.map((u,p)=>{let m=Number(u.id);return{id:Number.isFinite(m)?m:p,title:u.title,status:i(u.status)}})}}return c}})(W9||={});(t=>{function r(e){return{kind:"progressTask",content:yt.from(e.value)}}t.from=r})(poe||={});(t=>{function r(e){return{kind:"progressTaskResult",content:typeof e=="string"?yt.from(e):void 0}}t.from=r})(moe||={});(e=>{function r(n,o,i){return{kind:"command",command:o.toInternal(n.value,i)??{command:n.value.command,title:n.value.title}}}e.from=r;function t(n,o){return new bh(o.fromInternal(n.command)??{command:n.command.id,title:n.command.title})}e.to=t})(yL||={});(e=>{function r(n){return{kind:"textEdit",uri:n.uri,edits:n.edits.map(o=>Ms.from(o)),done:n.isDone,...n.autoTier!==void 0?{autoTier:n.autoTier}:{}}}e.from=r;function t(n){let o=new wh(S.revive(n.uri),n.edits.map(i=>Ms.to(i)));return o.isDone=n.done,o.autoTier=n.autoTier,o}e.to=t})(V9||={});(t=>{function r(e){return e.newCellMetadata?{editType:3,index:e.range.start,metadata:e.newCellMetadata}:e.newNotebookMetadata?{editType:5,metadata:e.newNotebookMetadata}:{editType:1,index:e.range.start,count:e.range.end-e.range.start,cells:e.newCells.map(Uy.from)}}t.from=r})(B9||={});(t=>{function r(e){return{kind:"notebookEdit",uri:e.uri,edits:e.edits.map(B9.from),done:e.isDone,...e.autoTier!==void 0?{autoTier:e.autoTier}:{}}}t.from=r})(q9||={});(t=>{function r(e){return{kind:"workspaceEdit",edits:e.edits.map(n=>({oldResource:n.oldResource,newResource:n.newResource}))}}t.from=r})($9||={});(e=>{function r(n){let o=Zt.isThemeIcon(n.iconPath)?n.iconPath:S.isUri(n.iconPath)?{light:S.revive(n.iconPath)}:n.iconPath&&"light"in n.iconPath&&"dark"in n.iconPath&&S.isUri(n.iconPath.light)&&S.isUri(n.iconPath.dark)?{light:S.revive(n.iconPath.light),dark:S.revive(n.iconPath.dark)}:void 0;return typeof n.value=="object"&&"variableName"in n.value?{kind:"reference",reference:{variableName:n.value.variableName,value:S.isUri(n.value.value)||!n.value.value?n.value.value:Da.from(n.value.value)},iconPath:o,options:n.options}:{kind:"reference",reference:S.isUri(n.value)||typeof n.value=="string"?n.value:Da.from(n.value),iconPath:o,options:n.options}}e.from=r;function t(n){let o=en(n),i=s=>S.isUri(s)?s:Da.to(s);return new Sh(typeof o.reference=="string"?o.reference:"variableName"in o.reference?{variableName:o.reference.variableName,value:o.reference.value&&i(o.reference.value)}:i(o.reference))}e.to=t})(vL||={});(t=>{function r(e){return{kind:"codeCitation",value:e.value,license:e.license,snippet:e.snippet}}t.from=r})(z9||={});(n=>{function r(o,i,s){return o instanceof ch?gL.from(o):o instanceof mh?hL.from(o):o instanceof Sh?vL.from(o):o instanceof gh?A9.from(o):o instanceof fh?D9.from(o):o instanceof hh?_9.from(o):o instanceof ux?M9.from(o):o instanceof uh?fL.from(o):o instanceof ph?k9.from(o):o instanceof bh?yL.from(o,i,s):o instanceof wh?V9.from(o):o instanceof hx?q9.from(o):o instanceof dh?R9.from(o):o instanceof xh?w9.from(o):o instanceof vh?O9.from(o):o instanceof Ih?U9.from(o):o instanceof cx?T9.from(o):o instanceof Eh?P9.from(o):o instanceof px?z9.from(o):o instanceof Ch?H9.from(o):o instanceof mx?N9.from(o):o instanceof gx?F9.from(o,i,s):o instanceof Rh?W9.from(o):o instanceof yx?$9.from(o):o instanceof yh?L9.from(o):{kind:"markdownContent",content:yt.from("")}}n.from=r;function t(o,i){switch(o.kind){case"reference":return vL.to(o);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return e(o,i)}}n.to=t;function e(o,i){switch(o.kind){case"markdownContent":return gL.to(o);case"inlineReference":return hL.to(o);case"progressMessage":return;case"treeData":return fL.to(o);case"command":return yL.to(o,i)}}n.toContent=e})(goe||={});(t=>{function r(e,n,o,i,s,a,l,c){let u=[],p=[];for(let y of e.variables.variables)y.kind==="tool"?u.push(y):y.kind==="toolset"?u.push(...y.value):p.push(y);let m=$l.parseLocalSessionId(e.sessionResource)??e.sessionResource.toString(),g={id:e.requestId,prompt:e.message,command:e.command,attempt:e.attempt??0,enableCommandDetection:e.enableCommandDetection??!0,isParticipantDetected:e.isParticipantDetected??!1,isVoiceModeInput:e.isVoiceModeInput,sessionId:m,sessionResource:e.sessionResource,references:p.flatMap(y=>K9.toReferences(y,s,c)),toolReferences:u.map(PE.to),location:G9.to(e.location),acceptedConfirmationData:e.acceptedConfirmationData,rejectedConfirmationData:e.rejectedConfirmationData,location2:n,toolInvocationToken:Object.freeze({sessionResource:e.sessionResource,requestId:e.requestId,workingDirectory:S.revive(e.workingDirectory)}),tools:a,model:o,modelConfiguration:i,editedFileEvents:e.editedFileEvents,modeInstructions:e.modeInstructions?.content,modeInstructions2:j9.to(e.modeInstructions),permissionLevel:e.permissionLevel,subAgentInvocationId:e.subAgentInvocationId,subAgentName:e.subAgentName,parentRequestId:e.parentRequestId,hasHooksEnabled:e.hasHooksEnabled??!1,hooks:e.hooks?Z9.to(e.hooks):void 0,isSystemInitiated:e.isSystemInitiated};return AC(l,"chatParticipantPrivate")||(delete g.id,delete g.attempt,delete g.enableCommandDetection,delete g.isParticipantDetected,delete g.isVoiceModeInput,delete g.location,delete g.location2,delete g.editedFileEvents,delete g.sessionId,delete g.subAgentInvocationId,delete g.subAgentName,delete g.parentRequestId,delete g.hasHooksEnabled,delete g.hooks),AC(l,"chatParticipantAdditions")||(delete g.acceptedConfirmationData,delete g.rejectedConfirmationData,delete g.tools),g}t.to=r})(foe||={});(e=>{function r(n){switch(n){case"notebook":return 3;case"terminal":return 2;case"panel":return 1;case"editor":return 4}}e.to=r;function t(n){switch(n){case 3:return"notebook";case 2:return"terminal";case 1:return"panel";case 4:return"editor"}}e.from=t})(G9||={});(e=>{function r(n){return n.id}e.from=r;function t(n){switch(n){case"agent":return ws.Agent;case"skill":return ws.Skill;case"instructions":return ws.Instructions;case"prompt":return ws.Prompt;case"hook":return ws.Hook;case"plugins":return ws.Plugins;default:return new ws(n)}}e.to=t})(hoe||={});(e=>{function r(n,o,i){let s=t(n,o,i);if(!s)return[];let a=Gx(n)?n:void 0;if(!a)return[s];let l=b7(a.imageData);return l?[s,{id:`${n.id}-screenshot`,name:`${n.name} screenshot`,value:new Th(a.imageMimeType??"image/png",()=>Promise.resolve(l))}]:[s]}e.toReferences=r;function t(n,o,i){let s=n.value;if(!s){let l;try{l=JSON.stringify(n)}catch{l=`kind=${n.kind}, id=${n.id}, name=${n.name}`}i.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${l}`);return}if(rs(s))s=S.revive(s);else if(s&&typeof s=="object"&&"uri"in s&&"range"in s&&rs(s.uri))s=Da.to(en(s));else if(ND(n)){let l=n.references?.[0]?.reference;s=new Th(n.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(n.value))),l&&S.isUri(l)?l:void 0,n.isPasted,n.isURL)}else if(n.kind==="diagnostic"){let l=n.filterSeverity&&TE.to(n.filterSeverity),c=n.filterUri&&S.revive(n.filterUri).toString();s=new vx(o.map(([u,p])=>n.filterUri&&u.toString()!==c?[u,[]]:[u,p.filter(m=>!(l&&m.severity>l||n.filterRange&&!Mn.areIntersectingOrTouching(n.filterRange,be.from(m.range))))]).filter(([,u])=>u.length>0))}let a;return(H4(n)||W4(n))&&n.toolReferences&&(a=wL.to(n.toolReferences)),{id:n.id,name:n.name,range:n.range&&[n.range.start,n.range.endExclusive],toolReferences:a,value:s,modelDescription:n.modelDescription}}e.to=t})(K9||={});(t=>{function r(e){if(e.value)throw new Error("Invalid tool reference");return{name:e.id,range:e.range&&[e.range.start,e.range.endExclusive]}}t.to=r})(PE||={});(t=>{function r(e){let n=[];for(let o of e)if(o.kind==="tool")n.push(PE.to(o));else if(o.kind==="toolset")n.push(...o.value.map(PE.to));else throw new Error("Invalid tool reference in prompt variables");return n}t.to=r})(wL||={});(e=>{function r(n){if(n)return{uri:S.revive(n.uri),name:n.name,content:n.content,toolReferences:wL.to(en(n.toolReferences)),allowedSubagents:n.allowedSubagents,metadata:n.metadata,isBuiltin:n.isBuiltin}}e.to=r;function t(n){if(n)return{uri:n.uri,name:n.name,content:n.content,toolReferences:n.toolReferences?.map(o=>({kind:"tool",id:o.name,name:o.name,value:void 0,range:o.range?{start:o.range[0],endExclusive:o.range[1]}:void 0}))??[],allowedSubagents:n.allowedSubagents,metadata:n.metadata,isBuiltin:n.isBuiltin}}e.from=t})(j9||={});(t=>{function r(e,n,o){return{id:e.id,label:e.label,fullName:e.fullName,icon:e.icon?.id,value:e.values[0].value,insertText:e.insertText,detail:e.detail,documentation:e.documentation,command:n.toInternal(e.command,o)}}t.from=r})(yoe||={});(n=>{function r(o){return{errorDetails:o.errorDetails,metadata:e(o.metadata),nextQuestion:o.nextQuestion,details:o.details}}n.to=r;function t(o){return{errorDetails:o.errorDetails,metadata:o.metadata,nextQuestion:o.nextQuestion,details:o.details}}n.from=t;function e(o){return so(o,i=>{if(i.$mid===20)return new Ph(so(i.content,e));if(i.$mid===21)return new zn(i.value);if(i.$mid===22)return new Yp(i.value,i.id,i.metadata);if(i.$mid===23)return new Rs(i.value);if(i.$mid===24){let s;if(i.data&&typeof i.data=="object"&&i.data.type==="Buffer"&&Array.isArray(i.data.data))s=new Uint8Array(i.data.data);else if(typeof i.data=="string")try{s=ir(i.data).buffer}catch{s=new Uint8Array(0)}else s=new Uint8Array(0);return new Go(s,i.mimeType,i.audience)}})}})(Q9||={});(t=>{function r(e,n,o){if(n.action.kind==="vote")return;let i=Q9.to(e);if(n.action.kind==="command"){let s=n.action.commandButton.command;return{action:{kind:"command",commandButton:{command:o.fromInternal(s)??{command:s.id,title:s.title}}},result:i}}else return n.action.kind==="followUp"?{action:{kind:"followUp",followup:C9.to(n.action.followup)},result:i}:n.action.kind==="inlineChat"?{action:{kind:"editor",accepted:n.action.action==="accepted"},result:i}:n.action.kind==="chatEditingSessionAction"?{action:{kind:"chatEditingSessionAction",outcome:new Map([["accepted",1],["rejected",2],["saved",3]]).get(n.action.outcome)??2,uri:S.revive(n.action.uri),hasRemainingEdits:n.action.hasRemainingEdits},result:i}:n.action.kind==="chatEditingHunkAction"?{action:{kind:"chatEditingHunkAction",outcome:new Map([["accepted",1],["rejected",2]]).get(n.action.outcome)??2,uri:S.revive(n.action.uri),hasRemainingEdits:n.action.hasRemainingEdits,lineCount:n.action.lineCount,linesAdded:n.action.linesAdded,linesRemoved:n.action.linesRemoved},result:i}:{action:n.action,result:i}}t.to=r})(voe||={});(t=>{function r(e,n,o){return"terminalCommand"in e?{terminalCommand:e.terminalCommand,shouldExecute:e.shouldExecute}:"uri"in e?{uri:e.uri}:n.toInternal(e,o)}t.from=r})(Ioe||={});(t=>{function r(e){return{...e,documentation:yt.fromStrict(e.documentation)}}t.from=r})(IL||={});(t=>{function r(e,n){return Array.isArray(e)?{items:e.map(o=>IL.from(o))}:{items:e.items.map(o=>IL.from(o)),resourceOptions:e.resourceOptions?J9.from(e.resourceOptions,n):void 0}}t.from=r})(boe||={});(t=>{function r(e,n){return{...e,pathSeparator:n,cwd:e.cwd,globPattern:_s.from(e.globPattern)??void 0}}t.from=r})(J9||={});(t=>{function r(e){return{kind:Y9.to(e.kind),acceptedLength:e.acceptedLength}}t.to=r})(Soe||={});(t=>{function r(e){switch(e){case 0:return 1;case 1:return 2;case 2:return 3;default:return 0}}t.to=r})(Y9||={});(t=>{function r(e,n){if(e.kind===2){let o=e.supersededBy?n(e.supersededBy):void 0;return{kind:2,supersededBy:o,userTypingDisagreed:e.userTypingDisagreed}}else if(e.kind===0)return{kind:0};return{kind:1}}t.to=r})(xoe||={});(e=>{function r(n){return n===2?2:1}e.from=r;function t(n){return n===2?2:1}e.to=t})(Coe||={});(t=>{function r(e,n){return{id:n,label:e.label,description:e.description,canEdit:e.canEdit,collapsibleState:e.collapsibleState||0,contextValue:e.contextValue}}t.from=r})(Eoe||={});(t=>{function r(e){return e.type==="mcp"?new xx(e.label,e.serverLabel||e.label,e.instructions):e.type==="extension"?new Sx(e.extensionId.value,e.label):void 0}t.to=r})(woe||={});(e=>{function r(n){let o=new Ph(n.content.map(i=>i.kind==="text"?new zn(i.value,i.audience):i.kind==="data"?new Go(i.value.data.buffer,i.value.mimeType,i.audience):new Rs(i.value)));return n.toolMetadata!==void 0&&(o.toolMetadata=n.toolMetadata),n.toolResultError&&(o.hasError=!!n.toolResultError),o}e.to=r;function t(n,o){n.toolResultMessage&&M_(o,"chatParticipantPrivate");let i=c=>{c.audience&&M_(o,"languageModelToolResultAudience")},s=!1,a;Array.isArray(n.toolResultDetails)?a=n.toolResultDetails?.map(c=>S.isUri(c)?c:Da.from(c)):n.toolResultDetails2&&(a={output:{type:"data",mimeType:n.toolResultDetails2.mime,value:O.wrap(n.toolResultDetails2.value)}},s=!0);let l={content:n.content.map(c=>{if(c instanceof zn)return i(c),{kind:"text",value:c.value,audience:c.audience};if(c instanceof Rs)return{kind:"promptTsx",value:c.value};if(c instanceof Go)return i(c),s=!0,{kind:"data",value:{mimeType:c.mimeType,data:O.wrap(c.data)},audience:c.audience};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:yt.fromStrict(n.toolResultMessage),toolResultDetails:a,toolMetadata:n.toolMetadata,toolResultError:n.hasError};return s?new Am(l):l}e.from=t})(Roe||={});(n=>{function r(o){return o}n.fromThemeIcon=r;function t(o){if(o){if(Zt.isThemeIcon(o))return o;if(S.isUri(o))return o;if(typeof o=="string")return S.file(o);if(typeof o=="object"&&o!==null&&"dark"in o){let i=typeof o.dark=="string"?S.file(o.dark):o.dark,s=typeof o.light=="string"?S.file(o.light):o.light;return i?{dark:i,light:s??i}:void 0}else return}else return}n.from=t;function e(o){if(o){if(Zt.isThemeIcon(o))return o;if(rs(o))return S.revive(o);{let i=o;return{light:S.revive(i.light),dark:S.revive(i.dark)}}}else return}n.to=e})(X9||={});(e=>{function r(n){return{query:n.query,kind:t(n.kind),settings:n.settings}}e.fromSettingsSearchResult=r;function t(n){switch(n){case 1:return 1;case 2:return 2;case 3:return 3;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(Toe||={});(n=>{function r(o){return!!o.uri}function t(o){return Dy.toSerialized(r(o)?{type:2,uri:o.uri,headers:Object.entries(o.headers),authentication:o.authentication?{providerId:o.authentication.providerId,scopes:o.authentication.scopes}:void 0}:{type:1,cwd:o.cwd?.fsPath,args:o.args,command:o.command,env:o.env,envFile:void 0,sandbox:void 0})}n.from=t;function e(o){let i=Dy.fromSerialized(o.launch);if(i.type===2)return new Ex(o.label,i.uri,Object.fromEntries(i.headers),o.cacheNonce==="$$NONE"?void 0:o.cacheNonce);{let s=new Cx(o.label,i.command,[...i.args],Object.fromEntries(Object.entries(i.env).map(([a,l])=>[a,l===null?null:String(l)])),o.cacheNonce==="$$NONE"?void 0:o.cacheNonce);return i.cwd&&(s.cwd=S.file(i.cwd)),s}}n.to=e})(Poe||={});(t=>{function r(e){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;default:throw new Error("Unknown SourceControlInputBoxValidationType")}}t.from=r})(koe||={});(t=>{function r(e){let n={};for(let[o,i]of Object.entries(e)){if(!i||i.length===0)continue;let s=[];for(let a of i){let l=e$.to(a);l&&s.push(l)}s.length>0&&(n[o]=s)}return n}t.to=r})(Z9||={});(t=>{function r(e){let n=L7(e,fr);if(n)return{command:n,cwd:e.cwd,env:e.env,timeout:e.timeout}}t.to=r})(e$||={});(e=>{function r(n){if(n!==void 0)switch(n){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return}}function t(n){let o=n.timing,i=o?.created??o?.startTime??0,s=o?.lastRequestStarted??o?.startTime,a=o?.lastRequestEnded??o?.endTime;return{resource:n.resource,label:n.label,description:n.description?yt.from(n.description):void 0,badge:n.badge?yt.from(n.badge):void 0,status:r(n.status),archived:n.archived,tooltip:yt.fromStrict(n.tooltip),timing:{created:i,lastRequestStarted:s,lastRequestEnded:a},changes:n.changes instanceof Array?n.changes:void 0,metadata:n.metadata,legacyResource:n.legacyResource}}e.from=t})(Aoe||={})});var n$,TL,yyt,o$=v(()=>{EE();n$=class r{static{this._n=0}static mixin(t){return t._id=r._n++,t}},TL={MainThreadAuthentication:L("MainThreadAuthentication"),MainThreadBulkEdits:L("MainThreadBulkEdits"),MainThreadLanguageModels:L("MainThreadLanguageModels"),MainThreadEmbeddings:L("MainThreadEmbeddings"),MainThreadChatAgents2:L("MainThreadChatAgents2"),MainThreadCodeMapper:L("MainThreadCodeMapper"),MainThreadLanguageModelTools:L("MainThreadChatSkills"),MainThreadGitExtension:L("MainThreadGitExtension"),MainThreadClipboard:L("MainThreadClipboard"),MainThreadCommands:L("MainThreadCommands"),MainThreadComments:L("MainThreadComments"),MainThreadConfiguration:L("MainThreadConfiguration"),MainThreadConsole:L("MainThreadConsole"),MainThreadDebugService:L("MainThreadDebugService"),MainThreadDecorations:L("MainThreadDecorations"),MainThreadDiagnostics:L("MainThreadDiagnostics"),MainThreadDialogs:L("MainThreadDiaglogs"),MainThreadDocuments:L("MainThreadDocuments"),MainThreadDocumentContentProviders:L("MainThreadDocumentContentProviders"),MainThreadTextEditors:L("MainThreadTextEditors"),MainThreadEditorInsets:L("MainThreadEditorInsets"),MainThreadEditorTabs:L("MainThreadEditorTabs"),MainThreadErrors:L("MainThreadErrors"),MainThreadTreeViews:L("MainThreadTreeViews"),MainThreadDownloadService:L("MainThreadDownloadService"),MainThreadLanguageFeatures:L("MainThreadLanguageFeatures"),MainThreadLanguages:L("MainThreadLanguages"),MainThreadLogger:L("MainThreadLogger"),MainThreadMessageService:L("MainThreadMessageService"),MainThreadOutputService:L("MainThreadOutputService"),MainThreadProgress:L("MainThreadProgress"),MainThreadQuickDiff:L("MainThreadQuickDiff"),MainThreadAgentEditorComments:L("MainThreadAgentEditorComments"),MainThreadDocumentDiff:L("MainThreadDocumentDiff"),MainThreadQuickOpen:L("MainThreadQuickOpen"),MainThreadStatusBar:L("MainThreadStatusBar"),MainThreadSecretState:L("MainThreadSecretState"),MainThreadStorage:L("MainThreadStorage"),MainThreadSpeech:L("MainThreadSpeechProvider"),MainThreadTelemetry:L("MainThreadTelemetry"),MainThreadMeteredConnection:L("MainThreadMeteredConnection"),MainThreadTerminalService:L("MainThreadTerminalService"),MainThreadTerminalShellIntegration:L("MainThreadTerminalShellIntegration"),MainThreadWebviews:L("MainThreadWebviews"),MainThreadWebviewPanels:L("MainThreadWebviewPanels"),MainThreadWebviewViews:L("MainThreadWebviewViews"),MainThreadCustomEditors:L("MainThreadCustomEditors"),MainThreadUrls:L("MainThreadUrls"),MainThreadUriOpeners:L("MainThreadUriOpeners"),MainThreadProfileContentHandlers:L("MainThreadProfileContentHandlers"),MainThreadWorkspace:L("MainThreadWorkspace"),MainThreadFileSystem:L("MainThreadFileSystem"),MainThreadFileSystemEventService:L("MainThreadFileSystemEventService"),MainThreadExtensionService:L("MainThreadExtensionService"),MainThreadSCM:L("MainThreadSCM"),MainThreadSearch:L("MainThreadSearch"),MainThreadShare:L("MainThreadShare"),MainThreadTask:L("MainThreadTask"),MainThreadWindow:L("MainThreadWindow"),MainThreadPower:L("MainThreadPower"),MainThreadGitHub:L("MainThreadGitHub"),MainThreadLabelService:L("MainThreadLabelService"),MainThreadNotebook:L("MainThreadNotebook"),MainThreadNotebookDocuments:L("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:L("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:L("MainThreadNotebookKernels"),MainThreadNotebookRenderers:L("MainThreadNotebookRenderers"),MainThreadInteractive:L("MainThreadInteractive"),MainThreadTheming:L("MainThreadTheming"),MainThreadTunnelService:L("MainThreadTunnelService"),MainThreadManagedSockets:L("MainThreadManagedSockets"),MainThreadBrowserTunnelProxy:L("MainThreadBrowserTunnelProxy"),MainThreadTimeline:L("MainThreadTimeline"),MainThreadChatArtifactIntegrations:L("MainThreadChatArtifactIntegrations"),MainThreadTesting:L("MainThreadTesting"),MainThreadLocalization:L("MainThreadLocalizationShape"),MainThreadMcp:L("MainThreadMcpShape"),MainThreadAiRelatedInformation:L("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:L("MainThreadAiEmbeddingVector"),MainThreadChatStatus:L("MainThreadChatStatus"),MainThreadChatQuota:L("MainThreadChatQuota"),MainThreadChatInputNotification:L("MainThreadChatInputNotification"),MainThreadAiSettingsSearch:L("MainThreadAiSettingsSearch"),MainThreadDataChannels:L("MainThreadDataChannels"),MainThreadChatSessions:L("MainThreadChatSessions"),MainThreadChatOutputRenderer:L("MainThreadChatOutputRenderer"),MainThreadChatContext:L("MainThreadChatContext"),MainThreadChatDebug:L("MainThreadChatDebug"),MainThreadBrowsers:L("MainThreadBrowsers")},yyt={ExtHostCodeMapper:L("ExtHostCodeMapper"),ExtHostCommands:L("ExtHostCommands"),ExtHostConfiguration:L("ExtHostConfiguration"),ExtHostDiagnostics:L("ExtHostDiagnostics"),ExtHostDebugService:L("ExtHostDebugService"),ExtHostDecorations:L("ExtHostDecorations"),ExtHostDocumentsAndEditors:L("ExtHostDocumentsAndEditors"),ExtHostDocuments:L("ExtHostDocuments"),ExtHostDocumentContentProviders:L("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:L("ExtHostDocumentSaveParticipant"),ExtHostEditors:L("ExtHostEditors"),ExtHostTreeViews:L("ExtHostTreeViews"),ExtHostFileSystem:L("ExtHostFileSystem"),ExtHostFileSystemInfo:L("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:L("ExtHostFileSystemEventService"),ExtHostLanguages:L("ExtHostLanguages"),ExtHostLanguageFeatures:L("ExtHostLanguageFeatures"),ExtHostQuickOpen:L("ExtHostQuickOpen"),ExtHostQuickDiff:L("ExtHostQuickDiff"),ExtHostAgentEditorComments:L("ExtHostAgentEditorComments"),ExtHostStatusBar:L("ExtHostStatusBar"),ExtHostShare:L("ExtHostShare"),ExtHostExtensionService:L("ExtHostExtensionService"),ExtHostLogLevelServiceShape:L("ExtHostLogLevelServiceShape"),ExtHostTerminalService:L("ExtHostTerminalService"),ExtHostTerminalShellIntegration:L("ExtHostTerminalShellIntegration"),ExtHostSCM:L("ExtHostSCM"),ExtHostSearch:L("ExtHostSearch"),ExtHostTask:L("ExtHostTask"),ExtHostWorkspace:L("ExtHostWorkspace"),ExtHostWindow:L("ExtHostWindow"),ExtHostPower:L("ExtHostPower"),ExtHostWebviews:L("ExtHostWebviews"),ExtHostWebviewPanels:L("ExtHostWebviewPanels"),ExtHostCustomEditors:L("ExtHostCustomEditors"),ExtHostWebviewViews:L("ExtHostWebviewViews"),ExtHostEditorInsets:L("ExtHostEditorInsets"),ExtHostEditorTabs:L("ExtHostEditorTabs"),ExtHostProgress:L("ExtHostProgress"),ExtHostComments:L("ExtHostComments"),ExtHostSecretState:L("ExtHostSecretState"),ExtHostStorage:L("ExtHostStorage"),ExtHostUrls:L("ExtHostUrls"),ExtHostUriOpeners:L("ExtHostUriOpeners"),ExtHostChatOutputRenderer:L("ExtHostChatOutputRenderer"),ExtHostProfileContentHandlers:L("ExtHostProfileContentHandlers"),ExtHostOutputService:L("ExtHostOutputService"),ExtHostLabelService:L("ExtHostLabelService"),ExtHostNotebook:L("ExtHostNotebook"),ExtHostNotebookDocuments:L("ExtHostNotebookDocuments"),ExtHostNotebookEditors:L("ExtHostNotebookEditors"),ExtHostNotebookKernels:L("ExtHostNotebookKernels"),ExtHostNotebookRenderers:L("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:L("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:L("ExtHostInteractive"),ExtHostChatAgents2:L("ExtHostChatAgents"),ExtHostLanguageModelTools:L("ExtHostChatSkills"),ExtHostChatProvider:L("ExtHostChatProvider"),ExtHostChatContext:L("ExtHostChatContext"),ExtHostChatDebug:L("ExtHostChatDebug"),ExtHostSpeech:L("ExtHostSpeech"),ExtHostEmbeddings:L("ExtHostEmbeddings"),ExtHostAiRelatedInformation:L("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:L("ExtHostAiEmbeddingVector"),ExtHostAiSettingsSearch:L("ExtHostAiSettingsSearch"),ExtHostTheming:L("ExtHostTheming"),ExtHostTunnelService:L("ExtHostTunnelService"),ExtHostManagedSockets:L("ExtHostManagedSockets"),ExtHostBrowserTunnelProxy:L("ExtHostBrowserTunnelProxy"),ExtHostAuthentication:L("ExtHostAuthentication"),ExtHostTimeline:L("ExtHostTimeline"),ExtHostChatArtifactIntegrations:L("ExtHostChatArtifactIntegrations"),ExtHostTesting:L("ExtHostTesting"),ExtHostTelemetry:L("ExtHostTelemetry"),ExtHostMeteredConnection:L("ExtHostMeteredConnection"),ExtHostLocalization:L("ExtHostLocalization"),ExtHostMcp:L("ExtHostMcp"),ExtHostDataChannels:L("ExtHostDataChannels"),ExtHostChatSessions:L("ExtHostChatSessions"),ExtHostChatQuota:L("ExtHostChatQuota"),ExtHostGitExtension:L("ExtHostGitExtension"),ExtHostBrowsers:L("ExtHostBrowsers")}});var r$,i$=v(()=>{Z();r$=A("IExtHostRpcService")});var Rd,_m,ec,Mm,Doe,Wy,PL,s$=v(()=>{te();ba();_y();ZM();CE();eL();RL();Rd=(r,t,e,n)=>{let o=t;return{enumerable:!0,configurable:!1,get(){return o},set(i){if(!e(o,i)){let s=o;o=i,r.listener?.(n(i,s))}}}},_m=(r,t)=>r===t,ec={range:(r,t)=>r===t?!0:!r||!t?!1:r.isEqual(t),label:_m,description:_m,sortText:_m,busy:_m,error:_m,canResolveChildren:_m,tags:(r,t)=>!(r.length!==t.length||r.some(e=>!t.find(n=>e.id===n.id)))},Mm=r=>t=>({op:4,update:r(t)}),Doe=(r,t)=>({range:(()=>{let e,n=Mm(o=>({range:Mn.lift(be.from(o))}));return{enumerable:!0,configurable:!1,get(){return e},set(o){r.listener?.({op:6}),ec.range(e,o)||(e=o,r.listener?.(n(o)))}}})(),label:Rd(r,t,ec.label,Mm(e=>({label:e}))),description:Rd(r,void 0,ec.description,Mm(e=>({description:e}))),sortText:Rd(r,void 0,ec.sortText,Mm(e=>({sortText:e}))),canResolveChildren:Rd(r,!1,ec.canResolveChildren,e=>({op:2,state:e})),busy:Rd(r,!1,ec.busy,Mm(e=>({busy:e}))),error:Rd(r,void 0,ec.error,Mm(e=>({error:yt.fromStrict(e)||null}))),tags:Rd(r,[],ec.tags,(e,n)=>({op:1,new:e.map(Zl.from),old:n.map(Zl.from)}))}),Wy=class r{constructor(t,e,n,o){if(e.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(e)} symbol`);let i=m9(this,t);Object.defineProperties(this,{id:{value:e,enumerable:!0,writable:!1},uri:{value:o,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return i.parent instanceof PL?void 0:i.parent}},children:{value:u9(i,wE,r),enumerable:!0,writable:!1},...Doe(i,n)})}},PL=class extends Wy{constructor(e,n){super(e,e,n,void 0);this._isRoot=!0}}});var a$,l$=v(()=>{Z();a$=A("IExtHostInitDataService")});var c$=v(()=>{Ve()});function _oe(r){let t=Date.now()-new Date(r).getTime();return isNaN(t)?!1:t<1e3*60*60*24}var kE,kL,d$,u$=v(()=>{Z();ue();_n();De();l$();c$();Wr();Xt();Q();ee();kE=class extends D{constructor(e,n,o){super();this.initData=n;this._onDidChangeTelemetryEnabled=this._register(new R);this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event;this._onDidChangeTelemetryConfiguration=this._register(new R);this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event;this._productConfig={usage:!0,error:!0};this._level=0;this._inLoggingOnlyMode=!1;this._telemetryLoggers=new Map;this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;let i=n.remote.isRemote?"remoteExtHostTelemetry":e?"workerExtHostTelemetry":"extHostTelemetry";this._outputLogger=this._register(o.createLogger(i,{name:d(5388,null,this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0,group:EI}))}getTelemetryConfiguration(){return this._level===3}getTelemetryDetails(){return{isCrashEnabled:this._level>=1,isErrorsEnabled:this._productConfig.error?this._level>=2:!1,isUsageEnabled:this._productConfig.usage?this._level>=3:!1}}instantiateLogger(e,n,o){let i=this.getTelemetryDetails(),s=e.identifier.value,a=new kL(n,o,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:i.isUsageEnabled,isErrorsEnabled:i.isErrorsEnabled},c=>this.removeTelemetryLogger(s,c)),l=this._telemetryLoggers.get(s)??[];return this._telemetryLoggers.set(s,[...l,a]),a.apiTelemetryLogger}removeTelemetryLogger(e,n){let o=this._telemetryLoggers.get(e);if(!o)return;let i=o.filter(s=>s!==n);i.length===0?this._telemetryLoggers.delete(e):this._telemetryLoggers.set(e,i)}$initializeTelemetryLevel(e,n,o){this._level=e,this._productConfig=o??{usage:!0,error:!0}}getBuiltInCommonProperties(e){let n=Object.create(null);switch(n["common.extname"]=`${e.publisher}.${e.name}`,n["common.extversion"]=e.version,n["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,n["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,n["common.vscodecommithash"]=this.initData.commit,n["common.sqmid"]=this.initData.telemetryInfo.sqmId,n["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId??this.initData.telemetryInfo.machineId,n["common.vscodeversion"]=this.initData.version,n["common.vscodereleasedate"]=this.initData.date,n["common.isnewappinstall"]=_oe(this.initData.telemetryInfo.firstSessionDate),n["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case 2:n["common.uikind"]="web";break;case 1:n["common.uikind"]="desktop";break;default:n["common.uikind"]="unknown"}return n["common.remotename"]=XN(this.initData.remote.authority,this.initData),this.initData.environment.isSessionsWindow&&(n["common.isAgentsWindow"]=!0),n}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;let n=this.getTelemetryDetails();this._telemetryLoggers.forEach((o,i)=>{let s=o.filter(a=>!a.isDisposed);s.length===0?this._telemetryLoggers.delete(i):this._telemetryLoggers.set(i,s)});for(let o of[...this._telemetryLoggers.values()])for(let i of o)i.updateTelemetryEnablements(n.isUsageEnabled,n.isErrorsEnabled);this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(e,n){let i=this._telemetryLoggers.get(e.value)?.filter(a=>!a.isDisposed);if(!i)return this._telemetryLoggers.delete(e.value),!1;let s=!1;for(let a of i)a.ignoreUnhandledExtHostErrors||(a.logError(n),s=!0);return s}};kE=w([b(1,a$),b(2,Bo)],kE);kL=class{constructor(t,e,n,o,i,s,a,l){this._extension=n;this._logger=o;this._inLoggingOnlyMode=i;this._commonProperties=s;this._onDidDispose=l;this._onDidChangeEnableStates=new R;this.ignoreUnhandledExtHostErrors=e?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=e?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=e?.additionalCommonProperties,this._sender=t,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}static validateSender(t){if(typeof t!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof t.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof t.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof t.flush<"u"&&typeof t.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}updateTelemetryEnablements(t,e){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:t,isErrorsEnabled:e},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(t){let e=t.properties?t.properties??{}:t;return e=nf(e,[]),this._additionalCommonProperties&&(e=Ys(e,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(e=Ys(e,this._commonProperties)),t.properties?t.properties=e:t=e,t}logEvent(t,e){this._sender&&(this._extension.publisher==="vscode"?t=this._extension.name+"/"+t:t=this._extension.identifier.value+"/"+t,e=this.mixInCommonPropsAndCleanData(e||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(t,e),this._logger.trace(t,e))}logUsage(t,e){this._telemetryEnablements.isUsageEnabled&&this.logEvent(t,e)}logError(t,e){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof t=="string")this.logEvent(t,e);else{let n={name:t.name,message:t.message,stack:t.stack,cause:t.cause},o=nf(n,[]),i=new Error(typeof o.message=="string"?o.message:void 0,{cause:o.cause});i.stack=typeof o.stack=="string"?o.stack:void 0,i.name=typeof o.name=="string"?o.name:"unknown",e=this.mixInCommonPropsAndCleanData(e||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(i,e),this._logger.trace("exception",e)}}get apiTelemetryLogger(){if(!this._apiObject){let t=this,e={logUsage:t.logUsage.bind(t),get isUsageEnabled(){return t._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return t._telemetryEnablements.isErrorsEnabled},logError:t.logError.bind(t),dispose:t.dispose.bind(t),onDidChangeEnableStates:t._onDidChangeEnableStates.event.bind(t)};this._apiObject=Object.freeze(e)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){let t=this.isDisposed;try{if(this._sender?.flush){let e=this._sender;this._sender=void 0,this._apiObject=void 0,Promise.resolve(e.flush()).then(e=void 0)}else this._sender=void 0}finally{this._onDidChangeEnableStates.dispose(),t||this._onDidDispose(this)}}};d$=A("IExtHostTelemetry")});var AE,m$,AL,p$,DL,g$=v(()=>{Ie();wx();RL();Xt();o$();Dt();De();fs();ba();Lx();te();Q();Z();i$();s$();Ve();EE();$s();Vs();Wr();u$();Vt();xe();AE=class{constructor(t,e,n){this._commands=new Map;this._apiCommands=new Map;this.$d=t.getProxy(TL.MainThreadCommands),this._logService=e,this.$f=n,this.$e=t.getProxy(TL.MainThreadTelemetry),this.converter=new AL(this,o=>{let i=this._apiCommands.get(o);return i?.result===DL.Void?i:void 0},e),this._argumentProcessors=[{processArgument(o){return en(o)}},{processArgument(o){return so(o,function(i){if(Mn.isIRange(i))return be.to(i);if(Gi.isIPosition(i))return _a.to(i);if(Mn.isIRange(i.range)&&S.isUri(i.uri))return Xl.to(i);if(i instanceof O)return i.buffer.buffer.slice(i.buffer.byteOffset,i.buffer.byteOffset+i.buffer.byteLength);if(!Array.isArray(i))return i})}}]}$d;$e;$f;registerArgumentProcessor(t){this._argumentProcessors.push(t)}registerApiCommand(t){let e=this.registerCommand(!1,t.id,async(...n)=>{let o=t.args.map((s,a)=>{if(!s.validate(n[a]))throw new Error(`Invalid argument '${s.name}' when running '${t.id}', received: ${typeof n[a]=="object"?JSON.stringify(n[a],null," "):n[a]} `);return s.convert(n[a])}),i=await this.executeCommand(t.internalId,...o);return t.result.convert(i,n,this.converter)},void 0,{description:t.description,args:t.args,returns:t.result.description});return this._apiCommands.set(t.id,t),new fa(()=>{e.dispose(),this._apiCommands.delete(t.id)})}registerCommand(t,e,n,o,i,s){if(this._logService.trace("ExtHostCommands#registerCommand",e),!e.trim().length)throw new Error("invalid id");if(this._commands.has(e))throw new Error(`command '${e}' already exists`);return this._commands.set(e,{callback:n,thisArg:o,metadata:i,extension:s}),t&&this.$d.$registerCommand(e),new fa(()=>{this._commands.delete(e)&&t&&this.$d.$unregisterCommand(e)})}executeCommand(t,...e){return this._logService.trace("ExtHostCommands#executeCommand",t),this._doExecuteCommand(t,e,!0)}async _doExecuteCommand(t,e,n){if(this._commands.has(t))return this.$d.$fireCommandActivationEvent(t),this._executeContributedCommand(t,e,!1);{let o=!1,i=so(e,function(s){if(s instanceof qe)return _a.from(s);if(s instanceof Xe)return be.from(s);if(s instanceof Oo)return Xl.from(s);if(Vi.isNotebookRange(s))return xL.from(s);if(s instanceof ArrayBuffer)return o=!0,O.wrap(new Uint8Array(s));if(s instanceof Uint8Array)return o=!0,O.wrap(s);if(s instanceof O)return o=!0,s;if(!Array.isArray(s))return s});try{let s=await this.$d.$executeCommand(t,o?new Am(i):i,n);return en(s)}catch(s){if(s instanceof Error&&s.message==="$executeCommand:retry")return this._doExecuteCommand(t,e,!1);throw s}}}async _executeContributedCommand(t,e,n){let o=this._commands.get(t);if(!o)throw new Error("Unknown command");let{callback:i,thisArg:s,metadata:a}=o;if(a?.args)for(let c=0;c<a.args.length;c++)try{pO(e[c],a.args[c].constraint)}catch{throw new Error(`Running the contributed command: '${t}' failed. Illegal argument '${a.args[c].name}' - ${a.args[c].description}`)}let l=no.create();try{return await i.apply(s,e)}catch(c){if(t===this.converter.delegatingCommandId){let u=this.converter.getActualCommand(...e);u&&(t=u.command)}if(on(c)||this._logService.error(c,t,o.extension?.identifier),!n)throw c;if(o.extension?.identifier){let u=this.$f.onExtensionError(o.extension.identifier,c);this._logService.trace("forwarded error to extension?",u,o.extension?.identifier)}throw new class extends Error{constructor(){super(rr(c));this.id=t;this.source=o.extension?.displayName??o.extension?.name}}}finally{this._reportTelemetry(o,t,l.elapsed())}}_reportTelemetry(t,e,n){t.extension&&(e.startsWith("code.copilot.logStructured")||this.$e.$publicLog2("Extension:ActionExecuted",{extensionId:t.extension.identifier.value,id:new Sr(e),duration:n}))}$executeContributedCommand(t,...e){this._logService.trace("ExtHostCommands#$executeContributedCommand",t);let n=this._commands.get(t);return n?(e=e.map(o=>this._argumentProcessors.reduce((i,s)=>s.processArgument(i,n.extension),o)),this._executeContributedCommand(t,e,!0)):Promise.reject(new Error(`Contributed command '${t}' does not exist.`))}getCommands(t=!1){return this._logService.trace("ExtHostCommands#getCommands",t),this.$d.$getCommands().then(e=>(t&&(e=e.filter(n=>n[0]!=="_")),e))}$getContributedCommandMetadata(){let t=Object.create(null);for(let[e,n]of this._commands){let{metadata:o}=n;o&&(t[e]=o)}return Promise.resolve(t)}};AE=w([b(0,r$),b(1,z),b(2,d$)],AE);m$=A("IExtHostCommands"),AL=class{constructor(t,e,n){this._commands=t;this._lookupApiCommand=e;this._logService=n;this.delegatingCommandId=`__vsc${Ee()}`;this._cache=new Map;this._cachIdPool=0;this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(t,e){if(!t)return;let n={$ident:void 0,id:t.command,title:t.title,tooltip:t.tooltip};if(!t.command)return n;let o=this._lookupApiCommand(t.command);if(o)n.id=o.internalId,n.arguments=o.args.map((i,s)=>i.convert(t.arguments&&t.arguments[s]));else if(ac(t.arguments)){let i=`${t.command} /${++this._cachIdPool}`;this._cache.set(i,t),e.add(se(()=>{this._cache.delete(i),this._logService.trace("CommandsConverter#DISPOSE",i)})),n.$ident=i,n.id=this.delegatingCommandId,n.arguments=[i],this._logService.trace("CommandsConverter#CREATE",t.command,i)}return n}fromInternal(t){return typeof t.$ident=="string"?this._cache.get(t.$ident):{command:t.id,title:t.title,arguments:t.arguments}}getActualCommand(...t){return this._cache.get(t[0])}_executeConvertedCommand(...t){let e=this.getActualCommand(...t);return this._logService.trace("CommandsConverter#EXECUTE",t[0],e?e.command:"MISSING"),e?this._commands.executeCommand(e.command,...e.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${t[0]}`)}},p$=class r{constructor(t,e,n,o){this.name=t;this.description=e;this.validate=n;this.convert=o}static{this.Uri=new r("uri","Uri of a text document",t=>S.isUri(t),t=>t)}static{this.Position=new r("position","A position in a text document",t=>qe.isPosition(t),_a.from)}static{this.Range=new r("range","A range in a text document",t=>Xe.isRange(t),be.from)}static{this.Selection=new r("selection","A selection in a text document",t=>Bi.isSelection(t),bL.from)}static{this.Number=new r("number","",t=>typeof t=="number",t=>t)}static{this.String=new r("string","",t=>typeof t=="string",t=>t)}static Arr(t){return new r(`${t.name}_array`,`Array of ${t.name}, ${t.description}`,e=>Array.isArray(e)&&e.every(n=>t.validate(n)),e=>e.map(n=>t.convert(n)))}static{this.CallHierarchyItem=new r("item","A call hierarchy item",t=>t instanceof jp,Fy.from)}static{this.TypeHierarchyItem=new r("item","A type hierarchy item",t=>t instanceof Jp,EL.from)}static{this.TestItem=new r("testItem","A VS Code TestItem",t=>t instanceof Wy,Hy.from)}static{this.TestProfile=new r("testProfile","A VS Code test profile",t=>t instanceof rx,CL.from)}optional(){return new r(this.name,`(optional) ${this.description}`,t=>t==null||this.validate(t),t=>t===void 0?void 0:t===null?null:this.convert(t))}with(t,e){return new r(t??this.name,e??this.description,this.validate,this.convert)}},DL=class r{constructor(t,e){this.description=t;this.convert=e}static{this.Void=new r("no result",t=>t)}}});import*as _E from"fs";var Vy,DE,f$=v(()=>{gp();g$();te();De();ia();Vy=class{constructor(t,e,n){this._commands=t;this.logService=e;this._ipcHandlePath=n;this._server=void 0;this._disposed=!1;this.setup()}get ipcHandlePath(){return this._ipcHandlePath}async setup(){try{let t=await import("http");if(this._disposed)return;this._server=t.createServer((e,n)=>this.onRequest(e,n));try{this._server.listen(this.ipcHandlePath),this._server.on("error",e=>this.logService.error(e))}catch{this.logService.error("Could not start open from terminal server.")}}catch(t){this.logService.error("Error setting up CLI server",t)}}onRequest(t,e){let n=(i,s)=>{e.writeHead(i,{"content-type":"application/json"}),e.end(JSON.stringify(s||null),a=>a&&this.logService.error(a))},o=[];t.setEncoding("utf8"),t.on("data",i=>o.push(i)),t.on("end",async()=>{try{let i=JSON.parse(o.join("")),s;switch(i.type){case"open":s=await this.open(i);break;case"openExternal":s=await this.openExternal(i);break;case"status":s=await this.getStatus(i);break;case"extensionManagement":s=await this.manageExtensions(i);break;case"clipboard":s=await this.clipboard(i);break;default:n(404,`Unknown message type: ${i.type}`);break}n(200,s)}catch(i){let s=i instanceof Error?i.message:JSON.stringify(i);n(500,s),this.logService.error("Error while processing pipe request",i)}})}async open(t){let{fileURIs:e,folderURIs:n,forceNewWindow:o,diffMode:i,mergeMode:s,addMode:a,removeMode:l,forceReuseWindow:c,gotoLineMode:u,waitMarkerFilePath:p,remoteAuthority:m}=t,g=[];if(Array.isArray(n))for(let x of n)try{g.push({folderUri:S.parse(x)})}catch{}if(Array.isArray(e))for(let x of e)try{KF(x)?g.push({workspaceUri:S.parse(x)}):g.push({fileUri:S.parse(x)})}catch{}let y=p?S.file(p):void 0,I={forceNewWindow:o,diffMode:i,mergeMode:s,addMode:a,removeMode:l,gotoLineMode:u,forceReuseWindow:c,preferNewWindow:!c&&!y&&!a&&!l,waitMarkerFileURI:y,remoteAuthority:m};this._commands.executeCommand("_remoteCLI.windowOpen",g,I)}async openExternal(t){for(let e of t.uris)S.parse(e).scheme!=="file"&&await this._commands.executeCommand("_remoteCLI.openExternal",e)}async manageExtensions(t){let e=o=>o?.map(i=>/\.vsix$/i.test(i)?S.parse(i):i),n={list:t.list,install:e(t.install),uninstall:e(t.uninstall),force:t.force};return await this._commands.executeCommand("_remoteCLI.manageExtensions",n)}async getStatus(t){return await this._commands.executeCommand("_remoteCLI.getSystemStatus")}async clipboard(t){return await this._commands.executeCommand("_remoteCLI.setClipboard",t.content)}dispose(){this._disposed=!0,this._server?.close(),this._ipcHandlePath&&process.platform!=="win32"&&_E.existsSync(this._ipcHandlePath)&&_E.unlinkSync(this._ipcHandlePath)}},DE=class extends Vy{constructor(t,e){super(t,e,Ml())}};DE=w([b(0,m$),b(1,z)],DE)});var h$=v(()=>{});function y$(r,t,e=!1){return r.scope?!!(r.scope.workspaceFolder&&t?.workspaceFolder&&r.scope.workspaceFolder.index===t.workspaceFolder.index):e?t===r.scope:!0}function v$(r,t){if(!t)return r;let e=new Set;t.forEach(o=>e.add(o.extensionIdentifier));let n=[];return r.forEach(o=>{e.has(o.extensionIdentifier)||n.push(o)}),n.length===0?void 0:n}function Uoe(r,t){if(!t)return;let e=new Map;t.forEach(o=>e.set(o.extensionIdentifier,o));let n=[];return r.forEach(o=>{let i=e.get(o.extensionIdentifier);i&&(o.type!==i.type||o.value!==i.value||o.scope?.workspaceFolder?.index!==i.scope?.workspaceFolder?.index)&&n.push(i)}),n.length===0?void 0:n}var Moe,Loe,Ooe,ME,I$=v(()=>{fe();h$();Moe=new Map([[2,"APPEND"],[3,"PREPEND"],[1,"REPLACE"]]),Loe=/^VSCODE_PYTHON_(PWSH|ZSH|BASH|FISH)_ACTIVATE/,Ooe="ms-python.vscode-python-envs",ME=class{constructor(t){this.collections=t;this.map=new Map;this.descriptionMap=new Map;t.forEach((e,n)=>{this.populateDescriptionMap(e,n);let o=e.map.entries(),i=o.next();for(;!i.done;){let s=i.value[1],a=i.value[0];if(this.blockPythonActivationVar(a,n)){i=o.next();continue}let l=this.map.get(a);if(l||(l=[],this.map.set(a,l)),l.length>0&&l[0].type===1){i=o.next();continue}let c={extensionIdentifier:n,value:s.value,type:s.type,scope:s.scope,variable:s.variable,options:s.options};c.scope||delete c.scope,l.unshift(c),i=o.next()}})}async applyToProcessEnvironment(t,e,n){let o;oe&&(o={},Object.keys(t).forEach(i=>o[i.toLowerCase()]=i));for(let[i,s]of this.getVariableMap(e)){let a=oe&&o[i.toLowerCase()]||i;for(let l of s){let c=n?await n(l.value):l.value;if(!this.blockPythonActivationVar(l.variable,l.extensionIdentifier)){if(l.options?.applyAtProcessCreation??!0)switch(l.type){case 2:t[a]=(t[a]||"")+c;break;case 3:t[a]=c+(t[a]||"");break;case 1:t[a]=c;break}if(l.options?.applyAtShellIntegration??!1){let u=`VSCODE_ENV_${Moe.get(l.type)}`;t[u]=(t[u]?t[u]+":":"")+i+"="+this._encodeColons(c)}}}}}_encodeColons(t){return t.replaceAll(":","\\x3a")}blockPythonActivationVar(t,e){return!!(Loe.test(t)&&Ooe!==e)}diff(t,e){let n=new Map,o=new Map,i=new Map;if(t.getVariableMap(e).forEach((s,a)=>{let l=this.getVariableMap(e).get(a),c=v$(s,l);c&&n.set(a,c)}),this.getVariableMap(e).forEach((s,a)=>{let l=t.getVariableMap(e).get(a),c=v$(s,l);c&&i.set(a,c)}),this.getVariableMap(e).forEach((s,a)=>{let l=t.getVariableMap(e).get(a),c=Uoe(s,l);c&&o.set(a,c)}),!(n.size===0&&o.size===0&&i.size===0))return{added:n,changed:o,removed:i}}getVariableMap(t){let e=new Map;for(let n of this.map.values()){let o=n.filter(i=>y$(i,t));o.length>0&&e.set(o[0].variable,o)}return e}getDescriptionMap(t){let e=new Map;for(let n of this.descriptionMap.values()){let o=n.filter(i=>y$(i,t,!0));for(let i of o)e.set(i.extensionIdentifier,i.description)}return e}populateDescriptionMap(t,e){if(!t.descriptionMap)return;let n=t.descriptionMap.entries(),o=n.next();for(;!o.done;){let i=o.value[1],s=o.value[0],a=this.descriptionMap.get(s);a||(a=[],this.descriptionMap.set(s,a));let l={extensionIdentifier:e,scope:i.scope,description:i.description};l.scope||delete l.scope,a.push(l),o=n.next()}}}});function b$(r){return[...r.entries()]}function S$(r){return r?[...r.entries()]:[]}function x$(r){return new Map(r)}function C$(r){return new Map(r??[])}var _L=v(()=>{});var ML=v(()=>{});function LL(r){return r.match(/^['"].*['"]$/)&&(r=r.substring(1,r.length-1)),fr===1&&r&&r[1]===":"?r[0].toUpperCase()+r.substring(1):r}function E$(r){return!r.strictEnv}var OL=v(()=>{fe();Ol()});function w$(r,t){if(t)if(oe)for(let e in t){let n=e;for(let i in r)if(e.toLowerCase()===i.toLowerCase()){n=i;break}let o=t[e];o!==void 0&&R$(r,n,o)}else Object.keys(t).forEach(e=>{let n=t[e];n!==void 0&&R$(r,e,n)})}function R$(r,t,e){G(e)?r[t]=e:delete r[t]}function Foe(r,t,e,n){r.TERM_PROGRAM="vscode",t&&(r.TERM_PROGRAM_VERSION=t),Hoe(r,n)&&(r.LANG=Woe(e)),r.COLORTERM="truecolor"}function T$(r,t){if(t)for(let e of Object.keys(t)){let n=t[e];n!=null&&(r[e]=n)}}async function P$(r,t){return await Promise.all(Object.entries(t).map(async([e,n])=>{if(G(n))try{t[e]=await r(n)}catch{t[e]=n}})),t}function Hoe(r,t){if(t==="on")return!0;if(t==="auto"){let e=r.LANG;return!e||e.search(/\.UTF\-8$/)===-1&&e.search(/\.utf8$/)===-1&&e.search(/\.euc.+/)===-1}return!1}function Woe(r){let t=r?r.split("-"):[],e=t.length;if(e===0)return"en_US.UTF-8";if(e===1){let n={af:"ZA",am:"ET",be:"BY",bg:"BG",ca:"ES",cs:"CZ",da:"DK",de:"DE",el:"GR",en:"US",es:"ES",et:"EE",eu:"ES",fi:"FI",fr:"FR",he:"IL",hr:"HR",hu:"HU",hy:"AM",is:"IS",it:"IT",ja:"JP",kk:"KZ",ko:"KR",lt:"LT",nl:"NL",no:"NO",pl:"PL",pt:"BR",ro:"RO",ru:"RU",sk:"SK",sl:"SI",sr:"YU",sv:"SE",tr:"TR",uk:"UA",zh:"CN"};Object.prototype.hasOwnProperty.call(n,t[0])&&t.push(n[t[0]])}else t[1]=t[1].toUpperCase();return t.join("_")+".UTF-8"}async function A$(r,t,e,n,o,i){if(r.cwd){let a=typeof r.cwd=="object"?r.cwd.fsPath:r.cwd,l=await k$(a,e);return LL(l||a)}let s;return!r.ignoreConfigurationCwd&&o&&(e&&(o=await k$(o,e,i)),o&&(Gn(o)?s=o:n&&(s=$(n.fsPath,o)))),s||(s=n?n.fsPath:t||""),LL(s)}async function k$(r,t,e){if(t)try{return await t(r)}catch(n){e?.error("Could not resolve terminal cwd",n);return}return r}function D$(r,t,e){if(e)return n=>e.resolveWithEnvironment(t,r,n)}async function _$(r,t,e,n,o,i){let s={};if(r.strictEnv)T$(s,r.env);else{T$(s,i);let a={...t};e&&(a&&await P$(e,a),r.env&&await P$(e,r.env)),vt&&(s.VSCODE_NODE_OPTIONS&&(s.NODE_OPTIONS=s.VSCODE_NODE_OPTIONS,delete s.VSCODE_NODE_OPTIONS),s.VSCODE_NODE_REPL_EXTERNAL_MODULE&&(s.NODE_REPL_EXTERNAL_MODULE=s.VSCODE_NODE_REPL_EXTERNAL_MODULE,delete s.VSCODE_NODE_REPL_EXTERNAL_MODULE)),wN(s,"VSCODE_IPC_HOOK_CLI","VSCODE_PROXY_URI"),w$(s,a),w$(s,r.env),Foe(s,n,Un,o)}return s}var M$=v(()=>{Oe();te();Ru();Ol();fe();OL();Ie()});var L$,UL,O$,wo,NL=v(()=>{xe();Z();L$=A("configurationResolverService"),UL=(we=>(we.Unknown="unknown",we.Env="env",we.Config="config",we.Command="command",we.Input="input",we.ExtensionInstallFolder="extensionInstallFolder",we.TaskVar="taskVar",we.WorkspaceFolder="workspaceFolder",we.Cwd="cwd",we.WorkspaceFolderBasename="workspaceFolderBasename",we.UserHome="userHome",we.LineNumber="lineNumber",we.ColumnNumber="columnNumber",we.SelectedText="selectedText",we.File="file",we.FileWorkspaceFolder="fileWorkspaceFolder",we.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",we.RelativeFile="relativeFile",we.RelativeFileDirname="relativeFileDirname",we.FileDirname="fileDirname",we.FileExtname="fileExtname",we.FileBasename="fileBasename",we.FileBasenameNoExtension="fileBasenameNoExtension",we.FileDirnameBasename="fileDirnameBasename",we.ExecPath="execPath",we.ExecInstallFolder="execInstallFolder",we.PathSeparator="pathSeparator",we.PathSeparatorAlias="/",we))(UL||{}),O$=Object.values(UL).filter(r=>typeof r=="string"),wo=class extends eo{constructor(e,n){super(n);this.variable=e}}});var Td,FL=v(()=>{ri();fe();dE();Td=class r{constructor(t){this.locations=new Map;this.newReplacementNotifiers=new Set;typeof t=="string"?(this.stringRoot=!0,this.root={value:t}):(this.stringRoot=!1,this.root=structuredClone(t))}static{this.VARIABLE_LHS="${"}static parse(t){if(t instanceof r)return t;let e=new r(t);return e.applyPlatformSpecificKeys(),e.parseObject(e.root),e}applyPlatformSpecificKeys(){let t=this.root,e=oe?"windows":vt?"osx":Ke?"linux":void 0;e&&t&&typeof t=="object"&&t.hasOwnProperty(e)&&Object.keys(t[e]).forEach(n=>t[n]=t[e][n]),delete t.windows,delete t.osx,delete t.linux}parseObject(t){if(!(typeof t!="object"||t===null)){if(Array.isArray(t)){for(let e=0;e<t.length;e++){let n=t[e];typeof n=="string"?this.parseString(t,e,n):this.parseObject(n)}return}for(let[e,n]of Object.entries(t))this.parseString(t,e,e,!0),typeof n=="string"?this.parseString(t,e,n):this.parseObject(n)}}parseString(t,e,n,o,i){let s=0;for(;s<n.length;){let a=n.indexOf("${",s);if(a===-1)break;let l=cE(n,a);if(l){if(s=l.end+1,i?.includes(l.replacement.id))continue;let c=this.locations.get(l.replacement.id)||{locations:[],replacement:l.replacement},u={object:t,propertyName:e,replaceKeyName:o};c.locations.push(u),this.locations.set(l.replacement.id,c),c.resolved?this._resolveAtLocation(l.replacement,u,c.resolved,i):this.newReplacementNotifiers.forEach(p=>p(l.replacement))}else s=a+2}}*unresolved(){let t=new Map,e=n=>{t.set(n.id,n)};for(let n of this.locations.values())n.resolved===void 0&&t.set(n.replacement.id,n.replacement);for(this.newReplacementNotifiers.add(e);;){let n=sn.first(t);if(!n)break;let[o,i]=n;yield i,t.delete(o)}this.newReplacementNotifiers.delete(e)}resolved(){return sn.map(sn.filter(this.locations.values(),t=>!!t.resolved),t=>[t.replacement,t.resolved])}resolve(t,e){typeof e!="object"&&(e={value:String(e)});let n=this.locations.get(t.id);if(n&&(n.resolved=e,e.value!==void 0))for(let o of n.locations||sn.empty())this._resolveAtLocation(t,o,e)}_resolveAtLocation(t,{replaceKeyName:e,propertyName:n,object:o},i,s=[]){if(i.value!==void 0){if(s.push(t.id),e&&typeof n=="string"){let a=o[n],l=n.replaceAll(t.id,i.value);delete o[n],o[l]=a,this._renameKeyInLocations(o,n,l),this.parseString(o,l,i.value,!0,s)}else o[n]=o[n].replaceAll(t.id,i.value),this.parseString(o,n,i.value,!1,s);s.pop()}}_renameKeyInLocations(t,e,n){for(let o of this.locations.values())for(let i of o.locations)i.object===t&&i.propertyName===e&&(i.propertyName=n)}toObject(){return this.stringRoot?this.root.value:this.root}}});var LE,U$=v(()=>{cM();Oe();fe();hr();Ie();ee();NL();FL();LE=class{constructor(t,e,n,o){this._contributedVariables=new Map;this.resolvableVariables=new Set(O$);this._context=t,this._labelService=e,this._userHomePromise=n,o&&(this._envVariablesPromise=o.then(i=>this.prepareEnv(i)))}prepareEnv(t){if(oe){let e=Object.create(null);return Object.keys(t).forEach(n=>{e[n.toLowerCase()]=t[n]}),e}return t}async resolveWithEnvironment(t,e,n){let o=Td.parse(n);for(let i of o.unresolved()){let s=await this.evaluateSingleVariable(i,e?.uri,t);s!==void 0&&o.resolve(i,String(s))}return o.toObject()}async resolveAsync(t,e){let n=Td.parse(e);for(let o of n.unresolved()){let i=await this.evaluateSingleVariable(o,t?.uri);i!==void 0&&n.resolve(o,String(i))}return n.toObject()}resolveWithInteractionReplace(t,e){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(t,e){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(t,e){if(this._contributedVariables.has(t))throw new Error("Variable "+t+" is contributed twice.");this.resolvableVariables.add(t),this._contributedVariables.set(t,e)}fsPath(t){return this._labelService?this._labelService.getUriLabel(t,{noPrefix:!0}):t.fsPath}async evaluateSingleVariable(t,e,n,o){let i={env:n!==void 0?this.prepareEnv(n):await this._envVariablesPromise,userHome:n!==void 0?void 0:await this._userHomePromise},{name:s,arg:a}=t,l=p=>{let m=this._context.getFilePath();if(m)return Em(m);throw new wo(p,d(25040,null,t.id))},c=p=>{let m=l(p);if(this._context.getWorkspaceFolderPathForFile){let g=this._context.getWorkspaceFolderPathForFile();if(g)return Em(g)}throw new wo(p,d(25041,null,t.id,Ze(m)))},u=p=>{if(a){let m=this._context.getFolderUri(a);if(m)return m;throw new wo(p,d(25038,null,p,a))}if(e)return e;throw this._context.getWorkspaceFolderCount()>1?new wo(p,d(25046,null,p)):new wo(p,d(25045,null,p))};switch(s){case"env":if(a){if(i.env){let p=i.env[oe?a.toLowerCase():a];if(G(p))return p}return""}throw new wo("env",d(25051,null,t.id));case"config":if(a){let p=this._context.getConfigurationValue(e,a);if(Kt(p))throw new wo("config",d(25048,null,t.id,a));if(ve(p))throw new wo("config",d(25047,null,t.id,a));return p}throw new wo("config",d(25050,null,t.id));case"command":return this.resolveFromMap("command",t.id,a,o,"command");case"input":return this.resolveFromMap("input",t.id,a,o,"input");case"extensionInstallFolder":if(a){let p=await this._context.getExtension(a);if(!p)throw new wo("extensionInstallFolder",d(25049,null,t.id,a));return this.fsPath(p.extensionLocation)}throw new wo("extensionInstallFolder",d(25052,null,t.id));default:switch(s){case"workspaceRoot":case"workspaceFolder":{let p=u("workspaceFolder");return p?Em(this.fsPath(p)):void 0}case"cwd":{if(!e&&!a)return _r();let p=u("cwd");return p?Em(this.fsPath(p)):void 0}case"workspaceRootFolderName":case"workspaceFolderBasename":{let p=u("workspaceFolderBasename");return p?Em(Ze(this.fsPath(p))):void 0}case"userHome":if(i.userHome)return i.userHome;throw new wo("userHome",d(25044,null,t.id));case"lineNumber":{let p=this._context.getLineNumber();if(p)return p;throw new wo("lineNumber",d(25042,null,t.id))}case"columnNumber":{let p=this._context.getColumnNumber();if(p)return p;throw new Error(d(25039,null,t.id))}case"selectedText":{let p=this._context.getSelectedText();if(p)return p;throw new wo("selectedText",d(25043,null,t.id))}case"file":return l("file");case"fileWorkspaceFolder":return c("fileWorkspaceFolder");case"fileWorkspaceFolderBasename":return Ze(c("fileWorkspaceFolderBasename"));case"relativeFile":return e||a?Hs(this.fsPath(u("relativeFile")),l("relativeFile")):l("relativeFile");case"relativeFileDirname":{let p=It(l("relativeFileDirname"));if(e||a){let m=Hs(this.fsPath(u("relativeFileDirname")),p);return m.length===0?".":m}return p}case"fileDirname":return It(l("fileDirname"));case"fileExtname":return ki(l("fileExtname"));case"fileBasename":return Ze(l("fileBasename"));case"fileBasenameNoExtension":{let p=Ze(l("fileBasenameNoExtension"));return p.slice(0,p.length-ki(p).length)}case"fileDirnameBasename":return Ze(It(l("fileDirnameBasename")));case"execPath":{let p=this._context.getExecPath();return p||t.id}case"execInstallFolder":{let p=this._context.getAppRoot();return p||t.id}case"pathSeparator":case"/":return wn;default:try{return this.resolveFromMap("unknown",t.id,a,o,void 0)}catch{return t.id}}}}resolveFromMap(t,e,n,o,i){if(n&&o){let s=i===void 0?o[n]:o[i+":"+n];if(typeof s=="string")return s;throw new wo(t,d(25053,null,e))}return e}}});import*as WL from"os";var HL,OE,N$=v(()=>{ue();Xt();Q();Oe();fe();Ru();te();gp();Tp();f$();I$();_L();ML();M$();U$();hk();Ue();OL();HL=class extends LE{constructor(t,e,n,o,i){super({getFolderUri:s=>{let a=e.filter(l=>l.name===s);if(a&&a.length>0)return a[0].uri},getWorkspaceFolderCount:()=>e.length,getConfigurationValue:(s,a)=>o[`config:${a}`],getExecPath:()=>t.VSCODE_EXEC_PATH,getAppRoot:()=>t.VSCODE_CWD,getFilePath:()=>{if(n)return Fn(n.fsPath)},getSelectedText:()=>o.selectedText,getLineNumber:()=>o.lineNumber,getColumnNumber:()=>o.columnNumber,getExtension:async s=>{let l=(await i.getInstalled()).find(c=>c.identifier.id===s);return l&&{extensionLocation:l.location}}},void 0,Promise.resolve(WL.homedir()),Promise.resolve(t))}},OE=class extends D{constructor(e,n,o,i,s,a){super();this._environmentService=e;this._logService=n;this._ptyHostService=o;this._productService=i;this._extensionManagementService=s;this._configurationService=a;this._lastReqId=0;this._pendingCommands=new Map;this._onExecuteCommand=this._register(new R);this.onExecuteCommand=this._onExecuteCommand.event}async call(e,n,o){switch(n){case"$restartPtyHost":return this._ptyHostService.restartPtyHost.apply(this._ptyHostService,o);case"$createProcess":{let i=xs(e.remoteAuthority);return this._createProcess(i,o)}case"$attachToProcess":return this._ptyHostService.attachToProcess.apply(this._ptyHostService,o);case"$detachFromProcess":return this._ptyHostService.detachFromProcess.apply(this._ptyHostService,o);case"$listProcesses":return this._ptyHostService.listProcesses.apply(this._ptyHostService,o);case"$getLatency":return this._ptyHostService.getLatency.apply(this._ptyHostService,o);case"$getPerformanceMarks":return this._ptyHostService.getPerformanceMarks.apply(this._ptyHostService,o);case"$orphanQuestionReply":return this._ptyHostService.orphanQuestionReply.apply(this._ptyHostService,o);case"$acceptPtyHostResolvedVariables":return this._ptyHostService.acceptPtyHostResolvedVariables.apply(this._ptyHostService,o);case"$start":return this._ptyHostService.start.apply(this._ptyHostService,o);case"$input":return this._ptyHostService.input.apply(this._ptyHostService,o);case"$sendSignal":return this._ptyHostService.sendSignal.apply(this._ptyHostService,o);case"$acknowledgeDataEvent":return this._ptyHostService.acknowledgeDataEvent.apply(this._ptyHostService,o);case"$shutdown":return this._ptyHostService.shutdown.apply(this._ptyHostService,o);case"$resize":return this._ptyHostService.resize.apply(this._ptyHostService,o);case"$clearBuffer":return this._ptyHostService.clearBuffer.apply(this._ptyHostService,o);case"$getInitialCwd":return this._ptyHostService.getInitialCwd.apply(this._ptyHostService,o);case"$getCwd":return this._ptyHostService.getCwd.apply(this._ptyHostService,o);case"$processBinary":return this._ptyHostService.processBinary.apply(this._ptyHostService,o);case"$sendCommandResult":return this._sendCommandResult(o[0],o[1],o[2]);case"$installAutoReply":return this._ptyHostService.installAutoReply.apply(this._ptyHostService,o);case"$uninstallAllAutoReplies":return this._ptyHostService.uninstallAllAutoReplies.apply(this._ptyHostService,o);case"$getDefaultSystemShell":return this._getDefaultSystemShell.apply(this,o);case"$getProfiles":return this._getProfiles.apply(this,o);case"$getEnvironment":return this._getEnvironment();case"$getWslPath":return this._getWslPath(o[0],o[1]);case"$getTerminalLayoutInfo":return this._ptyHostService.getTerminalLayoutInfo(o);case"$setTerminalLayoutInfo":return this._ptyHostService.setTerminalLayoutInfo(o);case"$serializeTerminalState":return this._ptyHostService.serializeTerminalState.apply(this._ptyHostService,o);case"$reviveTerminalProcesses":return this._ptyHostService.reviveTerminalProcesses.apply(this._ptyHostService,o);case"$getRevivedPtyNewId":return this._ptyHostService.getRevivedPtyNewId.apply(this._ptyHostService,o);case"$setUnicodeVersion":return this._ptyHostService.setUnicodeVersion.apply(this._ptyHostService,o);case"$setNextCommandId":return this._ptyHostService.setNextCommandId.apply(this._ptyHostService,o);case"$reduceConnectionGraceTime":return this._reduceConnectionGraceTime();case"$updateIcon":return this._ptyHostService.updateIcon.apply(this._ptyHostService,o);case"$updateTitle":return this._ptyHostService.updateTitle.apply(this._ptyHostService,o);case"$updateProperty":return this._ptyHostService.updateProperty.apply(this._ptyHostService,o);case"$refreshProperty":return this._ptyHostService.refreshProperty.apply(this._ptyHostService,o);case"$requestDetachInstance":return this._ptyHostService.requestDetachInstance(o[0],o[1]);case"$acceptDetachedInstance":return this._ptyHostService.acceptDetachInstanceReply(o[0],o[1]);case"$freePortKillProcess":return this._ptyHostService.freePortKillProcess.apply(this._ptyHostService,o);case"$acceptDetachInstanceReply":return this._ptyHostService.acceptDetachInstanceReply.apply(this._ptyHostService,o)}throw new Error(`IPC Command ${n} not found`)}listen(e,n,o){switch(n){case"$onPtyHostExitEvent":return this._ptyHostService.onPtyHostExit||F.None;case"$onPtyHostStartEvent":return this._ptyHostService.onPtyHostStart||F.None;case"$onPtyHostUnresponsiveEvent":return this._ptyHostService.onPtyHostUnresponsive||F.None;case"$onPtyHostResponsiveEvent":return this._ptyHostService.onPtyHostResponsive||F.None;case"$onPtyHostRequestResolveVariablesEvent":return this._ptyHostService.onPtyHostRequestResolveVariables||F.None;case"$onProcessDataEvent":return this._ptyHostService.onProcessData;case"$onProcessReadyEvent":return this._ptyHostService.onProcessReady;case"$onProcessExitEvent":return this._ptyHostService.onProcessExit;case"$onProcessReplayEvent":return this._ptyHostService.onProcessReplay;case"$onProcessOrphanQuestion":return this._ptyHostService.onProcessOrphanQuestion;case"$onExecuteCommand":return this.onExecuteCommand;case"$onDidRequestDetach":return this._ptyHostService.onDidRequestDetach||F.None;case"$onDidChangeProperty":return this._ptyHostService.onDidChangeProperty}throw new Error(`IPC Command ${n} not found`)}async _createProcess(e,n){let o={name:n.shellLaunchConfig.name,executable:n.shellLaunchConfig.executable,args:n.shellLaunchConfig.args,cwd:typeof n.shellLaunchConfig.cwd=="string"||typeof n.shellLaunchConfig.cwd>"u"?n.shellLaunchConfig.cwd:S.revive(e.transformIncoming(n.shellLaunchConfig.cwd)),env:n.shellLaunchConfig.env,useShellEnvironment:n.shellLaunchConfig.useShellEnvironment,reconnectionProperties:n.shellLaunchConfig.reconnectionProperties,type:n.shellLaunchConfig.type,isFeatureTerminal:n.shellLaunchConfig.isFeatureTerminal,forceShellIntegration:n.shellLaunchConfig.forceShellIntegration,tabActions:n.shellLaunchConfig.tabActions,shellIntegrationEnvironmentReporting:n.shellLaunchConfig.shellIntegrationEnvironmentReporting},i={...n.resolverEnv};wu(i);let s=await fk(i,!!n.shellLaunchConfig.useShellEnvironment,Un,this._environmentService,this._logService,this._configurationService);this._logService.trace("baseEnv",s);let a=M=>({uri:S.revive(e.transformIncoming(M.uri)),name:M.name,index:M.index,toResource:()=>{throw new Error("Not implemented")}}),l=n.workspaceFolders.map(a),c=n.activeWorkspaceFolder?a(n.activeWorkspaceFolder):void 0,u=n.activeFileResource?S.revive(e.transformIncoming(n.activeFileResource)):void 0,p=new HL(s,l,u,n.resolvedVariables,this._extensionManagementService),m=D$(c,s,p),g=await A$(o,WL.homedir(),m,c?.uri,n.configuration["terminal.integrated.cwd"],this._logService);o.cwd=g;let y=oe?"terminal.integrated.env.windows":vt?"terminal.integrated.env.osx":"terminal.integrated.env.linux",h=n.configuration[y],I=await _$(o,h,m,this._productService.version,n.configuration["terminal.integrated.detectLocale"],s);if(E$(o)){let M=[];for(let[Y,W,J]of n.envVariableCollections)M.push([Y,{map:x$(W),descriptionMap:C$(J)}]);let X=new Map(M),N=new ME(X),ae=c?c??void 0:void 0;await N.applyToProcessEnvironment(I,{workspaceFolder:ae},m)}this._logService.debug("Terminal process launching on remote agent",{shellLaunchConfig:o,initialCwd:g,cols:n.cols,rows:n.rows,env:I});let x=Ml();I.VSCODE_IPC_HOOK_CLI=x;let E=await this._ptyHostService.createProcess(o,g,n.cols,n.rows,n.unicodeVersion,I,s,n.options,n.shouldPersistTerminal,n.workspaceId,n.workspaceName),T={executeCommand:(M,...X)=>this._executeCommand(E,M,X,e)},P=new Vy(T,this._logService,x);return this._ptyHostService.onProcessExit(M=>M.id===E&&P.dispose()),{persistentTerminalId:E,resolvedShellLaunchConfig:o}}_executeCommand(e,n,o,i){let{resolve:s,reject:a,promise:l}=SR(),c=++this._lastReqId;this._pendingCommands.set(c,{resolve:s,reject:a,uriTransformer:i});let u=so(o,p=>{if(p&&p.$mid===1)return i.transformOutgoing(p);if(p&&p instanceof S)return i.transformOutgoingURI(p)});return this._onExecuteCommand.fire({reqId:c,persistentProcessId:e,commandId:n,commandArgs:u}),l}_sendCommandResult(e,n,o){let i=this._pendingCommands.get(e);if(!i)return;this._pendingCommands.delete(e);let s=so(o,a=>{if(a&&a.$mid===1)return i.uriTransformer.transformIncoming(a)});n?i.reject(s):i.resolve(s)}_getDefaultSystemShell(e){return this._ptyHostService.getDefaultSystemShell(e)}async _getProfiles(e,n,o,i){return this._ptyHostService.getProfiles(e,n,o,i)||[]}_getEnvironment(){return{...process.env}}_getWslPath(e,n){return this._ptyHostService.getWslPath(e,n)}_reduceConnectionGraceTime(){return this._ptyHostService.reduceConnectionGraceTime()}}});var F$,H$=v(()=>{Z();F$=A("labelService")});var W$,V$=v(()=>{Z();W$=A("environmentVariableService")});var B$,UE,q$=v(()=>{wM();nS();uC();ia();_L();NL();Wh();QM();Me();H$();V$();Ol();ML();FL();B$="remoteterminal",UE=class{constructor(t,e,n,o,i,s,a,l,c,u,p){this._remoteAuthority=t;this._channel=e;this._configurationService=n;this._workspaceContextService=o;this._resolverService=i;this._environmentVariableService=s;this._remoteAuthorityResolverService=a;this._logService=l;this._editorService=c;this._labelService=u;this._environmentService=p}get onPtyHostExit(){return this._channel.listen("$onPtyHostExitEvent")}get onPtyHostStart(){return this._channel.listen("$onPtyHostStartEvent")}get onPtyHostUnresponsive(){return this._channel.listen("$onPtyHostUnresponsiveEvent")}get onPtyHostResponsive(){return this._channel.listen("$onPtyHostResponsiveEvent")}get onPtyHostRequestResolveVariables(){return this._channel.listen("$onPtyHostRequestResolveVariablesEvent")}get onProcessData(){return this._channel.listen("$onProcessDataEvent")}get onProcessExit(){return this._channel.listen("$onProcessExitEvent")}get onProcessReady(){return this._channel.listen("$onProcessReadyEvent")}get onProcessReplay(){return this._channel.listen("$onProcessReplayEvent")}get onProcessOrphanQuestion(){return this._channel.listen("$onProcessOrphanQuestion")}get onExecuteCommand(){return this._channel.listen("$onExecuteCommand")}get onDidRequestDetach(){return this._channel.listen("$onDidRequestDetach")}get onDidChangeProperty(){return this._channel.listen("$onDidChangeProperty")}restartPtyHost(){return this._channel.call("$restartPtyHost",[])}async createProcess(t,e,n,o,i,s,a,l,c){await this._configurationService.whenRemoteConfigurationLoaded();let u=Object.create(null),p=n?this._workspaceContextService.getWorkspaceFolder(n)??void 0:void 0,m=Td.parse({shellLaunchConfig:t,configuration:e});try{await this._resolverService.resolveAsync(p,m)}catch(M){this._logService.error(M)}for(let[{inner:M},X]of m.resolved())(/^config:/.test(M)||M==="selectedText"||M==="lineNumber")&&(u[M]=X.value);let g=[];if(o.environmentVariableCollections!==void 0)for(let[M,X]of this._environmentVariableService.getMergedCollection(this._remoteAuthority,c).collections.entries())g.push([M,b$(X.map),S$(X.descriptionMap)]);let y=await this._remoteAuthorityResolverService.resolveAuthority(this._remoteAuthority),h={...this._environmentService.debugExtensionHost.env??{},...y.options?.extensionHostEnv},I=this._workspaceContextService.getWorkspace(),x=I.folders,E=n?this._workspaceContextService.getWorkspaceFolder(n):null,T=Hh.getOriginalUri(this._editorService.activeEditor,{supportSideBySide:1,filterByScheme:[q.file,q.vscodeUserData,q.vscodeRemote]}),P={configuration:e,resolvedVariables:u,envVariableCollections:g,shellLaunchConfig:t,workspaceId:I.id,workspaceName:this._labelService.getWorkspaceLabel(I),workspaceFolders:x,activeWorkspaceFolder:E,activeFileResource:T,shouldPersistTerminal:i,options:o,cols:s,rows:a,unicodeVersion:l,resolverEnv:h};return await this._channel.call("$createProcess",P)}requestDetachInstance(t,e){return this._channel.call("$requestDetachInstance",[t,e])}acceptDetachInstanceReply(t,e){return this._channel.call("$acceptDetachInstanceReply",[t,e])}attachToProcess(t){return this._channel.call("$attachToProcess",[t])}detachFromProcess(t,e){return this._channel.call("$detachFromProcess",[t,e])}listProcesses(){return this._channel.call("$listProcesses")}getLatency(){return this._channel.call("$getLatency")}getPerformanceMarks(){return this._channel.call("$getPerformanceMarks")}reduceConnectionGraceTime(){return this._channel.call("$reduceConnectionGraceTime")}processBinary(t,e){return this._channel.call("$processBinary",[t,e])}start(t){return this._channel.call("$start",[t])}input(t,e){return this._channel.call("$input",[t,e])}sendSignal(t,e){return this._channel.call("$sendSignal",[t,e])}acknowledgeDataEvent(t,e){return this._channel.call("$acknowledgeDataEvent",[t,e])}setUnicodeVersion(t,e){return this._channel.call("$setUnicodeVersion",[t,e])}setNextCommandId(t,e,n){return this._channel.call("$setNextCommandId",[t,e,n])}shutdown(t,e){return this._channel.call("$shutdown",[t,e])}resize(t,e,n,o,i){return this._channel.call("$resize",[t,e,n,o,i])}clearBuffer(t){return this._channel.call("$clearBuffer",[t])}getInitialCwd(t){return this._channel.call("$getInitialCwd",[t])}getCwd(t){return this._channel.call("$getCwd",[t])}orphanQuestionReply(t){return this._channel.call("$orphanQuestionReply",[t])}sendCommandResult(t,e,n){return this._channel.call("$sendCommandResult",[t,e,n])}freePortKillProcess(t){return this._channel.call("$freePortKillProcess",[t])}getDefaultSystemShell(t){return this._channel.call("$getDefaultSystemShell",[t])}getProfiles(t,e,n){return this._channel.call("$getProfiles",[this._workspaceContextService.getWorkspace().id,t,e,n])}acceptPtyHostResolvedVariables(t,e){return this._channel.call("$acceptPtyHostResolvedVariables",[t,e])}getEnvironment(){return this._channel.call("$getEnvironment")}getWslPath(t,e){return this._channel.call("$getWslPath",[t,e])}setTerminalLayoutInfo(t){let n={workspaceId:this._workspaceContextService.getWorkspace().id,tabs:t?t.tabs:[],background:t?t.background:null};return this._channel.call("$setTerminalLayoutInfo",n)}updateTitle(t,e,n){return this._channel.call("$updateTitle",[t,e,n])}updateIcon(t,e,n,o){return this._channel.call("$updateIcon",[t,e,n,o])}refreshProperty(t,e){return this._channel.call("$refreshProperty",[t,e])}updateProperty(t,e,n){return this._channel.call("$updateProperty",[t,e,n])}getTerminalLayoutInfo(){let e={workspaceId:this._workspaceContextService.getWorkspace().id};return this._channel.call("$getTerminalLayoutInfo",e)}reviveTerminalProcesses(t,e,n){return this._channel.call("$reviveTerminalProcesses",[t,e,n])}getRevivedPtyNewId(t){return this._channel.call("$getRevivedPtyNewId",[t])}serializeTerminalState(t){return this._channel.call("$serializeTerminalState",[t])}installAutoReply(t,e,n){return this._channel.call("$installAutoReply",[t,e,n])}uninstallAllAutoReplies(t){return this._channel.call("$uninstallAllAutoReplies",[t])}};UE=w([b(2,K7),b(3,fl),b(4,L$),b(5,W$),b(6,D2),b(7,oW),b(8,l9),b(9,F$),b(10,um)],UE)});var $$=v(()=>{Ve();$s();xe();ue();Q();Xa();Vt();st();Bc()});var z$,G$=v(()=>{xe();Q();Me();fe();$$();z$="remoteFilesystem"});import{AppInsightsCore as $oe}from"@microsoft/1ds-core-js";import*as zoe from"https";import*as Goe from"http";import*as Ci from"os";var NE,K$=v(()=>{NE=class extends $oe{constructor(e,n,o){super();this.endpoint=e;this.systemInfo={measurements:{},properties:{}};try{let i=Ci.cpus();this.systemInfo.measurements.cores=i.length,this.systemInfo.properties["common.cpuModel"]=i[0].model}catch{}try{this.systemInfo.properties["common.shell"]=Ci.userInfo().shell,this.systemInfo.properties["common.release"]=Ci.release(),this.systemInfo.properties["common.arch"]=Ci.arch()}catch{}this.systemInfo.properties["common.remoteMachineId"]=n,this.systemInfo.properties["common.isContainer"]=o}track(e){let n=e.baseData||{};n.measurements={...n.measurements||{},...this.systemInfo.measurements},n.properties={...n.properties||{},...this.systemInfo.properties};try{n.measurements.memoryFree=Ci.freemem(),n.measurements.memoryTotal=Ci.totalmem()}catch{}try{let o=(/^http:/.test(this.endpoint)?Goe:zoe).request(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"}});o.on("error",()=>{}),o.write(JSON.stringify(n)),o.end()}catch{}}}});async function $L(r,t,e){e===void 0&&(e=!!(globalThis._VSCODE_PRODUCT_JSON??globalThis.vscode?.context?.configuration()?.product)?.commit);let n=t?`${r}/${t}`:r;if(VL.has(n))return VL.get(n);let o;if(/^\w[\w\d+.-]*:\/\//.test(n))o=n;else{let l=`${e&&(_0||Nw&&H0)?GO:Pv}/${n}`;o=Pt.asBrowserUri(l).toString(!0)}let i=qL.INSTANCE.load(o);return VL.set(n,i),i}var BL,qL,VL,j$=v(()=>{Me();fe();te();Vt();BL=class{constructor(t,e,n){this.id=t;this.dependencies=e;this.callback=n}},qL=class r{constructor(){this._isWebWorker=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope";this._isRenderer=typeof document=="object";this._defineCalls=[];this._state=1}static{this.INSTANCE=new r}_initialize(){if(this._state===1){if(globalThis.define){this._state=3;return}}else return;this._state=2;let t=(e,n,o)=>{typeof e!="string"&&(o=n,n=e,e=null),(typeof n!="object"||!Array.isArray(n))&&(o=n,n=null),this._defineCalls.push(new BL(e,n,o))};t.amd=!0,this._define=t,(this._isRenderer||this._isWebWorker)&&(globalThis.define=t),this._isRenderer?this._amdPolicy=globalThis._VSCODE_WEB_PACKAGE_TTP??window.trustedTypes?.createPolicy("amdLoader",{createScriptURL(e){if(e.startsWith(window.location.origin)||e.startsWith(`${q.vscodeFileResource}://${Sg}`))return e;throw new Error(`[trusted_script_src] Invalid script url: ${e}`)}}):this._isWebWorker&&(this._amdPolicy=globalThis._VSCODE_WEB_PACKAGE_TTP??globalThis.trustedTypes?.createPolicy("amdLoader",{createScriptURL(e){return e}}))}async load(t){if(this._initialize(),this._state===3)return new Promise(s=>{let a=Ee();globalThis.define(a,[t],function(l){s(l)})});let e=await(this._isWebWorker?this._workerLoadScript(t):this._isRenderer?this._rendererLoadScript(t):this._nodeJSLoadScript(t));if(!e){console.warn(`Did not receive a define call from script ${t}`);return}let n={},o=[],i=[];if(Array.isArray(e.dependencies))for(let s of e.dependencies)s==="exports"?o.push(n):i.push(s);if(i.length>0)throw new Error(`Cannot resolve dependencies for script ${t}. The dependencies are: ${i.join(", ")}`);return typeof e.callback=="function"?e.callback(...o)??n:e.callback}_rendererLoadScript(t){return new Promise((e,n)=>{let o=document.createElement("script");o.setAttribute("async","async"),o.setAttribute("type","text/javascript");let i=()=>{o.removeEventListener("load",s),o.removeEventListener("error",a)},s=l=>{i(),e(this._defineCalls.pop())},a=l=>{i(),n(l)};o.addEventListener("load",s),o.addEventListener("error",a),this._amdPolicy&&(t=this._amdPolicy.createScriptURL(t)),o.setAttribute("src",t),window.document.getElementsByTagName("head")[0].appendChild(o)})}async _workerLoadScript(t){return this._amdPolicy&&(t=this._amdPolicy.createScriptURL(t)),await import(t),this._defineCalls.pop()}async _nodeJSLoadScript(t){try{let e=(await import("module")).default,n=e.createRequire(import.meta.url),o=n("fs"),i=n("vm"),s=S.parse(t).fsPath,a=o.readFileSync(s).toString(),l=e.wrap(a.replace(/^#!.*/,"")),u=new i.Script(l).runInThisContext(),p=globalThis.define;globalThis.define=this._define;try{u.apply()}finally{p===void 0?delete globalThis.define:globalThis.define=p}return this._defineCalls.pop()}catch(e){throw e}}},VL=new Map});function joe(r,t){r.ext=r.ext??{},r.ext.web=r.ext.web??{},r.ext.web.consentDetails='{"GPC_DataSharingOptIn":false}';let e=r.baseData;(t||e?.measurements?.["common.msftInternal"]===1)&&(r.ext.utc=r.ext.utc??{},r.ext.utc.flags=8462029)}async function Qoe(r,t,e){let n=bn?await $L("@microsoft/1ds-core-js","bundle/ms.core.min.js"):await import("@microsoft/1ds-core-js"),o=bn?await $L("@microsoft/1ds-post-js","bundle/ms.post.min.js"):await import("@microsoft/1ds-post-js"),i=new n.AppInsightsCore,s=new o.PostChannel,a={instrumentationKey:r,endpointUrl:Q$,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[s]]};if(e){a.extensionConfig={};let l={alwaysUseXhrOverride:!0,ignoreMc1Ms0CookieProcessing:!0,httpXHROverride:e};a.extensionConfig[s.identifier]=l}return i.initialize(a,[]),i.addTelemetryInitializer(l=>joe(l,t)),i}var Q$,Koe,FE,J$=v(()=>{j$();xe();Xt();fe();Wr();Q$="https://mobile.events.data.microsoft.com/OneCollector/1.0",Koe="https://mobile.events.data.microsoft.com/ping";FE=class{constructor(t,e,n,o,i){this._isInternalTelemetry=t;this._eventPrefix=e;this._defaultData=n;this._xhrOverride=i;this.endPointUrl=Q$;this.endPointHealthUrl=Koe;this._defaultData||(this._defaultData={}),typeof o=="function"?this._aiCoreOrKey=o():this._aiCoreOrKey=o,this._asyncAiCore=null}_withAIClient(t){if(this._aiCoreOrKey){if(typeof this._aiCoreOrKey!="string"){t(this._aiCoreOrKey);return}this._asyncAiCore||(this._asyncAiCore=Qoe(this._aiCoreOrKey,this._isInternalTelemetry,this._xhrOverride)),this._asyncAiCore.then(e=>{t(e)},e=>{pt(e),console.error(e)})}}log(t,e){if(!this._aiCoreOrKey)return;e=Ys(e,this._defaultData);let n=TI(e),o=this._eventPrefix+"/"+t;try{this._withAIClient(i=>{i.pluginVersionString=n?.properties.version??"Unknown",i.track({name:o,baseData:{name:o,properties:n?.properties,measurements:n?.measurements}})})}catch{}}flush(){return this._aiCoreOrKey?new Promise(t=>{this._withAIClient(e=>{e.unload(!0,()=>{this._aiCoreOrKey=void 0,t(void 0)})})}):Promise.resolve(void 0)}}});async function Joe(r,t){let e=await t.request(r,Ae.None),n=(await Ir(e.stream)).toString(),o=e.res.statusCode??200;return{headers:e.res.headers,statusCode:o,responseData:n}}async function Yoe(r){let t=await import("https"),e={method:r.type,headers:r.headers};return new Promise((o,i)=>{let s=t.request(r.url??"",e,a=>{a.on("data",function(l){o({headers:a.headers,statusCode:a.statusCode??200,responseData:l.toString()})}),a.on("error",function(l){i(l)})});s.write(r.data,a=>{a&&i(a)}),s.end()})}async function Xoe(r,t,e){let n=typeof t.data=="string"?t.data:new TextDecoder().decode(t.data),o={type:"POST",headers:{...t.headers,"Content-Type":"application/json","Content-Length":Buffer.byteLength(t.data).toString()},url:t.urlString,data:n,callSite:yN};try{let i=r?await Joe(o,r):await Yoe(o);e(i.statusCode,i.headers,i.responseData)}catch{e(0,{})}}var HE,Y$=v(()=>{Ve();Jt();Ui();J$();HE=class extends FE{constructor(t,e,n,o,i){let s={sendPOST:(a,l)=>{Xoe(t,a,l)}};super(e,n,o,i,s)}}});function X$(r,t,e,n,o){let i=new _c;return r.forEach(s=>{let a=i.get(s.identifier);a&&o.warn(d(25336,null,a.extensionLocation.fsPath,s.extensionLocation.fsPath)),i.set(s.identifier,s)}),t.forEach(s=>{let a=i.get(s.identifier);if(a)if(a.isBuiltin){if(hF(a.version,s.version)){o.warn(`Skipping extension ${s.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}s.isBuiltin=!0}else o.warn(d(25336,null,a.extensionLocation.fsPath,s.extensionLocation.fsPath));else if(s.isBuiltin){o.warn(`Skipping obsolete builtin extension ${s.extensionLocation.path}`);return}i.set(s.identifier,s)}),e.forEach(s=>{let a=i.get(s.identifier);a&&o.warn(d(25337,null,a.extensionLocation.fsPath,s.extensionLocation.fsPath)),i.set(s.identifier,s)}),n.forEach(s=>{o.info(d(25335,null,s.extensionLocation.fsPath));let a=i.get(s.identifier);a&&a.isBuiltin&&(s.isBuiltin=!0),i.set(s.identifier,s)}),Array.from(i.values())}var Z$=v(()=>{Yn();ee();gl()});var WE,VE,ez=v(()=>{Oe();fe();hr();te();Xr();Ll();ro();Ju();Yn();Z$();Me();ui();WE=class{constructor(t,e,n,o,i,s,a,l){this._extensionManagementCLI=t;this._userDataProfilesService=n;this._extensionsScannerService=o;this._logService=i;this._extensionGalleryService=s;this._languagePackService=a;this._extensionManagementService=l;this._whenBuiltinExtensionsReady=Promise.resolve({failed:[]});this._whenExtensionsReady=Promise.resolve({failed:[]});let c=e.args["install-builtin-extension"];if(c){i.trace("Installing builtin extensions passed via args...");let p={isMachineScoped:!!e.args["do-not-sync"],installPreReleaseVersion:!!e.args["pre-release"]};qt("code/server/willInstallBuiltinExtensions"),this._whenExtensionsReady=this._whenBuiltinExtensionsReady=t.installExtensions([],this._asExtensionIdOrVSIX(c),p,!!e.args.force).then(()=>(qt("code/server/didInstallBuiltinExtensions"),i.trace("Finished installing builtin extensions"),{failed:[]}),m=>(i.error(m),{failed:[]}))}let u=e.args["install-extension"];if(u){i.trace("Installing extensions passed via args...");let p={isMachineScoped:!!e.args["do-not-sync"],installPreReleaseVersion:!!e.args["pre-release"],isApplicationScoped:!0};this._whenExtensionsReady=this._whenBuiltinExtensionsReady.then(()=>t.installExtensions(this._asExtensionIdOrVSIX(u),[],p,!!e.args.force)).then(async()=>(i.trace("Finished installing extensions"),{failed:[]}),async m=>{i.error(m);let g=[],y=await this._extensionManagementService.getInstalled(1);for(let h of this._asExtensionIdOrVSIX(u))typeof h=="string"&&(y.some(I=>_e(I.identifier,{id:h}))||g.push({id:h,installOptions:p}));return g.length?(i.info(`Relaying the following extensions to install later: ${g.map(h=>h.id).join(", ")}`),{failed:g}):(i.trace("No extensions to report as failed"),{failed:[]})})}}_asExtensionIdOrVSIX(t){return t.map(e=>/\.vsix$/i.test(e)?S.file(Gn(e)?e:$(_r(),e)):e)}whenExtensionsReady(){return this._whenExtensionsReady}async scanExtensions(t,e,n,o,i){qt("code/server/willScanExtensions"),this._logService.trace(`Scanning extensions using UI language: ${t}`),await this._whenBuiltinExtensionsReady;let s=o?o.filter(l=>l.scheme===q.file).map(l=>l.fsPath):void 0;e=e??this._userDataProfilesService.defaultProfile.extensionsResource;let a=await this._scanExtensions(e,t??Un,n,s,i);return this._logService.trace("Scanned Extensions",a),this._massageWhenConditions(a),qt("code/server/didScanExtensions"),a}async _scanExtensions(t,e,n,o,i){await this._ensureLanguagePackIsInstalled(e,i);let[s,a,l,c]=await Promise.all([this._scanBuiltinExtensions(e),this._scanInstalledExtensions(t,e),this._scanWorkspaceInstalledExtensions(e,n),this._scanDevelopedExtensions(e,o)]);return X$(s,a,l,c,this._logService)}async _scanDevelopedExtensions(t,e){return e?(await Promise.all(e.map(n=>this._extensionsScannerService.scanOneOrMultipleExtensions(S.file(Sn(n)),1,{language:t})))).flat().map(n=>vf(n,!0)):[]}async _scanWorkspaceInstalledExtensions(t,e){let n=[];if(e?.length){let o=await Promise.all(e.map(i=>this._extensionsScannerService.scanExistingExtension(i,1,{language:t})));for(let i of o)i&&n.push(vf(i,!1))}return n}async _scanBuiltinExtensions(t){return(await this._extensionsScannerService.scanSystemExtensions({language:t})).map(n=>vf(n,!1))}async _scanInstalledExtensions(t,e){return(await this._extensionsScannerService.scanUserExtensions({profileLocation:t,language:e,useCache:!0})).map(o=>vf(o,!1))}async _ensureLanguagePackIsInstalled(t,e){if(!(t===Pi||!this._extensionGalleryService.isEnabled())){try{if((await this._languagePackService.getInstalledLanguages()).find(o=>o.id===t)){this._logService.trace(`Language Pack ${t} is already installed. Skipping language pack installation.`);return}}catch(n){this._logService.error(n)}if(!e){this._logService.trace(`No language pack id provided for language ${t}. Skipping language pack installation.`);return}this._logService.trace(`Language Pack ${e} for language ${t} is not installed. It will be installed now.`);try{await this._extensionManagementCLI.installExtensions([e],[],{isMachineScoped:!0},!0)}catch(n){this._logService.error(n)}}}_massageWhenConditions(t){let e=(l,c)=>l.replace(/file/g,"vscode-remote"),n=l=>{let c="";return c+=l.global?"g":"",c+=l.ignoreCase?"i":"",c+=l.multiline?"m":"",new RegExp(e(l.source,!0),c)},o=new class{mapDefined(l){return js.create(l)}mapNot(l){return Qs.create(l)}mapEquals(l,c){return l==="resourceScheme"&&typeof c=="string"?tl.create(l,e(c,!1)):tl.create(l,c)}mapNotEquals(l,c){return l==="resourceScheme"&&typeof c=="string"?nl.create(l,e(c,!1)):nl.create(l,c)}mapGreater(l,c){return ol.create(l,c)}mapGreaterEquals(l,c){return Sc.create(l,c)}mapSmaller(l,c){return xc.create(l,c)}mapSmallerEquals(l,c){return Cc.create(l,c)}mapRegex(l,c){return l==="resourceScheme"&&c?rl.create(l,n(c)):rl.create(l,c)}mapIn(l,c){return ru.create(l,c)}mapNotIn(l,c){return iu.create(l,c)}},i=l=>{if(!l||!l.when||!/resourceScheme/.test(l.when))return;let c=tt.deserialize(l.when);if(!c)return;let u=c.map(o);l.when=u.serialize()},s=l=>{if(Array.isArray(l))for(let c of l)i(c);else i(l)},a=l=>{for(let c in l)s(l[c])};t.forEach(l=>{l.contributes&&(l.contributes.menus&&a(l.contributes.menus),l.contributes.keybindings&&s(l.contributes.keybindings),l.contributes.views&&a(l.contributes.views))})}},VE=class{constructor(t,e){this.service=t;this.getUriTransformer=e}listen(t,e){throw new Error("Invalid listen")}async call(t,e,n){let o=this.getUriTransformer(t);switch(e){case"whenExtensionsReady":return await this.service.whenExtensionsReady();case"scanExtensions":{let i=n[0],s=n[1]?S.revive(o.transformIncoming(n[1])):void 0,a=Array.isArray(n[2])?n[2].map(p=>S.revive(o.transformIncoming(p))):void 0,l=Array.isArray(n[3])?n[3].map(p=>S.revive(o.transformIncoming(p))):void 0,c=n[4];return(await this.service.scanExtensions(i,s,a,l,c)).map(p=>$r(p,o))}}throw new Error("Invalid call")}}});var Cxt,tz,nz=v(()=>{Z();Cxt=A("IRemoteExtensionsScannerService"),tz="remoteExtensionsScanner"});var Lm,oz=v(()=>{Q();Me();Tb();Dn();Ub();Lm=class extends D{constructor(e,n){super();this._reconnectConstants=e;this._environmentService=n}start(){let e={serverName:"Pty Host",args:["--type=ptyHost","--logsPath",this._environmentService.logsHome.with({scheme:q.file}).fsPath],env:{VSCODE_ESM_ENTRYPOINT:"vs/platform/terminal/node/ptyHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true",VSCODE_RECONNECT_GRACE_TIME:this._reconnectConstants.graceTime,VSCODE_RECONNECT_SHORT_GRACE_TIME:this._reconnectConstants.shortGraceTime,VSCODE_RECONNECT_SCROLLBACK:this._reconnectConstants.scrollback}},n=t2(this._environmentService.args,this._environmentService.isBuilt);n&&(n.break&&n.port?e.debugBrk=n.port:!n.break&&n.port&&(e.debug=n.port));let o=new Sl(Pt.asFileUri("bootstrap-fork").fsPath,e),i=new re;return i.add(o),{client:o,store:i,onDidProcessExit:o.onDidProcessExit}}};Lm=w([b(1,Ut)],Lm)});var rz,iz,sz=v(()=>{rz="AI_AGENT",iz="github_copilot_vscode_agent"});function az(...r){return new zL(r)}var BE,Om,Nxt,Fxt,Hxt,Wxt,zL,lz=v(()=>{Dt();BE=class{validateOrThrow(t){let e=this.validate(t);if(e.error)throw new Error(e.error.message);return e.content}},Om=class extends BE{constructor(e){super();this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}getJSONSchema(){return{type:this.type}}},Nxt=new Om("string"),Fxt=new Om("number"),Hxt=new Om("boolean"),Wxt=new Om("object"),zL=class extends BE{constructor(e){super();this.values=e}validate(e){return this.values.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${this.values.join(", ")}`}}:{content:e,error:void 0}}getJSONSchema(){return{enum:this.values}}}});function GL(r){switch(r){case 0:return"off";case 1:return"crash";case 2:return"error";case 3:return"all";default:return"off"}}var cz,$xt,qE=v(()=>{lz();_n();cz="VSCODE_AGENT_HOST_LAUNCH_KIND",$xt=az("local","direct_websocket","dev_tunnel","dev_container","ssh","wsl","remote_extension_host","web_pub_sub","mission_control","unknown")});var KL,dz=v(()=>{Ve();te();ql();KL="ahp-canvas"});function QL(r,t){return Object.hasOwn(r,jL)&&r[jL]!==t?{...r,[jL]:t}:void 0}var jL,uz=v(()=>{jL="vscode.assistedApprovalFeedback"});var pz=v(()=>{uz()});function Iz(r,t){return t===void 0?r==="insider":t==="true"}function Ei(r){return typeof r=="object"&&r!==null}function sre(r,t){return t.startsWith(xz(r))&&t.endsWith(zE)}function hz(r){return JSON.stringify(r,Sz)}function yz(r,t){return JSON.stringify(r,function(e,n){let o=Sz.call(this,e,n);return typeof o=="string"&&o.length>t?`${o.slice(0,t)}\u2026[${o.length-t} more chars elided]`:o})}function Sz(r,t){if(Ei(t)){if(typeof t.authorization=="string")return{...t,authorization:"<redacted>"};let e=Ei(t._meta)?QL(t._meta,ire):void 0;if(e)return{...t,_meta:e};if((t.method==="channel/frame"||t.method==="tcp/data")&&Ei(t.params))return{...t,params:{...t.params,data:"<redacted channel payload>"}};if(Ei(t.result)&&Array.isArray(t.result.certificates))return{...t,result:{...t.result,certificates:"<redacted>"}};if(t.method==="authenticate"&&Ei(t.params)&&t.params.token!==void 0&&t.params.token!=="<redacted>"&&t.params.token!=="[REDACTED]")return{...t,params:{...t.params,token:"<redacted>"}};if(t.type==="canvas/stateChanged"&&Ei(t.canvas)&&t.canvas.url!==void 0)return{...t,canvas:{...t.canvas,url:fz}};if((typeof t.resource=="string"?t.resource.toLowerCase().startsWith(`${KL}:`):S.isUri(t.resource)&&t.resource.scheme===KL)&&Ei(t.state)&&t.state.url!==void 0)return{...t,state:{...t.state,url:fz}}}return t&&typeof t=="object"&&t.$mid===1&&rs(t)?S.revive(t).toString():t}function are(r){return r.toISOString().replace(/[:.]/g,"-")}function xz(r){let t=new Za;return t.update(r),`${Zoe}-${t.digest()}-`}function lre(r){return r.replace(/[\\/:\*\?"<>\|\s]+/g,"-").replace(/^-+|-+$/g,"")||"connection"}var vz,bz,Zoe,zE,ere,tre,nre,ore,rre,mz,gz,fz,ire,$E,Pd,JL=v(()=>{Ve();Ue();Mi();Q();fn();Ka();it();te();st();De();dz();pz();vz="VSCODE_AGENT_HOST_AHP_JSONL_LOGGING";bz="ahp",Zoe="ahp",zE=".jsonl",ere=75*1024*1024,tre=5,nre=4*1024*1024,ore=500*1024*1024,rre=1024*1024,mz=1024*1024,gz=16*1024,fz="<redacted canvas source>",ire="<redacted permission feedback>";$E=class{constructor(t,e,n){this._options=t;this._fileService=e;this._logService=n;this._writes=new Zd}run(t,e){return this._writes.queue(async()=>{await t();let n=e(),i=((await this._fileService.resolve(ge(this._options.logsHome,bz),{resolveMetadata:!0})).children??[]).filter(l=>l.isFile&&!l.isSymbolicLink&&sre(this._options.logId,l.name)).sort((l,c)=>Number(Tn(c.resource,n))-Number(Tn(l.resource,n))||(c.mtime??0)-(l.mtime??0)||c.name.localeCompare(l.name)),s=i.length,a=i.reduce((l,c)=>l+(c.size??0),0);for(let l of i.reverse()){if(s<=this._options.maxFiles&&a<=this._options.maxSizeBytes)break;try{await this._fileService.del(l.resource),s--,a-=l.size??0}catch(c){this._logService.warn("[AHPLog] Failed to remove retained transport log",l.resource.toString(),c)}}})}};$E=w([b(1,Le),b(2,z)],$E);Pd=class extends D{constructor(e,n,o){super();this._options=e;this._fileService=n;this._logService=o;this._logReadRequests=new ti(1024);this._currentSize=0;this._segment=0;this._queue=Promise.resolve();this._pending=[];this._pendingBytes=0;this._droppedEntries={c2s:0,s2c:0};this._drainScheduled=!1;let i=Pd._budgets.get(this._options.logsHome);i||(i={remainingBytes:this._options.maxTotalSizeBytes??ore,exhausted:!1},Pd._budgets.set(this._options.logsHome,i)),this._budget=i,this._directory=ge(this._options.logsHome,bz);let s=lre(this._options.connectionId).slice(0,64);this._baseName=`${xz(this._options.logId)}${are(new Date)}-${s}${zE}`,this._maxFileSizeBytes=this._options.maxFileSizeBytes??ere,this._maxFiles=this._options.maxFiles??tre,this._maxPendingBytes=this._options.maxPendingBytes??nre,this._currentFile=ge(this._directory,this._baseName)}static{this._budgets=new je}get resource(){return this._currentFile}log(e,n,o){if(this._budget.exhausted||this._options.isEnabled?.()===!1||this._isLogInspection(e,n))return;if(this._pendingBytes>=this._maxPendingBytes){this._droppedEntries[n]++;return}let i={ts:new Date().toISOString(),dir:n,connectionId:this._options.connectionId,transport:this._options.transport,...typeof o=="number"?{byteLength:o}:{}},s={...e,_ahpLog:i},a;typeof o=="number"&&o>mz*3?(i.truncated=!0,a=yz(s,gz)):(a=hz(s),a.length>mz&&(i.truncated=!0,a=yz(s,gz)));let l=`${a}
`;this._enqueue(O.fromString(l))}_isLogInspection(e,n){if(!Ei(e))return!1;let o=e.id;if(n==="s2c"&&e.method===void 0&&(typeof o=="number"||typeof o=="string")&&this._logReadRequests.delete(o))return!0;let i=e.params;if(!Ei(i))return!1;if(n==="c2s"&&(e.method==="resourceRead"||e.method==="resourceResolve"||e.method==="resourceList"||e.method==="resourceRequest"||e.method==="createResourceWatch")&&this._isLogResource(i.uri))return(typeof o=="number"||typeof o=="string")&&this._logReadRequests.set(o,!0),!0;let s=i.action;return e.method==="action"&&Ei(s)&&s.type==="resourceWatch/changed"&&Ei(s.changes)&&Array.isArray(s.changes.items)&&s.changes.items.length>0&&s.changes.items.every(a=>Ei(a)&&this._isLogResource(a.uri))}_isLogResource(e){if(S.isUri(e))return Bs(e,this._directory);if(typeof e!="string")return!1;try{return Bs(S.parse(e,!0),this._directory)}catch{return!1}}_enqueue(e){if(!this._budget.exhausted){if(e.byteLength>this._budget.remainingBytes){this._budget.exhausted=!0,this._logService.warn("[AHPLog] Transport logging stopped: shared process byte budget exhausted",this._options.logsHome.toString());return}this._budget.remainingBytes-=e.byteLength,this._pending.push(e),this._pendingBytes+=e.byteLength,this._scheduleDrain()}}async flush(){let e;do e=this._queue,await e;while(e!==this._queue)}_scheduleDrain(){this._drainScheduled||(this._drainScheduled=!0,this._queue=this._queue.then(()=>this._options.retention?this._options.retention.run(()=>this._drainPending(),()=>this._currentFile):this._drainPending()).catch(e=>{this._logService.error("[AHPLog] Failed to write transport log",e)}))}async _drainPending(){if(this._drainScheduled=!1,this._pending.length===0)return;let e=this._pending;this._pending=[];let n=e.reduce((o,i)=>o+i.byteLength,0);try{await this._writeBuffers(e)}finally{this._pendingBytes-=n,this._enqueueDroppedEntries()}}async _writeBuffers(e){this._folderCreated||(this._folderCreated=this._fileService.createFolder(this._directory)),await this._folderCreated,(this._currentSize===0||this._options.retention)&&(this._currentSize=await this._getFileSize(this._currentFile));let n=[],o=0,i=async()=>{if(n.length===0)return;let s=n.length===1?n[0]:O.concat(n,o);await this._fileService.writeFile(this._currentFile,s,{append:!0}),this._currentSize+=s.byteLength,n=[],o=0};for(let s of e){let a=this._currentSize+o;a>0&&a+s.byteLength>this._maxFileSizeBytes?(await i(),await this._rotate()):o>0&&o+s.byteLength>rre&&await i(),n.push(s),o+=s.byteLength}await i()}_enqueueDroppedEntries(){if(!this._budget.exhausted)for(let e of["c2s","s2c"]){let n=this._droppedEntries[e];if(n===0||this._pendingBytes>=this._maxPendingBytes)continue;this._droppedEntries[e]=0;let o={_ahpLog:{ts:new Date().toISOString(),dir:e,connectionId:this._options.connectionId,transport:this._options.transport,droppedEntries:n}};this._enqueue(O.fromString(`${hz(o)}
`))}}async _rotate(){this._segment++;let e=this._segment-this._maxFiles;e>=0&&await this._fileService.del(this._resourceForSegment(e)).catch(n=>{this._logService.trace("[AHPLog] Failed to delete old transport log",n)}),this._currentFile=this._resourceForSegment(this._segment),this._currentSize=await this._getFileSize(this._currentFile)}_resourceForSegment(e){if(e===0)return ge(this._directory,this._baseName);let n=this._baseName.slice(0,-zE.length);return ge(this._directory,`${n}.${e}${zE}`)}async _getFileSize(e){try{return(await this._fileService.resolve(e)).size??0}catch(n){if(this._options.retention&&(!(n instanceof Error)||wt(n)!==1))throw n;return 0}}};Pd=w([b(1,Le),b(2,z)],Pd)});var YL=v(()=>{Ie()});var CCt,ECt,Cz,wCt,RCt,Ez=v(()=>{Z();ro();CCt=new C("githubEnvironmentsAvailable",!1),ECt=A("missionControlAvailabilityService"),Cz="missionControlUseLocalCredentials",wCt=A("missionControlSharingService"),RCt=A("missionControlEnvironmentService")});var Um,wz=v(()=>{Um={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603}});var Rz=v(()=>{wz()});var kd,Tz=v(()=>{DD();CD();Rz();kd=class extends Error{constructor(e,n,o){super(n);this.code=e;this.data=o}}});var GE,Pz,XL=v(()=>{GE="modelRouter.enabled",Pz="chat.copilot.modelRouter.enabled"});function Re(r){let t=KE(r);return{protocol:r,validate:o=>{try{return t(o,""),!0}catch{return!1}},assertValid:(o,i="")=>t(o,i)}}function La(r){return{definition:r,toProtocol(){let t={};for(let e of Object.keys(r))t[e]=r[e].protocol;return{type:"object",properties:t}},values(t){let e=t;for(let n of Object.keys(r)){let o=e[n];if(o===void 0)continue;r[n].assertValid(o,n)}return{...e}},validate(t,e){let n=r[t];return n?n.validate(e):!1},assertValid(t,e){let n=r[t];if(!n)throw new kd(Um.InvalidParams,`Unknown schema key '${t}'`);n.assertValid(e,t)},validateOrDefault(t,e){let n={},o=t??{};for(let i of Object.keys(r)){let s=r[i],a=o[i];a!==void 0&&s.validate(a)?n[i]=a:Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n}}}function KE(r){if(r.type==="object"&&(r.properties||r.additionalProperties)){let t={},e=r.properties??{};for(let i of Object.keys(e))t[i]=KE(e[i]);let n=new Set(r.required??[]),o=r.additionalProperties?KE(r.additionalProperties):void 0;return(i,s)=>{if(typeof i!="object"||i===null||Array.isArray(i))throw Ad(s,"object",i);let a=i;for(let l of Object.keys(t)){let c=kz(s,l);if(a[l]===void 0){if(n.has(l))throw new kd(Um.InvalidParams,`Missing required property at '${c}'`);continue}t[l](a[l],c)}if(o)for(let l of Object.keys(a))Object.hasOwn(t,l)||o(a[l],kz(s,l))}}if(r.type==="array"&&r.items){let t=KE(r.items);return(e,n)=>{if(!Array.isArray(e))throw Ad(n,"array",e);for(let o=0;o<e.length;o++)t(e[o],`${n}[${o}]`)}}return dre(r)}function dre(r){let t=r.enumDynamic===!0;return(e,n)=>{switch(r.type){case"string":if(typeof e!="string")throw Ad(n,"string",e);break;case"number":if(typeof e!="number")throw Ad(n,"number",e);break;case"boolean":if(typeof e!="boolean")throw Ad(n,"boolean",e);break;case"array":if(!Array.isArray(e))throw Ad(n,"array",e);break;case"object":if(typeof e!="object"||e===null||Array.isArray(e))throw Ad(n,"object",e);break}if(r.enum&&!t&&!r.enum.includes(e))throw new kd(Um.InvalidParams,`Invalid value at '${n||"<root>"}': ${Az(e)} is not one of [${r.enum.map(o=>JSON.stringify(o)).join(", ")}]`)}}function Ad(r,t,e){return new kd(Um.InvalidParams,`Invalid value at '${r||"<root>"}': expected ${t}, got ${Az(e)}`)}function kz(r,t){return r?`${r}.${t}`:t}function Az(r){try{return JSON.stringify(r)}catch{return String(r)}}var Dz,ure,pre,XCt,mre,gre,fre,e1,t1,hre,yre,vre,n1,Ire,bre,Sre,xre,Cre,Ere,wre,o1,r1,i1,s1,Rre,Tre,Pre,kre,a1,ZL,_z,ZCt,l1,c1,d1,u1,p1,m1,g1,f1,h1,y1,v1,I1,b1,S1,x1,Are,Dre,_re,Mre,Lre,Ore,Ure,Nre,eEt,Dd=v(()=>{ee();cC();_n();qE();YL();Ez();Tz();XL();Dz=Re({type:"object",title:d(2091,null),description:d(2096,null),properties:{allow:{type:"array",title:d(2092,null),items:{type:"string",title:d(2095,null)}},deny:{type:"array",title:d(2094,null),items:{type:"string",title:d(2095,null)}},ask:{type:"array",title:d(2093,null),items:{type:"string",title:d(2095,null)}}},default:{allow:[],deny:[]},sessionMutable:!0,chatMutable:!0}),ure=Re({type:"array",title:d(2104,null),description:d(2108,null),items:{type:"object",title:d(2105,null),properties:{shell:{type:"string",title:d(2107,null),enum:["bash","powershell"]},script:{type:"string",title:d(2106,null)}},required:["shell","script"]},readOnly:!0,sessionMutable:!0}),pre=Re({type:"array",title:d(2099,null),description:d(2103,null),items:{type:"object",title:d(2101,null),properties:{path:{type:"string",title:d(2102,null)},isDirectory:{type:"boolean",title:d(2100,null)}},required:["path","isDirectory"]},readOnly:!0,sessionMutable:!0}),XCt=La({sandboxEnabled:Re({type:"string",title:d(2097,null),description:d(2098,null),enum:["default","on","off"],sessionMutable:!0,chatMutable:!0}),autoApprove:Re({type:"string",title:d(2075,null),description:d(2082,null),enum:["default","assisted","autoApprove"],enumLabels:[d(2080,null),d(2076,null),d(2078,null)],enumDescriptions:[d(2081,null),d(2077,null),d(2079,null)],default:"default",sessionMutable:!0,chatMutable:!0}),permissions:Dz,mode:Re({type:"string",title:d(2083,null),description:d(2090,null),enum:["interactive","plan","autopilot"],enumLabels:[d(2086,null),d(2088,null),d(2084,null)],enumDescriptions:[d(2087,null),d(2089,null),d(2085,null)],default:"interactive",sessionMutable:!0,chatMutable:!0}),shellInitScripts:ure,sensitiveEditLocations:pre}),mre="telemetryLevel",gre="editTelemetryEnabled",fre="disableRepoInfoTelemetry",e1="byokModelsEnabled",t1=!0,hre="utilitySmallModel",yre="byokUtilityModelDefault",vre=["none","mainAgent","copilot"],n1="codexAgentEnabled",Ire="editAutoApprovePatterns",bre="terminalAutoApproveEnabled",Sre="globalAutoApproveEnabled",xre="autoApprovePolicyRestricted",Cre="assistedApprovalInstructions",Ere="autoReplyEnabled",wre="workspaceTrust",o1="systemProxyEnabled",r1="githubMcpServerEnabled",i1="computerUseEnabled",s1="mcpToolRoutingEnabled",Rre="mcpSamplingAllowedServers",Tre="mcpSkillsServerApprovals",Pre="extensionPermissionApprovals",kre="mcpConnectorsEnabled",a1="mcpSkillsEnabled",ZL={Proxy:"http.proxy",ProxyKerberosServicePrincipal:"http.proxyKerberosServicePrincipal",NoProxy:"http.noProxy"},_z={[ZL.Proxy]:Re({type:"string",title:d(2001,null),description:d(2000,null)}),[ZL.ProxyKerberosServicePrincipal]:Re({type:"string",title:d(2003,null),description:d(2002,null)}),[ZL.NoProxy]:Re({type:"array",title:d(1999,null),description:d(1997,null),items:{type:"string",title:d(1998,null)},default:[]})},ZCt=La(_z),l1="titleGeneration",c1="activeAgentTitleGeneration",d1="deferredTitleGeneration",u1=["utility","activeAgent","agentReview"],p1="markdownPlanRichLinksEnabled",m1="workspaceSnapshotEnabled",g1="agentOrchestrationLimits",f1="artifactTools",h1="artifactIntegrations",y1="githubArtifactMarkReadyIgnoredChecks",v1="canvasesEnabled",I1="ahpJsonlLoggingEnabled",b1="autoAttachPullRequests",S1="overlapProviderPreparation",x1="prewarmSessions",Are="migrateLegacyCopilotCliEnabled",Dre="showExternalSessions",_re="autoArchiveMergedSessionsAfterDays",Mre="autoDeleteArchivedMergedSessionsAfterDays",Lre="terminalIgnoreDefaultAutoApproveRules",Ore="mcpServers",Ure={type:{type:"string",title:d(2029,null),description:d(2028,null),enum:["stdio","http"]},command:{type:"string",title:d(2017,null),description:d(2016,null)},args:{type:"array",title:d(2015,null),description:d(2014,null),items:{type:"string",title:d(2013,null)}},env:{type:"object",title:d(2024,null),description:d(2023,null)},cwd:{type:"string",title:d(2019,null),description:d(2018,null)},url:{type:"string",title:d(2031,null),description:d(2030,null)},headers:{type:"object",title:d(2026,null),description:d(2025,null)}},Nre={"<serverName>":{type:"object",title:d(2022,null),description:d(2021,null),properties:Ure}},eEt=La({..._z,[Cz]:Re({type:"boolean",title:d(2005,null),description:d(2004,null),readOnly:!0}),[I1]:Re({type:"boolean",title:d(1950,null),description:d(1949,null),readOnly:!0}),permissions:Dz,[fre]:Re({type:"boolean",title:d(1982,null),description:d(1981,null),default:!1}),[mre]:Re({type:"string",title:d(2057,null),description:d(2056,null),enum:["all","error","crash","off"],default:"all"}),[gre]:Re({type:"boolean",title:d(1986,null),description:d(1985,null),default:!0}),[e1]:Re({type:"boolean",title:d(1967,null),description:d(1966,null),default:t1}),[hre]:Re({type:"string",title:d(2068,null),description:d(2067,null),default:""}),[yre]:Re({type:"string",title:d(1972,null),description:d(1969,null),enum:[...vre],enumDescriptions:[d(1971,null),d(1970,null),d(1968,null)],default:"copilot"}),[n1]:Re({type:"boolean",title:d(1976,null),description:d(1975,null),default:!1}),[bre]:Re({type:"boolean",title:d(2059,null),description:d(2058,null),default:!0}),[Sre]:Re({type:"boolean",title:d(1996,null),description:d(1995,null),default:!1}),[xre]:Re({type:"boolean",title:d(1957,null),default:!1,readOnly:!0}),[Cre]:Re({type:"string",title:d(1956,null),description:d(1955,null),default:""}),[wre]:Re({type:"object",title:d(2071,null),properties:{enabled:{type:"boolean",title:d(2072,null)},trustedUris:{type:"array",title:d(2073,null),items:{type:"string",title:d(2074,null)}}},required:["enabled","trustedUris"],readOnly:!0}),[Ere]:Re({type:"boolean",title:d(1965,null),description:d(1964,null),default:!1}),[o1]:Re({type:"boolean",title:d(2055,null),description:d(2054,null),default:!0}),[r1]:Re({type:"boolean",title:d(1994,null),description:d(1993,null),default:!0}),[i1]:Re({type:"boolean",title:d(1978,null),description:d(1977,null),default:!1}),[s1]:Re({type:"boolean",title:d(2038,null),description:d(2037,null),default:!1}),[Rre]:Re({type:"array",title:d(2012,null),description:d(2010,null),items:{type:"string",title:d(2011,null)},default:[]}),[Tre]:Re({type:"object",title:d(2036,null),description:d(2034,null),additionalProperties:{type:"string",title:d(2035,null),enum:["allow","deny"]},default:{}}),[Pre]:Re({type:"object",title:d(1989,null),description:d(1987,null),additionalProperties:{type:"string",title:d(1988,null),enum:["allow","deny"]},default:{}}),[c1]:Re({type:"boolean",title:d(1944,null),description:d(1943,null),default:!1}),[d1]:Re({type:"boolean",title:d(1980,null),description:d(1979,null),default:!1}),[l1]:Re({type:"string",title:d(2065,null),description:d(2064,null),enum:[...u1],enumDescriptions:[d(2066,null),d(2062,null),d(2063,null)],default:"utility"}),[kre]:Re({type:"boolean",title:d(2009,null),description:d(2008,null),default:!1}),[a1]:Re({type:"boolean",title:d(2033,null),description:d(2032,null),default:!1}),[p1]:Re({type:"boolean",title:d(2007,null),description:d(2006,null),default:!1}),[m1]:Re({type:"boolean",title:d(2070,null),description:d(2069,null),default:!1}),[g1]:Re({type:"string",title:d(1948,null),description:d(1945,null),enum:["on","off"],enumDescriptions:[d(1947,null),d(1946,null)],default:"on"}),[f1]:Re({type:"boolean",title:d(1954,null),description:d(1953,null),default:!1}),[h1]:Re({type:"boolean",title:d(1952,null),description:d(1951,null),default:!1}),[y1]:Re({type:"array",title:d(1992,null),description:d(1990,null),items:{type:"string",title:d(1991,null)},default:[]}),[v1]:Re({type:"boolean",title:d(1974,null),description:d(1973,null),default:!1}),[b1]:Re({type:"boolean",title:d(1961,null),description:d(1960,null),default:!0}),[GE]:Re({type:"boolean",title:d(2042,null),description:d(2041,null),default:!1}),[S1]:Re({type:"boolean",title:d(2044,null),description:d(2043,null),default:!1}),[x1]:Re({type:"boolean",title:d(2046,null),description:d(2045,null),default:!1}),[Are]:Re({type:"boolean",title:d(2040,null),description:d(2039,null),default:!1}),[Dre]:Re({type:"string",title:d(2053,null),description:d(2047,null),enum:["none","recent","last24Hours","last7Days","last30Days"],enumDescriptions:[d(2051,null),d(2052,null),d(2048,null),d(2050,null),d(2049,null)],default:"none"}),[_re]:Re({type:"number",title:d(1959,null),description:d(1958,null),default:0}),[Mre]:Re({type:"number",title:d(1963,null),description:d(1962,null),default:0}),[Ire]:Re({type:"object",title:d(1984,null),description:d(1983,null),default:NB}),[Lre]:Re({type:"boolean",title:d(2061,null),description:d(2060,null),default:!1}),[Ore]:Re({type:"object",title:d(2027,null),description:d(2020,null),properties:Nre,default:{}})})});var C1,jE,rEt,E1=v(()=>{ee();Dd();C1={Enabled:"multipleChatProviders.enabled"},jE={Enabled:"chat.agentHost.multipleChatProviders.enabled"},rEt=La({[C1.Enabled]:Re({type:"boolean",title:d(1898,null),default:!1})})});import*as Oz from"fs";function Mz(...r){let t={},e=new Map;for(let n of r)for(let[o,i]of Object.entries(n??{})){let s=oe?o.toUpperCase():o,a=e.get(s)??o;e.set(s,a),t[a]=i??void 0}return t}var _d,Uz=v(()=>{Q();Me();fe();la();Tb();sz();dn();Dn();Ub();De();Xg();_n();qE();JL();Kl();E1();_d=class extends D{constructor(e,n,o,i){super();this._configurationService=e;this._environmentService=n;this._logService=o;this._telemetryService=i}setWebSocketConfig(e){this._wsConfig=e}setEnvironment(e,n){this._environment=Mz(n,e)}async start(){let e=await this._resolveShellEnv(),n={[rz]:iz,VSCODE_ESM_ENTRYPOINT:"vs/platform/agentHost/node/agentHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true",[cz]:"vscode_cli",[vz]:String(this._configurationService.getValue(SC))},o=e5({codexSdkRoot:this._configurationService.getValue(EC),codexHome:this._configurationService.getValue(wC),codexBinaryArgs:this._configurationService.getValue(RC),claudeAgentEnabled:this._configurationService.getValue(xC),multipleChatProvidersEnabled:this._configurationService.getValue(jE.Enabled)===!0,codexAgentEnabled:this._configurationService.getValue(CC)},process.env);Object.assign(n,o);let i=Zq({enabled:this._configurationService.getValue(Zh),exporterType:this._configurationService.getValue(ey),otlpEndpoint:this._configurationService.getValue(ty),captureContent:this._configurationService.getValue(ny),captureIdentity:this._configurationService.getValue(oy),outfile:this._configurationService.getValue(ry),dbSpanExporterEnabled:this._configurationService.getValue(TC)},process.env,Xq(this._configurationService),e);Object.assign(n,i),this._wsConfig&&(this._wsConfig.port&&(n.VSCODE_AGENT_HOST_PORT=this._wsConfig.port),this._wsConfig.socketPath&&(n.VSCODE_AGENT_HOST_SOCKET_PATH=this._wsConfig.socketPath),this._wsConfig.host&&(n.VSCODE_AGENT_HOST_HOST=this._wsConfig.host),this._wsConfig.connectionToken&&(n.VSCODE_AGENT_HOST_CONNECTION_TOKEN=this._wsConfig.connectionToken));let a={serverName:"Agent Host",args:["--type=agentHost","--logsPath",this._environmentService.logsHome.with({scheme:q.file}).fsPath,"--user-data-dir",this._environmentService.userDataPath,"--telemetry-level",GL(this._telemetryService.telemetryLevel)],env:Mz(process.env,e,this._environment,n)},l=n2(this._environmentService.args,this._environmentService.isBuilt);l&&(l.break&&l.port?a.debugBrk=l.port:!l.break&&l.port&&(a.debug=l.port)),await this._removeStaleSocket();let c=new re,u=c.add(this._createClient(a));return{client:u,store:c,onDidProcessExit:u.onDidProcessExit,shutdown:()=>Er.toService(u.getChannel("agentHostManagement")).shutdown()}}_createClient(e){return new Sl(Pt.asFileUri("bootstrap-fork").fsPath,e)}async _removeStaleSocket(){let e=this._wsConfig?.socketPath;if(!(!e||process.platform==="win32"))try{await Oz.promises.unlink(e)}catch(n){n?.code!=="ENOENT"&&this._logService.warn(`AgentHostStarter could not remove stale socket at ${e}`,n)}}async _resolveShellEnv(){try{return await pl(this._configurationService,this._logService,this._environmentService.args,process.env)}catch(e){return this._logService.error("AgentHostStarter was unable to resolve shell environment",e),{}}}};_d=w([b(0,bt),b(1,Ut),b(2,z),b(3,Mt)],_d)});var w1=v(()=>{});var R1=v(()=>{Tt();dM()});var Nz,$Et,T1=v(()=>{Tt();Ie();te();ee();w1();R1();bD();Nz="chat.artifactIntegrations.githubPullRequests.autoMarkReadyIgnoredChecks",$Et=[{id:"addressReviews",kind:"boolean",defaultValue:!1,actionIds:["addressReviews"],maxAttempts:3,label:d(2434,null),description:d(2435,null)},{id:"fixCI",kind:"boolean",defaultValue:!1,actionIds:["fixCI"],maxAttempts:3,label:d(2426,null),description:d(2427,null)},{id:"resolveConflicts",kind:"boolean",defaultValue:!1,actionIds:["resolveConflicts"],maxAttempts:3,label:d(2428,null),description:d(2429,null)},{id:"markReady",kind:"boolean",defaultValue:!1,actionIds:["markReady"],maxAttempts:1,label:d(2432,null),description:d(2433,null)},{id:"merge",kind:"enum",defaultValue:"never",disabledValue:"never",actionIds:["merge"],maxAttempts:1,label:d(2430,null),description:d(2431,null),choices:[{value:"never",label:d(2437,null)},{value:"always",label:d(2436,null)},{value:"ifUnchanged",label:d(2438,null)}]}]});var ur,tc,nc,nwt,Bre,qre,owt,Fz=v(()=>{ee();xr();Kx();Dd();w1();R1();SD();T1();YL();ur={Enabled:"agentMerge.enabled",AddressReviews:"agentMerge.addressReviews",FixCI:"agentMerge.fixCI",ResolveConflicts:"agentMerge.resolveConflicts",MergePullRequest:"agentMerge.mergePullRequest",MergeMethod:"agentMerge.mergeMethod",ReplyAttribution:"agentMerge.replyAttribution"},tc={Enabled:"chat.agentMerge.enabled",AddressReviews:"chat.agentMerge.addressReviews",FixCI:"chat.agentMerge.fixCI",ResolveConflicts:"chat.agentMerge.resolveConflicts",MergePullRequest:"chat.agentMerge.mergePullRequest",MergeMethod:"chat.agentMerge.mergeMethod",ReplyAttribution:"chat.agentMerge.replyAttribution"},nc="agentMerge",nwt=La({[ur.Enabled]:Re({type:"boolean",title:d(2175,null),default:!1}),[ur.AddressReviews]:Re({type:"boolean",title:d(2174,null),default:!0}),[ur.FixCI]:Re({type:"boolean",title:d(2176,null),default:!0}),[ur.ResolveConflicts]:Re({type:"boolean",title:d(2180,null),default:!0}),[ur.MergePullRequest]:Re({type:"string",title:d(2178,null),enum:["always","ifUnchanged","never"],default:"never"}),[ur.MergeMethod]:Re({type:"string",title:d(2177,null),enum:["auto","squash","merge","rebase"],default:"auto"}),[ur.ReplyAttribution]:Re({type:"boolean",title:d(2179,null),default:!0})}),Bre=["topLevelComments","submittedReviews","reviewThreads"],qre=["checks","mergeability"],owt=["core",...Bre,...qre]});var Hz,Wz=v(()=>{ee();Hz="chat.artifactIntegrations.enabled"});var Vz,Bz=v(()=>{ee();Wz();br();Dd();Kl();T1();Vz={[Hz]:{type:"boolean",markdownDescription:d(2261,null),default:!1,scope:1,tags:["experimental"],agentHost:{key:h1}},[Gq]:{type:"boolean",description:d(2262,null),default:!0,scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:f1}},[Nz]:{type:"array",items:{type:"string"},default:[],scope:5,tags:["experimental","advanced"],markdownDescription:d(2263,null),agentHost:{key:y1}}}});var P1,qz,ywt,$z=v(()=>{ee();Dd();xD();P1={Enabled:"chatMoves.enabled"},qz={Enabled:"chat.agentHost.moveChats.enabled"},ywt=La({[P1.Enabled]:Re({type:"boolean",title:d(1897,null),default:!1})})});var zz,Gz=v(()=>{ee();br();ai();$z();zz={[qz.Enabled]:{type:"boolean",description:d(2325,null),default:Je.quality!=="stable",scope:1,tags:["experimental"],experiment:{mode:"startup"},agentHost:{key:P1.Enabled}}}});var Kz,jz=v(()=>{ee();br();ai();Dd();Kl();Kz={[Wq]:{type:"string",enum:[...u1],enumDescriptions:[d(2784,null),d(2782,null),d(2783,null)],description:d(2781,null),default:Je.quality!=="stable"?"activeAgent":"utility",scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:l1,derivedKeys:{[c1]:r=>r==="activeAgent",[d1]:r=>r==="agentReview"}}}}});function zre(r){if(r.managedSettings?.[ud]!==void 0)return"file";let t=r.managedSettings?.[pd];if(t==="grpc")return"otlp-grpc";if(t==="http/protobuf"||t==="http/json")return"otlp-http"}function Gre(r){let t=r.managedSettings?.[h_];return typeof t=="boolean"?t:r.managedSettings?.[v_]===!0?!1:void 0}function Kre(r){let t=r.managedSettings?.[f_];return typeof t=="boolean"?t:r.managedSettings?.[ud]!==void 0?!0:void 0}function jre(r){let t=r.managedSettings,e=t?.[ud];if(typeof e=="string")return e;if(t?.[Xh]!==void 0||t?.[pd]!==void 0)return""}var $re,Qz=v(()=>{ee();of();br();mm();ai();$o();Kl();Dd();Fz();E1();Bz();Gz();jz();JL();XL();$re=St.as(Jn.Configuration);$re.registerConfiguration({id:"chatAgentHostStarter",title:d(2173,null),type:"object",properties:{[SC]:{type:"boolean",description:d(2112,null),default:Iz(Je.quality),tags:["experimental","advanced"],agentHost:{key:I1,scope:"local"}},[tc.Enabled]:{type:"boolean",markdownDescription:d(2156,null),default:Je.quality!=="stable",scope:1,tags:["experimental",nc],experiment:{mode:"auto"},agentHost:{key:ur.Enabled}},[tc.AddressReviews]:{type:"boolean",description:d(2155,null),default:!0,scope:1,tags:["experimental",nc],agentHost:{key:ur.AddressReviews}},[tc.FixCI]:{type:"boolean",description:d(2157,null),default:!0,scope:1,tags:["experimental",nc],agentHost:{key:ur.FixCI}},[tc.ResolveConflicts]:{type:"boolean",description:d(2168,null),default:!0,scope:1,tags:["experimental",nc],agentHost:{key:ur.ResolveConflicts}},[tc.MergePullRequest]:{type:"string",enum:["always","ifUnchanged","never"],enumDescriptions:[d(2164,null),d(2165,null),d(2166,null)],description:d(2163,null),default:"never",scope:1,tags:["experimental",nc],agentHost:{key:ur.MergePullRequest}},[tc.MergeMethod]:{type:"string",enum:["auto","squash","merge","rebase"],enumDescriptions:[d(2159,null),d(2162,null),d(2160,null),d(2161,null)],description:d(2158,null),default:"auto",scope:1,tags:["experimental",nc],agentHost:{key:ur.MergeMethod}},[tc.ReplyAttribution]:{type:"boolean",description:d(2167,null),default:!0,scope:1,tags:["experimental",nc],agentHost:{key:ur.ReplyAttribution}},[jE.Enabled]:{type:"boolean",description:d(2129,null),default:!1,scope:1,tags:["experimental"],agentHost:{key:C1.Enabled}},...zz,...Kz,...Vz,[Kq]:{type:"boolean",markdownDescription:d(2169,null,"workbench.browser.enableRemoteProxy"),default:!1,scope:1,tags:["preview"],experiment:{mode:"auto"},agentHost:{key:v1},policy:{name:"ChatCanvases",category:"InteractiveSession",minimumVersion:"1.144",value:r=>r.chat_preview_features_enabled===!1?!1:void 0,localization:{description:{key:"chat.canvases.enabled.policy",value:d(2170,null)}}}},[jq]:{type:"boolean",description:d(2122,null),default:!1,scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:b1}},[Bq]:{type:"boolean",description:d(2123,null),default:!1,scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:p1}},[Pz]:{type:"boolean",markdownDescription:d(2171,null),default:!1,scope:1,tags:["preview","advanced","experimental"],included:!1,agentHost:{key:GE}},[Qq]:{type:"boolean",description:d(2125,null),default:!1,scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:S1}},[Jq]:{type:"boolean",description:d(2126,null),default:!1,scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:x1}},[$q]:{type:"boolean",description:d(2128,null),default:!1,scope:1,tags:["experimental"],experiment:{mode:"auto"},agentHost:{key:a1}},[qq]:{type:"boolean",description:d(2172,null),default:!1,scope:1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:m1}},[zq]:{type:"string",enum:["on","off"],enumDescriptions:[d(2111,null),d(2110,null)],description:d(2109,null),default:"on",scope:1,tags:["experimental","advanced"],agentHost:{key:g1}},[Nq]:{type:"boolean",description:d(2154,null),default:!0,tags:["experimental","advanced"],experiment:{mode:"startup"},agentHost:{key:o1}},[Fq]:{type:"boolean",description:d(2127,null),default:!0,tags:["experimental","advanced"],experiment:{mode:"startup"},agentHost:{key:r1}},[Hq]:{type:"boolean",markdownDescription:d(2121,null),default:!1,tags:["experimental","advanced"],experiment:{mode:"startup"},agentHost:{key:i1,scope:"local"}},[Vq]:{type:"boolean",description:d(2124,null),default:!1,tags:["experimental","advanced"],experiment:{mode:"auto"},agentHost:{key:s1}},[xC]:{type:"boolean",description:d(2114,null),default:!0,tags:["experimental","advanced"],policy:{name:"Claude3PIntegration",category:"InteractiveSession",minimumVersion:"1.113",value:b_,managedSettings:{[pm]:{type:"boolean"}},localization:{description:{key:"chat.agentHost.claudeAgent.enabled.policy",value:d(2115,null)}}}},[Yq]:{type:"boolean",description:d(2113,null),default:t1,tags:["experimental","advanced"],experiment:{mode:"startup"},agentHost:{key:e1,scope:"local"}},[CC]:{type:"boolean",description:d(2118,null),default:!0,experiment:{mode:"startup"},agentHost:{key:n1},policy:{name:"Codex3PIntegration",category:"InteractiveSession",minimumVersion:"1.126",value:b_,managedSettings:{[pm]:{type:"boolean"}},localization:{description:{key:"chat.agentHost.codexAgent.enabled.policy",value:d(2119,null)}}}},[EC]:{type:"string",description:d(2120,null),default:"",tags:["experimental","advanced"],included:Je.quality!=="stable"},[wC]:{type:"string",description:d(2117,null),default:"",tags:["experimental","advanced"],included:Je.quality!=="stable"},[RC]:{type:"array",items:{type:"string"},description:d(2116,null),default:[],tags:["experimental","advanced"],included:Je.quality!=="stable"},[Zh]:{type:"boolean",markdownDescription:d(2134,null),default:!1,scope:1,tags:["experimental","advanced"],policy:{name:"CopilotOtelEnabled",category:"InteractiveSession",minimumVersion:"1.127",value:Kre,managedSettings:{[f_]:{type:"boolean"},[ud]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.enabled.policy",value:d(2135,null)}}}},[ey]:{type:"string",enum:["otlp-http","otlp-grpc","console","file"],markdownDescription:d(2136,null),default:"otlp-http",scope:1,tags:["experimental","advanced"],policy:{name:"CopilotOtelProtocol",category:"InteractiveSession",minimumVersion:"1.127",value:zre,managedSettings:{[pd]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.protocol.policy",value:d(2145,null)},enumDescriptions:[{key:"chat.agentHost.otel.protocol.policy.otlpHttp",value:d(2149,null)},{key:"chat.agentHost.otel.protocol.policy.otlpGrpc",value:d(2148,null)},{key:"chat.agentHost.otel.protocol.policy.console",value:d(2146,null)},{key:"chat.agentHost.otel.protocol.policy.file",value:d(2147,null)}]}}},[C_]:{type:"string",markdownDescription:d(2141,null),default:"",scope:1,included:!1,tags:["experimental","advanced"],policy:{name:"CopilotOtelOtlpProtocol",category:"InteractiveSession",minimumVersion:"1.127",value:Ta(pd),managedSettings:{[pd]:{type:"string"},[ud]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.otlpProtocol.policy",value:d(2142,null)}}}},[ty]:{type:"string",markdownDescription:d(2139,null),default:"",scope:1,tags:["experimental","advanced"],policy:{name:"CopilotOtelEndpoint",category:"InteractiveSession",minimumVersion:"1.127",value:Ta(Xh),managedSettings:{[Xh]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.otlpEndpoint.policy",value:d(2140,null)}}}},[ny]:{type:"boolean",markdownDescription:d(2130,null),default:!1,scope:1,tags:["experimental","advanced"],policy:{name:"CopilotOtelCaptureContent",category:"InteractiveSession",minimumVersion:"1.127",value:Gre,managedSettings:{[h_]:{type:"boolean"},[v_]:{type:"boolean"}},localization:{description:{key:"chat.agentHost.otel.captureContent.policy",value:d(2131,null)}}}},[oy]:{type:"boolean",default:!1,scope:1,included:!1,policy:{name:"CopilotOtelCaptureIdentity",category:"InteractiveSession",minimumVersion:"1.140",value:Ta(y_),managedSettings:{[y_]:{type:"boolean"}},localization:{description:{key:"chat.agentHost.otel.captureIdentity.policy",value:d(2132,null)}}}},[ry]:{type:"string",markdownDescription:d(2143,null),default:"",scope:1,tags:["experimental","advanced"],policy:{name:"CopilotOtelOutfile",category:"InteractiveSession",minimumVersion:"1.127",value:jre,managedSettings:{[Xh]:{type:"string"},[pd]:{type:"string"},[ud]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.outfile.policy",value:d(2144,null)}}}},[TC]:{type:"boolean",markdownDescription:d(2133,null),default:!1,scope:1,tags:["experimental","advanced"]},[E_]:{type:"string",markdownDescription:d(2152,null),default:"",scope:1,included:!1,tags:["experimental","advanced"],policy:{name:"CopilotOtelServiceName",category:"InteractiveSession",minimumVersion:"1.127",value:Ta(I_),managedSettings:{[I_]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.serviceName.policy",value:d(2153,null)}}}},[w_]:{type:"object",additionalProperties:{type:["string"]},default:{},scope:1,included:!1,tags:["experimental","advanced"],markdownDescription:d(2150,null),policy:{name:"CopilotOtelResourceAttributes",category:"InteractiveSession",minimumVersion:"1.127",value:Ta(yC),managedSettings:{[yC]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.resourceAttributes.policy",value:d(2151,null)}}}},"chat.agentHost.otel.headers":{type:"object",additionalProperties:{type:["string"]},default:{},scope:1,included:!1,tags:["experimental","advanced"],markdownDescription:d(2137,null),policy:{name:"CopilotOtelHeaders",category:"InteractiveSession",minimumVersion:"1.127",value:Ta(vC),managedSettings:{[vC]:{type:"string"}},localization:{description:{key:"chat.agentHost.otel.headers.policy",value:d(2138,null)}}}}}})});function k1(r,t,e){let{exitDiagnostics:n,...o}=t,i=e===void 0?void 0:wk(e);r.publicLogError2("agentHost.processError",{...o,isError:!0,...i?{callstack:i.callstack,msg:i.msg}:{},...n?Qre(n):{}})}function Qre(r){let t=r.startupFailure,e={exitReason:r.reason,uptimeMs:r.uptimeMs,fatalSignature:r.fatalSignature,exitPath:r.exitPath,exitCaller:r.exitCaller,msg:t?.msg,callstack:t?.callstack,errorName:t?.name,errorCode:t?.code,workingSetMb:r.workingSetMb,peakWorkingSetMb:r.peakWorkingSetMb,memorySampleAgeMs:r.memorySampleAgeMs};return Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0))}var Jz=v(()=>{Rk()});function Jre(r){return ve(r)}function Yz(r){let t=r.VSCODE_CLI_GITHUB_ENVIRONMENT_OPTIONS;if(delete r.VSCODE_CLI_GITHUB_ENVIRONMENT_OPTIONS,t===void 0)return;let e;try{e=JSON.parse(t)}catch(o){throw o instanceof SyntaxError?new Error("Invalid GitHub environment bootstrap options"):o}if(!Jre(e))throw new Error("Invalid GitHub environment bootstrap options");let n=e.name;if(e.baseUrl!=="https://api.github.com"||e.live!==!0||typeof e.accountId!="string"||!/^\d+$/.test(e.accountId)||typeof e.credential!="string"||!e.credential.trim()||!fg(e.roots)||e.roots.length===0||e.roots.some(o=>!o)||n!==void 0&&(typeof n!="string"||!n.trim()))throw new Error("Invalid GitHub environment bootstrap options");return{baseUrl:e.baseUrl,accountId:e.accountId,credential:e.credential,roots:e.roots,name:n,live:!0}}var dRt,Md,Xz=v(()=>{Ue();Ie();Q();la();Jz();qE();Kl();Z();De();hS();_n();dS();dRt=A("serverAgentHostManager");Md=class extends D{constructor(e,n={},o,i,s,a){super();this._starter=e;this._options=n;this._logService=o;this._loggerService=i;this._serverLifetimeService=s;this._telemetryService=a;this._restartCount=0;this._shuttingDown=!1;this._connectionStore=this._register(new Kn);this._lifetimeToken=this._register(new Kn);this._hasActiveSessions=!1;this._connectionCount=0;this._startMode=n.startMode??"eager",this._register(this._starter),this._register(this._serverLifetimeService.onWillShutdown(l=>{this._shuttingDown=!0,l.join(this.shutdown())})),this._register(this._serverLifetimeService.onDidAbortShutdown(()=>{this._startMode==="eager"&&this.ensureStarted().catch(l=>this._logService.error("ServerAgentHostManager: failed to restart after aborted server shutdown",l))})),this._startMode==="eager"&&this.ensureStarted().catch(()=>{})}ensureStarted(){if(this._shuttingDown||this._store.isDisposed)return Promise.reject(new Error("Server Agent Host manager is shutting down."));if(!this._startPromise){let e=this._start();this._startPromise=e,e.catch(()=>{this._startPromise===e&&(this._startPromise=void 0)})}return this._startPromise}async _start(){for(;;)try{await this._startOnce();return}catch(e){if(this._store.isDisposed)return;let n=this._restartCount<5;if(k1(this._telemetryService,{hostLaunchKind:"vscode_cli",kind:"startFailed",restartCount:this._restartCount,willRestart:n},e),!n)throw this._logService.error("ServerAgentHostManager: agent host failed to start, giving up after 5 restarts",e),this._restartCount=0,this._options.onRestartLimitReached?.(),e;this._logService.error("ServerAgentHostManager: agent host failed to start",e),this._restartCount++}}async _startOnce(){let e=await this._starter.start();if(this._store.isDisposed||this._shuttingDown){e.store.dispose();return}this._trackActiveSessions(e);try{if(await this._trackClientConnections(e),this._options.githubEnvironment){let n=Er.toService(e.client.getChannel("agentHostManagement"));await n.configureMissionControl(this._options.githubEnvironment);let o=await n.getMissionControlEnvironmentId();if(!o)throw new Error("GitHub environment registration did not return an environment ID");this._options.onGithubEnvironmentReady?.(o)}}catch(n){throw e.store.dispose(),n}if(this._store.isDisposed||e.store.isDisposed){e.store.dispose();return}this._logService.info("ServerAgentHostManager: agent host started"),e.store.add(new xp(this._loggerService,e.client.getChannel("agentHostLogger"))),e.store.add(e.onDidProcessExit(n=>this._handleUnexpectedExit(e,n))),this._connection=e,this._connectionStore.value=e.store}_handleUnexpectedExit(e,n){if(this._store.isDisposed||this._connection!==e)return;this._hasActiveSessions=!1,this._connectionCount=0,this._lifetimeToken.clear();let o=this._restartCount<5;k1(this._telemetryService,{hostLaunchKind:"vscode_cli",kind:"unexpectedExit",code:n.code,restartCount:this._restartCount,willRestart:o,exitDiagnostics:n.diagnostics}),this._connection=void 0,this._connectionStore.clear(),this._startPromise=void 0,o?(this._logService.error(`ServerAgentHostManager: agent host terminated unexpectedly with code ${n.code}`),this._restartCount++,this.ensureStarted().catch(()=>{})):(this._logService.error(`ServerAgentHostManager: agent host terminated with code ${n.code}, giving up after 5 restarts`),this._restartCount=0,this._options.onRestartLimitReached?.())}async shutdown(){this._shuttingDown=!0;try{let e=this._options.githubEnvironment?2e4:6e3;await _v(this._shutdownGracefully(),e,()=>{this._logService.warn(`ServerAgentHostManager: agent host did not shut down within ${e}ms; terminating it`)})}catch(e){this._logService.error("ServerAgentHostManager: failed to shut down agent host gracefully",e)}finally{let e=this._connection;this._startPromise=void 0,this._shuttingDown=!1,e&&(this._connection===e?(this._connection=void 0,this._connectionStore.clear()):e.store.dispose())}}async _shutdownGracefully(){try{await this._startPromise}catch{return}await this._connection?.shutdown()}_trackActiveSessions(e){let n=Er.toService(e.client.getChannel("agentHost"));e.store.add(n.onDidAction(o=>{o.action.type==="root/activeSessionsChanged"&&(this._hasActiveSessions=o.action.activeSessions>0,this._updateLifetimeToken())}))}async _trackClientConnections(e){let n=Er.toService(e.client.getChannel("agentHostConnectionTracker"));e.store.add(n.onDidChangeConnectionCount(o=>{this._connectionCount=o,this._updateLifetimeToken()})),await n.waitForConfiguredWebSocketServer()}_updateLifetimeToken(){this._hasActiveSessions||this._connectionCount>0?this._lifetimeToken.value??=this._serverLifetimeService.active("AgentHost"):this._lifetimeToken.clear()}};Md=w([b(2,z),b(3,Bo),b(4,vp),b(5,Mt)],Md)});function Xre(r){return ve(r)&&(!("env"in r)||Zz(r.env))&&(!("debugEnv"in r)||Zz(r.debugEnv))}function Zz(r){return r===void 0||ve(r)&&Object.values(r).every(t=>typeof t=="string"||t===null)}async function eie(){return Zre??=await import("ws")}async function nie(){return tie??=await import("net")}var Yre,Zre,tie,Nm,oie,A1,D1,Fm,e8=v(()=>{ue();Q();Me();Ie();Yre="Agent host proxy is not available because no upstream agent host endpoint was configured.";Nm=class{listen(t,e){switch(e){case"frame":case"close":return F.None}throw new Error(`Invalid listen: ${e}`)}call(t,e){switch(e){case"connect":return Promise.reject(new Error(Yre));case"send":case"close":return Promise.resolve(void 0)}return Promise.reject(new Error(`Invalid call: ${e}`))}},oie=r=>t=>new D1(t,r),A1=class extends D{constructor(e,n,o){super();this._resolveEndpoint=e;this._upstreamFactory=n;this._logService=o;this._onFrame=this._register(new R);this.onFrame=this._onFrame.event;this._onClose=this._register(new R);this.onClose=this._onClose.event;this._closeFired=!1}async connect(e){if(this._store.isDisposed)throw new Error("UpstreamConnection is disposed");let n=this._connectPromise??=this._connect(e);try{await n}catch(o){throw this._connectPromise===n&&(this._connectPromise=void 0),o}}send(e){let n=this._connection;if(!n){this._logService.warn("[AgentHostChannel] Drop send: upstream not open"),this._fireClose();return}n.send(e)}async _connect(e){let n=await this._resolveEndpoint(e);if(this._store.isDisposed)throw new Error("UpstreamConnection is disposed");let o=this._upstreamFactory(n);this._connection=o,this._register(o),this._register(o.onFrame(i=>this._onFrame.fire(i))),this._register(o.onClose(()=>this._fireClose()));try{await o.connect()}catch(i){throw this._connection=void 0,o.dispose(),i}}dispose(){this._fireClose(),super.dispose()}_fireClose(){this._closeFired||(this._closeFired=!0,this._onClose.fire())}},D1=class extends D{constructor(e,n){super();this._endpoint=e;this._logService=n;this._onFrame=this._register(new R);this.onFrame=this._onFrame.event;this._onClose=this._register(new R);this.onClose=this._onClose.event;this._closeFired=!1}connect(){return this._store.isDisposed?Promise.reject(new Error("UpstreamConnection is disposed")):this._connectPromise??=this._doConnect()}async _doConnect(){let e=await eie(),n=this._buildUrl(),o=await this._buildWsOptions(),i=new e.WebSocket(n,o);return this._ws=i,new Promise((s,a)=>{let l=()=>{p(),this._logService.trace("[AgentHostChannel] Upstream open"),i.on("message",m=>{let g=typeof m=="string"?m:m.toString("utf-8");this._onFrame.fire(g)}),i.on("close",()=>this._fireClose()),i.on("error",m=>{this._logService.warn("[AgentHostChannel] Upstream error",m),this._fireClose()}),s()},c=m=>{p(),this._logService.warn("[AgentHostChannel] Upstream connection failed",m),this._fireClose(),a(m)},u=()=>{p(),this._fireClose(),a(new Error("Upstream closed before connect"))},p=()=>{i.removeListener("open",l),i.removeListener("error",c),i.removeListener("close",u)};i.on("open",l),i.on("error",c),i.on("close",u)})}send(e){let n=this._ws;if(!n||n.readyState!==n.OPEN){this._logService.warn("[AgentHostChannel] Drop send: upstream not open"),this._fireClose();return}n.send(e)}dispose(){this._ws?.close(),this._fireClose(),super.dispose()}_fireClose(){this._closeFired||(this._closeFired=!0,this._onClose.fire())}_buildUrl(){let e=this._endpoint.host??"localhost",n=this._endpoint.port??"0",o=`ws://${e}:${n}`;return this._endpoint.connectionToken&&(o+=`?${is}=${encodeURIComponent(this._endpoint.connectionToken)}`),o}async _buildWsOptions(){if(!this._endpoint.socketPath)return;let e=await nie(),n=this._endpoint.socketPath;return{createConnection:(()=>e.createConnection(n))}}},Fm=class extends D{constructor(e,n,o,i){super();this._endpoint=n;this._logService=o;this._perCtx=new Map;this._upstreamFactory=i??oie(o),this._register(e.onDidRemoveConnection(s=>this._disposeCtx(s.ctx)))}listen(e,n){let o=this._getOrCreate(e);switch(n){case"frame":return o.onFrame;case"close":return o.onClose}throw new Error(`Invalid listen: ${n}`)}async call(e,n,o){let i=this._getOrCreate(e);switch(n){case"connect":if(o!==void 0&&!Xre(o))throw new Error("Invalid agent host connection environment: expected string or null values");this._logService.info(`[AgentHostChannel] Renderer ctx=${String(e)} requested connect to upstream`),await i.connect(o);return;case"send":if(typeof o!="string")throw new Error("send: arg must be a string frame");i.send(o);return;case"close":this._disposeCtx(e);return}throw new Error(`Invalid call: ${n}`)}dispose(){for(let e of this._perCtx.values())e.dispose();this._perCtx.clear(),super.dispose()}_getOrCreate(e){let n=this._perCtx.get(e);if(!n){n=new A1(i=>this._resolveEndpoint(i),i=>this._createUpstream(i),this._logService),this._perCtx.set(e,n);let o=n.onClose(()=>{o.dispose(),this._perCtx.get(e)===n&&this._perCtx.delete(e)})}return n}_createUpstream(e){let n=e.socketPath??`${e.host??"localhost"}:${e.port??"0"}`;return this._logService.info(`[AgentHostChannel] Opening upstream to ${n}`),this._upstreamFactory(e)}async _resolveEndpoint(e){let n=this._endpoint;return typeof n!="function"?n:n(e)}_disposeCtx(e){let n=this._perCtx.get(e);n&&(this._perCtx.delete(e),n.dispose())}}});function t8(){return rie.value}var rie,n8=v(()=>{ns();rie=new Yt(async()=>(await import("@vscode/ripgrep-universal")).rgPath.replace(/\bnode_modules\.asar\b/,"node_modules.asar.unpacked"))});import{spawn as iie}from"child_process";var QE,Hm,_1=v(()=>{Oe();Me();n8();Vs();Dn();Z();De();QE=A("ICSSDevelopmentService"),Hm=class{constructor(t,e){this.envService=t;this.logService=e}get isEnabled(){return!this.envService.isBuilt}getCssModules(){return this._cssModules??=this.computeCssModules(),this._cssModules}async computeCssModules(){if(!this.isEnabled)return[];let t=await t8();return await new Promise(e=>{let n=no.create(),o=[],i=Pt.asFileUri("").fsPath,s=iie(t,["-g","**/*.css","--files","--no-ignore",i],{});s.stdout.on("data",a=>{o.push(a)}),s.on("error",a=>{this.logService.error("[CSS_DEV] FAILED to compute CSS data",a),e([])}),s.on("close",()=>{let a=Buffer.concat(o).toString("utf8"),l=a.split(`
`).filter(Boolean).map(c=>Hs(i,c).replace(/\\/g,"/")).filter(Boolean).sort();l.some(c=>c.indexOf("vs/")!==0)&&this.logService.error(`[CSS_DEV] Detected invalid paths in css modules, raw output: ${a}`),e(l),this.logService.info(`[CSS_DEV] DONE, ${l.length} css modules (${Math.round(n.elapsed())}ms)`)})})}};Hm=w([b(0,Ut),b(1,z)],Hm)});var Wm,o8=v(()=>{Q();ee();Dn();De();Wn();Wr();Wm=class extends D{constructor(t,e,n,o,i){super();let s=typeof t=="string"?t:t.prefix;this.prefix=s;let a=typeof t=="string"?e?"remoteTelemetry":DT:t.loggerId,l=n.getLogger(a);if(l)this.logger=this._register(l);else{let u=RI(i,o)?" (Not Sent)":"";this.logger=this._register(n.createLogger(a,{name:d(4640,null,u),group:EI,hidden:!0}))}}flush(){return Promise.resolve()}log(t,e){this.logger.trace(`${this.prefix}telemetry/${t}`,TI(e))}};Wm=w([b(2,Bo),b(3,Ut),b(4,Be)],Wm)});var JE,r8,M1=v(()=>{Z();JE=A("INativeMcpDiscoveryHelperService"),r8="NativeMcpDiscoveryHelper"});var Vm,i8=v(()=>{Ll();M1();Vm=class{constructor(t,e){this.getUriTransformer=t;this.nativeMcpDiscoveryHelperService=e}listen(t,e){throw new Error("Invalid listen")}async call(t,e,n){let o=this.getUriTransformer?.(t);if(e==="load"){let i=await this.nativeMcpDiscoveryHelperService.load();return o?$r(i,o):i}throw new Error("Invalid call")}};Vm=w([b(1,JE)],Vm)});import{homedir as s8}from"os";var YE,a8=v(()=>{fe();te();wR();YE=class{constructor(t=process.env,e){this.environment=t;this.resolveShellEnvironment=e}async load(){let t=this.resolveShellEnvironment?{...this.environment,...await this.resolveShellEnvironment()}:this.environment;return{platform:ei,homedir:S.file(s8()),copilotHome:S.file(Uv(s8(),t)),winAppData:this.uriFromEnvVariable("APPDATA"),xdgHome:this.uriFromEnvVariable("XDG_CONFIG_HOME")}}uriFromEnvVariable(t,e=this.environment){let n=e[t];if(n)return S.file(n)}}});var XE,l8,c8,L1=v(()=>{Z();XE=A("IMcpGatewayService"),l8="mcpGateway",c8="mcpGatewayToolBroker"});function sie(r){return"method"in r&&"id"in r&&(typeof r.id=="string"||typeof r.id=="number")}function O1(r){return Rn(r,{id:!0,result:!0})||Rn(r,{id:!0,error:!0})}function U1(r){return Rn(r,{method:!0})&&!Rn(r,{id:!0})}function aie(r){return typeof r=="object"&&r!==null&&"then"in r&&typeof r.then=="function"}var wi,Bm,N1=v(()=>{Ue();Jt();xe();Q();Ie();wi=class extends Error{constructor(e,n,o){super(n);this.code=e;this.data=o}},Bm=class r extends D{constructor(e,n){super();this._send=e;this._handlers=n;this._nextRequestId=1;this._pendingRequests=new Map}static{this.ParseError=-32700}static{this.MethodNotFound=-32601}static{this.InternalError=-32603}sendNotification(e){this._send({jsonrpc:"2.0",...e})}sendRequest(e,n=Ae.None,o){if(this._store.isDisposed)return Promise.reject(new He);let i=this._nextRequestId++,s=new jn,a=new _t;this._pendingRequests.set(i,{promise:s,cts:a});let l=n.onCancellationRequested(()=>{s.isSettled||(this._pendingRequests.delete(i),a.cancel(),o?.(i),s.cancel()),l.dispose()});return this._send({jsonrpc:"2.0",id:i,...e}),s.p.finally(()=>{l.dispose(),this._pendingRequests.delete(i),a.dispose(!0)})}async handleMessage(e){if(Array.isArray(e)){let o=[];for(let i of e){let s=await this._handleMessage(i);s&&o.push(s)}return o}let n=await this._handleMessage(e);return n?[n]:[]}cancelPendingRequest(e){let n=this._pendingRequests.get(e);n&&(this._pendingRequests.delete(e),n.cts.cancel(),n.promise.cancel(),n.cts.dispose(!0))}cancelAllRequests(){for(let[e,n]of this._pendingRequests)this._pendingRequests.delete(e),n.cts.cancel(),n.promise.cancel(),n.cts.dispose(!0)}async _handleMessage(e){if(O1(e)){Rn(e,{result:!0})?this._handleResult(e):this._handleError(e);return}if(sie(e))return this._handleRequest(e);U1(e)&&this._handlers.handleNotification?.(e)}_handleResult(e){let n=this._pendingRequests.get(e.id);n&&(this._pendingRequests.delete(e.id),n.promise.complete(e.result),n.cts.dispose(!0))}_handleError(e){if(e.id===void 0)return;let n=this._pendingRequests.get(e.id);n&&(this._pendingRequests.delete(e.id),n.promise.error(new wi(e.error.code,e.error.message,e.error.data)),n.cts.dispose(!0))}async _handleRequest(e){if(!this._handlers.handleRequest){let o={jsonrpc:"2.0",id:e.id,error:{code:r.MethodNotFound,message:`Method not found: ${e.method}`}};return this._send(o),o}let n=new _t;this._register(se(()=>n.dispose(!0)));try{let o=this._handlers.handleRequest(e,n.token),i=aie(o)?await o:o,s={jsonrpc:"2.0",id:e.id,result:i};return this._send(s),s}catch(o){let i;return o instanceof wi?i={jsonrpc:"2.0",id:e.id,error:{code:o.code,message:o.message,data:o.data}}:i={jsonrpc:"2.0",id:e.id,error:{code:r.InternalError,message:o instanceof Error?o.message:"Internal error"}},this._send(i),i}finally{n.dispose(!0)}}dispose(){this.cancelAllRequests(),super.dispose()}static createParseError(e,n){return{jsonrpc:"2.0",error:{code:r.ParseError,message:e,data:n}}}}});function d8(r){let t=Array.isArray(r)?r[0]:r;return!t||!Rn(t,{method:!0})?!1:t.method==="initialize"}var lie,cie,die,uie,By,ZE,u8=v(()=>{N1();Q();Ie();lie="2025-11-25",cie=["2025-11-25","2025-06-18","2025-03-26","2024-11-05","2024-10-07"],die=-32600,uie=-32601,By=-32602,ZE=class extends D{constructor(e,n,o,i){super();this.id=e;this._logService=n;this._onDidDispose=o;this._serverInvoker=i;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._rpc=this._register(new Bm(s=>this._handleOutgoingMessage(s),{handleRequest:s=>this._handleRequest(s),handleNotification:s=>this._handleNotification(s)})),this._register(this._serverInvoker.onDidChangeTools(()=>{this._isInitialized&&(this._logService.info(`[McpGateway][session ${this.id}] Tools changed, notifying client`),this._rpc.sendNotification({method:"notifications/tools/list_changed"}))})),this._register(this._serverInvoker.onDidChangeResources(()=>{this._isInitialized&&(this._logService.info(`[McpGateway][session ${this.id}] Resources changed, notifying client`),this._rpc.sendNotification({method:"notifications/resources/list_changed"}))}))}attachSseClient(e,n){n.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),n.write(`: connected
`),this._sseClients.add(n),this._logService.info(`[McpGateway][session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),n.on("close",()=>{this._sseClients.delete(n),this._logService.info(`[McpGateway][session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){return this._rpc.handleMessage(e)}dispose(){this._logService.info(`[McpGateway][session ${this.id}] Disposing session (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._onDidDispose(),super.dispose()}_handleOutgoingMessage(e){if(O1(e)){this._logService.debug(`[McpGateway][session ${this.id}] --> response: ${JSON.stringify(e)}`);return}if(U1(e)){this._logService.debug(`[McpGateway][session ${this.id}] --> notification: ${e.method}`),this._broadcastSse(e);return}this._logService.warn("[McpGatewayService] Ignored unsupported outgoing gateway message")}_broadcastSse(e){if(this._sseClients.size===0){this._logService.debug(`[McpGateway][session ${this.id}] No SSE clients to broadcast to, dropping message`);return}let n=JSON.stringify(e),o=String(++this._lastEventId);this._logService.debug(`[McpGateway][session ${this.id}] Broadcasting SSE event id=${o} to ${this._sseClients.size}`);let i=n.split(/\r?\n/g),s=[`id: ${o}`,"event: message",...i.map(a=>`data: ${a}`),"",""].join(`
`);for(let a of[...this._sseClients]){if(a.destroyed||a.writableEnded){this._sseClients.delete(a);continue}a.write(s)}}async _handleRequest(e){if(this._logService.debug(`[McpGateway][session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`),e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw this._logService.warn(`[McpGateway][session ${this.id}] Rejected request '${e.method}': session not initialized`),new wi(die,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._handleListTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._handleListResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._handleListResourceTemplates();default:throw this._logService.warn(`[McpGateway][session ${this.id}] Unknown method: ${e.method}`),new wi(uie,`Method not found: ${e.method}`)}}_handleNotification(e){this._logService.debug(`[McpGateway][session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,this._logService.info(`[McpGateway][session ${this.id}] Session initialized`),this._rpc.sendNotification({method:"notifications/tools/list_changed"}),this._rpc.sendNotification({method:"notifications/resources/list_changed"}))}_handleInitialize(e){let n=typeof e.params=="object"&&e.params?e.params:void 0,o=typeof n?.protocolVersion=="string"?n.protocolVersion:void 0,i=n?.clientInfo,s=o&&cie.includes(o)?o:lie;return this._logService.info(`[McpGateway] Initialize: client=${i?.name??"unknown"}/${i?.version??"?"}, clientProtocol=${o??"(none)"}, negotiated=${s}`),o&&o!==s&&this._logService.warn(`[McpGateway] Client requested unsupported protocol version '${o}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0}},serverInfo:{name:"VS Code MCP Gateway",version:"1.0.0"}}}async _handleCallTool(e){let n=typeof e.params=="object"&&e.params?e.params:void 0;if(!n||typeof n.name!="string")throw new wi(By,"Missing tool call params");if(n.arguments&&typeof n.arguments!="object")throw new wi(By,"Invalid tool call arguments");let o=n.arguments&&typeof n.arguments=="object"?n.arguments:{};this._logService.debug(`[McpGateway][session ${this.id}] Calling tool '${n.name}' with args: ${JSON.stringify(o)}`);try{let i=await this._serverInvoker.callTool(n.name,o);return this._logService.debug(`[McpGateway][session ${this.id}] Tool '${n.name}' completed (isError=${i.isError??!1}, content blocks=${i.content.length})`),i}catch(i){throw this._logService.error(`[McpGateway][session ${this.id}] Tool '${n.name}' invocation failed`,i),new wi(By,String(i))}}async _handleListTools(){let e=await this._serverInvoker.listTools();return this._logService.debug(`[McpGateway][session ${this.id}] Listed ${e.length} tool(s): [${e.map(n=>n.name).join(", ")}]`),{tools:e}}async _handleListResources(){let e=await this._serverInvoker.listResources();return this._logService.debug(`[McpGateway][session ${this.id}] Listed ${e.length} resource(s)`),{resources:e}}async _handleReadResource(e){let n=typeof e.params=="object"&&e.params?e.params:void 0;if(!n||typeof n.uri!="string")throw new wi(By,"Missing resource URI");this._logService.debug(`[McpGateway][session ${this.id}] Reading resource '${n.uri}'`);try{let o=await this._serverInvoker.readResource(n.uri);return this._logService.debug(`[McpGateway][session ${this.id}] Resource read returned ${o.contents.length} content(s)`),o}catch(o){throw this._logService.error(`[McpGateway][session ${this.id}] Resource read failed for '${n.uri}'`,o),new wi(By,String(o))}}async _handleListResourceTemplates(){let e=await this._serverInvoker.listResourceTemplates();return this._logService.debug(`[McpGateway][session ${this.id}] Listed ${e.length} resource template(s)`),{resourceTemplates:e}}}});var qm,F1,p8=v(()=>{Ue();ue();N1();Q();te();Vt();De();u8();qm=class extends D{constructor(e){super();this._routes=new Map;this._gatewayRoutes=new Map;this._gatewayServerRoutes=new Map;this._gatewayToClient=new Map;this._gatewayDisposables=new Map;this._logger=this._register(e.createLogger("mcpGateway",{name:"MCP Gateway",logLevel:"always"})),this._logger.info("[McpGatewayService] Initialized")}async createGateway(e,n){if(await this._ensureServer(),this._port===void 0)throw new Error("[McpGatewayService] Server failed to start, port is undefined");if(!n)throw new Error("[McpGatewayService] Tool invoker is required to create gateway");let o=Ee(),i=new Set,s=new Map;this._gatewayRoutes.set(o,i),this._gatewayServerRoutes.set(o,s);let a=new re;this._gatewayDisposables.set(o,a);try{let l=n.listServers(),c=[];for(let p of l){let m=this._createRouteForServer(o,p.id,p.label,n,i,s);c.push(m)}e?(this._gatewayToClient.set(o,e),this._logger.info(`[McpGatewayService] Created gateway ${o} with ${c.length} server(s) for client ${e}`)):this._logger.warn(`[McpGatewayService] Created gateway ${o} with ${c.length} server(s) without client tracking`);let u=a.add(new R);return a.add(n.onDidChangeServers(p=>{this._refreshGatewayServers(o,p,n,i,s,u)})),{servers:c,onDidChangeServers:u.event,gatewayId:o}}catch(l){throw this._cleanupGateway(o),l}}_refreshGatewayServers(e,n,o,i,s,a){if(!this._gatewayRoutes.has(e))return;let l=new Set(n.map(p=>p.id)),c=new Set(s.keys());for(let p of c)if(!l.has(p)){let m=s.get(p);m&&(this._disposeRoute(m),i.delete(m),s.delete(p))}for(let p of n){if(!c.has(p.id)){this._createRouteForServer(e,p.id,p.label,o,i,s);continue}let m=s.get(p.id),g=m?this._routes.get(m):void 0;g&&g.label!==p.label&&(g.label=p.label)}let u=this._getGatewayServers(e);this._logger.info(`[McpGatewayService] Gateway ${e} servers changed: ${u.length} server(s)`),a.fire(u)}_cleanupGateway(e){let n=this._gatewayRoutes.get(e);if(n)for(let o of n)this._disposeRoute(o);this._gatewayRoutes.delete(e),this._gatewayServerRoutes.delete(e),this._gatewayToClient.delete(e),this._gatewayDisposables.get(e)?.dispose(),this._gatewayDisposables.delete(e)}_createRouteForServer(e,n,o,i,s,a){let l=Ee(),c={onDidChangeTools:i.onDidChangeTools,onDidChangeResources:i.onDidChangeResources,listTools:()=>i.listToolsForServer(n),callTool:(m,g)=>i.callToolForServer(n,m,g),listResources:()=>i.listResourcesForServer(n),readResource:m=>i.readResourceForServer(n,m),listResourceTemplates:()=>i.listResourceTemplatesForServer(n)},u=new F1(l,this._logger,c,o);this._routes.set(l,u),s.add(l),a.set(n,l);let p=S.parse(`http://127.0.0.1:${this._port}/gateway/${l}`);return this._logger.info(`[McpGatewayService] Created route ${l} for server '${o}' (${n}) at ${p}`),{label:o,address:p}}_getGatewayServers(e){let n=this._gatewayServerRoutes.get(e);if(!n)return[];let o=[];for(let[i,s]of n){let a=this._routes.get(s);a&&o.push({label:a.label,address:S.parse(`http://127.0.0.1:${this._port}/gateway/${s}`)})}return o}_disposeRoute(e){let n=this._routes.get(e);n&&(n.dispose(),this._routes.delete(e),this._logger.info(`[McpGatewayService] Disposed route: ${e}`))}async disposeGateway(e){if(!this._gatewayRoutes.has(e)){this._logger.warn(`[McpGatewayService] Attempted to dispose unknown gateway: ${e}`);return}this._cleanupGateway(e),this._logger.info(`[McpGatewayService] Disposed gateway: ${e} (remaining routes: ${this._routes.size})`),this._routes.size===0&&this._stopServer()}disposeGatewaysForClient(e){let n=[];for(let[o,i]of this._gatewayToClient)i===e&&n.push(o);if(n.length>0){this._logger.info(`[McpGatewayService] Disposing ${n.length} gateway(s) for disconnected client ${e}`);for(let o of n)this._cleanupGateway(o);this._routes.size===0&&this._stopServer()}}async _ensureServer(){if(!this._server?.listening){if(this._serverStartPromise)return this._serverStartPromise;this._serverStartPromise=this._startServer();try{await this._serverStartPromise}finally{this._serverStartPromise=void 0}}}async _startServer(){let{createServer:e}=await import("http"),n=new jn;this._server=e((i,s)=>{this._handleRequest(i,s)});let o=setTimeout(()=>{n.error(new Error("[McpGatewayService] Timeout waiting for server to start"))},5e3);return this._server.on("listening",()=>{let i=this._server.address();if(typeof i=="string")this._port=parseInt(i);else if(i instanceof Object)this._port=i.port;else{clearTimeout(o),n.error(new Error("[McpGatewayService] Unable to determine port"));return}clearTimeout(o),this._logger.info(`[McpGatewayService] Server started on port ${this._port}`),n.complete()}),this._server.on("error",i=>{if(i.code==="EADDRINUSE"){this._logger.warn("[McpGatewayService] Port in use, retrying with random port..."),this._server.listen(0,"127.0.0.1");return}clearTimeout(o),this._logger.error(`[McpGatewayService] Server error: ${i}`),n.error(i)}),this._server.listen(0,"127.0.0.1"),n.p}_stopServer(){this._server&&(this._logger.info("[McpGatewayService] Stopping server (no more routes)"),this._server.close(e=>{e?this._logger.error(`[McpGatewayService] Error closing server: ${e}`):this._logger.info("[McpGatewayService] Server stopped")}),this._server=void 0,this._port=void 0)}_handleRequest(e,n){let o=new URL(e.url,`http://${e.headers.host}`),i=o.pathname.split("/").filter(Boolean);if(this._logger.debug(`[McpGatewayService] ${e.method} ${o.pathname} (active routes: ${this._routes.size})`),i.length>=2&&i[0]==="gateway"){let s=i[1],a=this._routes.get(s);if(a){a.handleRequest(e,n);return}}this._logger.warn(`[McpGatewayService] ${e.method} ${o.pathname}: route not found`),n.writeHead(404,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Gateway not found"}))}dispose(){this._logger.info(`[McpGatewayService] Disposing service (routes: ${this._routes.size})`),this._stopServer();for(let e of this._routes.values())e.dispose();this._routes.clear(),this._gatewayRoutes.clear(),this._gatewayServerRoutes.clear(),this._gatewayToClient.clear();for(let e of this._gatewayDisposables.values())e.dispose();this._gatewayDisposables.clear(),super.dispose()}};qm=w([b(0,Bo)],qm);F1=class r extends D{constructor(e,n,o,i=""){super();this.routeId=e;this._logger=n;this._serverInvoker=o;this.label=i;this._sessions=new Map}static{this.SessionHeaderName="mcp-session-id"}handleRequest(e,n){if(this._logger.debug(`[McpGateway][route ${this.routeId}] ${e.method} request (sessions: ${this._sessions.size})`),e.method==="POST"){this._handlePost(e,n);return}if(e.method==="GET"){this._handleGet(e,n);return}if(e.method==="DELETE"){this._handleDelete(e,n);return}this._respondHttpError(n,405,"Method not allowed")}dispose(){this._logger.info(`[McpGateway][route ${this.routeId}] Disposing route (sessions: ${this._sessions.size})`);for(let e of this._sessions.values())e.dispose();this._sessions.clear(),super.dispose()}_handleDelete(e,n){let o=this._getSessionId(e);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let i=this._sessions.get(o);if(!i){this._respondHttpError(n,404,"Session not found");return}this._logger.info(`[McpGateway][route ${this.routeId}] Deleting session ${o}`),i.dispose(),this._sessions.delete(o),n.writeHead(204),n.end()}_handleGet(e,n){let o=this._getSessionId(e);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let i=this._sessions.get(o);if(!i){this._respondHttpError(n,404,"Session not found");return}this._logger.info(`[McpGateway][route ${this.routeId}] SSE connection requested for session ${o}`),i.attachSseClient(e,n)}async _handlePost(e,n){let o=await this._readRequestBody(e);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}this._logger.debug(`[McpGateway][route ${this.routeId}] Handling POST`);let i;try{i=JSON.parse(o)}catch(l){this._logger.warn(`[McpGateway][route ${this.routeId}] JSON parse error: ${l instanceof Error?l.message:String(l)}`),n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(Bm.createParseError("Parse error",l instanceof Error?l.message:String(l))));return}let s=this._getSessionId(e),a=this._resolveSessionForPost(s,i,n);if(a)try{let l=await a.handleIncoming(i),c={"Content-Type":"application/json","Mcp-Session-Id":a.id};if(l.length===0){this._logger.debug(`[McpGateway][route ${this.routeId}] POST response: 202 (no content)`),n.writeHead(202,c),n.end();return}let u=JSON.stringify(Array.isArray(i)?l:l[0]);this._logger.debug(`[McpGateway][route ${this.routeId}] POST response: 200, body: ${u}`),n.writeHead(200,c),n.end(u)}catch(l){this._logger.error("[McpGatewayService] Failed handling gateway request",l),this._respondHttpError(n,500,"Internal server error")}}_resolveSessionForPost(e,n,o){if(e){let a=this._sessions.get(e);if(!a){this._logger.warn(`[McpGateway][route ${this.routeId}] Session not found: ${e}`),this._respondHttpError(o,404,"Session not found");return}return a}if(!d8(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let i=Ee();this._logger.info(`[McpGateway][route ${this.routeId}] Creating new session ${i}`);let s=new ZE(i,this._logger,()=>{this._sessions.delete(i)},this._serverInvoker);return this._sessions.set(i,s),s}_respondHttpError(e,n,o){this._logger.debug(`[McpGateway][route ${this.routeId}] HTTP error response: ${n} ${o}`),e.writeHead(n,{"Content-Type":"application/json"}),e.end(JSON.stringify({jsonrpc:"2.0",error:{code:n,message:o}}))}_getSessionId(e){let n=e.headers[r.SessionHeaderName];return Array.isArray(n)?n[0]:n}async _readRequestBody(e){let n=[],o=0,i=1024*1024;for await(let s of e){let a=Buffer.isBuffer(s)?s:Buffer.from(s);if(o+=a.byteLength,o>i)return;n.push(a)}return Buffer.concat(n).toString("utf8")}}});function pie(r,t){return r.getChannel(c8,e=>e.ctx===t)}var $m,m8=v(()=>{ue();Q();De();L1();$m=class extends D{constructor(e,n,o){super();this._ipcServer=e;this.mcpGatewayService=n;this._loggerService=o;this._onDidChangeGatewayServers=this._register(new R);this._gatewayDisposables=this._register(new Wo);this._clientGateways=new Map;this._register(e.onDidRemoveConnection(i=>{this._loggerService.getLogger("mcpGateway")?.info(`[McpGateway][Channel] Client disconnected: ${i.ctx}, cleaning up gateways`),n.disposeGatewaysForClient(i.ctx);let s=this._clientGateways.get(i.ctx);if(s){for(let a of s)this._gatewayDisposables.deleteAndDispose(a);this._clientGateways.delete(i.ctx)}}))}listen(e,n){if(n==="onDidChangeGatewayServers")return this._onDidChangeGatewayServers.event;throw new Error(`Invalid listen: ${n}`)}async call(e,n,o){let i=this._loggerService.getLogger("mcpGateway");switch(i?.debug(`[McpGateway][Channel] IPC call: ${n} from client ${e}`),n){case"createGateway":{let{chatSessionResource:s}=o??{},a=pie(this._ipcServer,e),l=await a.call("listServers"),c=a.listen("onDidChangeServers"),u=await this.mcpGatewayService.createGateway(e,{onDidChangeServers:F.map(c,g=>(l=g,g)),onDidChangeTools:a.listen("onDidChangeTools"),onDidChangeResources:a.listen("onDidChangeResources"),listServers:()=>l,listToolsForServer:g=>a.call("listToolsForServer",{serverId:g}),callToolForServer:(g,y,h)=>a.call("callToolForServer",{serverId:g,name:y,args:h,chatSessionResource:s}),listResourcesForServer:g=>a.call("listResourcesForServer",{serverId:g}),readResourceForServer:(g,y)=>a.call("readResourceForServer",{serverId:g,uri:y}),listResourceTemplatesForServer:g=>a.call("listResourceTemplatesForServer",{serverId:g})}),p=new re;p.add(u.onDidChangeServers(g=>{this._onDidChangeGatewayServers.fire({gatewayId:u.gatewayId,servers:g})})),this._gatewayDisposables.set(u.gatewayId,p);let m=this._clientGateways.get(e);return m||(m=new Set,this._clientGateways.set(e,m)),m.add(u.gatewayId),i?.info(`[McpGateway][Channel] Gateway created: ${u.gatewayId} with ${u.servers.length} server(s) for client ${e}`),{gatewayId:u.gatewayId,servers:u.servers}}case"disposeGateway":{let s=o;i?.info(`[McpGateway][Channel] Disposing gateway: ${s} for client ${e}`),this._gatewayDisposables.deleteAndDispose(s);let a=this._clientGateways.get(e);a&&(a.delete(s),a.size===0&&this._clientGateways.delete(e)),await this.mcpGatewayService.disposeGateway(s);return}}throw new Error(`Invalid call: ${n}`)}};$m=w([b(1,XE),b(2,Bo)],$m)});var zm,g8=v(()=>{Ue();ue();De();Wn();Lc();XP();zm=class extends _l{constructor(e,n,o){super(o);this.logService=n;this._onDidChangeExtensionGalleryManifest=this._register(new R);this.onDidChangeExtensionGalleryManifest=this._onDidChangeExtensionGalleryManifest.event;this._onDidChangeExtensionGalleryManifestStatus=this._register(new R);this.onDidChangeExtensionGalleryManifestStatus=this._onDidChangeExtensionGalleryManifestStatus.event;this.barrier=new Ur;e.registerChannel("extensionGalleryManifest",{listen:()=>F.None,call:async(i,s,a)=>{if(s==="setExtensionGalleryManifest")return Promise.resolve(this.setExtensionGalleryManifest(a[0],a[1],a[2]));throw new Error("Invalid call")}})}get extensionGalleryManifestStatus(){return this._extensionGalleryManifest?"available":"unavailable"}async getExtensionGalleryManifest(){return await this.barrier.wait(),this._extensionGalleryManifest??null}setExtensionGalleryManifest(e,n,o){this.logService.trace(`[Marketplace] Setting manifest ${e?"available":"unavailable"}`),this.setAuthorization(n,o),this._extensionGalleryManifest=e,this._onDidChangeExtensionGalleryManifest.fire(e),this._onDidChangeExtensionGalleryManifestStatus.fire(this.extensionGalleryManifestStatus),this.barrier.open()}};zm=w([b(1,z),b(2,Be)],zm)});var qy,ew,f8=v(()=>{Dn();st();De();co();Jl();Ey();xy();qy=class extends Cd{constructor(t,e,n,o,i,s,a,l){super(t,e,n,o,i,s,a,l)}async installFromGallery(t,e){this.logService.trace("MCP Management Service: installGallery",t.name,t.galleryUrl),this._onInstallMcpServer.fire({name:t.name,mcpResource:this.mcpResource});try{let n=await this.updateMetadataFromGallery(t),o=e?.packageType??(n.remotes?.length?"remote":n.packages?.[0]?.registryType??"remote"),{mcpServerConfiguration:i,notices:s}=this.getMcpServerConfigurationFromManifest(n,o);s.length>0&&this.logService.warn(`MCP Management Service: Warnings while installing ${t.name}`,s);let a={name:t.name,config:{...i.config,gallery:t.galleryUrl??!0,version:t.version},inputs:i.inputs};this.ensureServerAllowed(a),await this.mcpResourceScannerService.addMcpServers([a],this.mcpResource,this.target),await this.updateLocal(t);let l=(await this.getInstalled()).find(c=>c.name===t.name);if(!l)throw new Error(`Failed to install MCP server: ${t.name}`);return l}catch(n){throw this._onDidInstallMcpServers.fire([{name:t.name,source:t,error:n,mcpResource:this.mcpResource}]),n}}};qy=w([b(1,ka),b(2,Le),b(3,Ye),b(4,z),b(5,Ji),b(6,dr),b(7,Ut)],qy);ew=class extends Tm{createMcpResourceManagementService(t){return this.instantiationService.createInstance(qy,t)}}});function tw(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function y8(r){switch(r){case"npm":return"npm";case"docker":case"docker-hub":case"oci":return"oci";case"pypi":return"pypi";case"nuget":return"nuget";default:return}}function v8(r,t,e){if(!r)return;let n=[];for(let o of r){let i=y8(t(o));i&&n.push(e(o,i))}return n}function fie(r){if(!tw(r)||!tw(r.server)||!G(r.server.name)||!G(r.server.version)||!Array.isArray(r.server.packages)||r.server.packages.length===0||r.server.packages.some(e=>!tw(e)||y8(e.registryType))||Array.isArray(r.server.remotes)&&r.server.remotes.length>0)return;let t=r.server.repository;if(tw(t)&&G(t.url))try{let e=new URL(t.url);if(e.protocol===`${q.https}:`&&!e.username&&!e.password)return{repositoryUrl:S.parse(e.href)}}catch{}return{}}function h8(r,t){let e=Ql(t,"McpServersQueryService")??t.url;try{let n=new URL(r),o=new URL(e);if(n.protocol!==`${q.http}:`&&n.protocol!==`${q.https}:`||n.username||n.password||o.username||o.password||n.origin!==o.origin)return;let i=o.pathname.replace(/\/+$/,"");return n.pathname!==i&&!n.pathname.startsWith(`${i}/`)?void 0:n.href}catch{return}}function hie(r,t){let e=Ql(t,"McpServerNamedResourceUriTemplate");return e?Lr(e,{name:r}):void 0}function yie(r,t){let e=Ql(t,"McpServerIdUriTemplate");return e?Lr(e,{id:r}):void 0}function vie(r,t){let e=Ql(t,"McpServerLatestVersionUriTemplate");return e?Lr(e,{name:encodeURIComponent(r)}):void 0}var mie,gie,H1,nw,I8,ow,W1,Iie,bie,V1,Sie,rw,Gm,b8=v(()=>{Jt();Ue();xr();Q();Me();Tt();te();ee();st();De();Ui();Jl();hy();xe();Ie();mie=5*1024*1024,gie=3e4,H1=class extends Error{constructor(e){super("The MCP server has no supported package or remote endpoint.");this.repositoryUrl=e}},nw=class extends Error{constructor(){super("Cannot fetch MCP server from outside the configured MCP gallery")}};(o=>{o.VERSION="v0-2025-07-09",o.SCHEMA="https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json";class e{toRawGalleryMcpServerResult(s){if(!s||typeof s!="object"||!Array.isArray(s.servers))return;let a=s,l=[];for(let c of a.servers){let u=this.toRawGalleryMcpServer(c);u&&l.push(u)}return{metadata:{count:a.metadata.count??0,total:a.metadata.total,nextCursor:a.metadata?.next_cursor},servers:l}}toRawGalleryMcpServer(s){if(!s||typeof s!="object")return;let a=s;if(!a.name||!G(a.name)||!a.description||!G(a.description)||!a.version||!G(a.version)||a.$schema&&a.$schema!==o.SCHEMA)return;let l=a._meta?.["io.modelcontextprotocol.registry/official"];function c(I){return{...I,isRequired:I.is_required,isSecret:I.is_secret}}function u(I){let x={};for(let[E,T]of Object.entries(I))x[E]=c(T);return x}function p(I){return I.type==="positional"?{...I,valueHint:I.value_hint,isRepeated:I.is_repeated,isRequired:I.is_required,isSecret:I.is_secret,variables:I.variables?u(I.variables):void 0}:{...I,isRepeated:I.is_repeated,isRequired:I.is_required,isSecret:I.is_secret,variables:I.variables?u(I.variables):void 0}}function m(I){return{...I,isRequired:I.is_required,isSecret:I.is_secret,variables:I.variables?u(I.variables):void 0}}function g(I){switch(I.type){case"stdio":return{type:"stdio"};case"streamable-http":return{type:"streamable-http",url:I.url,headers:I.headers?.map(m)};case"sse":return{type:"sse",url:I.url,headers:I.headers?.map(m)};default:return{type:"stdio"}}}let y=v8(a.packages,I=>I.registry_type??I.registry_name,(I,x)=>({identifier:I.identifier??I.name,registryType:x,version:I.version,fileSha256:I.file_sha256,registryBaseUrl:I.registry_base_url,transport:I.transport?g(I.transport):{type:"stdio"},packageArguments:I.package_arguments?.map(p),runtimeHint:I.runtime_hint,runtimeArguments:I.runtime_arguments?.map(p),environmentVariables:I.environment_variables?.map(m)}));if(!y?.length&&!a.remotes?.length)return;let h=a._meta["io.modelcontextprotocol.registry/publisher-provided"]?.github;return{id:l.id,name:a.name,description:a.description,repository:a.repository?{url:a.repository.url,source:a.repository.source,id:a.repository.id}:void 0,readme:a.repository?.readme,version:a.version,createdAt:a.created_at,updatedAt:a.updated_at,packages:y,remotes:a.remotes?.map(I=>({type:(I.type??I.transport_type??I.transport)==="sse"?"sse":"streamable-http",url:I.url,headers:I.headers?.map(m)})),registryInfo:{isLatest:l.is_latest,publishedAt:l.published_at,updatedAt:l.updated_at},githubInfo:h?{name:h.name,nameWithOwner:h.name_with_owner,displayName:h.display_name,isInOrganization:h.is_in_organization,license:h.license,opengraphImageUrl:h.opengraph_image_url,ownerAvatarUrl:h.owner_avatar_url,primaryLanguage:h.primary_language,primaryLanguageColor:h.primary_language_color,pushedAt:h.pushed_at,stargazerCount:h.stargazer_count,topics:h.topics,usesCustomOpengraphImage:h.uses_custom_opengraph_image}:void 0}}}o.SERIALIZER=new e})(I8||={});(n=>{n.VERSION="v0.1";class t{toRawGalleryMcpServerResult(i){if(!i||typeof i!="object"||!Array.isArray(i.servers))return;let s=i,a=[];for(let l of s.servers){let c=this.toRawGalleryMcpServer(l);c&&a.push(c)}return{metadata:s.metadata,servers:a}}toRawGalleryMcpServer(i){if(!i||typeof i!="object")return;let s=i;if(!s.server||!ve(s.server)||!s.server.name||!G(s.server.name)||!s.server.description||!G(s.server.description)||!s.server.version||!G(s.server.version))return;let{"io.modelcontextprotocol.registry/official":a,...l}=s._meta??{},c=s.server._meta?.["io.modelcontextprotocol.registry/publisher-provided"]?.github,u=v8(s.server.packages,p=>p.registryType,(p,m)=>({...p,registryType:m}));if(!(!u?.length&&!s.server.remotes?.length))return{name:s.server.name,description:s.server.description,version:s.server.version,title:s.server.title,repository:s.server.repository?{url:s.server.repository.url,source:s.server.repository.source,id:s.server.repository.id}:void 0,readme:c?.readme,icons:s.server.icons,websiteUrl:s.server.websiteUrl,packages:u,remotes:s.server.remotes,status:a?.status,registryInfo:a,githubInfo:c,apicInfo:l}}}n.SERIALIZER=new t})(ow||={});(n=>{n.VERSION="v0";class t{toRawGalleryMcpServerResult(i){if(!ve(i))return;let s=i;if(!Array.isArray(s.servers)||!ve(s.metadata))return;let a=s.metadata;if(a.count!==void 0&&typeof a.count!="number")return;let l=[];for(let c of s.servers){let u=this.toRawGalleryMcpServer(c);u&&l.push(u)}return{metadata:{count:a.count??0,total:typeof a.total=="number"?a.total:void 0,nextCursor:G(a.nextCursor)?a.nextCursor:G(a.next_cursor)?a.next_cursor:void 0},servers:l}}toRawGalleryMcpServer(i){return ve(i)&&ve(i.server)?ow.SERIALIZER.toRawGalleryMcpServer(i):I8.SERIALIZER.toRawGalleryMcpServer(i)}}n.SERIALIZER=new t})(W1||={});Iie=50,bie=1024,V1=class extends Error{constructor(){super(d(4552,null))}},Sie={pageSize:Iie},rw=class r{constructor(t=Sie){this.state=t}get pageSize(){return this.state.pageSize}get searchText(){return this.state.searchText}get cursor(){return this.state.cursor}withPage(t,e=this.pageSize){return new r({...this.state,pageSize:e,cursor:t})}withSearchText(t){return new r({...this.state,searchText:t})}},Gm=class extends D{constructor(e,n,o,i){super();this.requestService=e;this.fileService=n;this.logService=o;this.mcpGalleryManifestService=i;this.rateLimits=new Map;this.galleryMcpServerDataSerializers=new Map,this.galleryMcpServerDataSerializers.set(W1.VERSION,W1.SERIALIZER),this.galleryMcpServerDataSerializers.set(ow.VERSION,ow.SERIALIZER)}isEnabled(){return this.mcpGalleryManifestService.mcpGalleryManifestStatus==="available"}async queryPage(e,n,o){if(n.isCancellationRequested)throw new He;let i=o??await this.mcpGalleryManifestService.getMcpGalleryManifest();if(!i)throw new Error(d(4554,null));let s=new rw().withPage(e.cursor??"",e.pageSize).withSearchText(e.cursor?void 0:e.text?.trim()),{servers:a,metadata:l}=await this.queryGalleryMcpServers(s,i,n,!0),c=l.total;return{items:a,total:c!==void 0&&Number.isSafeInteger(c)&&c>=a.length?c:void 0,nextCursor:l.nextCursor}}async query(e,n=Ae.None,o){let i=o??await this.mcpGalleryManifestService.getMcpGalleryManifest();if(!i)return{firstPage:{items:[],hasMore:!1},getNextPage:async()=>({items:[],hasMore:!1})};let s=new rw;e?.text&&(s=s.withSearchText(e.text.trim()));let{servers:a,metadata:l}=await this.queryGalleryMcpServers(s,i,n),c=l.nextCursor;return{firstPage:{items:a,hasMore:!!l.nextCursor},getNextPage:async u=>{if(u.isCancellationRequested)throw new He;if(!c)return{items:[],hasMore:!1};let{servers:p,metadata:m}=await this.queryGalleryMcpServers(s.withPage(c).withSearchText(void 0),i,u);return c=m.nextCursor,{items:p,hasMore:!!m.nextCursor}}}}async getMcpServersFromGallery(e,n){let o=await this.resolveMcpServersFromGallery(e,n),i=[];for(let s of o.values())s.status===0&&i.push(s.server);return i}async resolveMcpServersFromGallery(e,n){let o=new Map,i=n??await this.mcpGalleryManifestService.getMcpGalleryManifest();if(!i){for(let s of e)o.set(s.name,{status:2});return o}return await Promise.all(e.map(async s=>{try{let a=await this.getMcpServerByName(s,i);o.set(s.name,a?{status:0,server:a}:{status:1})}catch(a){this.logService.warn(`Failed to resolve MCP server '${s.name}' from gallery: ${a}`),o.set(s.name,{status:2})}})),o}async getMcpServerByName({name:e,id:n},o){let i=[vie(e,o),hie(e,o),n?yie(n,o):void 0],s=!1,a;for(let l of i)if(l){s=!0;try{let c=await this.getMcpServer(l,o);if(c){if(c.name===e)return c;a=new Error(`MCP server lookup for '${e}' returned '${c.name}'`)}}catch(c){a=c}}if(!s)throw new Error(`Cannot resolve MCP server '${e}': registry manifest has no server lookup endpoint`);if(a!==void 0)throw a}async getReadme(e,n){let o=e.readmeUrl;if(!o)return Promise.resolve(d(4558,null));let i=S.parse(o);if(i.scheme===q.file)try{return(await this.fileService.readFile(i)).value.toString()}catch(l){this.logService.error(`Failed to read file from ${i}: ${l}`)}if(i.authority!=="raw.githubusercontent.com")return new at(d(4559,null,o)).value;let s=await this.requestService.request({type:"GET",url:o,callSite:"mcpGalleryService.getReadme"},n),a=await Cu(s);if(!a)throw new Error(`Failed to fetch README from ${o}`);return a}toGalleryMcpServer(e,n){let o="",i=e.title;if(e.githubInfo?.name)i||(i=e.githubInfo.name.split("-").map(c=>c.toLowerCase()==="mcp"?"MCP":c.toLowerCase()==="github"?"GitHub":aR(c)).join(" ")),o=e.githubInfo.nameWithOwner.split("/")[0];else{let c=e.name.split("/");if(c.length>0){let u=c[0].split(".");u.length>0&&(o=u[u.length-1])}i||(i=c[c.length-1].split("-").map(u=>aR(u)).join(" "))}e.githubInfo?.displayName&&(i=e.githubInfo.displayName);let s;if(e.githubInfo?.preferredImage)s={light:e.githubInfo.preferredImage,dark:e.githubInfo.preferredImage};else if(e.githubInfo?.ownerAvatarUrl)s={light:e.githubInfo.ownerAvatarUrl,dark:e.githubInfo.ownerAvatarUrl};else if(e.apicInfo?.["x-ms-icon"])s={light:e.apicInfo["x-ms-icon"],dark:e.apicInfo["x-ms-icon"]};else if(e.icons&&e.icons.length>0){let c=e.icons.find(p=>p.theme==="light")??e.icons[0],u=e.icons.find(p=>p.theme==="dark")??c;s={light:c.src,dark:u.src}}let a=n?this.getWebUrl(e.name,n):void 0,l=n?this.getPublisherUrl(o,n):void 0;return{id:e.id,name:e.name,displayName:i,galleryUrl:n?.url,webUrl:a,description:e.description,status:e.status??"active",version:e.version,isLatest:e.registryInfo?.isLatest??!0,publishDate:e.registryInfo?.publishedAt?Date.parse(e.registryInfo.publishedAt):void 0,lastUpdated:e.githubInfo?.pushedAt?Date.parse(e.githubInfo.pushedAt):e.registryInfo?.updatedAt?Date.parse(e.registryInfo.updatedAt):void 0,repositoryUrl:e.repository?.url,readme:e.readme,icon:s,publisher:o,publisherUrl:l,license:e.githubInfo?.license,starsCount:e.githubInfo?.stargazerCount,topics:e.githubInfo?.topics,configuration:{packages:e.packages,remotes:e.remotes}}}async queryGalleryMcpServers(e,n,o,i=!1){let{servers:s,metadata:a}=await this.queryRawGalleryMcpServers(e,n,o,i);return{servers:s.map(l=>this.toGalleryMcpServer(l,n)),metadata:a}}createRateLimitError(e){return e===void 0?new Error(d(4556,null)):new Error(d(4557,null,e))}async queryRawGalleryMcpServers(e,n,o,i=!1){let s=this.getMcpGalleryUrl(n);if(!s){if(i)throw new Error(d(4553,null));return{servers:[],metadata:{count:0}}}let a=S.parse(s);if(a.scheme===q.file)try{let h=(await this.fileService.readFile(a)).value.toString();return JSON.parse(h)}catch(y){if(this.logService.error(`Failed to read file from ${a}: ${y}`),i)throw y}let l=this.rateLimits.get(s),c=(l?.until??0)-Date.now();if(c>0){if(i)throw this.createRateLimitError(l?.retryAfterSeconds===void 0?void 0:Math.ceil(c/1e3));return{servers:[],metadata:{count:0}}}l&&this.rateLimits.delete(s);let u=`${s}?limit=${e.pageSize}&version=latest`;if(e.cursor&&(u+=`&cursor=${encodeURIComponent(e.cursor)}`),e.searchText){let y=encodeURIComponent(e.searchText);u+=`&search=${y}`}let p;try{p=await this.requestService.request({type:"GET",url:u,callSite:"mcpGalleryService.queryMcpServers"},o)}catch(y){if(on(y)||(this.logService.error(`Failed to query MCP gallery: ${y}`),i))throw y;return{servers:[],metadata:{count:0}}}if(!kc(p)){if(p.res.statusCode===429){let y=bN(p.res.headers),h=Math.min(y??60,3600),I=Date.now()+h*1e3,x=this.rateLimits.get(s);if((!x||I>x.until)&&this.rateLimits.set(s,{until:I,retryAfterSeconds:y===void 0?void 0:h}),this.logService.warn(`Failed to query MCP gallery: Server returned 429; retrying is blocked for ${h} seconds.`),i)throw this.createRateLimitError(y===void 0?void 0:h);return{servers:[],metadata:{count:0}}}if(p.res.statusCode===400&&e.cursor&&(await mT(p,bie,()=>new Error("MCP gallery error response exceeded the size limit.")).catch(()=>{}))?.trim()==="Invalid cursor parameter"){if(this.logService.error("Failed to query MCP gallery: Server rejected its pagination cursor."),i)throw new V1;return{servers:[],metadata:{count:0}}}if(this.logService.error(`Failed to query MCP gallery: Server returned ${p.res.statusCode}.`),i)throw new Error(d(4555,null,p.res.statusCode));return{servers:[],metadata:{count:0}}}let m=await us(p);if(!m){if(i)throw new Error(d(4551,null));return{servers:[],metadata:{count:0}}}let g=this.serializeMcpServersResult(m,n);if(!g)throw new Error(`Failed to serialize MCP servers result from ${s}`,m);return g}async getMcpServer(e,n,o=Ae.None){let i=n??await this.mcpGalleryManifestService.getMcpGalleryManifest();if(!i)throw new Error("Cannot fetch MCP server because no MCP gallery is configured");let s=h8(e,i);if(!s)throw new nw;let a={type:"GET",url:s,followRedirects:0,...n?{timeout:gie}:{},callSite:"mcpGalleryService.getMcpServer"},l=await this.requestService.request(a,o);try{if(l.res.statusCode===404)return;if(l.res.statusCode!==void 0&&[0,301,302,303,307,308].includes(l.res.statusCode)){let p=new URL(s);if(!p.pathname.endsWith("/")){p.pathname+="/";let m=h8(p.href,i);if(!m)throw new nw;l.stream.destroy(),l=await this.requestService.request({...a,url:m},o)}}if(!kc(l))throw new Error(`Failed to fetch MCP server from ${e}: server responded with ${l.res.statusCode}`);let c;if(n){let p=await bR(mT(l,mie,()=>new Error(d(4550,null))),o);try{c=JSON.parse(p)}catch{throw new Error(d(4549,null))}}else c=await bR(us(l),o);if(!c)throw new Error(`Failed to fetch MCP server from ${e}: empty response`);let u=this.serializeMcpServer(c,i);if(!u){let p=fie(c);throw p?new H1(p.repositoryUrl):new Error(`Failed to serialize MCP server from ${e}`,c)}return this.toGalleryMcpServer(u,i)}finally{l.stream.destroy()}}serializeMcpServer(e,n){return this.getSerializer(n)?.toRawGalleryMcpServer(e)}serializeMcpServersResult(e,n){return this.getSerializer(n)?.toRawGalleryMcpServerResult(e)}getSerializer(e){let n=e?.version??"v0";return this.galleryMcpServerDataSerializers.get(n)}getWebUrl(e,n){let o=Ql(n,"McpServerWebUriTemplate");if(o)return Lr(o,{name:e})}getPublisherUrl(e,n){let o=Ql(n,"PublisherUriTemplate");if(o)return Lr(o,{name:e})}getMcpGalleryUrl(e){return Ql(e,"McpServersQueryService")}};Gm=w([b(0,ao),b(1,Le),b(2,z),b(3,sE)],Gm)});function $y(r){if(Array.isArray(r))return r.filter(xie)}function xie(r){if(!ve(r))return!1;let{serverName:t,serverUrl:e,serverCommand:n}=r,o=G(t)&&t.length>0,i=G(e)&&e.length>0,s=Array.isArray(n)&&n.length>0&&n.every(G);return(o?1:0)+(i?1:0)+(s?1:0)==1}function S8(r,t){return!!r&&r.some(e=>Cie(e,t,n=>t.policyValues?.[n]??n))}function zy(r,t,e){if(S8(t,e))return 1;let n=e.url!==void 0?r?.filter(o=>G(o.serverUrl)):e.command!==void 0?r?.filter(o=>Array.isArray(o.serverCommand)):void 0;return r!==void 0&&!S8(n?.length?n:r,e)?2:0}function Cie(r,t,e){return G(r.serverName)?r.serverName===t.name:G(r.serverUrl)?t.url!==void 0&&Eie(e(r.serverUrl),t.url):Array.isArray(r.serverCommand)?t.command!==void 0&&Gt(r.serverCommand.map(e),t.command):!1}function Eie(r,t){let e=x8(t);if(e===void 0)return!1;let n=r.indexOf("://"),o=n>=0&&B1(r,n+3)===r.length;if(!r.includes("*")&&!o){let s=x8(r);return s!==void 0&&s===e}let i=C8(o?`${r}/*`:r);if(i===void 0)return!1;try{return new RegExp(Rie(i)).test(e)}catch{return!1}}function x8(r){try{let t=new URL(r);return t.protocol==="http:"||t.protocol==="https:"?t.origin+t.pathname+t.search:C8(r)}catch{return}}function C8(r){let t=r.indexOf("://");if(t<0)return r;let e=r.slice(0,t).toLowerCase(),n=r.slice(t+3),o=B1(n,0);if(e!=="http"&&e!=="https")return`${e}://${n.slice(0,o).toLowerCase()}${n.slice(o)}`;let i=n.slice(0,o),s=i.lastIndexOf("@");s>=0&&(i=i.slice(s+1));let a=wie(i);if(a===void 0)return;let l=e==="https"?"443":"80",c=a.port===l?void 0:a.port,u=n.slice(o).replace(/\\/g,"/"),p=u.indexOf("#");return p>=0&&(u=u.slice(0,p)),u?u.startsWith("?")&&(u=`/${u}`):u="/",`${e}://${a.host.toLowerCase()}${c!==void 0?`:${c}`:""}${u}`}function wie(r){if(r.startsWith("[")){let e=r.indexOf("]");return e===-1?void 0:r[e+1]===":"?{host:r.slice(0,e+1),port:r.slice(e+2)}:e+1<r.length?void 0:{host:r,port:void 0}}let t=r.lastIndexOf(":");return t>=0?{host:r.slice(0,t),port:r.slice(t+1)}:r?{host:r,port:void 0}:void 0}function Rie(r){let t=r.indexOf("://"),e=t>=0?t+3:0,n=B1(r,e),o="^";for(let i=0;i<r.length;i++){let s=r[i];i<n&&s===":"&&r[i+1]==="*"?(o+="(:[^/@\\\\?#]*)?",i++):s==="*"?o+=i<n?"[^/@\\\\?#]*":".*":o+=yo(s)}return o+"$"}function B1(r,t){for(let e=t;e<r.length;e++){let n=r[e];if(n==="/"||n==="\\"||n==="?"||n==="#")return e}return r.length}var E8=v(()=>{Dt();Tt();Ie()});function w8(r){return r>=65&&r<=90||r>=97&&r<=122}function Tie(r){return r>=48&&r<=57}function R8(r,t){let e=r.charCodeAt(t);if(!w8(e)&&e!==95)return;let n=t+1;for(;n<r.length;){let o=r.charCodeAt(n);if(!w8(o)&&!Tie(o)&&o!==95)break;n++}return n}function Pie(r,t){let e=0,n=[],o=s=>{n.push([s,e]),e=0},i=t;for(;i<r.length;){let s=r.charCodeAt(i),a=r.charCodeAt(i+1),l=1;if(e===1){if(s===39)e=0;else if(s===125)return}else if(s===92){if(e===2&&a===125)return;l=2}else if(e===2){if(s===125)return;s===34?e=0:s===36&&a===123?(o(0),l=2):s===36&&a===40&&(o(1),l=2)}else{let c=n.at(-1);switch(s){case 39:e=1;break;case 34:e=2;break;case 35:case 96:return;case 36:if(a===39||a===34)return;a===123?(o(0),l=2):a===40&&(o(1),l=2);break;case 60:if(a===60)return;break;case 40:c?.[0]===1&&n.push([1,e]);break;case 41:c?.[0]===1&&(e=c[1],n.pop());break;case 125:if(!c)return i;c[0]===0&&(e=c[1],n.pop());break}}i+=l}}function kie(r,t){let e=Pie(r,t);if(e!==void 0)return e;let n=r.indexOf("}",t);return n===-1?void 0:n}function Aie(r,t){let e=t+2,n=R8(r,e);if(n===void 0)return;let o=r.slice(e,n);if(r.charCodeAt(n)===125)return{name:o,defaultValue:void 0,verbatim:r.slice(t,n+1)};if(r.charCodeAt(n)!==58||r.charCodeAt(n+1)!==45)return;let i=n+2,s=kie(r,i);if(s!==void 0)return{name:o,defaultValue:r.slice(i,s),verbatim:r.slice(t,s+1)}}function Die(r,t,e){if(r.charCodeAt(t+1)===123)return Aie(r,t);if(e?.bareReferences===!1)return;let n=R8(r,t+1);if(n!==void 0)return{name:r.slice(t+1,n),defaultValue:void 0,verbatim:r.slice(t,n)}}function q1(r,t){if(r.length>1e3)return!1;for(let e=r.indexOf("$");e!==-1;e=r.indexOf("$",e+1))if(Die(r,e,t))return!0;return!1}var T8=v(()=>{});var Km,P8=v(()=>{Q();$s();ee();xr();dn();dE();ue();Ie();E8();Jl();Pa();mm();Ey();T8();Km=class extends D{constructor(e){super();this.configurationService=e;this._onDidChangeAllowedMcpServers=this._register(new R);this.onDidChangeAllowedMcpServers=this._onDidChangeAllowedMcpServers.event;this._register(this.configurationService.onDidChangeConfiguration(n=>{(n.affectsConfiguration(aE)||n.affectsConfiguration(Iy)||n.affectsConfiguration(lE)||n.affectsConfiguration(hC))&&this._onDidChangeAllowedMcpServers.fire()}))}get hasManagedAllowlist(){return Array.isArray(this.configurationService.inspect(Iy).policyValue)||this.configurationService.inspect(hC).policyValue===!0}isAllowed(e){if(Rn(e,{config:!0})){let s=e.config;return(s.type==="http"?G(s.url)&&!!s.url.trim():G(s.command)&&!!s.command.trim()&&(s.args===void 0||fg(s.args)))?this.isServerAllowedBeforeResolution(s.type==="http"?{name:e.name,url:s.url}:{name:e.name,command:[s.command,...s.args??[]]}):new at(d(4537,null))}let n=new Cy,o;try{o=[...(e.configuration.remotes??[]).map(s=>n.getMcpServerConfigurationFromManifest({remotes:[s]},"remote")),...(e.configuration.packages??[]).filter(s=>["npm","pypi","oci","nuget"].includes(s.registryType)).map(s=>n.getMcpServerConfigurationFromManifest({packages:[s]},s.registryType))]}catch(s){return new at().appendText(d(4535,null,rr(s)))}let i=this.isServerAllowedBeforeResolution({name:e.name});for(let s of o){let a=this.isAllowed({name:e.name,config:s.mcpServerConfiguration.config});if(a===!0)return!0;i=a}return i}isServerAllowedBeforeResolution(e){return this.checkServerAllowed(e,"definition")}isServerAllowed(e){return this.checkServerAllowed(e,"resolved")}getServerPolicyVariableValues(){let{allowlist:e,denylist:n}=this.getPolicyLists();return[...new Set([...e??[],...n??[]].flatMap(o=>[...o.serverCommand??[],...o.serverUrl!==void 0?[o.serverUrl]:[]].filter(i=>q1(i))))]}getPolicyLists(){let e=this.configurationService.getValue(hC)===!0;return{allowlist:e?$y(this.configurationService.inspect(Iy).policyValue)??[]:$y(this.configurationService.getValue(Iy)),denylist:e?this.getAllConfiguredMatchers(lE):$y(this.configurationService.getValue(lE))}}checkServerAllowed(e,n){if(this.configurationService.getValue(aE)==="none"){let l=FI("workbench.action.openSettings",{query:`@id:${aE}`}).toString();return new at(d(4542,null,l))}let{allowlist:o,denylist:i}=this.getPolicyLists(),s=[...o??[],...i??[]].some(l=>[...l.serverCommand??[],...l.serverUrl!==void 0?[l.serverUrl]:[]].some(c=>q1(c)&&e.policyValues?.[c]===void 0));if(n==="resolved"&&s)return new at(d(4536,null));switch(n==="definition"?this.checkServerAllowedBeforeResolution(o,i,e,s):zy(o,i,e)){case 1:return new at(d(4538,null));case 2:if(o?.some(l=>l.serverName===e.name)){if(e.url!==void 0)return new at(d(4540,null));if(e.command!==void 0)return new at(d(4539,null))}return new at(d(4541,null))}return!0}checkServerAllowedBeforeResolution(e,n,o,i){let s=o.url!==void 0&&(IM(o.url)||i),a=o.command!==void 0&&(o.command.some(IM)||i);if(!s&&!a)return zy(e,n,o);let l={name:o.name,url:s?void 0:o.url,command:a?void 0:o.command,policyValues:o.policyValues};return zy(void 0,n,l)===1?1:e?.some(c=>s&&G(c.serverUrl)||a&&Array.isArray(c.serverCommand))?0:zy(e,void 0,l)}getAllConfiguredMatchers(e){let n=this.configurationService.inspect(e);return[n.applicationValue,n.userValue,n.userLocalValue,n.userRemoteValue,n.workspaceValue,n.workspaceFolderValue,n.memoryValue,n.policyValue].flatMap(o=>$y(o)??[])}};Km=w([b(0,bt)],Km)});var iw,k8=v(()=>{Ue();ue();Q();hy();iw=class extends D{constructor(e){super();this._onDidChangeMcpGalleryManifest=this._register(new R);this.onDidChangeMcpGalleryManifest=this._onDidChangeMcpGalleryManifest.event;this._onDidChangeMcpGalleryManifestStatus=this._register(new R);this.onDidChangeMcpGalleryManifestStatus=this._onDidChangeMcpGalleryManifestStatus.event;this.barrier=new Ur;e.registerChannel("mcpGalleryManifest",{listen:()=>F.None,call:async(n,o,i)=>{if(o==="setMcpGalleryManifest"){let s=Array.isArray(i)?i[0]:null;return Promise.resolve(this.setMcpGalleryManifest(s))}throw new Error("Invalid call")}})}get mcpGalleryManifestStatus(){return this._mcpGalleryManifest?"available":"unavailable"}async getMcpGalleryManifest(){return await this.barrier.wait(),this._mcpGalleryManifest??null}async getDefaultMcpGalleryManifest(){return null}setMcpGalleryManifest(e){this._mcpGalleryManifest=e,this._onDidChangeMcpGalleryManifest.fire(e),this._onDidChangeMcpGalleryManifestStatus.fire(this.mcpGalleryManifestStatus),this.barrier.open()}}});import*as $1 from"fs";var Oa,z1,A8=v(()=>{Ue();ue();fn();Oe();vo();Oa=class r{constructor(t,e=Object.create(null)){this.path=t;this.name=Ze(this.path),this.logger=new z1(e.logging),this.useWAL=!!e.useWAL,this.busyTimeout=e.busyTimeout,this.whenConnected=this.connect(this.path)}static{this.IN_MEMORY_PATH=":memory:"}get onDidChangeItemsExternal(){return F.None}static{this.BUSY_OPEN_TIMEOUT=2e3}static{this.MAX_HOST_PARAMETERS=256}async getItems(){let t=await this.whenConnected,e=new Map;return(await this.all(t,"SELECT * FROM ItemTable")).forEach(o=>e.set(o.key,o.value)),this.logger.isTracing&&this.logger.trace(`[storage ${this.name}] getItems(): ${e.size} rows`),e}async updateItems(t){let e=await this.whenConnected;return this.doUpdateItems(e,t)}doUpdateItems(t,e){return this.logger.isTracing&&this.logger.trace(`[storage ${this.name}] updateItems(): insert(${e.insert?aO(e.insert):"0"}), delete(${e.delete?lO(e.delete):"0"})`),this.transaction(t,()=>{let n=e.insert,o=e.delete;if(n&&n.size>0){let i=[];i.push([]);let s=0;n.forEach((a,l)=>{let c=i[s];c.length>r.MAX_HOST_PARAMETERS&&(s++,c=[],i.push(c)),c.push(l,a)}),i.forEach(a=>{this.prepare(t,`INSERT INTO ItemTable VALUES ${new Array(a.length/2).fill("(?,?)").join(",")} ON CONFLICT (key) DO UPDATE SET value = excluded.value WHERE value != excluded.value`,l=>l.run(a),()=>{let l=[],c=0;return n.forEach((u,p)=>{l.push(p),c+=u.length}),`Keys: ${l.join(", ")} Length: ${c}`})})}if(o?.size){let i=[];i.push([]);let s=0;o.forEach(a=>{let l=i[s];l.length>r.MAX_HOST_PARAMETERS&&(s++,l=[],i.push(l)),l.push(a)}),i.forEach(a=>{this.prepare(t,`DELETE FROM ItemTable WHERE key IN (${new Array(a.length).fill("?").join(",")})`,l=>l.run(a),()=>{let l=[];return o.forEach(c=>{l.push(c)}),`Keys: ${l.join(", ")}`})})}})}async optimize(){this.logger.trace(`[storage ${this.name}] vacuum()`);let t=await this.whenConnected;return this.exec(t,"VACUUM")}async close(t){this.logger.trace(`[storage ${this.name}] close()`);let e=await this.whenConnected;return this.doClose(e,t)}doClose(t,e){return new Promise((n,o)=>{t.db.close(i=>(i&&this.handleSQLiteError(t,`[storage ${this.name}] close(): ${i}`),this.path===r.IN_MEMORY_PATH?n():!t.isErroneous&&!t.isInMemory?this.backup().then(n,s=>(this.logger.error(`[storage ${this.name}] backup(): ${s}`),n())):typeof e=="function"?$1.promises.unlink(this.path).then(()=>this.doConnect(this.path).then(s=>{let a=()=>this.doClose(s,void 0);return this.doUpdateItems(s,{insert:e()}).then(()=>a(),l=>(a(),Promise.reject(l)))})).then(n,o):o(i||new Error("Database has errors or is in-memory without recovery option"))))})}backup(){let t=this.toBackupPath(this.path);return Ce.copy(this.path,t,{preserveSymlinks:!1})}toBackupPath(t){return`${t}.backup`}async checkIntegrity(t){this.logger.trace(`[storage ${this.name}] checkIntegrity(full: ${t})`);let e=await this.whenConnected,n=await this.get(e,t?"PRAGMA integrity_check":"PRAGMA quick_check"),o=t?n.integrity_check:n.quick_check;return e.isErroneous?`${o} (last error: ${e.lastError})`:e.isInMemory?`${o} (in-memory!)`:o}async connect(t,e=!0){this.logger.trace(`[storage ${this.name}] open(${t}, retryOnBusy: ${e})`);try{return await this.doConnect(t)}catch(n){if(this.logger.error(`[storage ${this.name}] open(): Unable to open DB due to ${n}`),n.code==="SQLITE_BUSY"&&e)return await ko(r.BUSY_OPEN_TIMEOUT),this.connect(t,!1);try{await $1.promises.unlink(t);try{await Ce.rename(this.toBackupPath(t),t,!1)}catch{}return await this.doConnect(t)}catch(o){return this.logger.error(`[storage ${this.name}] open(): Unable to use backup due to ${o}`),this.doConnect(r.IN_MEMORY_PATH)}}}handleSQLiteError(t,e){t.isErroneous=!0,t.lastError=e,this.logger.error(e)}doConnect(t){return new Promise((e,n)=>{import("@vscode/sqlite3").then(o=>{let i=this.logger.isTracing?o.default.verbose().Database:o.default.Database,s={db:new i(t,a=>{if(a)return s.db&&a.code!=="SQLITE_CANTOPEN"?s.db.close(()=>n(a)):n(a);let l=["PRAGMA user_version = 1;","CREATE TABLE IF NOT EXISTS ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB);"];return this.useWAL&&l.push("PRAGMA journal_mode=WAL;"),this.busyTimeout&&l.push(`PRAGMA busy_timeout=${this.busyTimeout};`),this.exec(s,l.join("")).then(()=>e(s),c=>s.db.close(()=>n(c)))}),isInMemory:t===r.IN_MEMORY_PATH};s.db.on("error",a=>this.handleSQLiteError(s,`[storage ${this.name}] Error (event): ${a}`)),this.logger.isTracing&&s.db.on("trace",a=>this.logger.trace(`[storage ${this.name}] Trace (event): ${a}`))},n)})}exec(t,e){return new Promise((n,o)=>{t.db.exec(e,i=>i?(this.handleSQLiteError(t,`[storage ${this.name}] exec(): ${i}`),o(i)):n())})}get(t,e){return new Promise((n,o)=>{t.db.get(e,(i,s)=>i?(this.handleSQLiteError(t,`[storage ${this.name}] get(): ${i}`),o(i)):n(s))})}all(t,e){return new Promise((n,o)=>{t.db.all(e,(i,s)=>i?(this.handleSQLiteError(t,`[storage ${this.name}] all(): ${i}`),o(i)):n(s))})}transaction(t,e){return new Promise((n,o)=>{t.db.serialize(()=>{t.db.run("BEGIN TRANSACTION"),e(),t.db.run("END TRANSACTION",i=>i?(this.handleSQLiteError(t,`[storage ${this.name}] transaction(): ${i}`),o(i)):n())})})}prepare(t,e,n,o){let i=t.db.prepare(e),s=a=>{this.handleSQLiteError(t,`[storage ${this.name}] prepare(): ${a} (${e}). Details: ${o()}`)};i.on("error",s),n(i),i.finalize(a=>{a&&s(a),i.removeListener("error",s)})}},z1=class r{static{this.VSCODE_TRACE_STORAGE="VSCODE_TRACE_STORAGE"}constructor(t){t&&typeof t.logTrace=="function"&&process.env[r.VSCODE_TRACE_STORAGE]&&(this.logTrace=t.logTrace),t&&typeof t.logError=="function"&&(this.logError=t.logError)}get isTracing(){return!!this.logTrace}trace(t){this.logTrace?.(t)}error(t){this.logError?.(t)}}});import*as G1 from"fs";var jm,sw,aw,lw,Qm,cw,Gy,K1=v(()=>{Dt();Ue();ue();Q();Oe();Vs();te();vo();ZT();A8();De();gi();_n();ia();Me();jm=class r extends D{constructor(e,n){super();this.logService=e;this.fileService=n;this._onDidChangeStorage=this._register(new R);this.onDidChangeStorage=this._onDidChangeStorage.event;this._onDidCloseStorage=this._register(new R);this.onDidCloseStorage=this._onDidCloseStorage.event;this._storage=this._register(new qr(new hs,{hint:1}));this.initializePromise=void 0;this.whenInitPromise=new jn;this.whenInit=this.whenInitPromise.p;this.state=0}static{this.LOG_SLOW_CLOSE_THRESHOLD=2e3}get storage(){return this._storage}isInMemory(){return this._storage.isInMemory()}init(){return this.initializePromise||(this.initializePromise=(async()=>{if(this.state===0)try{let e=await this.doCreate();if(this._store.isDisposed){try{await e.close()}finally{e.dispose()}return}this._register(e),this._storage.dispose(),this._storage=e,this._register(e.onDidChangeStorage(o=>this._onDidChangeStorage.fire(o))),await this.doInit(e);let n=e.getBoolean(ff);n===void 0?e.set(ff,!0):n&&e.set(ff,!1)}catch(e){this.logService.error(`[storage main] initialize(): Unable to init storage due to ${e}`)}finally{this.state=1,this.whenInitPromise.complete()}})()),this.initializePromise}createLoggingOptions(){return{logTrace:this.logService.getLevel()===1?e=>this.logService.trace(e):void 0,logError:e=>this.logService.error(e)}}doInit(e){return e.init()}get items(){return this._storage.items}get(e,n){return this._storage.get(e,n)}set(e,n){return this._storage.set(e,n)}delete(e){return this._storage.delete(e)}optimize(){return this._storage.optimize()}async close(){let e=new no(!1);await this.doClose(),e.stop(),e.elapsed()>r.LOG_SLOW_CLOSE_THRESHOLD&&await this.logSlowClose(e),this._onDidCloseStorage.fire()}async logSlowClose(e){if(this.path)try{let n=X0(Array.from(this._storage.items.entries()).map(([i,s])=>({key:i,length:s.length})),(i,s)=>s.length-i.length,5).map(i=>`${i.key}:${i.length}`).join(", "),o=(await this.fileService.stat(S.file(this.path))).size;this.logService.warn(`[storage main] detected slow close() operation: Time: ${e.elapsed()}ms, DB size: ${o}b, Large Keys: ${n}`)}catch(n){this.logService.error("[storage main] figuring out stats for slow DB on close() resulted in an error",n)}}async doClose(){this.initializePromise&&await this.initializePromise,this.state=2,await this._storage.close()}},sw=class r extends jm{constructor(e,n,o,i){super(o,i);this.profile=e;this.options=n}static{this.STORAGE_NAME="state.vscdb"}get path(){if(!this.options.useInMemoryStorage)return $(this.profile.globalStorageHome.with({scheme:q.file}).fsPath,r.STORAGE_NAME)}async doCreate(){return new qr(new Oa(this.path??Oa.IN_MEMORY_PATH,{logging:this.createLoggingOptions()}),this.path?void 0:{hint:1})}},aw=class extends sw{},lw=class extends sw{constructor(t,e,n,o){super(e.defaultProfile,t,n,o)}async doInit(t){await super.doInit(t),this.updateTelemetryState(t)}updateTelemetryState(t){t.get(kT,void 0)===void 0&&t.set(kT,new Date().toUTCString());let n=t.get(PT,void 0),o=new Date().toUTCString();t.set(GN,typeof n>"u"?null:n),t.set(PT,o)}},Qm=class r extends jm{constructor(e,n,o,i,s){super(i,s);this.options=e;this.storageFolderPath=n;this.applicationStorage=o}static{this.STORAGE_NAME="state.vscdb"}get path(){if(!this.options.useInMemoryStorage)return $(this.storageFolderPath,r.STORAGE_NAME)}async doCreate(){let{storageFilePath:e,wasCreated:n}=await this.prepareStorageFolder();this.logService.info(`[shared storage] Creating shared storage database at '${e}' (wasCreated: ${n})`);let o=new Oa(e,{logging:this.createLoggingOptions()});this.logService.info(`[shared storage] Initializing fallback application storage (path: ${this.applicationStorage.path??"in-memory"})`),await this.applicationStorage.init(),this.logService.info(`[shared storage] Fallback application storage initialized with ${this.applicationStorage.items.size} items`);let i=new zI(o,{hint:n?0:void 0});return i.setFallbackStorage(this.applicationStorage.storage,!1),i}get applicationStorageItems(){return this.applicationStorage.items}async prepareStorageFolder(){if(this.options.useInMemoryStorage)return{storageFilePath:Oa.IN_MEMORY_PATH,wasCreated:!0};let e=$(this.storageFolderPath,r.STORAGE_NAME);return await Ce.exists(this.storageFolderPath)?{storageFilePath:e,wasCreated:!1}:(await G1.promises.mkdir(this.storageFolderPath,{recursive:!0}),{storageFilePath:e,wasCreated:!0})}},cw=class r extends jm{constructor(e,n,o,i,s){super(o,s);this.workspace=e;this.options=n;this.environmentService=i}static{this.WORKSPACE_STORAGE_NAME="state.vscdb"}static{this.WORKSPACE_META_NAME="workspace.json"}get path(){if(!this.options.useInMemoryStorage)return $(this.environmentService.workspaceStorageHome.with({scheme:q.file}).fsPath,this.workspace.id,r.WORKSPACE_STORAGE_NAME)}async doCreate(){let{storageFilePath:e,wasCreated:n}=await this.prepareWorkspaceStorageFolder();return new qr(new Oa(e,{logging:this.createLoggingOptions()}),{hint:this.options.useInMemoryStorage?1:n?0:void 0})}async prepareWorkspaceStorageFolder(){if(this.options.useInMemoryStorage)return{storageFilePath:Oa.IN_MEMORY_PATH,wasCreated:!0};let e=$(this.environmentService.workspaceStorageHome.with({scheme:q.file}).fsPath,this.workspace.id),n=$(e,r.WORKSPACE_STORAGE_NAME);return await Ce.exists(e)?{storageFilePath:n,wasCreated:!1}:(await G1.promises.mkdir(e,{recursive:!0}),this.ensureWorkspaceStorageFolderMeta(e),{storageFilePath:n,wasCreated:!0})}async ensureWorkspaceStorageFolderMeta(e){let n;if(GI(this.workspace)?n={folder:this.workspace.uri.toString()}:KI(this.workspace)&&(n={workspace:this.workspace.configPath.toString()}),n)try{let o=$(e,r.WORKSPACE_META_NAME);await Ce.exists(o)||await Ce.writeFile(o,JSON.stringify(n,void 0,2))}catch(o){this.logService.error(`[storage main] ensureWorkspaceStorageFolderMeta(): Unable to create workspace storage metadata due to ${o}`)}}},Gy=class extends jm{get path(){}async doCreate(){return new qr(new hs,{hint:1})}}});var dw,D8=v(()=>{ue();Q();fs();K1();ia();dw=class r extends D{constructor(e,n){super();this.logService=e;this.storageMainService=n;this.onDidChangeApplicationStorageEmitter=this._register(new R);this.onDidChangeApplicationSharedStorageEmitter=this._register(new R);this.mapProfileToOnDidChangeProfileStorageEmitter=new Map;this.registerStorageChangeListeners(n.applicationStorage,this.onDidChangeApplicationStorageEmitter),this.registerStorageChangeListeners(n.applicationSharedStorage,this.onDidChangeApplicationSharedStorageEmitter)}static{this.STORAGE_CHANGE_DEBOUNCE_TIME=100}registerStorageChangeListeners(e,n){this._register(F.debounce(e.onDidChangeStorage,(o,i)=>(o?o.push(i):o=[i],o),r.STORAGE_CHANGE_DEBOUNCE_TIME)(o=>{o.length&&n.fire(this.serializeStorageChangeEvents(o,e))}))}serializeStorageChangeEvents(e,n){let o=new Map,i=new Set;return e.forEach(s=>{let a=n.get(s.key);typeof a=="string"?o.set(s.key,a):i.add(s.key)}),{changed:Array.from(o.entries()),deleted:Array.from(i.values())}}listen(e,n,o){switch(n){case"onDidChangeStorage":{let i=o.profile?en(o.profile):void 0;if(!i)return o.applicationShared?this.onDidChangeApplicationSharedStorageEmitter.event:this.onDidChangeApplicationStorageEmitter.event;let s=this.mapProfileToOnDidChangeProfileStorageEmitter.get(i.id);return s||(s=this._register(new R),this.registerStorageChangeListeners(this.storageMainService.profileStorage(i),s),this.mapProfileToOnDidChangeProfileStorageEmitter.set(i.id,s)),s.event}}throw new Error(`Event not found: ${n}`)}async call(e,n,o){let i=o.profile?en(o.profile):void 0,s=zF(o.workspace),a=o.applicationShared,l=await this.withStorageInitialized(i,s,a);switch(n){case"getItems":{let c=new Map(l.items);return Array.from(c.entries())}case"getValue":{let c=o;return l.get(c.key)}case"getFallbackApplicationStorageItems":return l instanceof Qm?Array.from(l.applicationStorageItems.entries()):[];case"updateItems":{let c=o;if(c.insert)for(let[u,p]of c.insert)l.set(u,p);c.delete?.forEach(u=>l.delete(u));break}case"compareAndSwap":{let c=o,u=l.get(c.key);return u!==c.expectedValue?{swapped:!1,currentValue:u}:(l.set(c.key,c.newValue),{swapped:!0,currentValue:c.newValue})}case"optimize":return l.optimize();case"isUsed":{let c=o.payload;return typeof c=="string"?this.storageMainService.isUsed(c):!1}default:throw new Error(`Call not found: ${n}`)}}async withStorageInitialized(e,n,o){let i;n?i=this.storageMainService.workspaceStorage(n):e?i=this.storageMainService.profileStorage(e):o?i=this.storageMainService.applicationSharedStorage:i=this.storageMainService.applicationStorage;try{await i.init()}catch(s){this.logService.error(`StorageIPC#init: Unable to init ${n?"workspace":e?"profile":o?"application-shared":"application"} storage due to ${s}`)}return i}}});function _ie(r,t){let e=r["agent-plugins-dir"];if(e)return Sn(e);let n=Qt.VSCODE_AGENT_PLUGINS;if(n)return n;let o=Qt.VSCODE_PORTABLE;return o?$(o,"agent-plugins"):ge(t,"agent-plugins").fsPath}var _8,uw,M8=v(()=>{it();Dn();st();Z();De();Wn();co();xo();Kb();GP();te();hr();Oe();_8=Bt,uw=class extends yi{constructor(t,e,n,o,i,s){super(t,e,n,o,i),this.agentPluginsHome=S.file(_ie(n.args,ge(n.userHome,s.dataFolderName)))}createDefaultProfile(){return{...super.createDefaultProfile(),agentPluginsHome:this.agentPluginsHome}}async createAgentsWindowProfile(){let t=this.profiles.find(e=>e.id===hl);return t||this.createProfile(hl,"Agents")}getAssociatedEmptyWindows(){let t=[];for(let e of this.profilesObject.emptyWindows.keys())t.push({id:e});return t}};uw=w([b(0,zb),b(1,Ye),b(2,An),b(3,Le),b(4,z),b(5,Be)],uw)});var Mie,L8,Lie,Jm,zAt,pw,O8=v(()=>{te();ue();Q();Oe();Dn();st();Z();De();gi();K1();xo();M8();co();Me();Mie=3,L8=2,Lie=A("storageMainService"),Jm=class extends D{constructor(e,n,o,i,s,a){super();this.logService=e;this.environmentService=n;this.userDataProfilesService=o;this.lifecycleMainService=i;this.fileService=s;this.uriIdentityService=a;this.shutdownReason=void 0;this._onDidChangeProfileStorage=this._register(new R);this.onDidChangeProfileStorage=this._onDidChangeProfileStorage.event;this.mapProfileToStorage=new Map;this.mapWorkspaceToStorage=new Map;this.applicationStorage=this._register(this.createApplicationStorage()),this.applicationSharedStorage=this._register(this.createApplicationSharedStorage()),this.registerListeners()}getStorageOptions(){return{useInMemoryStorage:!!this.environmentService.extensionTestsLocationURI}}registerListeners(){(async()=>(await this.lifecycleMainService.when(Mie),this.applicationStorage.init(),this.applicationSharedStorage.init()))(),this._register(this.lifecycleMainService.onWillLoadWindow(e=>{e.window.profile&&this.profileStorage(e.window.profile).init(),e.workspace&&this.workspaceStorage(e.workspace).init()})),this._register(this.lifecycleMainService.onWillShutdown(e=>{this.logService.trace("storageMainService#onWillShutdown()"),this.shutdownReason=e.reason,e.join("applicationStorage",this.applicationStorage.close()),e.join("applicationSharedStorage",this.applicationSharedStorage.close());for(let[,n]of this.mapProfileToStorage)e.join("profileStorage",n.close());for(let[,n]of this.mapWorkspaceToStorage)e.join("workspaceStorage",n.close())})),this._register(this.userDataProfilesService.onWillCreateProfile(e=>{e.join((async()=>{await this.fileService.exists(e.profile.globalStorageHome)||await this.fileService.createFolder(e.profile.globalStorageHome)})())})),this._register(this.userDataProfilesService.onWillRemoveProfile(e=>{let n=this.mapProfileToStorage.get(e.profile.id);n&&e.join(n.close())}))}createApplicationStorage(){this.logService.trace("StorageMainService: creating application storage");let e=new lw(this.getStorageOptions(),this.userDataProfilesService,this.logService,this.fileService);return this._register(F.once(e.onDidCloseStorage)(()=>{this.logService.trace("StorageMainService: closed application storage")})),e}createApplicationSharedStorage(){this.logService.info("StorageMainService: creating application shared storage");let e=$(this.environmentService.appSharedDataHome.with({scheme:q.file}).fsPath,"sharedStorage"),n=new Qm(this.getStorageOptions(),e,this.applicationStorage,this.logService,this.fileService);return this._register(F.once(n.onDidCloseStorage)(()=>{this.logService.trace("StorageMainService: closed application shared storage")})),n}profileStorage(e){if(Uu(e))return this.applicationStorage;let n=this.mapProfileToStorage.get(e.id);if(!n){this.logService.trace(`StorageMainService: creating profile storage (${e.name})`),n=this._register(this.createProfileStorage(e)),this.mapProfileToStorage.set(e.id,n);let o=n.onDidChangeStorage(i=>this._onDidChangeProfileStorage.fire({...i,storage:n,profile:e}));F.once(n.onDidCloseStorage)(()=>{this.logService.trace(`StorageMainService: closed profile storage (${e.name})`),this.mapProfileToStorage.delete(e.id),o.dispose()})}return n}createProfileStorage(e){return this.shutdownReason===L8?new Gy(this.logService,this.fileService):new aw(e,this.getStorageOptions(),this.logService,this.fileService)}workspaceStorage(e){let n=this.mapWorkspaceToStorage.get(e.id);return n||(this.logService.trace(`StorageMainService: creating workspace storage (${e.id})`),n=this._register(this.createWorkspaceStorage(e)),this.mapWorkspaceToStorage.set(e.id,n),F.once(n.onDidCloseStorage)(()=>{this.logService.trace(`StorageMainService: closed workspace storage (${e.id})`),this.mapWorkspaceToStorage.delete(e.id)})),n}createWorkspaceStorage(e){return this.shutdownReason===L8?new Gy(this.logService,this.fileService):new cw(e,this.getStorageOptions(),this.logService,this.environmentService,this.fileService)}isUsed(e){let n=S.file(e);for(let o of[this.applicationStorage,this.applicationSharedStorage,...this.mapProfileToStorage.values(),...this.mapWorkspaceToStorage.values()])if(o.path&&this.uriIdentityService.extUri.isEqualOrParent(S.file(o.path),n))return!0;return!1}};Jm=w([b(0,z),b(1,An),b(2,_8),b(4,Le),b(5,Ye)],Jm);zAt=A("applicationStorageMainService"),pw=class extends gf{constructor(e,n){super();this.userDataProfilesService=e;this.storageMainService=n;this.whenReady=Promise.all([this.storageMainService.applicationStorage.whenInit,this.storageMainService.applicationSharedStorage.whenInit]).then(()=>{})}doInitialize(){return Promise.all([this.storageMainService.applicationStorage.whenInit,this.storageMainService.applicationSharedStorage.whenInit]).then(()=>{})}getStorage(e){if(e===-1)return this.storageMainService.applicationStorage.storage;if(e===-2)return this.storageMainService.applicationSharedStorage.storage}getLogDetails(e){if(e===-1)return this.userDataProfilesService.defaultProfile.globalStorageHome.with({scheme:q.file}).fsPath;if(e===-2)return this.storageMainService.applicationSharedStorage.path}shouldFlushWhenIdle(){return!1}switch(){throw new Error("Migrating storage is unsupported from main process")}switchToProfile(){throw new Error("Switching storage profile is unsupported from main process")}switchToWorkspace(){throw new Error("Switching storage workspace is unsupported from main process")}hasScope(){throw new Error("Main process is never profile or workspace scoped")}};pw=w([b(0,Bt),b(1,Lie)],pw)});var U8,mw,N8=v(()=>{U8="sandboxHelper",mw=class{constructor(t){this.service=t}listen(t,e){throw new Error("Invalid listen")}call(t,e,n,o){if(e==="checkSandboxDependencies")return this.service.checkSandboxDependencies();throw new Error("Invalid call")}}});import{execFile as Oie}from"child_process";import{readFile as Uie}from"fs/promises";var Nie,gw,F8=v(()=>{fe();ek();Jg();Nie=[{distributionIds:["debian","ubuntu","linuxmint","pop","elementary","kali","raspbian"],commands:[["apt-get","apt-get update && apt-get install -y"],["apt","apt update && apt install -y"]]},{distributionIds:["fedora","rhel","centos","rocky","almalinux"],commands:[["dnf","dnf install -y"],["yum","yum install -y"]]},{distributionIds:["arch","manjaro","endeavouros"],commands:[["pacman","pacman -S --needed --noconfirm"]]},{distributionIds:["suse","opensuse","opensuse-leap","opensuse-tumbleweed"],commands:[["zypper","zypper --non-interactive install"]]},{distributionIds:["alpine"],commands:[["apk","apk add"]]}],gw=class r{static async checkSandboxDependenciesWith(t,e=Ke,n=s=>r._probeBubblewrap(s),o=()=>r._resolveLinuxInstallEnvironment(),i=()=>r._resolveAppArmorRestriction()){if(!e)return;let[s,a]=await Promise.all([t("bwrap"),t("socat")]),l=s?await n(s):{usable:!1},[c,u]=await Promise.all([!s||!a?r._findDependencyInstallCommand(t,o):void 0,s&&!l.usable?i():void 0]);return{bubblewrapInstalled:!!s,bubblewrapUsable:l.usable,bubblewrapError:l.error,socatInstalled:!!a,dependencyInstallCommand:c,...u===void 0?void 0:{apparmorRestrictsUnprivilegedUserNamespaces:u}}}static async _resolveAppArmorRestriction(){let t=await Uie("/proc/sys/kernel/apparmor_restrict_unprivileged_userns","utf8").catch(()=>{});return t===void 0?void 0:t.trim()==="1"}static async _findDependencyInstallCommand(t,e){let n=await e(),o=Nie.find(s=>s.distributionIds.some(a=>n.distributionIds.includes(a)));if(!o)return;let i=n.isRoot?"":await t("sudo")?"sudo ":void 0;if(i!==void 0){for(let[s,a]of o.commands)if(await t(s))return a.split(" && ").map(l=>`${i}${l}`).join(" && ")}}static async _resolveLinuxInstallEnvironment(){let t=await Jb(()=>{});return{distributionIds:[t?.id,...t?.id_like?.split(/\s+/)??[]].filter(e=>!!e),isRoot:process.getuid?.()===0}}checkSandboxDependencies(){return r.checkSandboxDependenciesWith(Qg)}static _probeBubblewrap(t){return new Promise(e=>{Oie(t,["--unshare-net","--dev-bind","/","/","echo","ok"],{encoding:"utf8",timeout:5e3},(n,o,i)=>{if(!n&&o.trim()==="ok"){e({usable:!0});return}let s=i.trim()||n?.message||`Unexpected output: ${o.trim()}`;e({usable:!1,error:s.slice(0,1e3)})})})}}});import*as fw from"fs";import{hostname as Fie,release as Hie}from"os";async function H8(r,t,e,n,o){let i=Yz(process.env);if(i&&!(t["agent-host-port"]||t["agent-host-path"]))throw new Error("GitHub environment hosting requires an explicitly spawned agent host");let s=new sl,a=new J1,l={_serviceBrand:void 0,...Je};s.set(Be,l);let c=new Ss(t,l);s.set(Ut,c),s.set(An,c);let u=new pp(Ng(c),c.logsHome);s.set(Bo,u),a.registerChannel("logger",new fS(u,V=>Ld(V.remoteAuthority)));let p=u.createLogger("remoteagent",{name:d(5123,null)}),m=o.add(new il(p,[new Y1(Ng(c))]));s.set(z,m),setTimeout(()=>Vie(c.logsHome.with({scheme:q.file}).fsPath).then(null,V=>m.error(V)),1e4),o.add(m.onDidChangeLogLevel(V=>MU(m,V,`Log level changed to ${NR(m.getLevel())}`))),m.trace(`Remote configuration data at ${e}`),m.trace("process arguments:",Hb(c.args)),Array.isArray(l.serverGreeting)&&m.info(`
${l.serverGreeting.join(`
`)}
`),a.registerChannel(Bf.ChannelName,new Bf);let g=new Rb(V=>V.clientId==="renderer"),y=o.add(new vs(m));s.set(Le,y),y.registerProvider(q.file,o.add(new bs(m)));let h=new ca(y);s.set(Ye,h);let I=new xu(c.machineSettingsResource,y,new ul,m);s.set(bt,I);let x=new kl(h,c,y,m);s.set(Bt,x),a.registerChannel("userDataProfiles",new vE(x,V=>Ld(V.remoteAuthority))),s.set(QE,new ht(Hm,void 0,!0));let[,,E,T,P]=await Promise.all([I.initialize(),x.init(),z2(m.error.bind(m)),G2(m.error.bind(m)),K2(m.error.bind(m))]),M=new iS;s.set(sS,M);let X=new ml("remote",I,c,m);s.set(ao,X);let N;try{await fw.promises.stat("/run/.containerenv"),N=!0}catch{}if(!N)try{N=(await fw.promises.readFile("/proc/self/cgroup","utf8")).includes("docker")}catch{}let ae=YN,Y=eF(l,I);if(wI(l,c)){!RI(l,c)&&l.telemetryEndpoint&&(ae=new HE(X,Y,Wie,null,()=>new NE(l.telemetryEndpoint,E,N)),o.add(se(()=>ae?.flush())));let V={appenders:[ae,new Wm("",!0,u,c,l)],commonProperties:qN(Hie(),Fie(),process.arch,l.commit,l.version+"-remote",E,T,P,Y,l.date,"remoteAgent"),piiPaths:tF(c),userContentPaths:nF(c)},le=c.args["telemetry-level"],me=3;le==="all"?me=3:le==="error"?me=2:le==="crash"?me=1:le!==void 0&&(me=0),s.set(TS,new ht(kp,[V,me]))}else s.set(TS,kW);s.set(ys,new zm(a,m,l)),s.set(sE,new iw(a)),s.set(So,new ht(yl));let W=a.getChannel("download",g);s.set(qu,new uS(W,()=>Ld("renderer"))),s.set(Cr,new ht(Al)),s.set(sa,new ht(Tl)),s.set(Yu,new ht(vl)),s.set(Br,new ht(Dl)),s.set(xf,new ht(Il)),s.set(JE,new ht(YE)),s.set(XE,new ht(qm));let J=new Zu(s),we=o.add(new Jm(m,c,x,{when:()=>Promise.resolve(),onWillLoadWindow:F.None,onWillShutdown:F.None},y,h));s.set(dp,J.createInstance(Rl));let In=J.createInstance(Lm,{graceTime:c.reconnectionGraceTime,shortGraceTime:c.reconnectionGraceTime>0?Math.min(3e5,c.reconnectionGraceTime):0,scrollback:I.getValue("terminal.integrated.persistentSessionScrollback")??100}),Wt=J.createInstance(Rp,In);s.set(nW,Wt);let de=J.createInstance(yp,{enableAutoShutdown:!!t["enable-remote-auto-shutdown"],shutdownWithoutDelay:!!t["remote-auto-shutdown-without-delay"]},process.exit);s.set(vp,de);let j=t["agent-host-port"],ie=t["agent-host-path"];if(!!(j||ie)){let V=J.createInstance(_d);V.setWebSocketConfig({port:j,socketPath:ie,host:t.host||"localhost",connectionToken:r.type===2?r.value:void 0});let le=o.add(J.createInstance(Md,V,{githubEnvironment:i,onGithubEnvironmentReady:zt=>console.log(`__VSCODE_GITHUB_ENVIRONMENT_READY__:${zt}`),onRestartLimitReached:i?()=>process.exit(1):void 0}));if(i){let zt=()=>{le.shutdown().then(()=>process.exit(0),mo=>{m.error("GitHub environment shutdown failed",mo),process.exit(1)})};process.stdin.once("end",zt),o.add(se(()=>process.stdin.removeListener("end",zt))),process.stdin.resume(),await le.ensureStarted()}let me=j?parseInt(j,10):NaN,dt=Number.isFinite(me)&&me>0,We=t["agent-host-bridge-port"]??(dt?j:void 0),et=t["agent-host-bridge-path"]??ie,lt=t["agent-host-bridge-host"]??t.host??"localhost",Lt=t["agent-host-bridge-connection-token"]??n??((We||et)&&r.type===2?r.value:void 0);if(We||et){let zt=o.add(new Fm(a,{host:lt,port:We,socketPath:et,connectionToken:Lt},m));a.registerChannel("agentHostProxy",zt),m.info(`[AgentHostChannel] Registered IPC channel 'agentHostProxy' (upstream: ${et??`${lt}:${We}`})`)}else a.registerChannel("agentHostProxy",new Nm),m.info("[AgentHostChannel] Registered unavailable IPC channel 'agentHostProxy': no --agent-host-bridge-port / --agent-host-bridge-path set.")}else if(t["agent-host-bridge-port"]||t["agent-host-bridge-path"]||t["agent-host-bridge-host"]||t["agent-host-bridge-connection-token"]||n){let V=t["agent-host-bridge-port"],le=t["agent-host-bridge-path"],me=t["agent-host-bridge-host"]??t.host??"localhost",dt=t["agent-host-bridge-connection-token"]??n;if(V||le){let We=o.add(new Fm(a,{host:me,port:V,socketPath:le,connectionToken:dt},m));a.registerChannel("agentHostProxy",We),m.info(`[AgentHostChannel] Registered IPC channel 'agentHostProxy' (upstream: ${le??`${me}:${V}`})`)}else a.registerChannel("agentHostProxy",new Nm),m.info("[AgentHostChannel] Registered unavailable IPC channel 'agentHostProxy': no --agent-host-bridge-port / --agent-host-bridge-path set.")}else try{let V=Ml(),le=Ee();o.add(se(()=>{process.platform!=="win32"&&fw.promises.unlink(V).catch(()=>{})}));let me=J.createInstance(_d);me.setWebSocketConfig({socketPath:V,connectionToken:le});let dt=o.add(J.createInstance(Md,me,{startMode:"lazy"})),We=o.add(new Fm(a,async et=>((et?.env||et?.debugEnv)&&me.setEnvironment(et.env??{},et.debugEnv),await dt.ensureStarted(),{socketPath:V,connectionToken:le}),m));a.registerChannel("agentHostProxy",We),m.info(`[AgentHostChannel] Registered lazy IPC channel 'agentHostProxy' (upstream: ${V})`)}catch(V){a.registerChannel("agentHostProxy",new Nm),m.error("[AgentHostChannel] Failed to register IPC channel 'agentHostProxy'",V)}return s.set(dr,new ht(Km)),s.set(Ji,new ht(Sd)),s.set(ka,new ht(Gm)),s.set(vy,new ht(ew)),J.invokeFunction(V=>{let le=V.get(vy),me=V.get(xf),dt=V.get(sa),We=V.get(So),et=V.get(dp),lt=new xS(r,c,x,M,m);a.registerChannel("remoteextensionsenvironment",lt);let Lt=new RS(V.get(TS),ae);a.registerChannel("telemetry",Lt),a.registerChannel(U8,new mw(new gw)),a.registerChannel(B$,new OE(c,m,Wt,l,me,I));let zt=new WE(J.createInstance(wl,l.extensionsForceVersionByQuality??[],m),c,x,dt,m,We,et,me);a.registerChannel(tz,new VE(zt,Ro=>Ld(Ro.remoteAuthority))),a.registerChannel(r8,J.createInstance(Vm,Ro=>Ld(Ro.remoteAuthority))),a.registerChannel(l8,J.createInstance($m,a));let mo=o.add(new wS(m,c,I));a.registerChannel(z$,mo),a.registerChannel("request",new gS(V.get(ao)));let Zi=new mS(me,Ro=>Ld(Ro.remoteAuthority));a.registerChannel("extensions",Zi),a.registerChannel("mcpManagement",new yE(le,Ro=>Ld(Ro.remoteAuthority)));let Ua=Er.fromService(V.get(dp),o);return a.registerChannel("languagePacks",Ua),a.registerChannel("storage",o.add(new dw(m,we))),zt.whenExtensionsReady().then(()=>me.cleanUp()),o.add(new Kf(V.get(Mt))),{telemetryService:V.get(Mt)}}),{socketServer:a,instantiationService:J}}function Ld(r){return j1[r]||(j1[r]=xs(r)),j1[r]}function Ls(){let r=new Date;return`${Q1(r.getHours())}:${Q1(r.getMinutes())}:${Q1(r.getSeconds())}`}function Q1(r){return r<10?`0${r}`:String(r)}async function Vie(r){let t=Ze(r),e=It(r);if(!await Ce.exists(e))return;let i=(await Ce.readdir(e)).filter(a=>/^\d{8}T\d{6}$/.test(a)).sort().filter(a=>a!==t),s=i.slice(0,Math.max(0,i.length-9));await Promise.all(s.map(a=>Ce.rm($(e,a))))}var Wie,j1,J1,Y1,W8=v(()=>{ue();Q();Me();Oe();Vt();xk();vo();la();Cl();gp();dn();dT();j2();rb();Q2();Dn();lP();_o();sb();VP();X2();IP();st();wP();kf();Hg();SP();Gv();Wb();BP();De();ai();Wn();Ui();Z2();CT();TT();_n();Wr();tW();Ol();IW();co();qP();EW();RW();TW();AW();N$();Tp();Vf();zc();q$();G$();pk();Ju();zP();Hc();xo();K$();bu();Y$();QP();Kb();jP();$v();hS();ee();ez();nz();AM();oz();Uz();Qz();Xz();e8();Kl();dS();_1();YP();o8();M1();i8();a8();L1();p8();m8();Lc();g8();Jl();f8();b8();xy();kM();P8();hy();k8();D8();O8();N8();F8();Wie="monacoworkbench";j1=Object.create(null);J1=class extends Tf{constructor(){let t=new R;super(t.event),this._onDidConnectEmitter=t}acceptConnection(t,e){this._onDidConnectEmitter.fire({protocol:t,onDidClientDisconnect:e})}},Y1=class extends wc{constructor(t=Ug){super(),this.setLevel(t),this.useColors=!!process.stdout.isTTY}trace(t,...e){this.canLog(1)&&(this.useColors?console.log(`\x1B[90m[${Ls()}]\x1B[0m`,t,...e):console.log(`[${Ls()}]`,t,...e))}debug(t,...e){this.canLog(2)&&(this.useColors?console.log(`\x1B[90m[${Ls()}]\x1B[0m`,t,...e):console.log(`[${Ls()}]`,t,...e))}info(t,...e){this.canLog(3)&&(this.useColors?console.log(`\x1B[90m[${Ls()}]\x1B[0m`,t,...e):console.log(`[${Ls()}]`,t,...e))}warn(t,...e){this.canLog(4)&&(this.useColors?console.warn(`\x1B[93m[${Ls()}]\x1B[0m`,t,...e):console.warn(`[${Ls()}]`,t,...e))}error(t,...e){this.canLog(5)&&(this.useColors?console.error(`\x1B[91m[${Ls()}]\x1B[0m`,t,...e):console.error(`[${Ls()}]`,t,...e))}flush(){}}});import{createReadStream as Bie,promises as Ky}from"fs";import*as jy from"cookie";import*as yw from"crypto";async function pr(r,t,e,n){t.writeHead(e,{"Content-Type":"text/plain"}),t.end(n)}async function e0(r,t,e,n,o,i){try{let s=await Ky.stat(r);if(t===1){let l=`W/"${[s.ino,s.size,s.mtime.getTime()].join("-")}"`;if(i.Etag=l,n.headers["if-none-match"]===l)return o.writeHead(304,i),void o.end()}else t===2?i["Cache-Control"]="public, max-age=31536000":t===0&&(i["Cache-Control"]="no-store");i["Content-Type"]=qie[ki(r)]||Fk(r)||"text/plain";let a=Bie(r);await new Promise((l,c)=>{a.on("error",c),a.on("open",()=>{o.writeHead(200,i),a.pipe(o),o.once("close",()=>a.destroy()),a.on("end",l),a.removeAllListeners("error"),a.on("error",u=>{e.error(u),console.error(u.toString()),o.destroy()})})})}catch(s){return s.code!=="ENOENT"?(e.error(s),console.error(s.toString())):console.error(`File not found: ${r}`),o.writeHead(404,{"Content-Type":"text/plain"}),void o.end("Not found")}}function zie(r,t){return r.replace(/\{\{([^}]+)\}\}/g,(e,n)=>wv(t[n]??"undefined"))}function Gie(r){return r.startsWith("/")&&!r.startsWith("//")&&!/[?#\\]|[\u0000-\u001F\u007F]/.test(r)}function Kie(){return yw.randomBytes(16).toString("base64url")}function jie(r,t,e,n){return`${r}${t}/${e}/${encodeURIComponent(n)}/nls.messages.js`}function Qie(r,t,e,n){return["default-src 'self';","img-src 'self' https: data: blob:;","media-src 'self';",`script-src 'self' 'unsafe-eval' ${t??""} blob: 'nonce-${r}' '${$ie}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ;`,"child-src 'self';","frame-src 'self' https://*.vscode-cdn.net data:;","worker-src 'self' data: blob:;","style-src 'self' 'unsafe-inline';","connect-src 'self' ws: wss: https:;","font-src 'self' blob:;","manifest-src 'self';"].join(" ")}var qie,X1,hw,V8,Z1,$ie,Ym,q8,Jie,Yie,B8,$8=v(()=>{si();Kc();fe();De();zc();Oe();Me();Vt();Wn();Vf();Ui();Jt();te();Ve();Ie();$b();ii();_1();Tt();qie={".html":"text/html",".js":"text/javascript",".json":"application/json",".css":"text/css",".svg":"image/svg+xml"};X1=It(Pt.asFileUri("").fsPath),hw="/static",V8="/callback",Z1="/web-extension-resource",$ie="sha256-gfjiOVjAlxqrivZAfTq2d83mOaz0fnAxbGaFpj5IjD8=";Ym=class{constructor(t,e,n,o,i,s,a,l){this._connectionToken=t;this._basePath=e;this._productPath=n;this._environmentService=o;this._logService=i;this._requestService=s;this._productService=a;this._cssDevService=l;this._webExtensionResourceUrlTemplate=this._productService.extensionsGallery?.resourceUrlTemplate?S.parse(this._productService.extensionsGallery.resourceUrlTemplate):void 0}async handle(t,e,n,o){try{return o.startsWith(hw)&&o.charCodeAt(hw.length)===47?this._handleStatic(t,e,o.substring(hw.length)):o==="/"?this._handleRoot(t,e,n):o===V8?this._handleCallback(e):o.startsWith(Z1)&&o.charCodeAt(Z1.length)===47?this._handleWebExtensionResource(t,e,o.substring(Z1.length)):pr(t,e,404,"Not found.")}catch(i){return this._logService.error(i),console.error(i.toString()),pr(t,e,500,"Internal Server Error.")}}async _handleStatic(t,e,n){let o=Object.create(null),i=decodeURIComponent(n),s=$(X1,i);return tr(s,X1,!Ke)?e0(s,this._environmentService.isBuilt?2:1,this._logService,t,e,o):pr(t,e,400,"Bad request.")}_getResourceURLTemplateAuthority(t){let e=t.authority.indexOf(".");return e!==-1?t.authority.substring(e+1):void 0}async _handleWebExtensionResource(t,e,n){if(!this._webExtensionResourceUrlTemplate)return pr(t,e,500,"No extension gallery service configured.");let o=decodeURIComponent(n),i=Fn(o),s=S.parse(i).with({scheme:this._webExtensionResourceUrlTemplate.scheme,authority:i.substring(0,i.indexOf("/")),path:i.substring(i.indexOf("/")+1)});if(this._getResourceURLTemplateAuthority(this._webExtensionResourceUrlTemplate)!==this._getResourceURLTemplateAuthority(s))return pr(t,e,403,"Request Forbidden");let a={},l=y=>{let h=t.headers[y];h&&(G(h)||h[0])?a[y]=G(h)?h:h[0]:y!==y.toLowerCase()&&l(y.toLowerCase())};l("X-Client-Name"),l("X-Client-Version"),l("X-Machine-Id"),l("X-Client-Commit");let c=await this._requestService.request({type:"GET",url:s.toString(!0),headers:a,callSite:"webClientServer.fetchAndWriteFile"},Ae.None),u=c.res.statusCode||500;if(u!==200){let y=null;try{y=await ds(c)}catch{}return pr(t,e,u,y||`Request failed with status ${u}`)}let p=Object.create(null),m=y=>{let h=c.res.headers[y];h?p[y]=h:y!==y.toLowerCase()&&m(y.toLowerCase())};m("Cache-Control"),m("Content-Type"),e.writeHead(200,p);let g=await Ir(c.stream);e.end(g.buffer)}async _handleRoot(t,e,n){let o=K=>{let V=t.headers[K];return Array.isArray(V)?V[0]:V},i=Jie(B8(t)),s=Yie(B8(t)),a=o("x-forwarded-prefix"),l=s||(a&&Gie(a)?a:this._basePath),c=n.searchParams.getAll(is);if(c.length===1){let K=c[0],V=Object.create(null);V["Set-Cookie"]=jy.serialize(bg,K,{sameSite:"lax",maxAge:3600*24*7});let le=new URLSearchParams(n.searchParams);le.delete(is);let me=le.toString(),dt=me?`${l}?${me}`:l;return V.Location=dt,e.writeHead(302,V),void e.end()}let u=(K,V)=>{let le=K?.indexOf(":");return le!==-1&&(K=K?.substring(0,le)),K+=`:${V}`,K},p=!this._environmentService.isBuilt&&!!this._environmentService.args["use-test-resolver"],m=p?"test+test":"remote";if(!m)return pr(t,e,400,"Bad request.");let g=o("x-forwarded-port");g&&(m=u(m,g));function y(K){return JSON.stringify(K)}let h;this._environmentService.args["enable-smoke-test-driver"]&&(h=!1),this._logService.getLevel()===1&&(["x-original-host","x-forwarded-host","x-forwarded-port","host"].forEach(K=>{let V=o(K);V&&this._logService.trace(`[WebClientServer] ${K}: ${V}`)}),this._logService.trace(`[WebClientServer] Request URL: ${t.url}, basePath: ${l}, remoteAuthority: ${m}`));let I=ze.join(l,this._productPath,hw),x=ze.join(l,this._productPath,V8),E=K=>K&&S.file(Sn(K)).with({scheme:q.vscodeRemote,authority:m}),T=Pt.asFileUri(`vs/code/browser/workbench/workbench${this._environmentService.isBuilt?"":"-dev"}.html`).fsPath,P=!this._environmentService.isBuilt&&this._environmentService.args["github-auth"]?{id:Ee(),providerId:"github",accessToken:this._environmentService.args["github-auth"],scopes:[["user:email"],["repo"]]}:void 0,M=[];this._environmentService.args["link-protection-trusted-domains"]&&M.push(...this._environmentService.args["link-protection-trusted-domains"]),this._productService.linkProtectionTrustedDomains&&M.push(...this._productService.linkProtectionTrustedDomains);let X=this._environmentService.args["app-name"],N={codeServerVersion:this._productService.codeServerVersion,nameShort:X,nameLong:X,rootEndpoint:i,updateEndpoint:this._environmentService.args["disable-update-check"]?void 0:i+"/update/check",logoutEndpoint:this._environmentService.args.auth&&this._environmentService.args.auth!=="none"?i+"/logout":void 0,proxyEndpointTemplate:process.env.VSCODE_PROXY_URI??i+"/proxy/{{port}}/",serviceWorker:{scope:s+"/",path:i+"/_static/out/browser/serviceWorker.js"},enableTelemetry:this._productService.enableTelemetry,telemetryEndpoint:this._productService.telemetryEndpoint,embedderIdentifier:"server-distro",voiceWsUrl:this._productService.voiceWsUrl,extensionsGallery:this._productService.extensionsGallery,linkProtectionTrustedDomains:M};if(!this._environmentService.isBuilt)try{let K=JSON.parse((await Ky.readFile($(X1,"product.overrides.json"))).toString());Object.assign(N,K)}catch{}let ae={remoteAuthority:m,serverBasePath:l,webviewEndpoint:I+"/out/vs/workbench/contrib/webview/browser/pre",userDataPath:this._environmentService.userDataPath,isEnabledFileDownloads:!this._environmentService.args["disable-file-downloads"],isEnabledFileUploads:!this._environmentService.args["disable-file-uploads"],isEnabledFileCache:!this._environmentService.args["disable-file-cache"],isEnabledCoderGettingStarted:!this._environmentService.args["disable-getting-started-override"],_wrapWebWorkerExtHostInIframe:h,developmentOptions:{enableSmokeTestDriver:this._environmentService.args["enable-smoke-test-driver"]?!0:void 0,logLevel:this._logService.getLevel()},settingsSyncOptions:!this._environmentService.isBuilt&&this._environmentService.args["enable-sync"]?{enabled:!0}:void 0,enableWorkspaceTrust:!this._environmentService.args["disable-workspace-trust"],enabledExtensionProposedApi:this._environmentService.args["enable-proposed-api"],folderUri:E(this._environmentService.args["default-folder"]),workspaceUri:E(this._environmentService.args["default-workspace"]),productConfiguration:N,callbackRoute:x,remoteStorageEnabled:this._environmentService.args["enable-remote-storage"]?!0:void 0},Y=jy.parse(t.headers.cookie||""),W=this._environmentService.args.locale||await c2(this._environmentService.argvResource.fsPath)||Y["vscode.nls.locale"]||t.headers["accept-language"]?.split(",")[0]?.toLowerCase()||"en",J,we;if(!W.startsWith("en")&&this._productService.nlsCoreBaseUrl)J=this._productService.nlsCoreBaseUrl,we=jie(J,this._productService.commit,this._productService.version,W);else try{let K=await d2(W,this._environmentService.userDataPath);we=K?`${s}/vscode-remote-resource?path=${encodeURIComponent(K)}`:""}catch(K){console.error("Failed to generate translations",K),we=""}let In=Kie(),Wt={WORKBENCH_WEB_CONFIGURATION:y(ae),WORKBENCH_AUTH_SESSION:P?y(P):"",WORKBENCH_WEB_BASE_URL:I,WORKBENCH_NLS_URL:we,WORKBENCH_NLS_FALLBACK_URL:`${I}/out/nls.messages.js`,WORKBENCH_SCRIPT_NONCE:In,BASE:i,VS_BASE:l};if(this._cssDevService.isEnabled){let K=await this._cssDevService.getCssModules();Wt.WORKBENCH_DEV_CSS_MODULES=JSON.stringify(K)}if(p){let K=[];for(let V of["vscode-test-resolver","github-authentication"]){let le=JSON.parse((await Ky.readFile(Pt.asFileUri(`${zO}/${V}/package.json`).fsPath)).toString());K.push({extensionPath:V,packageJSON:le})}Wt.WORKBENCH_BUILTIN_EXTENSIONS=y(K)}let de;try{let K=(await Ky.readFile(T)).toString();de=zie(K,Wt)}catch{return e.writeHead(404,{"Content-Type":"text/plain"}),void e.end("Not found")}let ie={"Content-Type":"text/html","Content-Security-Policy":Qie(In,J,m,p)};return this._connectionToken.type!==0&&(ie["Set-Cookie"]=jy.serialize(bg,this._connectionToken.value,{sameSite:"lax",maxAge:3600*24*7})),e.writeHead(200,ie),void e.end(de)}_getScriptCspHashes(t){let e=/<script>([\s\S]+?)<\/script>/img,n=[],o;for(;o=e.exec(t);){let i=yw.createHash("sha256"),s=o[1].replace(/\r\n/g,`
`),a=i.update(Buffer.from(s)).digest().toString("base64");n.push(`'sha256-${a}'`)}return n}async _handleCallback(t){let e=Pt.asFileUri("vs/code/browser/workbench/callback.html").fsPath,n=(await Ky.readFile(e)).toString(),o=["default-src 'self';","img-src 'self' https: data: blob:;","media-src 'none';",`script-src 'self' ${this._getScriptCspHashes(n).join(" ")};`,"style-src 'self' 'unsafe-inline';","font-src 'self' blob:;"].join(" ");return t.writeHead(200,{"Content-Type":"text/html","Content-Security-Policy":o}),void t.end(n)}};Ym=w([b(3,El),b(4,z),b(5,ao),b(6,Be),b(7,QE)],Ym);q8=(r,t=!1)=>r.replace(/\/\/+/g,"/").replace(/\/+$/,t?"/":""),Jie=r=>{let t=(r.split("?",1)[0].match(/\//g)||[]).length;return q8("./"+(t>1?"../".repeat(t-1):""))},Yie=r=>{let t=r.split("?",1)[0].split("/");return q8("./"+t[t.length-1])},B8=r=>r.originalUrl||r.url});import*as Qy from"fs";import*as G8 from"net";import{createRequire as Xie}from"node:module";import{performance as Zie}from"perf_hooks";function z8(r){try{return r.startsWith("/")?new URL(`http://localhost${r}`):new URL(r)}catch{return}}async function K8(r,t,e,n){let o=await H2(t);o instanceof pa&&(console.warn(o.message),process.exit(1));function i(T){mv(P=>{gv(P)&&P.stack&&/unexpectedErrorHandler/.test(P.stack)||T(P)})}let s=[];i(T=>{s.push(T),console.error(T)});let a=!1;process.on("SIGPIPE",()=>{a||(a=!0,pt(new Error("Unexpected SIGPIPE")))});let l=new re,{socketServer:c,instantiationService:u}=await H8(o,t,e,n,l);u.invokeFunction(T=>{let P=T.get(z);s.forEach(M=>P.error(M)),s.length=0,i(M=>P.error(M))}),u.invokeFunction(T=>{let P=T.get(bt);oe&&(P.getValue("security.restrictUNCAccess")===!1?Qb():Nf(P.getValue("security.allowedUNCHosts")))}),u.invokeFunction(T=>{let P=T.get(z);if(oe&&process.env.HOMEDRIVE&&process.env.HOMEPATH){let M=$(process.env.HOMEDRIVE,"node_modules"),X=It($(process.env.HOMEDRIVE,process.env.HOMEPATH)),N=$(X,"node_modules");if(Qy.existsSync(M)||Qy.existsSync(N)){let ae=`
*
* !!!! Server terminated due to presence of CVE-2020-1416 !!!!
*
* Please remove the following directories and re-try
* ${M}
* ${N}
*
* For more information on the vulnerability https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1416
*
`;P.warn(ae),console.warn(ae),process.exit(0)}}});let p=u.invokeFunction(T=>{let P=T.get(z);if(Qy.existsSync($(Pt.asFileUri("").fsPath,"../node_modules/vsda")))try{return ese("vsda")}catch(X){P.error(X)}return null}),m=t["server-base-path"];m&&!m.startsWith("/")&&(m=`/${m}`);let g=Qy.existsSync(Pt.asFileUri("vs/code/browser/workbench/workbench.html").fsPath);if(g&&r&&typeof r!="string"){let T=o.type!==0?`?${is}=${o.value}`:"";console.log(`Web UI available at http://localhost${r.port===80?"":`:${r.port}`}${m??""}${T}`)}let y=u.createInstance(Jy,c,o,p,g,m);qt("code/server/ready");let h=Zie.now(),I=global.vscodeServerStartTime,x=global.vscodeServerListenTime,E=global.vscodeServerCodeLoadedTime;if(u.invokeFunction(async T=>{let P=T.get(Mt);if(P.publicLog2("serverStart",{startTime:I,startedTime:x,codeLoadedTime:E,readyTime:h}),Ke){let M=T.get(z),X=await Jb(M.error.bind(M));X&&P.publicLog2("serverPlatformInfo",{platformId:X.id,platformVersionId:X.version_id,platformIdLike:X.id_like})}}),t["print-startup-performance"]){let T="";T+=`Start-up time: ${x-I}
`,T+=`Code loading time: ${E-I}
`,T+=`Initialized time: ${h-I}
`,T+=`
`,console.log(T)}return y}var ese,Jy,t0,j8=v(()=>{Ve();ii();xe();si();Q();Me();Oe();Xr();fe();Tt();te();Vt();ek();S2();JP();Cl();gp();dn();Z();De();Wn();M2();_n();hk();N2();Vf();zc();dS();B2();W8();$8();ese=Xie(import.meta.url);Jy=class extends D{constructor(e,n,o,i,s,a,l,c,u,p){super();this._socketServer=e;this._connectionToken=n;this._vsdaMod=o;this._environmentService=a;this._productService=l;this._logService=c;this._instantiationService=u;this._serverLifetimeService=p;this._extHostLifetimeTokens=this._register(new Wo);this._webEndpointOriginChecker=t0.create(this._productService),s!==void 0&&s.charCodeAt(s.length-1)===47&&(s=s.substring(0,s.length-1)),this._serverBasePath=s,this._serverProductPath=`/${mR(l)}`,this._extHostConnections=Object.create(null),this._managementConnections=Object.create(null),this._allReconnectionTokens=new Set,this._webClientServer=i?this._instantiationService.createInstance(Ym,this._connectionToken,s??"/",this._serverProductPath):null,this._logService.info("Extension host agent started."),this._reconnectionGraceTime=this._environmentService.reconnectionGraceTime}async handleRequest(e,n){if(e.method!=="GET")return pr(e,n,405,`Unsupported method ${e.method}`);if(!e.url)return pr(e,n,400,"Bad request.");let o=z8(e.url);if(!o)return pr(e,n,400,"Bad request.");let i=o.pathname;if(!i)return pr(e,n,400,"Bad request.");if(this._serverBasePath!==void 0&&i.startsWith(this._serverBasePath)&&(i=i.substring(this._serverBasePath.length)||"/"),i.startsWith(this._serverProductPath)&&i.charCodeAt(this._serverProductPath.length)===47&&(i=i.substring(this._serverProductPath.length)),i==="/version")return n.writeHead(200,{"Content-Type":"text/plain"}),void n.end(this._productService.commit||"");if(i==="/delay-shutdown")return this._serverLifetimeService.delay(),n.writeHead(200),void n.end("OK");if(!W2(this._connectionToken,e,o.searchParams))return pr(e,n,403,"Forbidden.");if(i==="/vscode-remote-resource"){let s=o.searchParams.getAll("path");if(s.length!==1)return pr(e,n,400,"Bad request.");let a=s[0],l;try{l=S.from({scheme:q.file,path:a}).fsPath}catch{return pr(e,n,400,"Bad request.")}let c=e.headers.origin,u=V2(c,g=>this._webEndpointOriginChecker.matches(g)),p=tr(l,this._environmentService.builtinExtensionsPath,!Ke)||tr(l,this._environmentService.extensionsPath,!Ke);this._environmentService.isBuilt&&p&&(u["Cache-Control"]="public, max-age=31536000");let m=this._environmentService.args["disable-file-cache"]&&!p?0:1;return e0(l,m,this._logService,e,n,u)}if(this._webClientServer){this._webClientServer.handle(e,n,o,i);return}return n.writeHead(404,{"Content-Type":"text/plain"}),void n.end("Not found")}handleUpgrade(e,n){let o=Ee(),i=!1,s=!1;if(e.url){let l=z8(e.url);if(!l){this._logService.warn("WebSocket connection rejected: invalid request URL"),n.end(`HTTP/1.1 400 Bad Request\r
Connection: close\r
\r
`);return}let c=l.searchParams,u=c.getAll("reconnectionToken");u.length===1&&(o=u[0]),c.getAll("reconnection").length===1&&c.get("reconnection")==="true"&&(i=!0),c.getAll("skipWebSocketFrames").length===1&&c.get("skipWebSocketFrames")==="true"&&(s=!0)}let a=A2(e,n,{debugLabel:`server-connection-${o}`,skipWebSocketFrames:s,disableWebSocketCompression:this._environmentService.args["disable-websocket-compression"]});a&&this._handleWebSocketConnection(a,i,o)}handleServerError(e){this._logService.error("Error occurred in server"),this._logService.error(e)}_getRemoteAddress(e){let n;return e instanceof da?n=e.socket:n=e.socket.socket,n.remoteAddress||"<unknown>"}async _rejectWebSocketConnection(e,n,o){let i=n.getSocket();this._logService.error(`${e} ${o}.`);let s={type:"error",reason:o};n.sendControl(O.fromString(JSON.stringify(s))),n.dispose(),await i.drain(),i.dispose()}_handleWebSocketConnection(e,n,o){let i=this._getRemoteAddress(e),s=`[${i}][${o.substr(0,8)}]`,a=new _f({socket:e}),l=this._vsdaMod?new this._vsdaMod.validator:null,c=this._vsdaMod?new this._vsdaMod.signer:null,u;(E=>(E[E.WaitingForAuth=0]="WaitingForAuth",E[E.WaitingForConnectionType=1]="WaitingForConnectionType",E[E.Done=2]="Done",E[E.Error=3]="Error"))(u||={});let p=0,m=y=>{p=3,g.dispose(),this._rejectWebSocketConnection(s,a,y)},g=a.onControlMessage(y=>{if(p===0){let h;try{h=JSON.parse(y.toString())}catch{return m("Malformed first message")}if(h.type!=="auth")return m("Invalid first message");if(this._connectionToken.type===2&&!this._connectionToken.validate(h.auth))return m("Unauthorized client refused: auth mismatch");let I=Ee();if(c)try{I=c.sign(h.data)}catch{}let x=Ee();if(l)try{x=l.createNewMessage(x)}catch{}let E={type:"sign",data:x,signedData:I};a.sendControl(O.fromString(JSON.stringify(E))),p=1}else if(p===1){let h;try{h=JSON.parse(y.toString())}catch{return m("Malformed second message")}if(h.type!=="connectionType")return m("Invalid second message");if(typeof h.signedData!="string")return m("Invalid second message field type");let I=h.commit,x=this._productService.commit;if(I&&x&&I!==x)return m("Client refused: version mismatch");let E=!1;if(!l)E=!0;else if(this._connectionToken.validate(h.signedData))E=!0;else try{E=l.validate(h.signedData)==="ok"}catch{}if(!E){if(this._environmentService.isBuilt)return m("Unauthorized client refused");this._logService.error(`${s} Unauthorized client handshake failed but we proceed because of dev mode.`)}for(let T in this._managementConnections)this._managementConnections[T].shortenReconnectionGraceTimeIfNecessary();for(let T in this._extHostConnections)this._extHostConnections[T].shortenReconnectionGraceTimeIfNecessary();p=2,g.dispose(),this._handleConnectionType(i,s,a,e,n,o,h)}})}async _handleConnectionType(e,n,o,i,s,a,l){let c=l.desiredConnectionType===1?`${n}[ManagementConnection]`:l.desiredConnectionType===2?`${n}[ExtensionHostConnection]`:n;if(l.desiredConnectionType===1)if(i instanceof ua&&i.setRecordInflateBytes(!1),s){if(!this._managementConnections[a])return this._allReconnectionTokens.has(a)?this._rejectWebSocketConnection(c,o,"Unknown reconnection token (seen before)"):this._rejectWebSocketConnection(c,o,"Unknown reconnection token (never seen)");o.sendControl(O.fromString(JSON.stringify({type:"ok"})));let u=o.readEntireBuffer();o.dispose(),this._managementConnections[a].acceptReconnection(e,i,u)}else{if(this._managementConnections[a])return this._rejectWebSocketConnection(c,o,"Duplicate reconnection token");o.sendControl(O.fromString(JSON.stringify({type:"ok"})));let u=new cS(this._logService,a,e,o,this._reconnectionGraceTime);this._socketServer.acceptConnection(u.protocol,u.onClose),this._managementConnections[a]=u,this._allReconnectionTokens.add(a),u.onClose(()=>{delete this._managementConnections[a]})}else if(l.desiredConnectionType===2){let u=l.args||{language:"en"},p=await this._updateWithFreeDebugPort(u);if(p.port&&this._logService.trace(`${c} - startParams debug port ${p.port}`),this._logService.trace(`${c} - startParams language: ${p.language}`),this._logService.trace(`${c} - startParams env: ${JSON.stringify(p.env)}`),s){if(!this._extHostConnections[a])return this._allReconnectionTokens.has(a)?this._rejectWebSocketConnection(c,o,"Unknown reconnection token (seen before)"):this._rejectWebSocketConnection(c,o,"Unknown reconnection token (never seen)");o.sendPause(),o.sendControl(O.fromString(JSON.stringify(p.port?{debugPort:p.port}:{})));let m=o.readEntireBuffer();o.dispose(),this._extHostConnections[a].acceptReconnection(e,i,m)}else{if(this._extHostConnections[a])return this._rejectWebSocketConnection(c,o,"Duplicate reconnection token");o.sendPause(),o.sendControl(O.fromString(JSON.stringify(p.port?{debugPort:p.port}:{})));let m=o.readEntireBuffer();o.dispose();let g=this._instantiationService.createInstance(hp,a,e,i,m);this._extHostConnections[a]=g,this._allReconnectionTokens.add(a),this._extHostLifetimeTokens.set(a,this._serverLifetimeService.active(`ExtensionHost:${a.substring(0,8)}`)),g.onClose(()=>{g.dispose(),delete this._extHostConnections[a],this._extHostLifetimeTokens.deleteAndDispose(a)}),g.start(p).catch(y=>{this._logService.error(`${c} Failed to start extension host connection:`,y)})}}else if(l.desiredConnectionType===3){i instanceof ua&&i.setRecordInflateBytes(!1);let u=l.args;this._createTunnel(o,u)}else return this._rejectWebSocketConnection(c,o,"Unknown initial data received")}async _createTunnel(e,n){let o;try{o=await this._connectTunnelSocket(n.host,n.port)}catch(c){this._logService.error(`[remote-connection] Failed to connect tunnel to ${n.host}:${n.port}:`,c);let p={type:"error",reason:c instanceof Error?c.message:String(c)};e.sendControl(O.fromString(JSON.stringify(p)));let m=e.getSocket();e.dispose(),await m.drain(),m.dispose();return}let i={type:"ok"};e.sendControl(O.fromString(JSON.stringify(i)));let s=e.getSocket(),a=s.socket,l=e.readEntireBuffer();e.dispose(),s.dispose(!1),l.byteLength>0&&o.write(l.buffer),o.on("end",()=>a.end()),o.on("close",()=>a.end()),o.on("error",()=>a.destroy()),a.on("end",()=>o.end()),a.on("close",()=>o.end()),a.on("error",()=>o.destroy()),o.pipe(a),a.pipe(o)}_connectTunnelSocket(e,n){return new Promise((o,i)=>{let s=G8.createConnection({host:e,port:n,autoSelectFamily:!0},()=>{s.removeListener("error",i),s.pause(),o(s)});s.once("error",i)})}_updateWithFreeDebugPort(e){return typeof e.port=="number"?b2(e.port,10,5e3).then(n=>(e.port=n,e)):(e.debugId=void 0,e.port=void 0,e.break=void 0,Promise.resolve(e))}};Jy=w([b(5,El),b(6,Be),b(7,z),b(8,Hn),b(9,vp)],Jy);t0=class r{constructor(t){this._originRegExp=t}static create(t){let e=t.webEndpointUrlTemplate,n=t.commit,o=t.quality;if(!e||!n||!o)return new r(null);let i=Ee(),a=new URL(e.replace("{{uuid}}",i).replace("{{commit}}",n).replace("{{quality}}",o)).origin,l=yo(a).replace(i,"[a-zA-Z0-9\\-]+");try{let c=AO(`^${l}$`,!0,{matchCase:!1});return new r(c)}catch{return new r(null)}}matches(t){return this._originRegExp?this._originRegExp.test(t):!1}}});var X8={};c0(X8,{createServer:()=>rse,spawnCli:()=>ose});import*as Q8 from"os";import*as vw from"fs";import{performance as tse}from"perf_hooks";function J8(){return SI(process.argv.slice(2),WP,nse)}function Y8(r){let t=r["server-data-dir"]||r["user-data-dir"]||process.env.VSCODE_AGENT_FOLDER||$(Q8.homedir(),Je.serverDataFolderName||".vscode-remote"),e=r["user-data-dir"]||$(t,"data"),n=$(e,"User"),o=$(n,"globalStorage"),i=$(n,"History"),s=$(e,"Machine");r["user-data-dir"]=e;let a=It(Pt.asFileUri("").fsPath),l=r["builtin-extensions-dir"]||$(a,"extensions");return r["builtin-extensions-dir"]=l,r["extensions-dir"]=r["extensions-dir"]||$(t,"extensions"),[t,r["extensions-dir"],e,n,s,o,i].forEach(c=>{try{vw.existsSync(c)||vw.mkdirSync(c,{mode:448,recursive:!0})}catch(u){console.error(u)}}),t}function ose(r=J8()){return y2(r,Y8(r),WP)}function rse(r,t=J8()){let e=process.env[HP];return delete process.env[HP],K8(r,t,Y8(t),e)}var nse,Z8=v(()=>{Me();v2();j8();Yg();Oe();zc();ai();Xr();qt("code/server/codeLoaded");global.vscodeServerCodeLoadedTime=tse.now();nse={onMultipleValues:(r,t)=>{console.error(`Option '${r}' can only be defined once. Using value ${t}.`)},onEmptyValue:r=>{console.error(`Ignoring option '${r}': Value must not be empty.`)},onUnknownOption:r=>{console.error(`Ignoring option '${r}': not supported for server.`)},onDeprecatedOption:(r,t)=>{console.warn(`Option '${r}' is deprecated: ${t}`)}}});delete process.env.ELECTRON_RUN_AS_NODE;var n6=d0(ww(),1);import*as o0 from"node:path";import*as bw from"node:fs";import*as r0 from"node:http";import*as Xm from"node:os";import*as e6 from"node:readline";import{performance as t6}from"node:perf_hooks";import*as es from"node:path";import{Buffer as p6}from"node:buffer";import{createRequire as m6}from"node:module";var Rw=m6(import.meta.url),g0=process.platform==="win32";process.platform==="linux"&&(p6.poolSize=8*1024);Error.stackTraceLimit=100;if(!process.env.VSCODE_HANDLES_SIGPIPE){let r=!1;process.on("SIGPIPE",()=>{r||(r=!0,console.error(new Error("Unexpected SIGPIPE")))})}function g6(){try{typeof process.env.VSCODE_CWD!="string"&&(process.env.VSCODE_CWD=process.cwd()),process.platform==="win32"&&process.chdir(es.dirname(process.execPath))}catch(r){console.error(r)}}g6();function f6(){if(!process.env.ELECTRON_RUN_AS_NODE&&!process.versions.electron||process.env.VSCODE_DEV)return;let r=o=>{if(g0&&o.length>=2&&o.charCodeAt(1)===58){let i=o.charCodeAt(0);if(i>=65&&i<=90||i>=97&&i<=122)return o[0].toLowerCase()+o.slice(1)}return o},t=r(es.join(import.meta.dirname,"../node_modules")),e=Rw("node:module"),n=e._resolveLookupPaths;e._resolveLookupPaths=function(o,i){let s=n(o,i);if(Array.isArray(s)){for(let a=0,l=s.length;a<l;a++)if(r(s[a])===t){s.splice(a,0,`${s[a]}.asar`);break}}return s}}f6();function f0(r){if(!process.env.VSCODE_DEV)return;if(!r)throw new Error("Missing injectPath");Rw("node:module").register("./bootstrap-import.js",{parentURL:import.meta.url,data:r})}function h0(){if(typeof process?.versions?.electron=="string")return;let r=Rw("module"),t=r.globalPaths,e=r._resolveLookupPaths;r._resolveLookupPaths=function(o,i){let s=e(o,i);if(Array.isArray(s)){let a=0;for(;a<s.length&&s[s.length-1-a]===t[t.length-1-a];)a++;return s.slice(0,s.length-a)}return s};let n=r._nodeModulePaths;r._nodeModulePaths=function(o){let i=n(o);if(!g0)return i;let s=a=>a.length>=3&&a.endsWith(":\\");if(s(o)||(i=i.filter(a=>!s(es.dirname(a)))),process.env.HOMEDRIVE&&process.env.HOMEPATH){let a=es.dirname(es.join(process.env.HOMEDRIVE,process.env.HOMEPATH)),l=c=>es.relative(c,a).length===0;l(o)||(i=i.filter(c=>!l(es.dirname(c))))}return i}}import*as Vd from"node:fs";import{createRequire as b0,isBuiltin as b6,registerHooks as S6}from"node:module";import{dirname as x6,join as C6}from"node:path";import{fileURLToPath as Dw,pathToFileURL as S0}from"node:url";import{createRequire as h6}from"node:module";var Pw=h6(import.meta.url),og={BUILD_INSERT_PRODUCT_CONFIGURATION:"BUILD_INSERT_PRODUCT_CONFIGURATION"};og.BUILD_INSERT_PRODUCT_CONFIGURATION&&(og=Pw("../product.json"));var Tw={"name":"code-server","version":"1.146.0","packageManager":"pnpm@12.16.0","nativeBuild":{"runtime":"node","target":"24.22.1","disturl":"https://nodejs.org/dist","msBuildId":"488038","buildFromSource":true,"forceProcessConfig":true},"private":true,"copilotRuntimeVersion":"1.0.108-0","type":"module"};Tw.BUILD_INSERT_PACKAGE_CONFIGURATION&&(Tw=Pw("../package.json"));var y0={};if(process.env.VSCODE_DEV)try{y0=Pw("../product.overrides.json"),og=Object.assign(og,y0)}catch{}var mr=og,v0=Tw;Xr();globalThis._VSCODE_PRODUCT_JSON={...mr};globalThis._VSCODE_PACKAGE_JSON={...v0};globalThis._VSCODE_FILE_ROOT=import.meta.dirname;function E6(){if(!process.env.ELECTRON_RUN_AS_NODE&&!process.versions.electron)return;let r,t=process.env.VSCODE_ASAR_TRACE||void 0;if(t){let m="[asar-resolve] ";t==="1"||t==="true"||t==="on"||t==="stderr"?r=g=>{try{process.stderr.write(`${m}${g}
`)}catch{}}:r=g=>{try{Vd.appendFileSync(t,`${m}${g}
`)}catch{}}}let e=m=>process.platform==="win32"&&m.length>=2&&(m.charCodeAt(0)>=65&&m.charCodeAt(0)<=90||m.charCodeAt(0)>=97&&m.charCodeAt(0)<=122)&&m.charCodeAt(1)===58?m[0].toLowerCase()+m.slice(1):m,n=m=>{if(m==="")return!1;let g=m[0];return g==="."||g==="/"||g==="#"?!1:!URL.canParse(m)},o=m=>{if(m[0]==="@"){let y=m.indexOf("/");if(y===-1)return m;let h=m.indexOf("/",y+1);return h===-1?m:m.slice(0,h)}let g=m.indexOf("/");return g===-1?m:m.slice(0,g)},i=new Map,s=(m,g,y)=>{let h=Object.entries(y.importAttributes??{}).sort(([I],[x])=>I.localeCompare(x));return JSON.stringify([m,g,y.conditions,h])},a=x6(import.meta.dirname),l=process.env.VSCODE_DEV?void 0:e(a),c=l?b0(C6(a,"node_modules.asar","x.js")):void 0;r?.(`tracing enabled (node ${process.versions.node}); resourcesPath=${l}`);let u,p=!0;S6({resolve(m,g,y){if(p)return p=!1,u=[...g.conditions],y(m,g);let h=u;if(g.importAttributes===void 0||h!==void 0&&g.conditions.length===h.length&&g.conditions.every((x,E)=>x===h[E]))return y(m,g);if(m==="fs")return r?.(`map "fs" -> node:original-fs (from ${g.parentURL})`),{format:"builtin",shortCircuit:!0,url:"node:original-fs"};if(c&&l&&g.parentURL&&n(m)&&!b6(m)&&m!=="electron"&&!m.startsWith("electron/")){let x;try{x=e(Dw(g.parentURL))}catch{x=void 0}if(x&&x.startsWith(l)){r?.(`resolve "${m}" from "${g.parentURL}"`);let E=s(m,x,g),T=i.get(E);if(T)return r?.(` cache -> ${T.url} (ACCEPT)`),T;let P,M;try{P=y(m,g)}catch(W){M=W instanceof Error?W:new Error(String(W))}if(P){let W;try{W=e(Dw(P.url))}catch{W=void 0}if(!W||W.startsWith(l))return r?.(` default -> ${P.url} (in app, ACCEPT)`),P;r?.(` default -> ${P.url} (outside app, reject)`)}else r?.(` default -> <none> (${M?.message})`);let X;try{X=c.resolve(`./${o(m)}/package.json`)}catch{throw r?.(` archive: package "${o(m)}" NOT in archive -> throw`),M??new Error(`Cannot find package '${m}' within the application resources`)}r?.(` archive pkg.json -> ${X}`);try{let W=y(m,{...g,parentURL:S0(X).href}),J;try{J=e(Dw(W.url))}catch{J=void 0}if(J&&J.startsWith(l))return r?.(` self-ref -> ${W.url} (in app, ACCEPT)`),i.set(E,{...W,shortCircuit:!0}),W;r?.(` self-ref -> ${W.url} (escaped app, reject)`)}catch(W){r?.(` self-ref -> <throw> (${W instanceof Error?W.message:String(W)})`)}let N=c.resolve(`./${m}`),ae=S0(N).href;r?.(` direct -> ${ae} (ACCEPT)`);let Y={url:ae,shortCircuit:!0};return i.set(E,Y),Y}r?.(`defer "${m}" (parent outside app resources: ${g.parentURL})`)}return y(m,g)}});try{b0(import.meta.url).resolve("node:fs")}finally{p=!1}if(!u)throw new Error("Failed to identify CommonJS module resolution conditions")}E6();var _w;function w6(){return _w||(_w=R6()),_w}async function R6(){qt("code/willLoadNls");let r,t;if(process.env.VSCODE_NLS_CONFIG)try{r=JSON.parse(process.env.VSCODE_NLS_CONFIG),r?.languagePack?.messagesFile?t=r.languagePack.messagesFile:r?.defaultMessagesFile&&(t=r.defaultMessagesFile),globalThis._VSCODE_NLS_LANGUAGE=r?.resolvedLanguage}catch(e){console.error(`Error reading VSCODE_NLS_CONFIG from environment: ${e}`)}if(!(process.env.VSCODE_DEV||!t)){try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await Vd.promises.readFile(t)).toString())}catch(e){if(console.error(`Error reading NLS messages file ${t}: ${e}`),r?.languagePack?.corruptMarkerFile)try{await Vd.promises.writeFile(r.languagePack.corruptMarkerFile,"corrupted")}catch(n){console.error(`Error writing corrupted NLS marker file: ${n}`)}if(r?.defaultMessagesFile&&r.defaultMessagesFile!==t)try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await Vd.promises.readFile(r.defaultMessagesFile)).toString())}catch(n){console.error(`Error reading default NLS messages file ${r.defaultMessagesFile}: ${n}`)}}return qt("code/didLoadNls"),r}}async function x0(){await w6()}ER();Xr();qt("code/server/start");globalThis.vscodeServerStartTime=t6.now();async function ise(){let r=(0,n6.default)(process.argv.slice(2),{boolean:["start-server","list-extensions","print-ip-address","help","version","accept-server-license-terms","update-extensions","agent-host-ca-confirm"],string:["install-extension","install-builtin-extension","uninstall-extension","locate-extension","socket-path","host","port","compatibility","agent-host-port","agent-host-path","agent-host-ca"],alias:{help:"h",version:"v"}});["host","port","accept-server-license-terms"].forEach(i=>{if(!r[i]){let s=process.env[`VSCODE_SERVER_${i.toUpperCase().replace("-","_")}`];s&&(r[i]=s)}});let t=["list-extensions","locate-extension"],e=["install-extension","install-builtin-extension","uninstall-extension","update-extensions"],n=r.help||r.version||t.some(i=>!!r[i])||e.some(i=>!!r[i])&&!r["start-server"],o=await Pg({userLocale:"en",osLocale:"en",commit:mr.commit,nlsMetadataHash:mr.nlsMetadataHash,userDataPath:"",nlsMetadataPath:import.meta.dirname});if(r["agent-host-ca"]!==void 0)try{await o6(o);let{runAgentHostCertificateCommand:i}=await Promise.resolve().then(()=>(VU(),WU));process.exitCode=await i(r["agent-host-ca"],r["agent-host-ca-confirm"]===!0)}catch(i){console.error(i),process.exitCode=1}else if(n)n0(o).then(i=>{i.spawnCli()});else{sse(r);let i=null,s=null,a=()=>(s||(s=n0(o).then(async y=>{let h=await y.createServer(u);return i=h,h})),s);if(Array.isArray(mr.serverLicense)&&mr.serverLicense.length&&(console.log(mr.serverLicense.join(`
`)),mr.serverLicensePrompt&&r["accept-server-license-terms"]!==!0)){dse()&&(console.log("To accept the license terms, start the server with --accept-server-license-terms"),process.exit(1));try{await r6(mr.serverLicensePrompt)||process.exit(1)}catch(y){console.log(y),process.exit(1)}}let l=!0,c=!0,u=null,p=r0.createServer(async(y,h)=>(l&&(l=!1,qt("code/server/firstRequest")),(await a()).handleRequest(y,h)));p.on("upgrade",async(y,h)=>(c&&(c=!1,qt("code/server/firstWebSocket")),(await a()).handleUpgrade(y,h))),p.on("error",async y=>(await a()).handleServerError(y));let m=Iw(r.host)||(r.compatibility!=="1.63"?"localhost":void 0),g=r["socket-path"]?{path:Iw(r["socket-path"])}:{host:m,port:await ase(m,Iw(r.port))};p.listen(g,async()=>{let y=Array.isArray(mr.serverGreeting)&&mr.serverGreeting.length?`
${mr.serverGreeting.join(`
`)}
`:"";if(typeof g.port=="number"&&r["print-ip-address"]){let h=Xm.networkInterfaces();Object.keys(h).forEach(function(I){h[I]?.forEach(function(x){!x.internal&&x.family==="IPv4"&&(y+=`IP Address: ${x.address}
`)})})}if(u=p.address(),u===null)throw new Error("Unexpected server address");y+=`Server bound to ${typeof u=="string"?u:`${u.address}:${u.port} (${u.family})`}
`,y+=`Extension host agent listening on ${typeof u=="string"?u:u.port}
`,console.log(y),qt("code/server/started"),globalThis.vscodeServerListenTime=t6.now(),await a()}),process.on("exit",()=>{p.close(),i&&i.dispose()})}}function Iw(r){return Array.isArray(r)&&(r=r.pop()),typeof r=="string"?r:void 0}function sse(r){if(!process.env.VSCODE_SERVER_EXIT_DIAGNOSTICS)return;let t=Date.now(),e=Iw(r.logsPath)||Xm.tmpdir(),n=o0.join(e,"server-exit-diagnostics.log");try{bw.mkdirSync(e,{recursive:!0})}catch{}let o=!0;try{process.stderr.on("error",()=>{o=!1})}catch{o=!1}let i=c=>{let u=`[server-exit-diagnostics][${new Date().toISOString()}][pid:${process.pid}][+${Date.now()-t}ms] ${c}`;try{bw.appendFileSync(n,`${u}
`)}catch{}if(o)try{process.stderr.write(`${u}
`)}catch{o=!1}},s=()=>{try{let u=process.getActiveResourcesInfo?.()??[],p=process.memoryUsage();return`uptime=${process.uptime().toFixed(3)}s rss=${Math.round(p.rss/1024/1024)}MB activeResources=[${u.join(", ")}]`}catch(c){return`(failed to collect process state: ${c})`}};i(`installed. ppid=${process.ppid} platform=${process.platform} node=${process.version} argv=${JSON.stringify(process.argv.slice(2))}`),process.on("beforeExit",c=>i(`'beforeExit' (code: ${c}) \u2014 event loop drained, process will exit on its own. ${s()}`)),process.on("exit",c=>i(`'exit' (code: ${c}). ${s()}`));let a=!1;process.on("uncaughtExceptionMonitor",(c,u)=>{if(!a){a=!0;try{i(`'uncaughtExceptionMonitor' (origin: ${u}): ${c?.stack||c}`)}finally{a=!1}}});let l=["SIGTERM","SIGINT","SIGHUP","SIGBREAK","SIGQUIT"];for(let c of l)try{process.on(c,()=>{i(`received signal '${c}' \u2014 terminating. ${s()}`);let u=Xm.constants.signals[c];process.exit(typeof u=="number"?128+u:1)})}catch{}}async function ase(r,t){if(t){let e;if(t.match(/^\d+$/))return parseInt(t,10);if(e=lse(t)){let n=await cse(r,e.start,e.end);if(n!==void 0)return n;console.warn(`--port: Could not find free port in range: ${e.start} - ${e.end} (inclusive).`),process.exit(1)}else console.warn(`--port "${t}" is not a valid number or range. Ranges must be in the form 'from-to' with 'from' an integer larger than 0 and not larger than 'end'.`),process.exit(1)}return 8e3}function lse(r){let t=r.match(/^(\d+)-(\d+)$/);if(t){let e=parseInt(t[1],10),n=parseInt(t[2],10);if(e>0&&e<=n&&n<=65535)return{start:e,end:n}}}async function cse(r,t,e){let n=o=>new Promise(i=>{let s=r0.createServer();s.listen(o,r,()=>{s.close(),i(!0)}).on("error",()=>{i(!1)})});for(let o=t;o<=e;o++)if(await n(o))return o}async function n0(r){return await o6(r),Promise.resolve().then(()=>(Z8(),X8))}async function o6(r){process.env.VSCODE_NLS_CONFIG=JSON.stringify(r),process.env.VSCODE_HANDLES_SIGPIPE="true",process.env.VSCODE_DEV?(process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH=process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH||o0.join(import.meta.dirname,"..","remote","node_modules"),f0(process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH)):delete process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH,h0(),await x0()}function dse(){try{return!process.stdin.isTTY}catch{}return!1}function r6(r){let t=e6.createInterface({input:process.stdin,output:process.stdout});return new Promise((e,n)=>{t.question(r+" ",async function(o){t.close();let i=o.toString().trim().toLowerCase();i===""||i==="y"||i==="yes"?e(!0):i==="n"||i==="no"?e(!1):(process.stdout.write(`
Invalid Response. Answer either yes (y, yes) or no (n, no)
`),e(await r6(r)))})})}async function MLt(){let r=await Pg({userLocale:"en",osLocale:"en",commit:mr.commit,userDataPath:"",nlsMetadataPath:import.meta.dirname});return n0(r)}process.env.CODE_SERVER_PARENT_PID||ise();export{MLt as loadCodeWithNls};