/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

export function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

export var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    }
    return __assign.apply(this, arguments);
}

export function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

export function __decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}

export function __param(paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
}

export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};

export function __runInitializers(thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};

export function __propKey(x) {
    return typeof x === "symbol" ? x : "".concat(x);
};

export function __setFunctionName(f, name, prefix) {
    if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};

export function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

export function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

export function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
}

export var __createBinding = Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
});

export function __exportStar(m, o) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

export function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

export function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
}

/** @deprecated */
export function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
        ar = ar.concat(__read(arguments[i]));
    return ar;
}

/** @deprecated */
export function __spreadArrays() {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
}

export function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
}

export function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
}

export function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
    function fulfill(value) { resume("next", value); }
    function reject(value) { resume("throw", value); }
    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

export function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

export function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

export function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
};

export function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
}

export function __importDefault(mod) {
    return (mod && mod.__esModule) ? mod : { default: mod };
}

export function __classPrivateFieldGet(receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

export function __classPrivateFieldSet(receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

export function __classPrivateFieldIn(state, receiver) {
    if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
    return typeof state === "function" ? receiver === state : state.has(receiver);
}

export function __addDisposableResource(env, value, async) {
    if (value !== null && value !== void 0) {
        if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
        var dispose, inner;
        if (async) {
            if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
            dispose = value[Symbol.asyncDispose];
        }
        if (dispose === void 0) {
            if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
            dispose = value[Symbol.dispose];
            if (async) inner = dispose;
        }
        if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
        if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
        env.stack.push({ value: value, dispose: dispose, async: async });
    }
    else if (async) {
        env.stack.push({ async: true });
    }
    return value;

}

var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
    var e = new Error(message);
    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

export function __disposeResources(env) {
    function fail(e) {
        env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
        env.hasError = true;
    }
    function next() {
        while (env.stack.length) {
            var rec = env.stack.pop();
            try {
                var result = rec.dispose && rec.dispose.call(rec.value);
                if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
            }
            catch (e) {
                fail(e);
            }
        }
        if (env.hasError) throw env.error;
    }
    return next();
}

export default {
    __extends: __extends,
    __assign: __assign,
    __rest: __rest,
    __decorate: __decorate,
    __param: __param,
    __metadata: __metadata,
    __awaiter: __awaiter,
    __generator: __generator,
    __createBinding: __createBinding,
    __exportStar: __exportStar,
    __values: __values,
    __read: __read,
    __spread: __spread,
    __spreadArrays: __spreadArrays,
    __spreadArray: __spreadArray,
    __await: __await,
    __asyncGenerator: __asyncGenerator,
    __asyncDelegator: __asyncDelegator,
    __asyncValues: __asyncValues,
    __makeTemplateObject: __makeTemplateObject,
    __importStar: __importStar,
    __importDefault: __importDefault,
    __classPrivateFieldGet: __classPrivateFieldGet,
    __classPrivateFieldSet: __classPrivateFieldSet,
    __classPrivateFieldIn: __classPrivateFieldIn,
    __addDisposableResource: __addDisposableResource,
    __disposeResources: __disposeResources,
};

var Jk=Object.create;var Mg=Object.defineProperty;var Ob=Object.getOwnPropertyDescriptor;var Qk=Object.getOwnPropertyNames;var Xk=Object.getPrototypeOf,Yk=Object.prototype.hasOwnProperty;var Lb=(n,r)=>(r=Symbol[n])?r:Symbol.for("Symbol."+n),Mb=n=>{throw TypeError(n)};var I=(n,r)=>()=>(n&&(r=n(n=0)),r);var Zk=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports);var eR=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Qk(r))!Yk.call(n,i)&&i!==e&&Mg(n,i,{get:()=>r[i],enumerable:!(t=Ob(r,i))||t.enumerable});return n};var Fb=(n,r,e)=>(e=n!=null?Jk(Xk(n)):{},eR(r||!n||!n.__esModule?Mg(e,"default",{value:n,enumerable:!0}):e,n));var E=(n,r,e,t)=>{for(var i=t>1?void 0:t?Ob(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(t?s(r,e,i):s(i))||i);return t&&i&&Mg(r,e,i),i},g=(n,r)=>(e,t)=>r(e,t,n);var Wb=(n,r,e)=>{if(r!=null){typeof r!="object"&&typeof r!="function"&&Mb("Object expected");var t,i;e&&(t=r[Lb("asyncDispose")]),t===void 0&&(t=r[Lb("dispose")],e&&(i=t)),typeof t!="function"&&Mb("Object not disposable"),i&&(t=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),n.push([e,t,r])}else e&&n.push([e]);return r},Ub=(n,r,e)=>{var t=typeof SuppressedError=="function"?SuppressedError:function(s,a,l,c){return c=Error(l),c.name="SuppressedError",c.error=s,c.suppressed=a,c},i=s=>r=e?new t(s,r,"An error was suppressed during disposal"):(e=!0,s),o=s=>{for(;s=n.pop();)try{var a=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(a).then(o,l=>(i(l),o()))}catch(l){i(l)}if(e)throw r};return o()};function Fg(n){let r=[];typeof n=="number"&&r.push("code/timeOrigin",n);function e(o,s){r.push(o,s?.startTime??Date.now())}function t(){let o=[];for(let s=0;s<r.length;s+=2)o.push({name:r[s],startTime:r[s+1]});return o}function i(o){if(typeof o>"u"){let s=r.length>=2&&r[0]==="code/timeOrigin",a=s?r[1]:void 0;r.length=0,s&&r.push("code/timeOrigin",a)}else for(let s=r.length-2;s>=0;s-=2)r[s]===o&&r.splice(s,2)}return{mark:e,getMarks:t,clearMarks:i}}function nR(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?Fg():{mark(n,r){performance.mark(n,r)},clearMarks(n){performance.clearMarks(n)},getMarks(){let n=performance.timeOrigin;typeof n!="number"&&(n=(performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart)??0);let r=[{name:"code/timeOrigin",startTime:Math.round(n)}];for(let e of performance.getEntriesByType("mark"))r.push({name:e.name,startTime:Math.round(n+e.startTime)});return r}};if(typeof process=="object"){let n=performance?.timeOrigin;return Fg(n)}else return console.trace("perf-util loaded in UNKNOWN environment"),Fg()}function oR(n){return n.MonacoPerformanceMarks||(n.MonacoPerformanceMarks=nR()),n.MonacoPerformanceMarks}var Wg,Ve,lW,Ep,hn=I(()=>{Wg=oR(globalThis),Ve=Wg.mark,lW=Wg.clearMarks,Ep=Wg.getMarks});var Bg=Zk((fW,Kb)=>{"use strict";function cR(n,r){var e=n;r.slice(0,-1).forEach(function(i){e=e[i]||{}});var t=r[r.length-1];return t in e}function $b(n){return typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function qb(n,r){return r==="constructor"&&typeof n[r]=="function"||r==="__proto__"}Kb.exports=function(n,r){r||(r={});var e={bools:{},strings:{},unknownFn:null};typeof r.unknown=="function"&&(e.unknownFn=r.unknown),typeof r.boolean=="boolean"&&r.boolean?e.allBools=!0:[].concat(r.boolean).filter(Boolean).forEach(function(k){e.bools[k]=!0});var t={};function i(k){return t[k].some(function(A){return e.bools[A]})}Object.keys(r.alias||{}).forEach(function(k){t[k]=[].concat(r.alias[k]),t[k].forEach(function(A){t[A]=[k].concat(t[k].filter(function(de){return A!==de}))})}),[].concat(r.string).filter(Boolean).forEach(function(k){e.strings[k]=!0,t[k]&&[].concat(t[k]).forEach(function(A){e.strings[A]=!0})});var o=r.default||{},s={_:[]};function a(k,A){return e.allBools&&/^--[^=]+$/.test(A)||e.strings[k]||e.bools[k]||t[k]}function l(k,A,de){for(var L=k,J=0;J<A.length-1;J++){var K=A[J];if(qb(L,K))return;L[K]===void 0&&(L[K]={}),(L[K]===Object.prototype||L[K]===Number.prototype||L[K]===String.prototype)&&(L[K]={}),L[K]===Array.prototype&&(L[K]=[]),L=L[K]}var ve=A[A.length-1];qb(L,ve)||((L===Object.prototype||L===Number.prototype||L===String.prototype)&&(L={}),L===Array.prototype&&(L=[]),L[ve]===void 0||e.bools[ve]||typeof L[ve]=="boolean"?L[ve]=de:Array.isArray(L[ve])?L[ve].push(de):L[ve]=[L[ve],de])}function c(k,A,de){if(!(de&&e.unknownFn&&!a(k,de)&&e.unknownFn(de)===!1)){var L=!e.strings[k]&&$b(A)?Number(A):A;l(s,k.split("."),L),(t[k]||[]).forEach(function(J){l(s,J.split("."),L)})}}Object.keys(e.bools).forEach(function(k){c(k,o[k]===void 0?!1:o[k])});var d=[];n.indexOf("--")!==-1&&(d=n.slice(n.indexOf("--")+1),n=n.slice(0,n.indexOf("--")));for(var u=0;u<n.length;u++){var f=n[u],m,v;if(/^--.+=/.test(f)){var y=f.match(/^--([^=]+)=([\s\S]*)$/);m=y[1];var C=y[2];e.bools[m]&&(C=C!=="false"),c(m,C,f)}else if(/^--no-.+/.test(f))m=f.match(/^--no-(.+)/)[1],c(m,!1,f);else if(/^--.+/.test(f))m=f.match(/^--(.+)/)[1],v=n[u+1],v!==void 0&&!/^(-|--)[^-]/.test(v)&&!e.bools[m]&&!e.allBools&&(!t[m]||!i(m))?(c(m,v,f),u+=1):/^(true|false)$/.test(v)?(c(m,v==="true",f),u+=1):c(m,e.strings[m]?"":!0,f);else if(/^-[^-]+/.test(f)){for(var w=f.slice(1,-1).split(""),_=!1,D=0;D<w.length;D++){if(v=f.slice(D+2),v==="-"){c(w[D],v,f);continue}if(/[A-Za-z]/.test(w[D])&&v[0]==="="){c(w[D],v.slice(1),f),_=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(v)){c(w[D],v,f),_=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],f.slice(D+2),f),_=!0;break}else c(w[D],e.strings[w[D]]?"":!0,f)}m=f.slice(-1)[0],!_&&m!=="-"&&(n[u+1]&&!/^(-|--)[^-]/.test(n[u+1])&&!e.bools[m]&&(!t[m]||!i(m))?(c(m,n[u+1],f),u+=1):n[u+1]&&/^(true|false)$/.test(n[u+1])?(c(m,n[u+1]==="true",f),u+=1):c(m,e.strings[m]?"":!0,f))}else if((!e.unknownFn||e.unknownFn(f)!==!1)&&s._.push(e.strings._||!$b(f)?f:Number(f)),r.stopEarly){s._.push.apply(s._,n.slice(u+1));break}}return Object.keys(o).forEach(function(k){cR(s,k.split("."))||(l(s,k.split("."),o[k]),(t[k]||[]).forEach(function(A){l(s,A.split("."),o[k])}))}),r["--"]?s["--"]=d.slice():d.forEach(function(k){s._.push(k)}),s}});function uR(n){return n.replace(dR,function(r,e,t,i,o,s){if(i)return"";if(o){let a=o.length;return o[a-1]===`
`?o[a-2]==="\r"?`\r
`:`
`:""}else return s?r.substring(1):r})}function Tp(n){let r=uR(n);try{return JSON.parse(r)}catch{let t=r.replace(/,\s*([}\]])/g,"$1");return JSON.parse(t)}}var dR,Vg=I(()=>{dR=/("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\/\*[^\/\*]*(?:(?:\*|\/)[^\/\*]*)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))|(,\s*[}\]])/g});import{homedir as zb}from"os";import{resolve as pR,isAbsolute as fR,join as Ia}from"path";function ed(n,r){let e=hR(n,r),t=[e];return fR(e)||t.unshift(mR),pR(...t)}function hR(n,r){process.env.VSCODE_DEV&&(process.isEmbeddedApp?r="agents-oss-dev":r="code-oss-dev");let e=process.env.VSCODE_PORTABLE;if(e)return Ia(e,"user-data");let t=process.env.VSCODE_APPDATA;if(t)return Ia(t,r);let i=n["user-data-dir"];return i||Hg(r)}function Hg(n){let r;switch(process.platform){case"win32":if(r=process.env.APPDATA,!r){let e=process.env.USERPROFILE;if(typeof e!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");r=Ia(e,"AppData","Roaming")}break;case"darwin":r=Ia(zb(),"Library","Application Support");break;case"linux":r=process.env.XDG_CONFIG_HOME||Ia(zb(),".config");break;default:throw new Error("Platform not supported")}return Ia(r,n)}var mR,_p=I(()=>{mR=process.env.VSCODE_CWD||process.cwd()});function $g(){return globalThis._VSCODE_NLS_MESSAGES}function td(){return globalThis._VSCODE_NLS_LANGUAGE}function kp(n,r){let e;return r.length===0?e=n:e=n.replace(/\{(\d+)\}/g,(t,i)=>{let o=i[0],s=r[o],a=t;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),gR&&(e="\uFF3B"+e.replace(/[aouei]/g,"$&$&")+"\uFF3D"),e}function h(n,r,...e){return kp(typeof n=="number"?jb(n,r):r,e)}function jb(n,r){let e=$g()?.[n];if(typeof e!="string"){if(typeof r=="string")return r;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return e}function qg(n,r,...e){let t;typeof n=="number"?t=jb(n,r):t=r;let i=kp(t,e);return{value:i,original:r===t?i:kp(r,e)}}var gR,xe=I(()=>{gR=td()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0});function Lp(n){switch(n){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}function Gg(n){return parseFloat(n)>=25}var Ps,id,nd,rd,Jb,Qb,Kg,vR,Xb,Yb,yR,Rp,Dp,Gb,Zb,zn,jn,Yr,eS,IR,Ap,F,V,re,Mp,Op,Pr,wR,tS,rS,Gn,gn,vi,bR,zg,SR,iS,Ut,jg,nS,oS,sS,yW,X=I(()=>{xe();Ps="en",id=!1,nd=!1,rd=!1,Jb=!1,Qb=!1,Kg=!1,vR=!1,Xb=!1,Yb=!1,yR=!1,Dp=Ps,Gb=Ps,jn=globalThis;typeof jn.vscode<"u"&&typeof jn.vscode.process<"u"?Yr=jn.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Yr=process);eS=typeof Yr?.versions?.electron=="string",IR=eS&&Yr?.type==="renderer";if(typeof Yr=="object"){id=Yr.platform==="win32",nd=Yr.platform==="darwin",rd=Yr.platform==="linux",Jb=rd&&!!Yr.env.SNAP&&!!Yr.env.SNAP_REVISION,vR=eS,Yb=!!Yr.env.CI||!!Yr.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!Yr.env.GITHUB_WORKSPACE,Rp=Ps,Dp=Ps;let n=Yr.env.VSCODE_NLS_CONFIG;if(n)try{let r=JSON.parse(n);Rp=r.userLocale,Gb=r.osLocale,Dp=r.resolvedLanguage||Ps,Zb=r.languagePack?.translationsConfigFile}catch{}Qb=!0}else typeof navigator=="object"&&!IR?(zn=navigator.userAgent,id=zn.indexOf("Windows")>=0,nd=zn.indexOf("Macintosh")>=0,Xb=(zn.indexOf("Macintosh")>=0||zn.indexOf("iPad")>=0||zn.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rd=zn.indexOf("Linux")>=0,yR=zn?.indexOf("Mobi")>=0,Kg=!0,Dp=td()||Ps,Rp=navigator.language.toLowerCase(),Gb=Rp):console.error("Unable to resolve platform.");Ap=0;nd?Ap=1:id?Ap=3:rd&&(Ap=2);F=id,V=nd,re=rd,Mp=Jb,Op=Qb,Pr=Kg,wR=Kg&&typeof jn.importScripts=="function",tS=wR?jn.origin:void 0,rS=Yb,Gn=Ap,gn=zn,vi=Dp;(t=>{function n(){return vi}t.value=n;function r(){return vi.length===2?vi==="en":vi.length>=3?vi[0]==="e"&&vi[1]==="n"&&vi[2]==="-":!1}t.isDefaultVariant=r;function e(){return vi==="en"}t.isDefault=e})(bR||={});zg=Zb,SR=typeof jn.postMessage=="function"&&!jn.importScripts,iS=(()=>{if(SR){let n=[];jn.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let t=0,i=n.length;t<i;t++){let o=n[t];if(o.id===e.data.vscodeScheduleAsyncWork){n.splice(t,1),o.callback();return}}});let r=0;return e=>{let t=++r;n.push({id:t,callback:e}),jn.postMessage({vscodeScheduleAsyncWork:t},"*")}}return n=>setTimeout(n)})(),Ut=nd||Xb?2:id?1:3,jg=!!(gn&&gn.indexOf("Chrome")>=0),nS=!!(gn&&gn.indexOf("Firefox")>=0),oS=!!(!jg&&gn&&gn.indexOf("Safari")>=0),sS=!!(gn&&gn.indexOf("Edg/")>=0),yW=!!(gn&&gn.indexOf("Android")>=0)});var Es,Jg,Zr,St,Fp,aS,yi=I(()=>{X();Jg=globalThis.vscode;if(typeof Jg<"u"&&typeof Jg.process<"u"){let n=Jg.process;Es={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Es={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Es={get platform(){return F?"win32":V?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};Zr=Es.cwd,St=Es.env,Fp=Es.platform,aS=Es.arch});function _R(n,r){if(n===null||typeof n!="object")throw new Wp(r,"Object",n)}function Nt(n,r){if(typeof n!="string")throw new Wp(r,"string",n)}function De(n){return n===fr||n===ei}function Qg(n){return n===fr}function Qn(n){return n>=xR&&n<=ER||n>=PR&&n<=CR}function Up(n,r,e,t){let i="",o=0,s=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c<n.length)l=n.charCodeAt(c);else{if(t(l))break;l=fr}if(t(l)){if(!(s===c-1||a===1))if(a===2){if(i.length<2||o!==2||i.charCodeAt(i.length-1)!==Cs||i.charCodeAt(i.length-2)!==Cs){if(i.length>2){let d=i.lastIndexOf(e);d===-1?(i="",o=0):(i=i.slice(0,d),o=i.length-1-i.lastIndexOf(e)),s=c,a=0;continue}else if(i.length!==0){i="",o=0,s=c,a=0;continue}}r&&(i+=i.length>0?`${e}..`:"..",o=2)}else i.length>0?i+=`${e}${n.slice(s+1,c)}`:i=n.slice(s+1,c),o=c-s-1;s=c,a=0}else l===Cs&&a!==-1?++a:a=-1}return i}function kR(n){return n?`${n[0]==="."?"":"."}${n}`:""}function cS(n,r){_R(r,"pathObject");let e=r.dir||r.root,t=r.base||`${r.name||""}${kR(r.ext)}`;return e?e===r.root?`${e}${t}`:`${e}${n}${t}`:t}var xR,PR,ER,CR,Cs,fr,ei,Jn,TR,Wp,ti,dt,RR,pe,kt,Do,N,Er,Np,Le,Pe,ba,bW,SW,xW,Bt,Bp,we=I(()=>{yi();xR=65,PR=97,ER=90,CR=122,Cs=46,fr=47,ei=92,Jn=58,TR=63,Wp=class extends Error{constructor(r,e,t){let i;typeof e=="string"&&e.indexOf("not ")===0?(i="must not be",e=e.replace(/^not /,"")):i="must be";let o=r.indexOf(".")!==-1?"property":"argument",s=`The "${r}" ${o} ${i} of type ${e}`;s+=`. Received type ${typeof t}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}};ti=Fp==="win32";dt={resolve(...n){let r="",e="",t=!1;for(let i=n.length-1;i>=-1;i--){let o;if(i>=0){if(o=n[i],Nt(o,`paths[${i}]`),o.length===0)continue}else r.length===0?o=Zr():(o=St[`=${r}`]||Zr(),(o===void 0||o.slice(0,2).toLowerCase()!==r.toLowerCase()&&o.charCodeAt(2)===ei)&&(o=`${r}\\`));let s=o.length,a=0,l="",c=!1,d=o.charCodeAt(0);if(s===1)De(d)&&(a=1,c=!0);else if(De(d))if(c=!0,De(o.charCodeAt(1))){let u=2,f=u;for(;u<s&&!De(o.charCodeAt(u));)u++;if(u<s&&u!==f){let m=o.slice(f,u);for(f=u;u<s&&De(o.charCodeAt(u));)u++;if(u<s&&u!==f){for(f=u;u<s&&!De(o.charCodeAt(u));)u++;(u===s||u!==f)&&(l=`\\\\${m}\\${o.slice(f,u)}`,a=u)}}}else a=1;else Qn(d)&&o.charCodeAt(1)===Jn&&(l=o.slice(0,2),a=2,s>2&&De(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(r.length>0){if(l.toLowerCase()!==r.toLowerCase())continue}else r=l;if(t){if(r.length>0)break}else if(e=`${o.slice(a)}\\${e}`,t=c,c&&r.length>0)break}return e=Up(e,!t,"\\",De),t?`${r}\\${e}`:`${r}${e}`||"."},normalize(n){Nt(n,"path");let r=n.length;if(r===0)return".";let e=0,t,i=!1,o=n.charCodeAt(0);if(r===1)return Qg(o)?"\\":n;if(De(o))if(i=!0,De(n.charCodeAt(1))){let a=2,l=a;for(;a<r&&!De(n.charCodeAt(a));)a++;if(a<r&&a!==l){let c=n.slice(l,a);for(l=a;a<r&&De(n.charCodeAt(a));)a++;if(a<r&&a!==l){for(l=a;a<r&&!De(n.charCodeAt(a));)a++;if(a===r)return`\\\\${c}\\${n.slice(l)}\\`;a!==l&&(t=`\\\\${c}\\${n.slice(l,a)}`,e=a)}}}else e=1;else Qn(o)&&n.charCodeAt(1)===Jn&&(t=n.slice(0,2),e=2,r>2&&De(n.charCodeAt(2))&&(i=!0,e=3));let s=e<r?Up(n.slice(e),!i,"\\",De):"";if(s.length===0&&!i&&(s="."),s.length>0&&De(n.charCodeAt(r-1))&&(s+="\\"),!i&&t===void 0&&n.includes(":")){if(s.length>=2&&Qn(s.charCodeAt(0))&&s.charCodeAt(1)===Jn)return`.\\${s}`;let a=n.indexOf(":");do if(a===r-1||De(n.charCodeAt(a+1)))return`.\\${s}`;while((a=n.indexOf(":",a+1))!==-1)}return t===void 0?i?`\\${s}`:s:i?`${t}\\${s}`:`${t}${s}`},isAbsolute(n){Nt(n,"path");let r=n.length;if(r===0)return!1;let e=n.charCodeAt(0);return De(e)||r>2&&Qn(e)&&n.charCodeAt(1)===Jn&&De(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let r,e;for(let o=0;o<n.length;++o){let s=n[o];Nt(s,"path"),s.length>0&&(r===void 0?r=e=s:r+=`\\${s}`)}if(r===void 0)return".";let t=!0,i=0;if(typeof e=="string"&&De(e.charCodeAt(0))){++i;let o=e.length;o>1&&De(e.charCodeAt(1))&&(++i,o>2&&(De(e.charCodeAt(2))?++i:t=!1))}if(t){for(;i<r.length&&De(r.charCodeAt(i));)i++;i>=2&&(r=`\\${r.slice(i)}`)}return dt.normalize(r)},relative(n,r){if(Nt(n,"from"),Nt(r,"to"),n===r)return"";let e=dt.resolve(n),t=dt.resolve(r);if(e===t||(n=e.toLowerCase(),r=t.toLowerCase(),n===r))return"";if(e.length!==n.length||t.length!==r.length){let v=e.split("\\"),y=t.split("\\");v[v.length-1]===""&&v.pop(),y[y.length-1]===""&&y.pop();let C=v.length,w=y.length,_=C<w?C:w,D;for(D=0;D<_&&v[D].toLowerCase()===y[D].toLowerCase();D++);return D===0?t:D===_?w>_?y.slice(D).join("\\"):C>_?"..\\".repeat(C-1-D)+"..":"":"..\\".repeat(C-D)+y.slice(D).join("\\")}let i=0;for(;i<n.length&&n.charCodeAt(i)===ei;)i++;let o=n.length;for(;o-1>i&&n.charCodeAt(o-1)===ei;)o--;let s=o-i,a=0;for(;a<r.length&&r.charCodeAt(a)===ei;)a++;let l=r.length;for(;l-1>a&&r.charCodeAt(l-1)===ei;)l--;let c=l-a,d=s<c?s:c,u=-1,f=0;for(;f<d;f++){let v=n.charCodeAt(i+f);if(v!==r.charCodeAt(a+f))break;v===ei&&(u=f)}if(f!==d){if(u===-1)return t}else{if(c>d){if(r.charCodeAt(a+f)===ei)return t.slice(a+f+1);if(f===2)return t.slice(a+f)}s>d&&(n.charCodeAt(i+f)===ei?u=f:f===2&&(u=3)),u===-1&&(u=0)}let m="";for(f=i+u+1;f<=o;++f)(f===o||n.charCodeAt(f)===ei)&&(m+=m.length===0?"..":"\\..");return a+=u,m.length>0?`${m}${t.slice(a,l)}`:(t.charCodeAt(a)===ei&&++a,t.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;let r=dt.resolve(n);if(r.length<=2)return n;if(r.charCodeAt(0)===ei){if(r.charCodeAt(1)===ei){let e=r.charCodeAt(2);if(e!==TR&&e!==Cs)return`\\\\?\\UNC\\${r.slice(2)}`}}else if(Qn(r.charCodeAt(0))&&r.charCodeAt(1)===Jn&&r.charCodeAt(2)===ei)return`\\\\?\\${r}`;return r},dirname(n){Nt(n,"path");let r=n.length;if(r===0)return".";let e=-1,t=0,i=n.charCodeAt(0);if(r===1)return De(i)?n:".";if(De(i)){if(e=t=1,De(n.charCodeAt(1))){let a=2,l=a;for(;a<r&&!De(n.charCodeAt(a));)a++;if(a<r&&a!==l){for(l=a;a<r&&De(n.charCodeAt(a));)a++;if(a<r&&a!==l){for(l=a;a<r&&!De(n.charCodeAt(a));)a++;if(a===r)return n;a!==l&&(e=t=a+1)}}}}else Qn(i)&&n.charCodeAt(1)===Jn&&(e=r>2&&De(n.charCodeAt(2))?3:2,t=e);let o=-1,s=!0;for(let a=r-1;a>=t;--a)if(De(n.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(e===-1)return".";o=e}return n.slice(0,o)},basename(n,r){r!==void 0&&Nt(r,"suffix"),Nt(n,"path");let e=0,t=-1,i=!0,o;if(n.length>=2&&Qn(n.charCodeAt(0))&&n.charCodeAt(1)===Jn&&(e=2),r!==void 0&&r.length>0&&r.length<=n.length){if(r===n)return"";let s=r.length-1,a=-1;for(o=n.length-1;o>=e;--o){let l=n.charCodeAt(o);if(De(l)){if(!i){e=o+1;break}}else a===-1&&(i=!1,a=o+1),s>=0&&(l===r.charCodeAt(s)?--s===-1&&(t=o):(s=-1,t=a))}return e===t?t=a:t===-1&&(t=n.length),n.slice(e,t)}for(o=n.length-1;o>=e;--o)if(De(n.charCodeAt(o))){if(!i){e=o+1;break}}else t===-1&&(i=!1,t=o+1);return t===-1?"":n.slice(e,t)},extname(n){Nt(n,"path");let r=0,e=-1,t=0,i=-1,o=!0,s=0;n.length>=2&&n.charCodeAt(1)===Jn&&Qn(n.charCodeAt(0))&&(r=t=2);for(let a=n.length-1;a>=r;--a){let l=n.charCodeAt(a);if(De(l)){if(!o){t=a+1;break}continue}i===-1&&(o=!1,i=a+1),l===Cs?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:cS.bind(null,"\\"),parse(n){Nt(n,"path");let r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;let e=n.length,t=0,i=n.charCodeAt(0);if(e===1)return De(i)?(r.root=r.dir=n,r):(r.base=r.name=n,r);if(De(i)){if(t=1,De(n.charCodeAt(1))){let u=2,f=u;for(;u<e&&!De(n.charCodeAt(u));)u++;if(u<e&&u!==f){for(f=u;u<e&&De(n.charCodeAt(u));)u++;if(u<e&&u!==f){for(f=u;u<e&&!De(n.charCodeAt(u));)u++;u===e?t=u:u!==f&&(t=u+1)}}}}else if(Qn(i)&&n.charCodeAt(1)===Jn){if(e<=2)return r.root=r.dir=n,r;if(t=2,De(n.charCodeAt(2))){if(e===3)return r.root=r.dir=n,r;t=3}}t>0&&(r.root=n.slice(0,t));let o=-1,s=t,a=-1,l=!0,c=n.length-1,d=0;for(;c>=t;--c){if(i=n.charCodeAt(c),De(i)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),i===Cs?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===s+1?r.base=r.name=n.slice(s,a):(r.name=n.slice(s,o),r.base=n.slice(s,a),r.ext=n.slice(o,a))),s>0&&s!==t?r.dir=n.slice(0,s-1):r.dir=r.root,r},sep:"\\",delimiter:";",win32:null,posix:null},RR=(()=>{if(ti){let n=/\\/g;return()=>{let r=Zr().replace(n,"/");return r.slice(r.indexOf("/"))}}return()=>Zr()})(),pe={resolve(...n){let r="",e=!1;for(let t=n.length-1;t>=0&&!e;t--){let i=n[t];Nt(i,`paths[${t}]`),i.length!==0&&(r=`${i}/${r}`,e=i.charCodeAt(0)===fr)}if(!e){let t=RR();r=`${t}/${r}`,e=t.charCodeAt(0)===fr}return r=Up(r,!e,"/",Qg),e?`/${r}`:r.length>0?r:"."},normalize(n){if(Nt(n,"path"),n.length===0)return".";let r=n.charCodeAt(0)===fr,e=n.charCodeAt(n.length-1)===fr;return n=Up(n,!r,"/",Qg),n.length===0?r?"/":e?"./":".":(e&&(n+="/"),r?`/${n}`:n)},isAbsolute(n){return Nt(n,"path"),n.length>0&&n.charCodeAt(0)===fr},join(...n){if(n.length===0)return".";let r=[];for(let e=0;e<n.length;++e){let t=n[e];Nt(t,"path"),t.length>0&&r.push(t)}return r.length===0?".":pe.normalize(r.join("/"))},relative(n,r){if(Nt(n,"from"),Nt(r,"to"),n===r||(n=pe.resolve(n),r=pe.resolve(r),n===r))return"";let e=1,t=n.length,i=t-e,o=1,s=r.length-o,a=i<s?i:s,l=-1,c=0;for(;c<a;c++){let u=n.charCodeAt(e+c);if(u!==r.charCodeAt(o+c))break;u===fr&&(l=c)}if(c===a)if(s>a){if(r.charCodeAt(o+c)===fr)return r.slice(o+c+1);if(c===0)return r.slice(o+c)}else i>a&&(n.charCodeAt(e+c)===fr?l=c:c===0&&(l=0));let d="";for(c=e+l+1;c<=t;++c)(c===t||n.charCodeAt(c)===fr)&&(d+=d.length===0?"..":"/..");return`${d}${r.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(Nt(n,"path"),n.length===0)return".";let r=n.charCodeAt(0)===fr,e=-1,t=!0;for(let i=n.length-1;i>=1;--i)if(n.charCodeAt(i)===fr){if(!t){e=i;break}}else t=!1;return e===-1?r?"/":".":r&&e===1?"//":n.slice(0,e)},basename(n,r){r!==void 0&&Nt(r,"suffix"),Nt(n,"path");let e=0,t=-1,i=!0,o;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r===n)return"";let s=r.length-1,a=-1;for(o=n.length-1;o>=0;--o){let l=n.charCodeAt(o);if(l===fr){if(!i){e=o+1;break}}else a===-1&&(i=!1,a=o+1),s>=0&&(l===r.charCodeAt(s)?--s===-1&&(t=o):(s=-1,t=a))}return e===t?t=a:t===-1&&(t=n.length),n.slice(e,t)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===fr){if(!i){e=o+1;break}}else t===-1&&(i=!1,t=o+1);return t===-1?"":n.slice(e,t)},extname(n){Nt(n,"path");let r=-1,e=0,t=-1,i=!0,o=0;for(let s=n.length-1;s>=0;--s){let a=n[s];if(a==="/"){if(!i){e=s+1;break}continue}t===-1&&(i=!1,t=s+1),a==="."?r===-1?r=s:o!==1&&(o=1):r!==-1&&(o=-1)}return r===-1||t===-1||o===0||o===1&&r===t-1&&r===e+1?"":n.slice(r,t)},format:cS.bind(null,"/"),parse(n){Nt(n,"path");let r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;let e=n.charCodeAt(0)===fr,t;e?(r.root="/",t=1):t=0;let i=-1,o=0,s=-1,a=!0,l=n.length-1,c=0;for(;l>=t;--l){let d=n.charCodeAt(l);if(d===fr){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),d===Cs?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(s!==-1){let d=o===0&&e?1:o;i===-1||c===0||c===1&&i===s-1&&i===o+1?r.base=r.name=n.slice(d,s):(r.name=n.slice(d,i),r.base=n.slice(d,s),r.ext=n.slice(i,s))}return o>0?r.dir=n.slice(0,o-1):e&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};pe.win32=dt.win32=dt;pe.posix=dt.posix=pe;kt=ti?dt.normalize:pe.normalize,Do=ti?dt.isAbsolute:pe.isAbsolute,N=ti?dt.join:pe.join,Er=ti?dt.resolve:pe.resolve,Np=ti?dt.relative:pe.relative,Le=ti?dt.dirname:pe.dirname,Pe=ti?dt.basename:pe.basename,ba=ti?dt.extname:pe.extname,bW=ti?dt.format:pe.format,SW=ti?dt.parse:pe.parse,xW=ti?dt.toNamespacedPath:pe.toNamespacedPath,Bt=ti?dt.sep:pe.sep,Bp=ti?dt.delimiter:pe.delimiter});function fS(n,r){let e=Object.create(null);for(let t of n){let i=r(t),o=e[i];o||(o=e[i]=[]),o.push(t)}return e}var uS,pS,dS,Xg=I(()=>{dS=class{constructor(r,e){this.toKey=e;this._map=new Map;this[uS]="SetWithKey";for(let t of r)this.add(t)}get size(){return this._map.size}add(r){let e=this.toKey(r);return this._map.set(e,r),this}delete(r){return this._map.delete(this.toKey(r))}has(r){return this._map.has(this.toKey(r))}*entries(){for(let r of this._map.values())yield[r,r]}keys(){return this.values()}*values(){for(let r of this._map.values())yield r}clear(){this._map.clear()}forEach(r,e){this._map.forEach(t=>r.call(e,t,t,this))}[(pS=Symbol.iterator,uS=Symbol.toStringTag,pS)](){return this.values()}}});function $p(n){xa.setUnexpectedErrorHandler(n)}function mS(n){if(!n||typeof n!="object")return!1;let r=n;return r.code==="EPIPE"&&r.syscall?.toUpperCase()==="WRITE"}function nt(n){od(n)||xa.onUnexpectedError(n)}function od(n){return n instanceof xt?!0:n instanceof Error&&n.name===Vp&&n.message===Vp}function qi(){let n=new Error(Vp);return n.name=n.message,n}function qp(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}function mr(n){return n?n.message?n.message:n.stack?n.stack.split(`
`)[0]:String(n):"Error"}var Yg,xa,Vp,xt,Hp,Sa,ri,$i,He=I(()=>{Yg=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(r){setTimeout(()=>{throw r.stack?ri.isErrorNoTelemetry(r)?new ri(r.message+`

`+r.stack):new Error(r.message+`

`+r.stack):r},0)}}addListener(r){return this.listeners.push(r),()=>{this._removeListener(r)}}emit(r){this.listeners.forEach(e=>{e(r)})}_removeListener(r){this.listeners.splice(this.listeners.indexOf(r),1)}setUnexpectedErrorHandler(r){this.unexpectedErrorHandler=r}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(r){this.unexpectedErrorHandler(r),this.emit(r)}onUnexpectedExternalError(r){this.unexpectedErrorHandler(r)}},xa=new Yg;Vp="Canceled";xt=class extends Error{constructor(){super(Vp),this.name=this.message}},Hp=class n extends Error{static{this._name="PendingMigrationError"}static is(r){return r instanceof n||r instanceof Error&&r.name===n._name}constructor(r){super(r),this.name=n._name}};Sa=class extends Error{constructor(){super(...arguments);this.isExpected=!0}},ri=class n extends Error{constructor(r){super(r),this.name="CodeExpectedError"}static fromError(r){if(r instanceof n)return r;let e=new n;return e.message=r.message,e.stack=r.stack,e}static isErrorNoTelemetry(r){return r.name==="CodeExpectedError"}},$i=class n extends Error{constructor(r){super(r||"An unexpected bug occurred."),Object.setPrototypeOf(this,n.prototype)}}});function Xn(n,r){let e=this,t=!1,i;return function(){if(t)return i;if(t=!0,r)try{i=n.apply(e,arguments)}finally{r()}else i=n.apply(e,arguments);return i}}var Pa=I(()=>{});function DR(n,r,e=0,t=n.length){let i=e,o=t;for(;i<o;){let s=Math.floor((i+o)/2);r(n[s])?i=s+1:o=s}return i-1}function vS(n,r,e=0,t=n.length){let i=e,o=t;for(;i<o;){let s=Math.floor((i+o)/2);r(n[s])?o=s:i=s+1}return i}var gS,yS=I(()=>{gS=class n{constructor(r){this._array=r;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(r){if(n.assertInvariants){if(this._prevFindLastPredicate){for(let t of this._array)if(this._prevFindLastPredicate(t)&&!r(t))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=r}let e=DR(this._array,r,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=e+1,e===-1?void 0:this._array[e]}}});function Ao(n,r,e=(t,i)=>t===i){if(n===r)return!0;if(!n||!r||n.length!==r.length)return!1;for(let t=0,i=n.length;t<i;t++)if(!e(n[t],r[t]))return!1;return!0}function wS(n,r,e){return AR(n.length,t=>e(n[t],r))}function AR(n,r){let e=0,t=n-1;for(;e<=t;){let i=(e+t)/2|0,o=r(i);if(o<0)e=i+1;else if(o>0)t=i-1;else return i}return-(e+1)}function Kp(n,r,e){if(n=n|0,n>=r.length)throw new TypeError("invalid index");let t=r[Math.floor(r.length*Math.random())],i=[],o=[],s=[];for(let a of r){let l=e(a,t);l<0?i.push(a):l>0?o.push(a):s.push(a)}return n<i.length?Kp(n,i,e):n<i.length+s.length?s[0]:Kp(n-(i.length+s.length),o,e)}function bS(n,r,e){if(e===0)return[];let t=n.slice(0,e).sort(r);return LR(n,r,t,e,n.length),t}function LR(n,r,e,t,i){for(let o=e.length;t<i;t++){let s=n[t];if(r(s,e[o-1])<0){e.pop();let a=vS(e,l=>r(s,l)<0);e.splice(a,0,s)}}}function at(n){return n.filter(r=>!!r)}function Mr(n,r=e=>e){let e=new Set;return n.filter(t=>{let i=r(t);return e.has(i)?!1:(e.add(i),!0)})}function Zg(n,r){return n.push(r),()=>MR(n,r)}function MR(n,r){let e=n.indexOf(r);if(e>-1)return n.splice(e,1),r}function ev(n,r){let e;if(typeof r=="number"){let t=r;e=()=>{let i=Math.sin(t++)*179426549;return i-Math.floor(i)}}else e=Math.random;for(let t=n.length-1;t>0;t-=1){let i=Math.floor(e()*(t+1)),o=n[t];n[t]=n[i],n[i]=o}}function SS(n){return n[Math.floor(Math.random()*n.length)]}function PS(n,r){return(e,t)=>r(n(e),n(t))}var xS,ES,IS,Jt=I(()=>{yS();He();(a=>{function n(l){return l<0}a.isLessThan=n;function r(l){return l<=0}a.isLessThanOrEqual=r;function e(l){return l>0}a.isGreaterThan=e;function t(l){return l===0}a.isNeitherLessOrGreaterThan=t,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(xS||={});ES=(n,r)=>n-r,IS=class n{constructor(r){this.iterate=r}static{this.empty=new n(r=>{})}forEach(r){this.iterate(e=>(r(e),!0))}toArray(){let r=[];return this.iterate(e=>(r.push(e),!0)),r}filter(r){return new n(e=>this.iterate(t=>r(t)?e(t):!0))}map(r){return new n(e=>this.iterate(t=>e(r(t))))}some(r){let e=!1;return this.iterate(t=>(e=r(t),!e)),e}findFirst(r){let e;return this.iterate(t=>r(t)?(e=t,!1):!0),e}findLast(r){let e;return this.iterate(t=>(r(t)&&(e=t),!0)),e}findLastMaxBy(r){let e,t=!0;return this.iterate(i=>((t||xS.isGreaterThan(r(i,e)))&&(t=!1,e=i),!0)),e}}});function RS(n){let r=[];return n.forEach((e,t)=>{r.push(`${t} => ${e}`)}),`Map(${n.size}) {${r.join(", ")}}`}function DS(n){let r=[];return n.forEach(e=>{r.push(e)}),`Set(${n.size}) {${r.join(", ")}}`}function OR(n){return Array.isArray(n)}var tv,TS,mt,_S,Ea,kS,rv,iv,ki,zp,Cr=I(()=>{tv=class{constructor(r,e){this.uri=r;this.value=e}};mt=class n{constructor(r,e){this[TS]="ResourceMap";if(r instanceof n)this.map=new Map(r.map),this.toKey=e??n.defaultToKey;else if(OR(r)){this.map=new Map,this.toKey=e??n.defaultToKey;for(let[t,i]of r)this.set(t,i)}else this.map=new Map,this.toKey=r??n.defaultToKey}static{this.defaultToKey=r=>r.toString()}set(r,e){return this.map.set(this.toKey(r),new tv(r,e)),this}get(r){return this.map.get(this.toKey(r))?.value}has(r){return this.map.has(this.toKey(r))}get size(){return this.map.size}clear(){this.map.clear()}delete(r){return this.map.delete(this.toKey(r))}forEach(r,e){typeof e<"u"&&(r=r.bind(e));for(let[t,i]of this.map)r(i.value,i.uri,this)}*values(){for(let r of this.map.values())yield r.value}*keys(){for(let r of this.map.values())yield r.uri}*entries(){for(let r of this.map.values())yield[r.uri,r.value]}*[(TS=Symbol.toStringTag,Symbol.iterator)](){for(let[,r]of this.map)yield[r.uri,r.value]}},Ea=class{constructor(r,e){this[_S]="ResourceSet";!r||typeof r=="function"?this._map=new mt(r):(this._map=new mt(e),r.forEach(this.add,this))}get size(){return this._map.size}add(r){return this._map.set(r,r),this}clear(){this._map.clear()}delete(r){return this._map.delete(r)}forEach(r,e){this._map.forEach((t,i)=>r.call(e,i,i,this))}has(r){return this._map.has(r)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(_S=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},rv=class{constructor(){this[kS]="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(r){return this._map.has(r)}get(r,e=0){let t=this._map.get(r);if(t)return e!==0&&this.touch(t,e),t.value}set(r,e,t=0){let i=this._map.get(r);if(i)i.value=e,t!==0&&this.touch(i,t);else{switch(i={key:r,value:e,next:void 0,previous:void 0},t){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(r,i),this._size++}return this}delete(r){return!!this.remove(r)}remove(r){let e=this._map.get(r);if(e)return this._map.delete(r),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 r=this._head;return this._map.delete(r.key),this.removeItem(r),this._size--,r.value}forEach(r,e){let t=this._state,i=this._head;for(;i;){if(e?r.bind(e)(i.value,i.key,this):r(i.value,i.key,this),this._state!==t)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let r=this,e=this._state,t=this._head,i={[Symbol.iterator](){return i},next(){if(r._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let o={value:t.key,done:!1};return t=t.next,o}else return{value:void 0,done:!0}}};return i}values(){let r=this,e=this._state,t=this._head,i={[Symbol.iterator](){return i},next(){if(r._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let o={value:t.value,done:!1};return t=t.next,o}else return{value:void 0,done:!0}}};return i}entries(){let r=this,e=this._state,t=this._head,i={[Symbol.iterator](){return i},next(){if(r._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let o={value:[t.key,t.value],done:!1};return t=t.next,o}else return{value:void 0,done:!0}}};return i}[(kS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(r){if(r>=this.size)return;if(r===0){this.clear();return}let e=this._head,t=this.size;for(;e&&t>r;)this._map.delete(e.key),e=e.next,t--;this._head=e,this._size=t,e&&(e.previous=void 0),this._state++}trimNew(r){if(r>=this.size)return;if(r===0){this.clear();return}let e=this._tail,t=this.size;for(;e&&t>r;)this._map.delete(e.key),e=e.previous,t--;this._tail=e,this._size=t,e&&(e.next=void 0),this._state++}addItemFirst(r){if(!this._head&&!this._tail)this._tail=r;else if(this._head)r.next=this._head,this._head.previous=r;else throw new Error("Invalid list");this._head=r,this._state++}addItemLast(r){if(!this._head&&!this._tail)this._head=r;else if(this._tail)r.previous=this._tail,this._tail.next=r;else throw new Error("Invalid list");this._tail=r,this._state++}removeItem(r){if(r===this._head&&r===this._tail)this._head=void 0,this._tail=void 0;else if(r===this._head){if(!r.next)throw new Error("Invalid list");r.next.previous=void 0,this._head=r.next}else if(r===this._tail){if(!r.previous)throw new Error("Invalid list");r.previous.next=void 0,this._tail=r.previous}else{let e=r.next,t=r.previous;if(!e||!t)throw new Error("Invalid list");e.previous=t,t.next=e}r.next=void 0,r.previous=void 0,this._state++}touch(r,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(r===this._head)return;let t=r.next,i=r.previous;r===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),r.previous=void 0,r.next=this._head,this._head.previous=r,this._head=r,this._state++}else if(e===2){if(r===this._tail)return;let t=r.next,i=r.previous;r===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),r.next=void 0,r.previous=this._tail,this._tail.next=r,this._tail=r,this._state++}}}toJSON(){let r=[];return this.forEach((e,t)=>{r.push([t,e])}),r}fromJSON(r){this.clear();for(let[e,t]of r)this.set(e,t)}},iv=class extends rv{constructor(r,e=1){super(),this._limit=r,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(r){this._limit=r,this.checkTrim()}get ratio(){return this._ratio}set ratio(r){this._ratio=Math.min(Math.max(0,r),1),this.checkTrim()}get(r,e=2){return super.get(r,e)}peek(r){return super.get(r,0)}set(r,e){return super.set(r,e,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},ki=class extends iv{constructor(r,e=1){super(r,e)}trim(r){this.trimOld(r)}set(r,e){return super.set(r,e),this.checkTrim(),this}},zp=class{constructor(){this.map=new Map}add(r,e){let t=this.map.get(r);t||(t=new Set,this.map.set(r,t)),t.add(e)}delete(r,e){let t=this.map.get(r);t&&(t.delete(e),t.size===0&&this.map.delete(r))}forEach(r,e){let t=this.map.get(r);t&&t.forEach(e)}get(r){let e=this.map.get(r);return e||new Set}}});function jp(n,r){if(!n)throw new Error(r?`Assertion failed (${r})`:"Assertion Failed")}function Ca(n,r="unexpected state"){if(!n)throw typeof r=="string"?new $i(`Assertion Failed: ${r}`):r}var Ta=I(()=>{He()});function Fe(n){return typeof n=="string"}function Ge(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function AS(n){let r=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof r}function Ki(n){return typeof n=="number"&&!isNaN(n)}function LS(n){return!!n&&typeof n[Symbol.iterator]=="function"}function Gp(n){return n===!0||n===!1}function Hr(n){return typeof n>"u"}function Vt(n){return Hr(n)||n===null}function MS(n,r){if(!n)throw new Error(r?`Unexpected type, expected '${r}'`:"Unexpected type")}function yn(n){return Ca(n!=null,"Argument is `undefined` or `null`."),n}function Jp(n){if(!Ge(n))return!1;for(let r in n)if(WR.call(n,r))return!1;return!0}function sd(n){return typeof n=="function"}function Ri(n,r){for(let e in r)if(!(e in n))return!1;return!0}var WR,Oe=I(()=>{Ta();WR=Object.prototype.hasOwnProperty});var In,ad=I(()=>{Oe();(de=>{function n(L){return!!L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}de.is=n;let r=Object.freeze([]);function e(){return r}de.empty=e;function*t(L){yield L}de.single=t;function i(L){return n(L)?L:t(L)}de.wrap=i;function o(L){return L??r}de.from=o;function*s(L){for(let J=L.length-1;J>=0;J--)yield L[J]}de.reverse=s;function a(L){return!L||L[Symbol.iterator]().next().done===!0}de.isEmpty=a;function l(L){return L[Symbol.iterator]().next().value}de.first=l;function c(L,J){let K=0;for(let ve of L)if(J(ve,K++))return!0;return!1}de.some=c;function d(L,J){let K=0;for(let ve of L)if(!J(ve,K++))return!1;return!0}de.every=d;function u(L,J){for(let K of L)if(J(K))return K}de.find=u;function*f(L,J){for(let K of L)J(K)&&(yield K)}de.filter=f;function*m(L,J){let K=0;for(let ve of L)yield J(ve,K++)}de.map=m;function*v(L,J){let K=0;for(let ve of L)yield*J(ve,K++)}de.flatMap=v;function*y(...L){for(let J of L)LS(J)?yield*J:yield J}de.concat=y;function C(L,J,K){let ve=K;for(let yt of L)ve=J(ve,yt);return ve}de.reduce=C;function w(L){let J=0;for(let K of L)J++;return J}de.length=w;function*_(L,J,K=L.length){for(J<-L.length&&(J=0),J<0&&(J+=L.length),K<0?K+=L.length:K>L.length&&(K=L.length);J<K;J++)yield L[J]}de.slice=_;function D(L,J=Number.POSITIVE_INFINITY){let K=[];if(J===0)return[K,L];let ve=L[Symbol.iterator]();for(let yt=0;yt<J;yt++){let Ot=ve.next();if(Ot.done)return[K,de.empty()];K.push(Ot.value)}return[K,{[Symbol.iterator](){return ve}}]}de.consume=D;async function k(L){let J=[];for await(let K of L)J.push(K);return J}de.asyncToArray=k;async function A(L){let J=[];for await(let K of L)J=J.concat(K);return J}de.asyncToArrayFlat=A})(In||={})});function NR(n){ka=n}function ld(n){return ka?.trackDisposable(n),n}function cd(n){ka?.markAsDisposed(n)}function Ts(n,r){ka?.setParent(n,r)}function BR(n,r){if(ka)for(let e of n)ka.setParent(e,r)}function Qp(n){return typeof n=="object"&&n!==null&&typeof n.dispose=="function"&&n.dispose.length===0}function ut(n){if(In.is(n)){let r=[];for(let e of n)if(e)try{e.dispose()}catch(t){r.push(t)}if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function FS(...n){let r=G(()=>ut(n));return BR(n,r),r}function G(n){return new nv(n)}function WS(n,r){return n.then(e=>(r.isDisposed?e.dispose():r.add(e),e))}var UR,ka,OS,nv,j,T,Qt,Dt,$=I(()=>{Jt();Xg();Cr();Pa();ad();He();UR=!1,ka=null,OS=class n{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(r){let e=this.livingDisposables.get(r);return e||(e={parent:null,source:null,isSingleton:!1,value:r,idx:n.idx++},this.livingDisposables.set(r,e)),e}trackDisposable(r){let e=this.getDisposableData(r);e.source||(e.source=new Error().stack)}setParent(r,e){let t=this.getDisposableData(r);t.parent=e}markAsDisposed(r){this.livingDisposables.delete(r)}markAsSingleton(r){this.getDisposableData(r).isSingleton=!0}getRootParent(r,e){let t=e.get(r);if(t)return t;let i=r.parent?this.getRootParent(this.getDisposableData(r.parent),e):r;return e.set(r,i),i}getTrackedDisposables(){let r=new Map;return[...this.livingDisposables.entries()].filter(([,t])=>t.source!==null&&!this.getRootParent(t,r).isSingleton).flatMap(([t])=>t)}computeLeakingDisposables(r=10,e){let t;if(e)t=e;else{let l=new Map,c=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,l).isSingleton);if(c.length===0)return;let d=new Set(c.map(u=>u.value));if(t=c.filter(u=>!(u.parent&&d.has(u.parent))),t.length===0)throw new Error("There are cyclic diposable chains!")}if(!t)return;function i(l){function c(u,f){for(;u.length>0&&f.some(m=>typeof m=="string"?m===u[0]:u[0].match(m));)u.shift()}let d=l.source.split(`
`).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return c(d,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),d.reverse()}let o=new zp;for(let l of t){let c=i(l);for(let d=0;d<=c.length;d++)o.add(c.slice(0,d).join(`
`),l)}t.sort(PS(l=>l.idx,ES));let s="",a=0;for(let l of t.slice(0,r)){a++;let c=i(l),d=[];for(let u=0;u<c.length;u++){let f=c[u];f=`(shared with ${o.get(c.slice(0,u+1).join(`
`)).size}/${t.length} leaks) at ${f}`;let v=o.get(c.slice(0,u).join(`
`)),y=fS([...v].map(C=>i(C)[u]),C=>C);delete y[c[u]];for(let[C,w]of Object.entries(y))w&&d.unshift(`    - stacktraces of ${w.length} other leaks continue with ${C}`);d.unshift(f)}s+=`


==================== Leaking disposable ${a}/${t.length}: ${l.value.constructor.name} ====================
${d.join(`
`)}
============================================================

`}return t.length>r&&(s+=`


... and ${t.length-r} more leaking disposables

`),{leaks:t,details:s}}};if(UR){let n="__is_disposable_tracked__";NR(new class{trackDisposable(r){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{r[n]||console.log(e)},3e3)}setParent(r,e){if(r&&r!==T.None)try{r[n]=!0}catch{}}markAsDisposed(r){if(r&&r!==T.None)try{r[n]=!0}catch{}}markAsSingleton(r){}})}nv=class{constructor(r){this._isDisposed=!1,this._fn=r,ld(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,cd(this),this._fn()}}};j=class n{constructor(){this._toDispose=new Set;this._isDisposed=!1;ld(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(cd(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ut(this._toDispose)}finally{this._toDispose.clear()}}add(r){if(!r||r===T.None)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return Ts(r,this),this._isDisposed?n.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(r),r}delete(r){if(r){if(r===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(r),r.dispose()}}deleteAndLeak(r){r&&this._toDispose.delete(r)&&Ts(r,null)}assertNotDisposed(){this._isDisposed&&nt(new $i("Object disposed"))}},T=class{constructor(){this._store=new j;ld(this),Ts(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){cd(this),this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}},Qt=class{constructor(){this._isDisposed=!1;ld(this)}get value(){return this._isDisposed?void 0:this._value}set value(r){this._isDisposed||r===this._value||(this._value?.dispose(),r&&Ts(r,this),this._value=r)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,cd(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let r=this._value;return this._value=void 0,r&&Ts(r,null),r}},Dt=class{constructor(r=new Map){this._isDisposed=!1;this._store=r,ld(this)}dispose(){cd(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ut(this._store.values())}finally{this._store.clear()}}has(r){return this._store.has(r)}get size(){return this._store.size}get(r){return this._store.get(r)}set(r,e,t=!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),t||this._store.get(r)?.dispose(),this._store.set(r,e),Ts(e,this)}deleteAndDispose(r){this._store.get(r)?.dispose(),this._store.delete(r)}deleteAndLeak(r){let e=this._store.get(r);return e&&Ts(e,null),this._store.delete(r),e}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}});var It,Ra,ov=I(()=>{It=class n{static{this.Undefined=new n(void 0)}constructor(r){this.element=r,this.next=n.Undefined,this.prev=n.Undefined}},Ra=class{constructor(){this._first=It.Undefined;this._last=It.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===It.Undefined}clear(){let r=this._first;for(;r!==It.Undefined;){let e=r.next;r.prev=It.Undefined,r.next=It.Undefined,r=e}this._first=It.Undefined,this._last=It.Undefined,this._size=0}unshift(r){return this._insert(r,!1)}push(r){return this._insert(r,!0)}_insert(r,e){let t=new It(r);if(this._first===It.Undefined)this._first=t,this._last=t;else if(e){let o=this._last;this._last=t,t.prev=o,o.next=t}else{let o=this._first;this._first=t,t.next=o,o.prev=t}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(t))}}shift(){if(this._first!==It.Undefined){let r=this._first.element;return this._remove(this._first),r}}pop(){if(this._last!==It.Undefined){let r=this._last.element;return this._remove(this._last),r}}peek(){if(this._last!==It.Undefined)return this._last.element}_remove(r){if(r.prev!==It.Undefined&&r.next!==It.Undefined){let e=r.prev;e.next=r.next,r.next.prev=e}else r.prev===It.Undefined&&r.next===It.Undefined?(this._first=It.Undefined,this._last=It.Undefined):r.next===It.Undefined?(this._last=this._last.prev,this._last.next=It.Undefined):r.prev===It.Undefined&&(this._first=this._first.next,this._first.prev=It.Undefined);this._size-=1}*[Symbol.iterator](){let r=this._first;for(;r!==It.Undefined;)yield r.element,r=r.next}}});var VR,ii,_s=I(()=>{VR=globalThis.performance.now.bind(globalThis.performance),ii=class n{static create(r){return new n(r)}constructor(r){this._now=r===!1?Date.now:VR,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 BS(){return!!St.VSCODE_DEV}function dv(n,r){r instanceof j?r.add(n):Array.isArray(r)&&r.push(n)}function HS(n,r){if(r instanceof j)r.delete(n);else if(Array.isArray(r)){let e=r.indexOf(n);e!==-1&&r.splice(e,1)}n.dispose()}var US,HR,$R,NS,S,sv,VS,av,Aa,La,lv,qR,Da,KR,zR,b,cv,ks,Xp,dd,q=I(()=>{Xg();He();Pa();$();ov();yi();_s();US=!1,HR=!1,$R=100,NS=6e4;(gi=>{gi.None=()=>T.None;function r(ie){if(HR){let{onDidAddListener:z}=ie,Y=Aa.create(),ee=0;ie.onDidAddListener=()=>{++ee===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Y.print()),z?.()}}}function e(ie,z,Y){return m(ie,()=>{},0,void 0,z??!0,void 0,Y)}gi.defer=e;function t(ie){return(z,Y=null,ee)=>{let ne=!1,fe;return fe=ie(Ie=>{if(!ne)return fe?fe.dispose():ne=!0,z.call(Y,Ie)},null,ee),ne&&fe.dispose(),fe}}gi.once=t;function i(ie,z){return gi.once(gi.filter(ie,z))}gi.onceIf=i;function o(ie,z,Y){return u((ee,ne=null,fe)=>ie(Ie=>ee.call(ne,z(Ie)),null,fe),Y)}gi.map=o;function s(ie,z,Y){return u((ee,ne=null,fe)=>ie(Ie=>{z(Ie),ee.call(ne,Ie)},null,fe),Y)}gi.forEach=s;function a(ie,z,Y){return u((ee,ne=null,fe)=>ie(Ie=>z(Ie)&&ee.call(ne,Ie),null,fe),Y)}gi.filter=a;function l(ie){return ie}gi.signal=l;function c(...ie){return(z,Y=null,ee)=>{let ne=FS(...ie.map(fe=>fe(Ie=>z.call(Y,Ie))));return f(ne,ee)}}gi.any=c;function d(ie,z,Y,ee){let ne=Y;return o(ie,fe=>(ne=z(ne,fe),ne),ee)}gi.reduce=d;function u(ie,z){let Y,ee={onWillAddFirstListener(){Y=ie(ne.fire,ne)},onDidRemoveLastListener(){Y?.dispose()}};z||r(ee);let ne=new b(ee);return z?.add(ne),ne.event}function f(ie,z){return z instanceof Array?z.push(ie):z&&z.add(ie),ie}function m(ie,z,Y=100,ee=!1,ne=!1,fe,Ie){let bt,Xe,Ft,Re=0,tr,Br={leakWarningThreshold:fe,onWillAddFirstListener(){bt=ie(jc=>{Re++,Xe=z(Xe,jc),ee&&!Ft&&(fn.fire(Xe),Xe=void 0),tr=()=>{let Gc=Xe;Xe=void 0,Ft=void 0,(!ee||Re>1)&&fn.fire(Gc),Re=0},typeof Y=="number"?(Ft&&clearTimeout(Ft),Ft=setTimeout(tr,Y)):Ft===void 0&&(Ft=null,queueMicrotask(tr))})},onWillRemoveListener(){ne&&Re>0&&tr?.()},onDidRemoveLastListener(){tr=void 0,bt.dispose()}};Ie||r(Br);let fn=new b(Br);return Ie?.add(fn),fn.event}gi.debounce=m;function v(ie,z=0,Y,ee){return gi.debounce(ie,(ne,fe)=>ne?(ne.push(fe),ne):[fe],z,void 0,Y??!0,void 0,ee)}gi.accumulate=v;function y(ie,z,Y=100,ee=!0,ne=!0,fe,Ie){let bt,Xe,Ft,Re=0,tr={leakWarningThreshold:fe,onWillAddFirstListener(){bt=ie(fn=>{Re++,Xe=z(Xe,fn),Ft===void 0&&(ee&&(Br.fire(Xe),Xe=void 0,Re=0),typeof Y=="number"?Ft=setTimeout(()=>{ne&&Re>0&&Br.fire(Xe),Xe=void 0,Ft=void 0,Re=0},Y):(Ft=0,queueMicrotask(()=>{ne&&Re>0&&Br.fire(Xe),Xe=void 0,Ft=void 0,Re=0})))})},onDidRemoveLastListener(){bt.dispose()}};Ie||r(tr);let Br=new b(tr);return Ie?.add(Br),Br.event}gi.throttle=y;function C(ie,z=(ee,ne)=>ee===ne,Y){let ee=!0,ne;return a(ie,fe=>{let Ie=ee||!z(fe,ne);return ee=!1,ne=fe,Ie},Y)}gi.latch=C;function w(ie,z,Y){return[gi.filter(ie,z,Y),gi.filter(ie,ee=>!z(ee),Y)]}gi.split=w;function _(ie,z,Y=!1,ee=[],ne){let fe=ee.slice(),Ie;BS()&&(Ie={stack:Aa.create(),timerId:setTimeout(()=>{fe&&fe.length>0&&Ie&&!Ie.warned&&(Ie.warned=!0,console.warn(`[Event.buffer][${z}] potential LEAK detected: ${fe.length} events buffered for ${NS/1e3}s without being consumed. Buffered here:`),Ie.stack.print())},NS),warned:!1},ne&&ne.add(G(()=>clearTimeout(Ie.timerId))));let bt=()=>{Ie&&clearTimeout(Ie.timerId)},Xe=ie(tr=>{fe?(fe.push(tr),BS()&&Ie&&!Ie.warned&&fe.length>=$R&&(Ie.warned=!0,console.warn(`[Event.buffer][${z}] potential LEAK detected: ${fe.length} events buffered without being consumed. Buffered here:`),Ie.stack.print())):Re.fire(tr)});ne&&ne.add(Xe);let Ft=()=>{fe?.forEach(tr=>Re.fire(tr)),fe=null,bt()},Re=new b({onWillAddFirstListener(){Xe||(Xe=ie(tr=>Re.fire(tr)),ne&&ne.add(Xe))},onDidAddFirstListener(){fe&&(Y?setTimeout(Ft):Ft())},onDidRemoveLastListener(){Xe&&Xe.dispose(),Xe=null,bt()}});return ne&&ne.add(Re),Re.event}gi.buffer=_;function D(ie,z){return(ee,ne,fe)=>{let Ie=z(new A);return ie(function(bt){let Xe=Ie.evaluate(bt);Xe!==k&&ee.call(ne,Xe)},void 0,fe)}}gi.chain=D;let k=Symbol("HaltChainable");class A{constructor(){this.steps=[]}map(z){return this.steps.push(z),this}forEach(z){return this.steps.push(Y=>(z(Y),Y)),this}filter(z){return this.steps.push(Y=>z(Y)?Y:k),this}reduce(z,Y){let ee=Y;return this.steps.push(ne=>(ee=z(ee,ne),ee)),this}latch(z=(Y,ee)=>Y===ee){let Y=!0,ee;return this.steps.push(ne=>{let fe=Y||!z(ne,ee);return Y=!1,ee=ne,fe?ne:k}),this}evaluate(z){for(let Y of this.steps)if(z=Y(z),z===k)break;return z}}function de(ie,z,Y=ee=>ee){let ee=(...bt)=>Ie.fire(Y(...bt)),ne=()=>ie.on(z,ee),fe=()=>ie.removeListener(z,ee),Ie=new b({onWillAddFirstListener:ne,onDidRemoveLastListener:fe});return Ie.event}gi.fromNodeEventEmitter=de;function L(ie,z,Y=ee=>ee){let ee=(...bt)=>Ie.fire(Y(...bt)),ne=()=>ie.addEventListener(z,ee),fe=()=>ie.removeEventListener(z,ee),Ie=new b({onWillAddFirstListener:ne,onDidRemoveLastListener:fe});return Ie.event}gi.fromDOMEventEmitter=L;function J(ie,z){let Y,ee,ne=new Promise(fe=>{ee=t(ie)(fe),dv(ee,z),Y=()=>{HS(ee,z)}});return ne.cancel=Y,z&&ne.finally(()=>HS(ee,z)),ne}gi.toPromise=J;function K(ie,z){return ie(Y=>z.fire(Y))}gi.forward=K;function ve(ie,z,Y){return z(Y),ie(ee=>z(ee))}gi.runAndSubscribe=ve;class yt{constructor(z,Y){this._observable=z;this._counter=0;this._hasChanged=!1;let ee={onWillAddFirstListener:()=>{z.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{z.removeObserver(this)}};Y||r(ee),this.emitter=new b(ee),Y&&Y.add(this.emitter)}beginUpdate(z){this._counter++}handlePossibleChange(z){}handleChange(z,Y){this._hasChanged=!0}endUpdate(z){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ot(ie,z){return new yt(ie,z).emitter.event}gi.fromObservable=Ot;function pn(ie){return(z,Y,ee)=>{let ne=0,fe=!1,Ie={beginUpdate(){ne++},endUpdate(){ne--,ne===0&&(ie.reportChanges(),fe&&(fe=!1,z.call(Y)))},handlePossibleChange(){},handleChange(){fe=!0}};ie.addObserver(Ie),ie.reportChanges();let bt={dispose(){ie.removeObserver(Ie)}};return dv(bt,ee),bt}}gi.fromObservableLight=pn})(S||={});sv=class n{constructor(r){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${r}_${n._idPool++}`,n.all.add(this)}static{this.all=new Set}static{this._idPool=0}start(r){this._stopWatch=new ii,this.listenerCount=r}stop(){if(this._stopWatch){let r=this._stopWatch.elapsed();this.durations.push(r),this.elapsedOverall+=r,this.invocationCount+=1,this._stopWatch=void 0}}},VS=-1,av=class n{constructor(r,e,t=(n._idPool++).toString(16).padStart(3,"0")){this._errorHandler=r;this.threshold=e;this.name=t;this._warnCountdown=0}static{this._idPool=1}dispose(){this._stacks?.clear()}check(r,e){let t=this.threshold;if(t<=0||e<t)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(r.value)||0;if(this._stacks.set(r.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=t*.5;let[o,s]=this.getMostFrequentStack(),a=/^[0-9a-f]+$/i.test(this.name)?void 0:this.name,l=`[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${s}):`;console.warn(l),console.warn(o);let c=s/e>.3?"dominated":"popular",d=new La(c,l,o,e,a);this._errorHandler(d)}return()=>{let o=this._stacks.get(r.value)||0;this._stacks.set(r.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let r,e=0;for(let[t,i]of this._stacks)(!r||e<i)&&(r=[t,i],e=i);return r}},Aa=class n{constructor(r){this.value=r}static create(){let r=new Error;return new n(r.stack??"")}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},La=class n extends Error{constructor(r,e,t,i,o){super(o?`[${o}] potential listener LEAK detected, ${r}`:`potential listener LEAK detected, ${r}`),this.name="ListenerLeakError",this.kind=r,this.listenerCount=i,this.details=e,this.stack=t}static is(r){return r instanceof n||r instanceof Error&&typeof r.kind=="string"&&typeof r.listenerCount=="number"}},lv=class extends La{constructor(r,e,t,i,o){super(r,e,t,i,o),this.name="ListenerRefusalError"}},qR=0,Da=class{constructor(r){this.value=r;this.id=qR++}},KR=2,zR=(n,r)=>{if(n instanceof Da)r(n);else for(let e=0;e<n.length;e++){let t=n[e];t&&r(t)}},b=class{constructor(r){this._size=0;this._options=r,this._leakageMon=VS>0||this._options?.leakWarningThreshold?new av(r?.onListenerError??nt,this._options?.leakWarningThreshold??VS,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new sv(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(US){let r=this._listeners;queueMicrotask(()=>{zR(r,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(r,e,t)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=c[1]/this._size>.3?"dominated":"popular",u=new lv(d,`${l}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||nt)(u),T.None}if(this._disposed)return T.None;e&&(r=r.bind(e));let i=new Da(r),o,s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Aa.create(),o=this._leakageMon.check(i.stack,this._size+1)),US&&(i.stack=s??Aa.create()),this._listeners?this._listeners instanceof Da?(this._deliveryQueue??=new cv,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=G(()=>{o?.(),this._removeListener(i)});return dv(a,t),a},this._event}_removeListener(r){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,t=e.indexOf(r);if(t===-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[t]=void 0;let i=this._deliveryQueue.current===this;if(this._size*KR<=e.length){let o=0;for(let s=0;s<e.length;s++)e[s]?e[o++]=e[s]:i&&o<this._deliveryQueue.end&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=o}}_deliver(r,e){if(!r)return;let t=this._options?.onListenerError||nt;if(!t){r.value(e);return}try{r.value(e)}catch(i){t(i)}}_deliverQueue(r){let e=r.current._listeners;for(;r.i<r.end;)this._deliver(e[r.i++],r.value);r.reset()}fire(r){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Da)this._deliver(this._listeners,r);else{let e=this._deliveryQueue;e.enqueue(this,r,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},cv=class{constructor(){this.i=-1;this.end=0}enqueue(r,e,t){this.i=0,this.end=t,this.current=r,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},ks=class extends b{constructor(e){super(e);this._isPaused=0;this._eventQueue=new Ra;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))}},Xp=class{constructor(){this.hasListeners=!1;this.events=[];this.emitter=new b({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(r){let e={event:r,listener:null};return this.events.push(e),this.hasListeners&&this.hook(e),G(Xn(()=>{this.hasListeners&&this.unhook(e);let i=this.events.indexOf(e);this.events.splice(i,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(r=>this.hook(r))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(r=>this.unhook(r))}hook(r){r.listener=r.event(e=>this.emitter.fire(e))}unhook(r){r.listener?.dispose(),r.listener=null}dispose(){this.emitter.dispose();for(let r of this.events)r.listener?.dispose();this.events=[]}},dd=class{constructor(){this.listening=!1;this.inputEvent=S.None;this.inputEventListener=T.None;this.emitter=new b({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(r){this.inputEvent=r,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=r(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}});var $S,Ce,Ma,$e,wt=I(()=>{q();$();$S=Object.freeze(function(n,r){let e=setTimeout(n.bind(r),0);return{dispose(){clearTimeout(e)}}});(t=>{function n(i){return i===t.None||i===t.Cancelled||i instanceof Ma?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=n,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:S.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$S})})(Ce||={});Ma=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?$S:(this._emitter||(this._emitter=new b),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},$e=class{constructor(r){this._token=void 0;this._parentListener=void 0;this._parentListener=r&&r.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Ma),this._token}cancel(){this._token?this._token instanceof Ma&&this._token.cancel():this._token=Ce.Cancelled}dispose(r=!1){r&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Ma&&this._token.dispose():this._token=Ce.None}}});var zi=I(()=>{});function jR(n){return n}var Yp,qS=I(()=>{wt();Yp=class{constructor(r,e){this.lastCache=void 0;this.lastArgKey=void 0;typeof r=="function"?(this._fn=r,this._computeKey=jR):(this._fn=e,this._computeKey=r.getCacheKey)}get(r){let e=this._computeKey(r);return this.lastArgKey!==e&&(this.lastArgKey=e,this.lastCache=this._fn(r)),this.lastCache}}});var rr,Yn=I(()=>{rr=class{constructor(r){this.executor=r;this._state=0}get hasValue(){return this._state===2}get value(){if(this._state===0){this._state=1;try{this._value=this.executor()}catch(r){this._error=r}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 KS=I(()=>{});function QS(n){return!n||typeof n!="string"?!0:n.trim().length===0}function XS(n){return n.replace(/[<>"'&]/g,r=>{switch(r){case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&apos;";case"&":return"&amp;"}return r})}function Lo(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function uv(n,r=" "){let e=pv(n,r);return ji(e,r)}function pv(n,r){if(!n||!r)return n;let e=r.length,t=0;if(e===1){let i=r.charCodeAt(0);for(;t<n.length&&n.charCodeAt(t)===i;)t++}else for(;n.startsWith(r,t);)t+=e;return n.substring(t)}function ji(n,r){if(!n||!r)return n;let e=r.length,t=n.length;if(e===1){let o=t,s=r.charCodeAt(0);for(;o>0&&n.charCodeAt(o-1)===s;)o--;return n.substring(0,o)}let i=t;for(;i>0&&n.endsWith(r,i);)i-=e;return n.substring(0,i)}function ud(n,r){return n<r?-1:n>r?1:0}function Zp(n,r,e=0,t=n.length,i=0,o=r.length){for(;e<t&&i<o;e++,i++){let l=n.charCodeAt(e),c=r.charCodeAt(i);if(l<c)return-1;if(l>c)return 1}let s=t-e,a=o-i;return s<a?-1:s>a?1:0}function pd(n,r){return Rs(n,r,0,n.length,0,r.length)}function Rs(n,r,e=0,t=n.length,i=0,o=r.length){for(;e<t&&i<o;e++,i++){let l=n.charCodeAt(e),c=r.charCodeAt(i);if(l===c)continue;if(l>=128||c>=128)return Zp(n.toLowerCase(),r.toLowerCase(),e,t,i,o);zS(l)&&(l-=32),zS(c)&&(c-=32);let d=l-c;if(d!==0)return d}let s=t-e,a=o-i;return s<a?-1:s>a?1:0}function zS(n){return n>=97&&n<=122}function fv(n){return n>=65&&n<=90}function $r(n,r){return n.length===r.length&&Rs(n,r)===0}function Mo(n,r){let e=r.length;return e<=n.length&&Rs(n,r,0,e)===0}function YS(n,r){let e=n.length,t=e-r.length;return t>=0&&Rs(n,r,t,e)===0}function ZS(n){return 55296<=n&&n<=56319}function mv(n){return 56320<=n&&n<=57343}function e1(n,r){return(n-55296<<10)+(r-56320)+65536}function XR(){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 GR,JR,QR,h4,g4,jS,GS,JS,ar=I(()=>{qS();zi();Yn();KS();GR=/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,JR=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,QR=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,h4=new RegExp("(?:"+[GR.source,JR.source,QR.source].join("|")+")","g"),g4=String.fromCharCode(65279),jS=class n{static{this._INSTANCE=null}static getInstance(){return n._INSTANCE||(n._INSTANCE=new n),n._INSTANCE}constructor(){this._data=XR()}getGraphemeBreakType(r){if(r<32)return r===10?3:r===13?2:4;if(r<127)return 0;let e=this._data,t=e.length/3,i=1;for(;i<=t;)if(r<e[3*i])i=2*i;else if(r>e[3*i+1])i=2*i+1;else return e[3*i+2];return 0}};GS=class n{constructor(r){this.confusableDictionary=r}static{this.ambiguousCharacterData=new rr(()=>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 Yp(r=>{let e=r.split(",");function t(u){let f=new Map;for(let m=0;m<u.length;m+=2)f.set(u[m],u[m+1]);return f}function i(u,f){let m=new Map(u);for(let[v,y]of f)m.set(v,y);return m}function o(u,f){if(!u)return f;let m=new Map;for(let[v,y]of u)f.has(v)&&m.set(v,y);return m}let s=this.ambiguousCharacterData.value,a=e.filter(u=>!u.startsWith("_")&&Object.hasOwn(s,u));a.length===0&&(a=["_default"]);let l;for(let u of a){let f=t(s[u]);l=o(l,f)}let c=t(s._common),d=i(c,l);return new n(d)})}static getInstance(r){return n.cache.get(Array.from(r).join(","))}static{this._locales=new rr(()=>Object.keys(n.ambiguousCharacterData.value).filter(r=>!r.startsWith("_")))}static getLocales(){return n._locales.value}isAmbiguous(r){return this.confusableDictionary.has(r)}containsAmbiguousCharacter(r){for(let e=0;e<r.length;e++){let t=r.codePointAt(e);if(typeof t=="number"&&this.isAmbiguous(t))return!0}return!1}getPrimaryConfusable(r){return this.confusableDictionary.get(r)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},JS=class n{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(n.getRawData())].flat())),this._data}static isInvisibleCharacter(r){return n.getData().has(r)}static containsInvisibleCharacter(r){for(let e=0;e<r.length;e++){let t=r.codePointAt(e);if(typeof t=="number"&&(n.isInvisibleCharacter(t)||t===32))return!0}return!1}static get codePoints(){return n.getData()}}});function Oo(n){return n===47||n===92}function wn(n){return n.replace(/[\\/]/g,pe.sep)}function t1(n){return n.indexOf("/")===-1&&(n=wn(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function hv(n,r=pe.sep){if(!n)return"";let e=n.length,t=n.charCodeAt(0);if(Oo(t)){if(Oo(n.charCodeAt(1))&&!Oo(n.charCodeAt(2))){let o=3,s=o;for(;o<e&&!Oo(n.charCodeAt(o));o++);if(s!==o&&!Oo(n.charCodeAt(o+1))){for(o+=1;o<e;o++)if(Oo(n.charCodeAt(o)))return n.slice(0,o+1).replace(/[\\/]/g,r)}}return r}else if(tf(t)&&n.charCodeAt(1)===58)return Oo(n.charCodeAt(2))?n.slice(0,2)+r:n.slice(0,2);let i=n.indexOf("://");if(i!==-1){for(i+=3;i<e;i++)if(Oo(n.charCodeAt(i)))return n.slice(0,i+1)}return""}function r1(n){if(!F||!n||n.length<5)return!1;let r=n.charCodeAt(0);if(r!==92||(r=n.charCodeAt(1),r!==92))return!1;let e=2,t=e;for(;e<n.length&&(r=n.charCodeAt(e),r!==92);e++);return!(t===e||(r=n.charCodeAt(e+1),isNaN(r)||r===92))}function i1(n,r=F){let e=r?YR:ZR;return!(!n||n.length===0||/^\s+$/.test(n)||(e.lastIndex=0,e.test(n))||r&&eD.test(n)||n==="."||n===".."||r&&n[n.length-1]==="."||r&&n.length!==n.trim().length||n.length>255)}function Fo(n,r,e){let t=n===r;return!e||t?t:!n||!r?!1:$r(n,r)}function eo(n,r,e,t=Bt){if(n===r)return!0;if(!n||!r||r.length>n.length)return!1;if(e){if(!Mo(n,r))return!1;if(r.length===n.length)return!0;let o=r.length;return r.charAt(r.length-1)===t&&o--,n.charAt(o)===t}return r.charAt(r.length-1)!==t&&(r+=t),n.indexOf(r)===0}function tf(n){return n>=65&&n<=90||n>=97&&n<=122}function rf(n,r){return F&&n.endsWith(":")&&(n+=Bt),Do(n)||(n=N(r,n)),n=kt(n),gv(n)}function gv(n){return F?(n=ji(n,Bt),n.endsWith(":")&&(n+=Bt)):(n=ji(n,Bt),n||(n=Bt)),n}function vv(n){let r=kt(n);return F?n.length>3?!1:yv(r)&&(n.length===2||r.charCodeAt(2)===92):r===pe.sep}function yv(n,r=F){return r?tf(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function Oa(n){let r=n.split(":"),e,t,i;for(let o of r){let s=Number(o);Ki(s)?t===void 0?t=s:i===void 0&&(i=s):e=e?[e,o].join(":"):o}if(!e)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:e,line:t!==void 0?t:void 0,column:i!==void 0?i:t!==void 0?1:void 0}}function Ds(n,r,e=8){let t="";for(let o=0;o<e;o++){let s;o===0&&F&&!r&&(e===3||e===4)?s=rD:s=tD,t+=s.charAt(Math.floor(Math.random()*s.length))}let i;return r?i=`${r}-${t}`:i=t,n?N(n,i):i}var YR,ZR,eD,tD,rD,ni=I(()=>{zi();we();X();ar();Oe();YR=/[\\/:\*\?"<>\|]/g,ZR=/[/]/g,eD=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;tD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rD="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789"});var nf=I(()=>{});function aD(n,r){if(!n.scheme&&r)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!nD.test(n.scheme)){let e=[...n.scheme.matchAll(/[^\w\d+.-]/gu)],t=e.length>0?` Found '${e[0][0]}' at index ${e[0].index} (${e.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${t} (len:${n.scheme.length})`)}if(n.path){if(n.authority){if(!oD.test(n.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(sD.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function lD(n,r){return!n&&!r?"file":n}function cD(n,r){switch(n){case"https":case"http":case"file":r?r[0]!==Gi&&(r=Gi+r):r=Gi;break}return r}function n1(n,r,e){let t,i=-1;for(let o=0;o<n.length;o++){let s=n.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||r&&s===47||e&&s===91||e&&s===93||e&&s===58)i!==-1&&(t+=encodeURIComponent(n.substring(i,o)),i=-1),t!==void 0&&(t+=n.charAt(o));else{t===void 0&&(t=n.substr(0,o));let a=l1[s];a!==void 0?(i!==-1&&(t+=encodeURIComponent(n.substring(i,o)),i=-1),t+=a):i===-1&&(i=o)}}return i!==-1&&(t+=encodeURIComponent(n.substring(i))),t!==void 0?t:n}function uD(n){let r;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);t===35||t===63?(r===void 0&&(r=n.substr(0,e)),r+=l1[t]):r!==void 0&&(r+=n[e])}return r!==void 0?r:n}function fd(n,r){let e;return n.authority&&n.path.length>1&&n.scheme==="file"?e=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?r?e=n.path.substr(1):e=n.path[1].toLowerCase()+n.path.substr(2):e=n.path,F&&(e=e.replace(/\//g,"\\")),e}function Iv(n,r){let e=r?uD:n1,t="",{scheme:i,authority:o,path:s,query:a,fragment:l}=n;if(i&&(t+=i,t+=":"),(o||i==="file")&&(t+=Gi,t+=Gi),o){let c=o.indexOf("@");if(c!==-1){let d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?t+=e(d,!1,!1):(t+=e(d.substr(0,c),!1,!1),t+=":",t+=e(d.substr(c+1),!1,!0)),t+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?t+=e(o,!1,!0):(t+=e(o.substr(0,c),!1,!0),t+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){let c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){let c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}t+=e(s,!0,!1)}return a&&(t+="?",t+=e(a,!1,!1)),l&&(t+="#",t+=r?l:n1(l,!1,!1)),t}function c1(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+c1(n.substr(3)):n}}function of(n){return n.match(o1)?n.replace(o1,r=>c1(r)):n}var nD,oD,sD,ht,Gi,dD,x,a1,Wo,l1,o1,ce=I(()=>{zi();nf();we();X();nD=/^\w[\w\d+.-]*$/,oD=/^\//,sD=/^\/\//;ht="",Gi="/",dD=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,x=class n{static isUri(r){return r instanceof n?!0:!r||typeof r!="object"?!1:typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="string"&&typeof r.with=="function"&&typeof r.toString=="function"}constructor(r,e,t,i,o,s=!1){typeof r=="object"?(this.scheme=r.scheme||ht,this.authority=r.authority||ht,this.path=r.path||ht,this.query=r.query||ht,this.fragment=r.fragment||ht):(this.scheme=lD(r,s),this.authority=e||ht,this.path=cD(this.scheme,t||ht),this.query=i||ht,this.fragment=o||ht,aD(this,s))}get fsPath(){return fd(this,!1)}with(r){if(!r)return this;let{scheme:e,authority:t,path:i,query:o,fragment:s}=r;return e===void 0?e=this.scheme:e===null&&(e=ht),t===void 0?t=this.authority:t===null&&(t=ht),i===void 0?i=this.path:i===null&&(i=ht),o===void 0?o=this.query:o===null&&(o=ht),s===void 0?s=this.fragment:s===null&&(s=ht),e===this.scheme&&t===this.authority&&i===this.path&&o===this.query&&s===this.fragment?this:new Wo(e,t,i,o,s)}static parse(r,e=!1){let t=dD.exec(r);return t?new Wo(t[2]||ht,of(t[4]||ht),of(t[5]||ht),of(t[7]||ht),of(t[9]||ht),e):new Wo(ht,ht,ht,ht,ht)}static file(r){let e=ht;if(F&&(r=r.replace(/\\/g,Gi)),r[0]===Gi&&r[1]===Gi){let t=r.indexOf(Gi,2);t===-1?(e=r.substring(2),r=Gi):(e=r.substring(2,t),r=r.substring(t)||Gi)}return new Wo("file",e,r,ht,ht)}static from(r,e){return new Wo(r.scheme,r.authority,r.path,r.query,r.fragment,e)}static joinPath(r,...e){if(!r.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${r.toString()}`);let t;return F&&r.scheme==="file"?t=n.file(dt.join(fd(r,!0),...e)).path:t=pe.join(r.path,...e),r.with({path:t})}toString(r=!1){return Iv(this,r)}toJSON(){return this}static revive(r){if(r){if(r instanceof n)return r;{let e=new Wo(r);return e._formatted=r.external??null,e._fsPath=r._sep===a1?r.fsPath??null:null,e}}else return r}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}},a1=F?1:void 0,Wo=class extends x{constructor(){super(...arguments);this._formatted=null;this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=fd(this,!1)),this._fsPath}toString(e=!1){return e?Iv(this,!0):(this._formatted||(this._formatted=Iv(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=a1),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}},l1={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"};o1=/(%[0-9A-Za-z][0-9A-Za-z])+/g});function pD(n,r){return x.isUri(n)?$r(n.scheme,r):Mo(n,r+":")}function Sv(n,...r){return r.some(e=>pD(n,e))}function mD(n){return`${n.quality??"oss"}-${n.commit??"dev"}`}var W,fD,wv,xv,Fa,bv,st,d1,u1,Wa,ze=I(()=>{He();X();ar();ce();we();(me=>(me.inMemory="inmemory",me.vscode="vscode",me.internal="private",me.walkThrough="walkThrough",me.walkThroughSnippet="walkThroughSnippet",me.http="http",me.https="https",me.file="file",me.mailto="mailto",me.untitled="untitled",me.data="data",me.command="command",me.vscodeRemote="vscode-remote",me.vscodeRemoteResource="vscode-remote-resource",me.vscodeManagedRemoteResource="vscode-managed-remote-resource",me.vscodeUserData="vscode-userdata",me.vscodeCustomEditor="vscode-custom-editor",me.vscodeNotebookCell="vscode-notebook-cell",me.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",me.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",me.vscodeNotebookCellOutput="vscode-notebook-cell-output",me.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",me.vscodeNotebookMetadata="vscode-notebook-metadata",me.vscodeInteractiveInput="vscode-interactive-input",me.vscodeSettings="vscode-settings",me.vscodeWorkspaceTrust="vscode-workspace-trust",me.vscodeTerminal="vscode-terminal",me.vscodeImageCarousel="vscode-image-carousel",me.vscodeChatCodeBlock="vscode-chat-code-block",me.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",me.vscodeChatEditor="vscode-chat-editor",me.vscodeChatInput="chatSessionInput",me.vscodeLocalChatSession="vscode-chat-session",me.webviewPanel="webview-panel",me.vscodeWebview="vscode-webview",me.vscodeBrowser="vscode-browser",me.extension="extension",me.vscodeFileResource="vscode-file",me.tmp="tmp",me.vsls="vsls",me.vscodeSourceControl="vscode-scm",me.commentsInput="comment",me.codeSetting="code-setting",me.outputChannel="output",me.accessibleView="accessible-view",me.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",me.chatEditingModel="chat-editing-text-model",me.copilotPr="copilot-pr"))(W||={});fD="tkn",wv=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(r){this._preferredWebSchema=r}setDelegate(r){this._delegate=r}setServerRootPath(r,e){this._serverRootPath=pe.join(e??"/",mD(r))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return pe.join(this._serverRootPath,W.vscodeRemoteResource)}set(r,e,t){this._hosts[r]=e,this._ports[r]=t}setConnectionToken(r,e){this._connectionTokens[r]=e}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(r){if(this._delegate)try{return this._delegate(r)}catch(a){return nt(a),r}let e=r.authority,t=this._hosts[e];t&&t.indexOf(":")!==-1&&t.indexOf("[")===-1&&(t=`[${t}]`);let i=this._ports[e],o=this._connectionTokens[e],s=`path=${encodeURIComponent(r.path)}`;return typeof o=="string"&&(s+=`&${fD}=${encodeURIComponent(o)}`),x.from({scheme:Pr?this._preferredWebSchema:W.vscodeRemoteResource,authority:`${t}:${i}`,path:this._remoteResourcesPath,query:s})}},xv=new wv;Fa="vscode-app",bv=class n{static{this.FALLBACK_AUTHORITY=Fa}asBrowserUri(r){let e=this.toUri(r);return this.uriToBrowserUri(e)}uriToBrowserUri(r){return r.scheme===W.vscodeRemote?xv.rewrite(r):r.scheme===W.file&&(Op||tS===`${W.vscodeFileResource}://${n.FALLBACK_AUTHORITY}`)?r.with({scheme:W.vscodeFileResource,authority:r.authority||n.FALLBACK_AUTHORITY,query:null,fragment:null}):r}asFileUri(r){let e=this.toUri(r);return this.uriToFileUri(e)}uriToFileUri(r){return r.scheme===W.vscodeFileResource?r.with({scheme:W.file,authority:r.authority!==n.FALLBACK_AUTHORITY?r.authority:null,query:null,fragment:null}):r}toUri(r){if(x.isUri(r))return r;if(globalThis._VSCODE_FILE_ROOT){let e=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(e))return x.joinPath(x.parse(e,!0),r);let t=N(e,r);return x.file(t)}throw new Error("Cannot determine URI for module id!")}},st=new bv,d1=Object.freeze({"Cache-Control":"no-cache, no-store"}),u1=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});(o=>{let n=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"}]]);o.CoopAndCoep=Object.freeze(n.get("3"));let e="vscode-coi";function t(s){let a;typeof s=="string"?a=new URL(s).searchParams:s instanceof URL?a=s.searchParams:x.isUri(s)&&(a=new URL(s.toString(!0)).searchParams);let l=a?.get(e);if(l)return n.get(l)}o.getHeadersFromQuery=t;function i(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}o.addSearchParam=i})(Wa||={})});function hr(n){return fd(n,!0)}var As,We,Je,Ua,Na,Pv,O4,hD,qr,f1,m1,oe,sf,F4,W4,h1,Or,p1,g1,U4,gD,gt=I(()=>{zi();ni();ze();we();X();ar();ce();As=class{constructor(r){this._ignorePathCasing=r}compare(r,e,t=!1){return r===e?0:ud(this.getComparisonKey(r,t),this.getComparisonKey(e,t))}isEqual(r,e,t=!1){return r===e?!0:!r||!e?!1:this.getComparisonKey(r,t)===this.getComparisonKey(e,t)}getComparisonKey(r,e=!1){return r.with({path:this._ignorePathCasing(r)?r.path.toLowerCase():void 0,fragment:e?null:void 0}).toString()}ignorePathCasing(r){return this._ignorePathCasing(r)}isEqualOrParent(r,e,t=!1){if(r.scheme===e.scheme){if(r.scheme===W.file)return eo(hr(r),hr(e),this._ignorePathCasing(r))&&r.query===e.query&&(t||r.fragment===e.fragment);if(Or(r.authority,e.authority))return eo(r.path,e.path,this._ignorePathCasing(r),"/")&&r.query===e.query&&(t||r.fragment===e.fragment)}return!1}joinPath(r,...e){return x.joinPath(r,...e)}basenameOrAuthority(r){return qr(r)||r.authority}basename(r,e){return pe.basename(r.path,e)}extname(r){return pe.extname(r.path)}dirname(r){if(r.path.length===0)return r;let e;return r.scheme===W.file?e=x.file(Le(hr(r))).path:(e=pe.dirname(r.path),r.authority&&e.length&&e.charCodeAt(0)!==47&&(console.error(`dirname("${r.toString})) resulted in a relative path`),e="/")),r.with({path:e})}normalizePath(r){if(!r.path.length)return r;let e;return r.scheme===W.file?e=x.file(kt(hr(r))).path:e=pe.normalize(r.path),r.with({path:e})}relativePath(r,e){if(r.scheme!==e.scheme||!Or(r.authority,e.authority))return;if(r.scheme===W.file){let o=Np(hr(r),hr(e));return F?wn(o):o}let t=r.path||"/",i=e.path||"/";if(this._ignorePathCasing(r)){let o=0;for(let s=Math.min(t.length,i.length);o<s&&!(t.charCodeAt(o)!==i.charCodeAt(o)&&t.charAt(o).toLowerCase()!==i.charAt(o).toLowerCase());o++);t=i.substr(0,o)+t.substr(o)}return pe.relative(t,i)}resolvePath(r,e){if(r.scheme===W.file){let t=x.file(Er(hr(r),e));return r.with({authority:t.authority,path:t.path})}return e=t1(e),r.with({path:pe.resolve(r.path,e)})}isAbsolutePath(r){return!!r.path&&r.path[0]==="/"}isEqualAuthority(r,e){return r===e||r!==void 0&&e!==void 0&&$r(r,e)}hasTrailingPathSeparator(r,e=Bt){if(r.scheme===W.file){let t=hr(r);return t.length>hv(t).length&&t[t.length-1]===e}else{let t=r.path;return t.length>1&&t.charCodeAt(t.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(r.fsPath)}}removeTrailingPathSeparator(r,e=Bt){return p1(r,e)?r.with({path:r.path.substr(0,r.path.length-1)}):r}addTrailingPathSeparator(r,e=Bt){let t=!1;if(r.scheme===W.file){let i=hr(r);t=i!==void 0&&i.length===hv(i).length&&i[i.length-1]===e}else{e="/";let i=r.path;t=i.length===1&&i.charCodeAt(i.length-1)===47}return!t&&!p1(r,e)?r.with({path:r.path+"/"}):r}},We=new As(()=>!1),Je=new As(n=>n.scheme===W.file?!re:!0),Ua=new As(n=>!0),Na=We.isEqual.bind(We),Pv=We.isEqualOrParent.bind(We),O4=We.getComparisonKey.bind(We),hD=We.basenameOrAuthority.bind(We),qr=We.basename.bind(We),f1=We.extname.bind(We),m1=We.dirname.bind(We),oe=We.joinPath.bind(We),sf=We.normalizePath.bind(We),F4=We.relativePath.bind(We),W4=We.resolvePath.bind(We),h1=We.isAbsolutePath.bind(We),Or=We.isEqualAuthority.bind(We),p1=We.hasTrailingPathSeparator.bind(We),g1=We.removeTrailingPathSeparator.bind(We),U4=We.addTrailingPathSeparator.bind(We);(o=>{o.META_DATA_LABEL="label",o.META_DATA_DESCRIPTION="description",o.META_DATA_SIZE="size",o.META_DATA_MIME="mime";function i(s){let a=new Map;s.path.substring(s.path.indexOf(";")+1,s.path.lastIndexOf(";")).split(";").forEach(d=>{let[u,f]=d.split(":");u&&f&&a.set(u,f)});let c=s.path.substring(0,s.path.indexOf(";"));return c&&a.set(o.META_DATA_MIME,c),a}o.parseMetaData=i})(gD||={})});var v1,y1=I(()=>{v1=Symbol("MicrotaskDelay")});function ff(n){return!!n&&typeof n.then=="function"}function Ji(n){let r=new $e,e=n(r.token),t=!1,i=new Promise((o,s)=>{let a=r.token.onCancellationRequested(()=>{t=!0,a.dispose(),s(new xt)});Promise.resolve(e).then(l=>{a.dispose(),r.dispose(),t?Qp(l)&&l.dispose():o(l)},l=>{a.dispose(),r.dispose(),s(l)})});return new class{cancel(){r.cancel(),r.dispose()}then(o,s){return i.then(o,s)}catch(o){return this.then(void 0,o)}finally(o){return i.finally(o)}}}function Tv(n,r,e){let t,i=setTimeout(()=>{t?.(void 0),e?.()},r);return Promise.race([n.finally(()=>clearTimeout(i)),new Promise(o=>t=o)])}function b1(){let n,r;return{promise:new Promise((t,i)=>{n=t,r=i}),resolve:n,reject:r}}function lt(n,r){return r?new Promise((e,t)=>{let i=setTimeout(()=>{o.dispose(),e()},n),o=r.onCancellationRequested(()=>{clearTimeout(i),o.dispose(),t(new xt)})}):Ji(e=>lt(n,e))}function S1(n,r=0,e){let t=setTimeout(()=>{n(),e&&i.dispose()},r),i=G(()=>{clearTimeout(t),e?.delete(i)});return e?.add(i),i}function x1(n,r=t=>!!t,e=null){let t=0,i=n.length,o=()=>{if(t>=i)return Promise.resolve(e);let s=n[t++];return Promise.resolve(s()).then(l=>r(l)?Promise.resolve(l):o())};return o()}async function P1(n,r,e){let t;for(let i=0;i<e;i++)try{return await n()}catch(o){t=o,await lt(r)}throw t}var md,lf,vD,yD,to,Tr,bn,hd,Di,Ba,Ls,cf,gr,df,uf,Va,gd,af,Ev,pf,At,vt,I1,Cv,w1,he=I(()=>{wt();He();q();$();gt();X();y1();Yn();md=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new $e}queue(r){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=r,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let t=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,t};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>{this.queuedPromise.then(e,t)})}return this.activePromise=r(this.cancellationTokenSource.token),new Promise((e,t)=>{this.activePromise.then(i=>{this.activePromise=null,e(i)},i=>{this.activePromise=null,t(i)})})}dispose(){this.cancellationTokenSource.cancel()}},lf=class{constructor(){this.promiseMap=new Map}queue(r,e){let i=(this.promiseMap.get(r)??Promise.resolve()).catch(()=>{}).then(e).finally(()=>{this.promiseMap.get(r)===i&&this.promiseMap.delete(r)});return this.promiseMap.set(r,i),i}peek(r){return this.promiseMap.get(r)||void 0}keys(){return this.promiseMap.keys()}},vD=(n,r)=>{let e=!0,t=setTimeout(()=>{e=!1,r()},n);return{isTriggered:()=>e,dispose:()=>{clearTimeout(t),e=!1}}},yD=n=>{let r=!0;return queueMicrotask(()=>{r&&(r=!1,n())}),{isTriggered:()=>r,dispose:()=>{r=!1}}},to=class{constructor(r){this.defaultDelay=r;this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(r,e=this.defaultDelay){this.task=r,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,o)=>{this.doResolve=i,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let i=this.task;return this.task=null,i()}}));let t=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=e===v1?yD(t):vD(e,t),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new xt),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},Tr=class{constructor(r){this.delayer=new to(r),this.throttler=new md}trigger(r,e){return this.delayer.trigger(()=>this.throttler.queue(r),e)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},bn=class{constructor(){this._isOpen=!1,this._promise=new Promise((r,e)=>{this._completePromise=r})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};hd=class{constructor(r){this._size=0;this._isDisposed=!1;this.maxDegreeOfParalellism=r,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new b}whenIdle(){return this.size>0?S.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(r){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((e,t)=>{this.outstandingPromises.push({factory:r,c:e,e:t}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){let r=this.outstandingPromises.shift();this.runningPromises++;let e=r.factory();e.then(r.c,r.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()}},Di=class extends hd{constructor(){super(1)}},Ba=class{constructor(){this.queues=new Map;this.drainers=new Set;this.drainListeners=void 0;this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let r=new At;return this.drainers.add(r),r.p}isDrained(){for(let[,r]of this.queues)if(r.size>0)return!1;return!0}queueSize(r,e=We){let t=e.getComparisonKey(r);return this.queues.get(t)?.size??0}queueFor(r,e,t=We){let i=t.getComparisonKey(r),o=this.queues.get(i);if(!o){o=new Di;let s=this.drainListenerCount++,a=S.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(i),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(s),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Dt),this.drainListeners.set(s,a),this.queues.set(i,o)}return o.queue(e)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let r of this.drainers)r.complete();this.drainers.clear()}dispose(){for(let[,r]of this.queues)r.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}},Ls=class{constructor(r,e){this._isDisposed=!1;this._token=void 0,typeof r=="function"&&typeof e=="number"&&this.setIfNotSet(r,e)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(r,e){if(this._isDisposed)throw new $i("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,r()},e)}setIfNotSet(r,e){if(this._isDisposed)throw new $i("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,r()},e))}},cf=class{constructor(){this.disposable=void 0;this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(r,e,t=globalThis){if(this.isDisposed)throw new $i("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=t.setInterval(()=>{r()},e);this.disposable=G(()=>{t.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},gr=class{constructor(r,e){this.timeoutToken=void 0,this.runner=r,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(r=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,r)}get delay(){return this.timeout}set delay(r){this.timeout=r}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?.()}},df=class{constructor(r,e){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.runner=r,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(r=this.timeout){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(r/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?.())}},uf=class extends gr{constructor(e,t){super(e,t);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()}},Va=class extends T{constructor(e,t){super();this.options=e;this.handler=t;this.pendingWork=[];this.throttler=this._register(new Qt);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 i of e)this.pendingWork.push(i);let t=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||t>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-t,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 gr(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};(function(){let n=globalThis;typeof n.requestIdleCallback!="function"||typeof n.cancelIdleCallback!="function"?af=(r,e,t)=>{iS(()=>{if(i)return;let o=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,o-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:af=(r,e,t)=>{let i=r.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0),o=!1;return{dispose(){o||(o=!0,r.cancelIdleCallback(i))}}},gd=(r,e)=>af(globalThis,r,e)})();Ev=class{constructor(r,e){this._didRun=!1;this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=af(r,()=>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}},pf=class extends Ev{constructor(r){super(globalThis,r)}};At=class n{static fromPromise(r){let e=new n;return e.settleWith(r),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((r,e)=>{this.completeCallback=r,this.errorCallback=e})}complete(r){return this.isSettled?Promise.resolve():new Promise(e=>{this.completeCallback(r),this.outcome={outcome:0,value:r},e()})}error(r){return this.isSettled?Promise.resolve():new Promise(e=>{this.errorCallback(r),this.outcome={outcome:1,value:r},e()})}settleWith(r){return r.then(e=>this.complete(e),e=>this.error(e))}cancel(){return this.error(new xt)}};(e=>{async function n(t){let i,o=await Promise.all(t.map(s=>s.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return o}e.settled=n;function r(t){return new Promise(async(i,o)=>{try{await t(i,o)}catch(s){o(s)}})}e.withAsyncBody=r})(vt||={});I1=class n{static fromArray(r){return new n(e=>{e.emitMany(r)})}static fromPromise(r){return new n(async e=>{e.emitMany(await r)})}static fromPromisesResolveOrder(r){return new n(async e=>{await Promise.all(r.map(async t=>e.emitOne(await t)))})}static merge(r){return new n(async e=>{await Promise.all(r.map(async t=>{for await(let i of t)e.emitOne(i)}))})}static{this.EMPTY=n.fromArray([])}constructor(r,e){this._state=0,this._results=[],this._error=null,this._onReturn=e,this._onStateChanged=new b,queueMicrotask(async()=>{let t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(r(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let r=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(r<this._results.length)return{done:!1,value:this._results[r++]};if(this._state===1)return{done:!0,value:void 0};await S.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(r,e){return new n(async t=>{for await(let i of r)t.emitOne(e(i))})}map(r){return n.map(this,r)}static filter(r,e){return new n(async t=>{for await(let i of r)e(i)&&t.emitOne(i)})}filter(r){return n.filter(this,r)}static coalesce(r){return n.filter(r,e=>!!e)}coalesce(){return n.coalesce(this)}static async toPromise(r){let e=[];for await(let t of r)e.push(t);return e}toPromise(){return n.toPromise(this)}emitOne(r){this._state===0&&(this._results.push(r),this._onStateChanged.fire())}emitMany(r){this._state===0&&(this._results=this._results.concat(r),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(r){this._state===0&&(this._state=2,this._error=r,this._onStateChanged.fire())}},Cv=class{constructor(){this._unsatisfiedConsumers=[];this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(r){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let e=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(e,r)}else this._unconsumedValues.push(r)}produceFinal(r){this._ensureNoFinalValue(),this._finalValue=r;for(let e of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(e,r);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new $i("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(r,e){e.ok?r.complete(e.value):r.error(e.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let r=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return r.ok?Promise.resolve(r.value):Promise.reject(r.error)}else{let r=new At;return this._unsatisfiedConsumers.push(r),r.p}}},w1=class n{constructor(r,e){this._onReturn=e;this._producerConsumer=new Cv;this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async r=>(this._finishError(r),{done:!0,value:void 0})};queueMicrotask(async()=>{let t=r({emitOne:i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),emitMany:i=>{for(let o of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}})},reject:i=>this._finishError(i)});if(!this._producerConsumer.hasFinalValue)try{await t,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(r){return new n(e=>{e.emitMany(r)})}static fromPromise(r){return new n(async e=>{e.emitMany(await r)})}static fromPromisesResolveOrder(r){return new n(async e=>{await Promise.all(r.map(async t=>e.emitOne(await t)))})}static merge(r){return new n(async e=>{await Promise.all(r.map(async t=>{for await(let i of t)e.emitOne(i)}))})}static{this.EMPTY=n.fromArray([])}static map(r,e){return new n(async t=>{for await(let i of r)t.emitOne(e(i))})}static tee(r){let e,t,i=new At,o=async()=>{if(!(!e||!t))try{for await(let l of r)e.emitOne(l),t.emitOne(l)}catch(l){e.reject(l),t.reject(l)}finally{i.complete()}},s=new n(async l=>(e=l,o(),i.p)),a=new n(async l=>(t=l,o(),i.p));return[s,a]}map(r){return n.map(this,r)}static coalesce(r){return n.filter(r,e=>!!e)}coalesce(){return n.coalesce(this)}static filter(r,e){return new n(async t=>{for await(let i of r)e(i)&&t.emitOne(i)})}filter(r){return n.filter(this,r)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(r){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:r})}[Symbol.asyncIterator](){return this._iterator}}});function Sn(n){return E1(n,"NFC",ID)}function bD(n){return E1(n,"NFD",wD)}function E1(n,r,e){if(!n)return n;let t=e.get(n);if(t)return t;let i;return SD.test(n)?i=n.normalize(r):i=n,e.set(n,i),i}var ID,wD,SD,rU,vd=I(()=>{Cr();ID=new ki(1e4);wD=new ki(1e4);SD=/[^\u0000-\u0080]/;rU=(function(){let n=new ki(1e4),r=/[\u0300-\u036f]/g;return function(e){let t=n.get(e);if(t)return t;let i=bD(e).replace(r,""),o=(i.length===e.length?i:e).toLowerCase();return n.set(e,o),o}})()});import*as be from"fs";import{tmpdir as xD}from"os";import{promisify as yd}from"util";async function _1(n,r=0,e){if(vv(n))throw new Error("rimraf - will refuse to recursively delete root");return r===0?_v(n):PD(n,e)}async function PD(n,r=Ds(xD())){try{try{await be.promises.rename(n,r)}catch(e){return e.code==="ENOENT"?void 0:_v(n)}_v(r).catch(()=>{})}catch(e){if(e.code!=="ENOENT")throw e}}async function _v(n){return be.promises.rm(n,{recursive:!0,force:!0,maxRetries:3})}async function mf(n,r){try{return await C1(n,r)}catch(e){if(e.code==="ENOENT"&&F&&vv(n))try{return await C1(`${n}.`,r)}catch{}throw e}}async function C1(n,r){return CD(await(r?ED(n):be.promises.readdir(n)))}async function ED(n){try{return await be.promises.readdir(n,{withFileTypes:!0})}catch(t){t.code!=="ENOENT"&&console.warn("[node.js fs] readdir with filetypes failed with error: ",t)}let r=[],e=await mf(n);for(let t of e){let i=!1,o=!1,s=!1;try{let a=await be.promises.lstat(N(n,t));i=a.isFile(),o=a.isDirectory(),s=a.isSymbolicLink()}catch(a){a.code!=="ENOENT"&&console.warn("[node.js fs] unexpected error from lstat after readdir: ",a)}r.push({name:t,isFile:()=>i,isDirectory:()=>o,isSymbolicLink:()=>s})}return r}function CD(n){return n.map(r=>typeof r=="string"?V?Sn(r):r:(r.name=V?Sn(r.name):r.name,r))}async function TD(n){let r=await mf(n),e=[];for(let t of r)await ir.existsDirectory(N(n,t))&&e.push(t);return e}function k1(n,r=1e3){return new Promise(e=>{let t=!1,i=setInterval(()=>{t||(t=!0,be.access(n,o=>{t=!1,o&&(clearInterval(i),e(void 0))}))},r)})}function kD(n,r,e){return _D.queueFor(x.file(n),()=>{let t=AD(e);return new Promise((i,o)=>DD(n,r,t,s=>s?o(s):i()))},Je)}function RD(n){R1=n}function DD(n,r,e,t){if(!R1)return be.writeFile(n,r,{mode:e.mode,flag:e.flag},t);be.open(n,e.flag,e.mode,(i,o)=>{if(i)return t(i);be.writeFile(o,r,s=>{if(s)return be.close(o,()=>t(s));be.fdatasync(o,a=>(a&&(console.warn("[node.js fs] fdatasync is now disabled for this session because it failed: ",a),RD(!1)),be.close(o,l=>t(l))))})})}function AD(n){return n?{mode:typeof n.mode=="number"?n.mode:438,flag:typeof n.flag=="string"?n.flag:"w"}:{mode:438,flag:"w"}}async function LD(n,r,e=6e4){if(n!==r)try{F&&typeof e=="number"?await D1(n,r,Date.now(),e):await be.promises.rename(n,r)}catch(t){if(n.toLowerCase()!==r.toLowerCase()&&t.code==="EXDEV"||n.endsWith("."))await A1(n,r,{preserveSymlinks:!1}),await _1(n,1);else throw t}}async function D1(n,r,e,t,i=0){try{return await be.promises.rename(n,r)}catch(o){if(o.code!=="EACCES"&&o.code!=="EPERM"&&o.code!=="EBUSY")throw o;if(Date.now()-e>=t)throw console.error(`[node.js fs] rename failed after ${i} retries with error: ${o}`),o;if(i===0){let s=!1;try{let{stat:a}=await ir.stat(r);a.isFile()||(s=!0)}catch{}if(s)throw o}return await lt(Math.min(100,i*10)),D1(n,r,e,t,i+1)}}async function A1(n,r,e){return L1(n,r,{root:{source:n,target:r},options:e,handledSourcePaths:new Set})}async function L1(n,r,e){if(e.handledSourcePaths.has(n))return;e.handledSourcePaths.add(n);let{stat:t,symbolicLink:i}=await ir.stat(n);if(i){if(e.options.preserveSymlinks)try{return await FD(n,r,e)}catch{}if(i.dangling)return}return t.isDirectory()?MD(n,r,t.mode&T1,e):OD(n,r,t.mode&T1)}async function MD(n,r,e,t){await be.promises.mkdir(r,{recursive:!0,mode:e});let i=await mf(n);for(let o of i)await L1(N(n,o),N(r,o),t)}async function OD(n,r,e){await be.promises.copyFile(n,r),await be.promises.chmod(r,e)}async function FD(n,r,e){let t=await be.promises.readlink(n);eo(t,e.root.source,!re)&&(t=N(e.root.target,t.substr(e.root.source.length+1))),await be.promises.symlink(t,r)}async function WD(n){try{return await yd(be.realpath)(n)}catch{let r=UD(n);return await be.promises.access(r,be.constants.R_OK),r}}function UD(n){return ji(kt(n),Bt)}var ir,_D,R1,T1,Q,nr=I(()=>{he();ni();vd();we();X();gt();ce();ar();(t=>{async function n(i){let o;try{if(o=await be.promises.lstat(i),!o.isSymbolicLink())return{stat:o}}catch{}try{return{stat:await be.promises.stat(i),symbolicLink:o?.isSymbolicLink()?{dangling:!1}:void 0}}catch(s){if(s.code==="ENOENT"&&o)return{stat:o,symbolicLink:{dangling:!0}};if(F&&s.code==="EACCES")try{return{stat:await be.promises.stat(await be.promises.readlink(i)),symbolicLink:{dangling:!1}}}catch(a){if(a.code==="ENOENT"&&o)return{stat:o,symbolicLink:{dangling:!0}};throw a}throw s}}t.stat=n;async function r(i){try{let{stat:o,symbolicLink:s}=await t.stat(i);return o.isFile()&&s?.dangling!==!0}catch{}return!1}t.existsFile=r;async function e(i){try{let{stat:o,symbolicLink:s}=await t.stat(i);return o.isDirectory()&&s?.dangling!==!0}catch{}return!1}t.existsDirectory=e})(ir||={});_D=new Ba;R1=!0;T1=511;Q=new class{get read(){return(n,r,e,t,i)=>new Promise((o,s)=>{be.read(n,r,e,t,i,(a,l,c)=>a?s(a):o({bytesRead:l,buffer:c}))})}get write(){return(n,r,e,t,i)=>new Promise((o,s)=>{be.write(n,r,e,t,i,(a,l,c)=>a?s(a):o({bytesWritten:l,buffer:c}))})}get fdatasync(){return yd(be.fdatasync)}get open(){return yd(be.open)}get close(){return yd(be.close)}get ftruncate(){return yd(be.ftruncate)}async exists(n){try{return await be.promises.access(n),!0}catch{return!1}}get readdir(){return mf}get readDirsInDir(){return TD}get writeFile(){return kD}get rm(){return _1}get rename(){return LD}get copy(){return A1}get realpath(){return WD}}});function M1(){let n=O1();return n?Array.from(n):[]}function O1(){return process.uncHostAllowlist}function io(n){if(process.platform!=="win32")return;let r=O1();if(r)if(typeof n=="string")r.add(n.toLowerCase());else for(let e of HD(n))io(e)}function HD(n){let r=new Set;if(Array.isArray(n))for(let e of n)typeof e=="string"&&r.add(e);return Array.from(r)}function hf(n){if(typeof n!="string")return;let r=["\\\\.\\UNC\\","\\\\?\\UNC\\","\\\\"],e;for(let t of r){if(n.indexOf(t)!==0)continue;let o=n.indexOf("\\",t.length);if(o===-1)continue;let s=n.substring(t.length,o);if(s){e=s;break}}return e}function F1(){process.platform==="win32"&&(process.restrictUNCAccess=!1)}function W1(){return process.platform!=="win32"?!0:process.restrictUNCAccess===!1}var Ha=I(()=>{});var U1,SU,bd=I(()=>{xe();U1="/etc/vscode/policy.json",SU={Extensions:{name:{key:"extensionsConfigurationTitle",value:h(138,null)}},IntegratedTerminal:{name:{key:"terminalIntegratedConfigurationTitle",value:h(141,null)}},InteractiveSession:{name:{key:"interactiveSessionConfigurationTitle",value:h(139,null)}},Telemetry:{name:{key:"telemetryConfigurationTitle",value:h(140,null)}},Update:{name:{key:"updateConfigurationTitle",value:h(142,null)}}}});function $D(n,r,e){r[Qi.DI_TARGET]===r?r[Qi.DI_DEPENDENCIES].push({id:n,index:e}):(r[Qi.DI_DEPENDENCIES]=[{id:n,index:e}],r[Qi.DI_TARGET]=r)}function O(n){if(Qi.serviceIds.has(n))return Qi.serviceIds.get(n);let r=function(e,t,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");$D(r,e,i)};return r.toString=()=>n,Qi.serviceIds.set(n,r),r}var Qi,Ht,Z=I(()=>{(i=>{i.serviceIds=new Map,i.DI_TARGET="$di$target",i.DI_DEPENDENCIES="$di$dependencies";function t(o){return o[i.DI_DEPENDENCIES]||[]}i.getServiceDependencies=t})(Qi||={});Ht=O("instantiationService")});function gf(n){let r=n;return r&&typeof r=="object"&&(!r.overrideIdentifier||typeof r.overrideIdentifier=="string")&&(!r.resource||r.resource instanceof x)}function N1(n){let r=n;return r&&typeof r=="object"&&(!r.overrideIdentifiers||Array.isArray(r.overrideIdentifiers))&&!r.overrideIdentifier&&(!r.resource||r.resource instanceof x)}function vf(n,r){let e=Object.create(null);for(let t in n)Rv(e,t,n[t],r);return e}function Rv(n,r,e,t){let i=r.split("."),o=i.pop(),s=n;for(let a=0;a<i.length;a++){let l=i[a],c=s[l];switch(typeof c){case"undefined":c=s[l]=Object.create(null);break;case"object":if(c===null){t(`Ignoring ${r} as ${i.slice(0,a+1).join(".")} is null`);return}break;default:t(`Ignoring ${r} as ${i.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}s=c}if(typeof s=="object"&&s!==null)try{s[o]=e}catch{t(`Ignoring ${r} as ${i.join(".")} is ${JSON.stringify(s)}`)}else t(`Ignoring ${r} as ${i.join(".")} is ${JSON.stringify(s)}`)}function B1(n,r){let e=r.split(".");V1(n,e)}function V1(n,r){if(!n)return;let e=n,t=r.shift();if(r.length===0){delete e[t];return}if(Object.keys(e).indexOf(t)!==-1){let i=e[t];typeof i=="object"&&!Array.isArray(i)&&(V1(i,r),Object.keys(i).length===0&&delete e[t])}}function Sd(n,r,e){function t(s,a){let l=s;for(let c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}let i=r.split("."),o=t(n,i);return typeof o>"u"?e:o}function H1(n){return n.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}var ue,et=I(()=>{Ta();Oe();ce();Z();ue=O("configurationService")});function $1(n){let r=!1,e=new Map,t=new Map;if(qD(n,d=>{if(n===d)return!0;let u=JSON.stringify(d);if(u.length<30)return!0;let f=e.get(u);if(!f){let m={schemas:[d]};return e.set(u,m),t.set(d,m),!0}return f.schemas.push(d),t.set(d,f),r=!0,!1}),e.clear(),!r)return JSON.stringify(n);let o="$defs";for(;n.hasOwnProperty(o);)o+="_";let s=[];function a(d){return JSON.stringify(d,(u,f)=>{if(f!==d){let m=t.get(f);if(m&&m.schemas.length>1)return m.id||(m.id=`_${s.length}`,s.push(m.schemas[0])),{$ref:`#/${o}/${m.id}`}}return f})}let l=a(n),c=[];for(let d=0;d<s.length;d++)c.push(`"_${d}":${a(s[d])}`);return c.length?`${l.substring(0,l.length-1)},"${o}":{${c.join(",")}}}`:l}function $a(n){return typeof n=="object"&&n!==null}function qD(n,r){if(!n||typeof n!="object")return;let e=(...l)=>{for(let c of l)$a(c)&&s.push(c)},t=(...l)=>{for(let c of l)if($a(c))for(let d in c){let u=c[d];$a(u)&&s.push(u)}},i=(...l)=>{for(let c of l)if(Array.isArray(c))for(let d of c)$a(d)&&s.push(d)},o=l=>{if(Array.isArray(l))for(let c of l)$a(c)&&s.push(c);else $a(l)&&s.push(l)},s=[n],a=s.pop();for(;a;)r(a)&&(e(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),t(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),i(a.anyOf,a.allOf,a.oneOf,a.prefixItems),o(a.items)),a=s.pop()}var q1=I(()=>{});var Dv,Pt,Xi=I(()=>{Ta();Oe();Dv=class{constructor(){this.data=new Map}add(r,e){jp(Fe(r)),jp(Ge(e)),jp(!this.data.has(r),"There is already an extension with this id"),this.data.set(r,e)}knows(r){return this.data.has(r)}as(r){return this.data.get(r)||null}dispose(){this.data.forEach(r=>{sd(r.dispose)&&r.dispose()}),this.data.clear()}},Pt=new Dv});function K1(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}var Lv,Av,zD,z1=I(()=>{q();q1();$();Xi();Lv={JSONContribution:"base.contributions.json"};Av=class extends T{constructor(){super(...arguments);this.schemasById={};this.schemaAssociations={};this._onDidChangeSchema=this._register(new b);this.onDidChangeSchema=this._onDidChangeSchema.event;this._onDidChangeSchemaAssociations=this._register(new b);this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(e,t,i){let o=K1(e);this.schemasById[o]=t,this._onDidChangeSchema.fire(e),i&&i.add(G(()=>{delete this.schemasById[o],this._onDidChangeSchema.fire(e)}))}registerSchemaAssociation(e,t){let i=K1(e);return this.schemaAssociations[i]||(this.schemaAssociations[i]=[]),this.schemaAssociations[i].includes(t)||(this.schemaAssociations[i].push(t),this._onDidChangeSchemaAssociations.fire()),G(()=>{let o=this.schemaAssociations[i];if(o){let s=o.indexOf(t);s!==-1&&(o.splice(s,1),o.length===0&&delete this.schemaAssociations[i],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){let t=this.schemasById[e];return t?$1(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}getSchemaAssociations(){return this.schemaAssociations}},zD=new Av;Pt.add(Lv.JSONContribution,zD)});var oi,Mv,Fr,xd=I(()=>{yi();Mv=globalThis.vscode;if(typeof Mv<"u"&&typeof Mv.context<"u"){let n=Mv.context.configuration();if(n)oi=n.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(oi=globalThis._VSCODE_PRODUCT_JSON,St.VSCODE_DEV&&Object.assign(oi,{nameShort:`${oi.nameShort} Dev`,nameLong:`${oi.nameLong} Dev`,dataFolderName:`${oi.dataFolderName}-dev`,serverDataFolderName:oi.serverDataFolderName?`${oi.serverDataFolderName}-dev`:void 0}),!oi.version){let n=globalThis._VSCODE_PACKAGE_JSON;Object.assign(oi,{version:n.version})}}else oi={nameShort:"Code",nameLong:"Visual Studio Code",applicationName:"code",win32x64AppId:"{{EA457B21-F73E-494C-ACAB-524FDE069978}",win32arm64AppId:"{{A5270FC5-65AD-483E-AC30-2C276B63D0AC}",win32x64UserAppId:"{{771FD6B0-FA20-440A-A002-3B3BAC16DC50}",win32arm64UserAppId:"{{D9E514E7-1A56-452D-9337-2990C0DC4310}",win32NameVersion:"Microsoft Visual Studio Code",win32DirName:"Microsoft VS Code",win32SetupExeBasename:"VSCodeSetup",win32AppUserModelId:"Microsoft.VisualStudioCode",win32ShellNameShort:"Code",win32MutexName:"vscode",win32RegValueName:"VSCode",win32VersionedUpdate:!0,darwinCredits:"resources/darwin/Credits.rtf",darwinBundleIdentifier:"com.microsoft.VSCode",darwinSharedKeychainServiceName:"com.microsoft.VSCode.shared-secrets",darwinProfileUUID:"EBAE60D6-C8A2-4419-92FF-24F8AD5077AB",darwinProfilePayloadUUID:"C6B5723A-6539-4F31-8A4E-3CC96E51F48C",darwinExecutable:"VSCode",linuxIconName:"vscode",licenseFileName:"LICENSE.rtf",licenseName:"Multiple, see https://code.visualstudio.com/license",serverGreeting:[],serverLicense:["*","* Visual Studio Code Server","*","* By using the software, you agree to","* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and","* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).","*"],serverLicensePrompt:"Do you accept the terms in the License Agreement (Y/n)?",serverApplicationName:"code-server",urlProtocol:"vscode",dataFolderName:".vscode",sharedDataFolderName:".vscode-shared",serverDataFolderName:".vscode-server",downloadUrl:"https://code.visualstudio.com",updateUrl:"https://update.code.visualstudio.com",webUrl:"https://vscode.dev",webEndpointUrl:"https://main.vscode-cdn.net",webEndpointUrlTemplate:"https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}",nlsCoreBaseUrl:"https://www.vscode-unpkg.net/nls/",webviewContentExternalBaseUrlTemplate:"https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/",quality:"stable",embedded:{nameShort:"Agents",nameLong:"Visual Studio Code Agents",applicationName:"agents",telemetryAppName:"agents",win32AppUserModelId:"Microsoft.VisualStudioCodeAgents",win32MutexName:"vscodeagents",win32RegValueName:"VSCodeAgents",win32NameVersion:"Microsoft Visual Studio Code Agents",win32VersionedUpdate:!0,darwinBundleIdentifier:"com.microsoft.VSCodeAgents",dataFolderName:".vscode-agents",urlProtocol:"vscode-agents",inheritAuthAccountPreference:{"github.copilot":["github.copilot-chat"],"vscode.github":["github.copilot-chat"]}},extensionsGallery:{nlsBaseUrl:"https://www.vscode-unpkg.net/_lp/",serviceUrl:"https://marketplace.visualstudio.com/_apis/public/gallery",itemUrl:"https://marketplace.visualstudio.com/items",publisherUrl:"https://marketplace.visualstudio.com/publishers",resourceUrlTemplate:"https://{publisher}.vscode-unpkg.net/{publisher}/{name}/{version}/{path}",extensionUrlTemplate:"https://www.vscode-unpkg.net/_gallery/{publisher}/{name}/latest",controlUrl:"https://main.vscode-cdn.net/extensions/marketplace.json",mcpUrl:"https://main.vscode-cdn.net/mcp/servers.json",accessSKUs:["copilot_enterprise_seat","copilot_enterprise_seat_quota","copilot_enterprise_seat_multi_quota","copilot_enterprise_seat_assignment","copilot_enterprise_seat_assignment_quota","copilot_enterprise_seat_assignment_multi_quota","copilot_enterprise_trial_seat","copilot_enterprise_trial_seat_quota","copilot_for_business_seat","copilot_for_business_seat_quota","copilot_for_business_seat_multi_quota","copilot_for_business_seat_assignment","copilot_for_business_seat_assignment_quota","copilot_for_business_seat_assignment_multi_quota","copilot_for_business_trial_seat","copilot_for_business_trial_seat_quota"]},mcpGallery:{serviceUrl:"https://api.mcp.github.com",itemWebUrl:"https://github.com/mcp/{name}",publisherUrl:"https://github.com/{name}",supportUrl:"https://support.github.com",privacyPolicyUrl:"https://docs.github.com/site-policy/privacy-policies/github-general-privacy-statement",termsOfServiceUrl:"https://docs.github.com/site-policy/github-terms/github-terms-of-service",reportUrl:"https://docs.github.com/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam"},extensionProperties:{"github.copilot-chat":{hasPrereleaseVersion:!1,excludeVersionRange:"<=0.16.1"},"github.copilot":{hasPrereleaseVersion:!0}},extensionsForceVersionByQuality:["github.copilot-chat","github.copilot"],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.117.0",sha256:"854eeb8a785b1f41ba2bd02d7ccd4fdbe10021b61473293973c7e96d036c7fb8",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.10",sha256:"7361748ddf9fd09d8a2ed1f2a2d7376a2cf9aae708692820b799708385c38e08",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"}},{name:"TypeScriptTeam.jsts-chat-features",version:"0.0.2",sha256:"288d8bc26a6e3a752c0971bc93078736c3d818384b27989c1e05ec49a28e1c29",metadata:{id:"7d881d23-233c-448d-9700-cf11a0de79c2",publisherId:{publisherId:"4f0355d2-4a53-4ab1-a8ea-507f4a333a6f",publisherName:"ms-vscode",displayName:"Microsoft",flags:"verified"},publisherDisplayName:"Microsoft"}}],profileTemplatesUrl:"https://main.vscode-cdn.net/core/profile-templates.json",emergencyAlertUrl:"https://main.vscode-cdn.net/core/stable.json",extensionPublisherOrgs:["microsoft"],trustedExtensionPublishers:["microsoft","github","openai"],extensionRecommendations:{"ms-vscode.vscode-chat-customizations-evaluations":{onFileOpen:[{pathGlob:"{**/*prompt.md, **/*skill.md, **/*instructions.md, **/*agent.md}",important:!0},{languages:["prompt","chatagent","skill","instructions"],important:!0}]},"ms-dotnettools.csdevkit":{onFileOpen:[{pathGlob:"{**/*.cs,**/global.json,**/*.csproj,**/*.cshtml,**/*.sln}",important:!0},{languages:["csharp"],important:!0},{pathGlob:"{**/project.json,**/appsettings.json}"}]},"microsoft-aspire.aspire-vscode":{onFileOpen:[{pathGlob:"{**/apphost.cs,**/apphost.js,**/apphost.ts,**/apphost.py,**/AppHost.java,**/aspire.config.json,**/.aspire/settings.json}",important:!0}]},"ms-python.python":{onFileOpen:[{pathGlob:"{**/*.py}",important:!0},{languages:["python"],important:!0},{pathGlob:"{**/*.ipynb}"}]},"ms-toolsai.jupyter":{onFileOpen:[{pathGlob:"{**/*.py}",contentPattern:"^#\\s*%%$",important:!0,whenInstalled:["ms-python.python"]},{pathGlob:"{**/*.ipynb}"}]},"ms-toolsai.datawrangler":{onFileOpen:[{pathGlob:"{**/*.ipynb}",contentPattern:"import\\s*pandas|from\\s*pandas",whenInstalled:["ms-toolsai.jupyter"]}]},"golang.Go":{onFileOpen:[{pathGlob:"**/*.go",important:!0},{languages:["go"],important:!0}]},"vscjava.vscode-java-pack":{onFileOpen:[{pathGlob:"{**/*.java}",important:!0,whenNotInstalled:["ASF.apache-netbeans-java","Oracle.oracle-java"]},{languages:["java"],important:!0,whenNotInstalled:["ASF.apache-netbeans-java","Oracle.oracle-java"]}]},"ms-vscode.PowerShell":{onFileOpen:[{pathGlob:"{**/*.ps1,**/*.psd1,**/*.psm1}",important:!0},{languages:["powershell"],important:!0},{pathGlob:"{**/*.ps.config,**/*.ps1.config}"}]},"ms-toolsai.prompty":{onFileOpen:[{pathGlob:"{**/*.prompty}",important:!1}]},"quantum.qsharp-lang-vscode":{onFileOpen:[{pathGlob:"{**/*.qs,**/*.qsc,**/*.qasm}",important:!0}]},"typespec.typespec-vscode":{onFileOpen:[{pathGlob:"{**/*.tsp,**/tspconfig.yaml}",important:!0}]},"ms-vscode.cpptools-extension-pack":{onFileOpen:[{pathGlob:"{**/*.c,**/*.cpp,**/*.cc,**/.cxx,**/*.hh,**/*.hpp,**/*.hxx,**/*.h}",important:!0,whenNotInstalled:["llvm-vs-code-extensions.vscode-clangd"]},{languages:["c","cpp"],important:!0,whenNotInstalled:["llvm-vs-code-extensions.vscode-clangd"]}]},"ms-azuretools.vscode-containers":{onFileOpen:[{pathGlob:"{**/dockerfile,**/Dockerfile,**/docker-compose.yml,**/docker-compose.*.yml}",important:!0,whenNotInstalled:["ms-azuretools.vscode-docker"]},{languages:["dockerfile"],important:!0,whenNotInstalled:["ms-azuretools.vscode-docker"]},{pathGlob:"{**/*.cs,**/project.json,**/global.json,**/*.csproj,**/*.cshtml,**/*.sln,**/appsettings.json,**/*.py,**/*.ipynb,**/*.js,**/*.ts,**/package.json}",whenNotInstalled:["ms-azuretools.vscode-docker"]}]},"vue.volar":{onFileOpen:[{pathGlob:"{**/*.vue}",important:!0},{languages:["vue"],important:!0}]},"ms-vscode.makefile-tools":{onFileOpen:[{pathGlob:"{**/makefile,**/Makefile}",important:!0},{languages:["makefile"],important:!0}]},"ms-vscode.cmake-tools":{onFileOpen:[{pathGlob:"{**/CMakeLists.txt}",important:!0}]},"ms-azure-devops.azure-pipelines":{onFileOpen:[{pathGlob:"{**/azure-pipelines.yaml}",important:!0}]},"msazurermtools.azurerm-vscode-tools":{onFileOpen:[{pathGlob:"{**/azuredeploy.json}",important:!0}]},"ms-vscode-remote.remote-containers":{onFileOpen:[{pathGlob:"{**/devcontainer.json}",important:!0}]},"ms-azuretools.vscode-bicep":{onFileOpen:[{pathGlob:"{**/*.bicep}",important:!0,whenNotInstalled:["ms-azuretools.rad-vscode-bicep"]}]},"svelte.svelte-vscode":{onFileOpen:[{pathGlob:"{**/*.svelte}",important:!0}]},"ms-vscode.vscode-github-issue-notebooks":{onFileOpen:[{pathGlob:"{**/*.github-issues}",important:!0}]},"ms-playwright.playwright":{onFileOpen:[{pathGlob:"{**/*playwright*.config.ts,**/*playwright*.config.js,**/*playwright*.config.mjs}",important:!0}]},"vscjava.vscode-gradle":{onFileOpen:[{pathGlob:"{**/gradlew,**/gradlew.bat,**/build.gradle,**/build.gradle.kts,**/settings.gradle,**/settings.gradle.kts}",important:!0}]},"REditorSupport.r":{onFileOpen:[{pathGlob:"{**/*.r}",important:!0},{languages:["r"],important:!0}]},"firefox-devtools.vscode-firefox-debug":{onFileOpen:[{pathGlob:"{**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.es6,**/.babelrc}"}]},"ms-edgedevtools.vscode-edge-devtools":{onFileOpen:[{pathGlob:"{**/*.ts,**/*.tsx,**/*.js,**/*.css,**/*.html}"}]},"Ionide.Ionide-fsharp":{onFileOpen:[{pathGlob:"{**/*.fsx,**/*.fsi,**/*.fs,**/*.ml,**/*.mli}"}]},"dbaeumer.vscode-eslint":{onFileOpen:[{pathGlob:"{**/*.js,**/*.jsx,**/*.es6,**/.eslintrc.*,**/.eslintrc,**/.babelrc,**/jsconfig.json}"}]},"bmewburn.vscode-intelephense-client":{onFileOpen:[{pathGlob:"{**/*.php,**/php.ini}"}]},"xdebug.php-debug":{onFileOpen:[{pathGlob:"{**/*.php,**/php.ini}"}]},"rust-lang.rust-analyzer":{onFileOpen:[{pathGlob:"{**/*.rs,**/*.rslib}"}]},"DavidAnson.vscode-markdownlint":{onFileOpen:[{pathGlob:"{**/*.md}"}]},"EditorConfig.EditorConfig":{onFileOpen:[{pathGlob:"{**/.editorconfig}"}]},"HookyQR.beautify":{onFileOpen:[{pathGlob:"{**/.jsbeautifyrc}"}]},"donjayamanne.githistory":{onFileOpen:[{pathGlob:"{**/.gitignore,**/.git}"}]},"eamodio.gitlens":{onFileOpen:[{pathGlob:"{**/.gitignore,**/.git}"}]},"Shopify.ruby-lsp":{onFileOpen:[{pathGlob:"{**/*.rb,**/*.erb,**/*.reek,**/.fasterer.yml,**/ruby-lint.yml,**/.rubocop.yml}"}]},"swiftlang.swift-vscode":{onFileOpen:[{pathGlob:"{**/*.swift,**/*.swiftinterface}",important:!0}]},"DotJoshJohnson.xml":{onFileOpen:[{pathGlob:"{**/*.xml}"}]},"stylelint.vscode-stylelint":{onFileOpen:[{pathGlob:"{**/.stylelintrc,**/stylelint.config.js}"}]},"ms-mssql.mssql":{onFileOpen:[{pathGlob:"{**/*.sql}"}]},"mtxr.sqltools":{onFileOpen:[{pathGlob:"{**/*.sql}"}]},"usqlextpublisher.usql-vscode-ext":{onFileOpen:[{pathGlob:"{**/*.usql}"}]},"ms-vscode.sublime-keybindings":{onFileOpen:[{pathGlob:"{**/.sublime-project,**/.sublime-workspace}"}]},"k--kato.intellij-idea-keybindings":{onFileOpen:[{pathGlob:"{**/.idea}"}]},"christian-kohler.npm-intellisense":{onFileOpen:[{pathGlob:"{**/package.json}"}]},"cake-build.cake-vscode":{onFileOpen:[{pathGlob:"{**/build.cake}"}]},"Angular.ng-template":{onFileOpen:[{pathGlob:"{**/.angular-cli.json,**/angular.json,**/*.ng.html,**/*.ng,**/*.ngml}"}]},"vscjava.vscode-maven":{onFileOpen:[{pathGlob:"**/pom.xml"}]},"ms-azuretools.vscode-azureterraform":{onFileOpen:[{pathGlob:"**/*.tf"}]},"HashiCorp.terraform":{onFileOpen:[{pathGlob:"**/*.tf"}]},"vsciot-vscode.vscode-arduino":{onFileOpen:[{pathGlob:"**/*.ino"}]},"ms-kubernetes-tools.vscode-kubernetes-tools":{onFileOpen:[{pathGlob:"{**/Chart.yaml}"}]},"Oracle.oracledevtools":{onFileOpen:[{pathGlob:"{**/*.sql}"}]},"betterthantomorrow.calva":{onFileOpen:[{pathGlob:"{**/*.clj,**/*.cljs}"}]},"vmware.vscode-boot-dev-pack":{onFileOpen:[{pathGlob:"{**/application.properties}"}]},"GitHub.copilot":{onFileOpen:[{pathGlob:"{**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.py,**/*.go,**/*.rb,**/*.html,**/*.css,**/*.php,**/*.cpp,**/*.vue,**/*.c,**/*.sql,**/*.java,**/*.cs,**/*.rs,**/*.dart,**/*.ps,**/*.ps1,**/*.tex}"}]},"GitHub.copilot-chat":{onSettingsEditorOpen:{descriptionOverride:"GitHub Copilot is an AI-powered coding assistant that helps you write code faster and smarter."}},"GitHub.vscode-github-actions":{onFileOpen:[{pathGlob:"{**/.github/workflows/*.yml}",important:!0}]},"circleci.circleci":{onFileOpen:[{pathGlob:"{**/.circleci/config.yml}"}]},"mechatroner.rainbow-csv":{onFileOpen:[{pathGlob:"**/*.csv",important:!0}]},"tomoki1207.pdf":{onFileOpen:[{pathGlob:"**/*.pdf",important:!0}]},"Redis.redis-for-vscode":{onFileOpen:[{pathGlob:"{**/redis.*,**/redis-server.*,**/redis_*,**/redisinsight.*}",important:!0}]},"SonarSource.sonarlint-vscode":{onFileOpen:[{pathGlob:"{**/sonar-project.properties,**/sonarcloud.properties,**/sonarlint.*}",important:!0}]}},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"}],keymapExtensionTips:["vscodevim.vim","ms-vscode.sublime-keybindings","ms-vscode.atom-keybindings","ms-vscode.brackets-keybindings","ms-vscode.vs-keybindings","ms-vscode.notepadplusplus-keybindings","k--kato.intellij-idea-keybindings","lfs.vscode-emacs-friendly","alphabotsec.vscode-eclipse-keybindings","alefragnani.delphi-keybindings"],languageExtensionTips:["ms-python.python","ms-vscode.cpptools-extension-pack","ms-dotnettools.csdevkit","ms-toolsai.jupyter","vscjava.vscode-java-pack","ecmel.vscode-html-css","vue.volar","bmewburn.vscode-intelephense-client","dsznajder.es7-react-js-snippets","golang.go","ms-vscode.powershell","dart-code.dart-code","rust-lang.rust-analyzer","Shopify.ruby-lsp","GitHub.copilot"],configBasedExtensionTips:{git:{configPath:".git/config",configName:"Git",recommendations:{"github.vscode-pull-request-github":{name:"GitHub Pull Request",contentPattern:"^\\s*url\\s*=\\s*https:\\/\\/github\\.com.*$"},"eamodio.gitlens":{name:"GitLens"}}},devContainer:{configPath:".devcontainer/devcontainer.json",configName:"Dev Container",recommendations:{"ms-vscode-remote.remote-containers":{name:"Dev Containers",important:!0}}},maven:{configPath:"pom.xml",configName:"Maven",recommendations:{"vscjava.vscode-java-pack":{name:"Java",important:!0,isExtensionPack:!0,whenNotInstalled:["ASF.apache-netbeans-java","Oracle.oracle-java"]},"vmware.vscode-boot-dev-pack":{name:"Spring Boot Extension Pack",isExtensionPack:!0}}},gradle:{configPath:"build.gradle",configName:"Gradle",recommendations:{"vscjava.vscode-java-pack":{name:"Java",important:!0,isExtensionPack:!0,whenNotInstalled:["ASF.apache-netbeans-java","Oracle.oracle-java"]}}},"github-pull-request":{configPath:".vscode/.github-pull-request.rec",configName:"GitHub",configScheme:"vscode-vfs",recommendations:{"github.vscode-pull-request-github":{name:"GitHub Pull Request",important:!0}}},"pyproject-formatter":{configPath:"pyproject.toml",configName:"Python Formatter",recommendations:{"ms-python.black-formatter":{name:"Black Formatter",contentPattern:'(^\\s*\\[\\[?\\s*"?tool"?\\s*\\.\\s*"?black"?\\s*[\\].])|("black\\s*["[(<=>!~;@])'},"ms-python.autopep8":{name:"Autopep8",contentPattern:'(^\\s*\\[\\[?\\s*"?tool"?\\s*\\.\\s*"?autopep8"?\\s*[\\].])|("autopep8\\s*["[(<=>!~;@])'}}},"pep8-formatter":{configPath:".pep8",configName:"Python Formatter",recommendations:{"ms-python.autopep8":{name:"Autopep8"}}},"python-setup-cgf-formatter":{configPath:"setup.cfg",configName:"Python Formatter",recommendations:{"ms-python.autopep8":{name:"Autopep8",contentPattern:"^\\[pep8\\]"}}},"tox-ini-formatter":{configPath:"tox.ini",configName:"Python Formatter",recommendations:{"ms-python.autopep8":{name:"Autopep8",contentPattern:"^\\[pep8\\]"}}},"pyproject-linter":{configPath:"pyproject.toml",configName:"Python Linter",recommendations:{"ms-python.pylint":{name:"Pylint",contentPattern:'(^\\s*\\[\\[?\\s*"?tool"?\\s*\\.\\s*"?pylint"?\\s*[\\].])|("pylint\\s*["[(<=>!~;@])'},"charliermarsh.ruff":{name:"Ruff",contentPattern:'(^\\s*\\[\\[?\\s*"?tool"?\\s*\\.\\s*"?ruff"?\\s*[\\].])|("ruff\\s*["[(<=>!~;@])'},"ms-python.mypy-type-checker":{name:"Mypy Type Checker",contentPattern:'(^\\s*\\[\\[?\\s*"?tool"?\\s*\\.\\s*"?mypy"?\\s*[\\].])|("mypy\\s*["[(<=>!~;@])'},"ms-python.flake8":{name:"Flake8",contentPattern:'(^\\s*\\[\\[?\\s*"?tool"?\\s*\\.\\s*"?flake8"?\\s*[\\].])|("flake8\\s*["[(<=>!~;@])'}}},".pylintrc-linter":{configPath:".pylintrc",configName:"Python Linter",recommendations:{"ms-python.pylint":{name:"Pylint"}}},"pylintrc-linter":{configPath:"pylintrc",configName:"Python Linter",recommendations:{"ms-python.pylint":{name:"Pylint"}}},"mypy-ini-linter":{configPath:".mypy.ini",configName:"Python Linter",recommendations:{"ms-python.mypy-type-checker":{name:"Mypy Type Checker"}}},"tox-ini-linter":{configPath:"tox.ini",configName:"Python Linter",recommendations:{"ms-python.flake8":{name:"Flake8",contentPattern:"^\\[flake8\\]"}}},".flake8-linter":{configPath:".flake8",configName:"Python Linter",recommendations:{"ms-python.flake8":{name:"Flake8"}}},"python-setup-cgf-linter":{configPath:"setup.cfg",configName:"Python Linter",recommendations:{"ms-python.flake8":{name:"Flake8",contentPattern:"^\\[flake8\\]"}}}},exeBasedExtensionTips:{az:{friendlyName:"Azure CLI",windowsPath:"%ProgramFiles(x86)%\\Microsoft SDKs\\Azure\\CLI2\\wbin\\az.cmd",recommendations:{"ms-vscode.vscode-node-azure-pack":{name:"Azure Tools"},"ms-azuretools.vscode-azure-github-copilot":{name:"GitHub Copilot for Azure"}}},azd:{friendlyName:"Azure Dev CLI",windowsPath:"%USERPROFILE%\\AppData\\Local\\Programs\\Azure Dev CLI\\azd.exe",recommendations:{"ms-vscode.vscode-node-azure-pack":{name:"Azure Tools"},"ms-azuretools.vscode-azure-github-copilot":{name:"GitHub Copilot for Azure"}}},"azd-user":{friendlyName:"Azure Dev CLI",windowsPath:"%ProgramFiles%\\Azure Dev CLI\\azd.exe",recommendations:{"ms-vscode.vscode-node-azure-pack":{name:"Azure Tools"},"ms-azuretools.vscode-azure-github-copilot":{name:"GitHub Copilot for Azure"}}},"azure-powershell":{friendlyName:"Azure PowerShell",windowsPath:"%USERPROFILE%\\.Azure",recommendations:{"ms-vscode.vscode-node-azure-pack":{name:"Azure Tools"}}},heroku:{friendlyName:"Heroku CLI",windowsPath:"%ProgramFiles%\\Heroku\\bin\\heroku.cmd",recommendations:{"ms-azuretools.vscode-azureappservice":{name:"Azure App Service"},"pkosta2005.heroku-command":{name:"heroku-cli"}}},mongo:{friendlyName:"Mongo",windowsPath:"%ProgramFiles%\\MongoDB\\Server\\3.6\\bin\\mongod.exe",recommendations:{"ms-azuretools.vscode-cosmosdb":{name:"Azure Databases"}}},serverless:{friendlyName:"Serverless framework",windowsPath:"%APPDATA%\\npm\\serverless.cmd",recommendations:{"ms-azuretools.vscode-azurefunctions":{name:"Azure Functions"}}},func:{friendlyName:"Azure Function SDK",windowsPath:"%APPDATA%\\npm\\func.cmd",recommendations:{"ms-azuretools.vscode-azurefunctions":{name:"Azure Functions"}}},mysql:{friendlyName:"MySQL",windowsPath:"%ProgramFiles%\\MySQL\\MySQL Server 8.0\\bin\\mysqld.exe",recommendations:{"mtxr.sqltools":{name:"SQLTools"}}},postgres:{friendlyName:"PostgreSQL",windowsPath:"%ProgramFiles%\\PostgreSQL\\11\\bin\\psql.exe",recommendations:{"ms-ossdata.vscode-postgresql":{name:"PostgreSQL"},"mtxr.sqltools":{name:"SQLTools"}}},sqlcmd:{friendlyName:"SQL CLI",recommendations:{"ms-mssql.mssql":{name:"SQL Server (mssql)"}}},now:{friendlyName:"Now CLI",windowsPath:"%APPDATA%\\npm\\now.cmd",recommendations:{"ms-azuretools.vscode-azureappservice":{name:"Azure App Service"},"ms-azuretools.vscode-containers":{name:"Docker"}}},docker:{friendlyName:"Docker",windowsPath:"%ProgramFiles%\\Docker\\Docker\\Resources\\bin\\docker.exe",recommendations:{"ms-azuretools.vscode-containers":{name:"Docker",important:!0,whenNotInstalled:["ms-azuretools.vscode-docker"]},"ms-vscode-remote.remote-containers":{name:"Dev Containers",important:!0},"ms-kubernetes-tools.vscode-kubernetes-tools":{name:"Kubernetes"}}},kubectl:{friendlyName:"Kubernetes",windowsPath:"%ProgramFiles%\\Docker\\Docker\\Resources\\bin\\kubectl.exe",recommendations:{"ms-azuretools.vscode-containers":{name:"Docker"},"ms-kubernetes-tools.vscode-kubernetes-tools":{name:"Kubernetes"},"ms-vscode-remote.remote-containers":{name:"Dev Containers"}}},ng:{friendlyName:"Angular CLI",windowsPath:"%APPDATA%\\npmexit\\ng.cmd",recommendations:{"johnpapa.Angular2":{name:"Angular Snippets"}}},"create-react-app":{friendlyName:"Create React App",windowsPath:"%APPDATA%\\npm\\create-react-app.cmd",recommendations:{"msjsdiag.vscode-react-native":{name:"React Native Tools"}}},"react-native":{friendlyName:"React Native",windowsPath:"%APPDATA%\\npm\\react-native-cli",recommendations:{"msjsdiag.vscode-react-native":{name:"React Native Tools"}}},p4:{friendlyName:"Perforce",recommendations:{"slevesque.perforce":{name:"Perforce for VS Code"}}},hg:{friendlyName:"Mercurial",recommendations:{"mrcrowl.hg":{name:"Hg"}}},git:{friendlyName:"Git",windowsPath:"%ProgramFiles%\\Git\\git-bash.exe",recommendations:{"eamodio.gitlens":{name:"GitLens"}}},svn:{friendlyName:"Subversion",windowsPath:"%ProgramFiles%\\TortoiseSVN\\bin\\TortoiseProc.exe",recommendations:{"johnstoncode.svn-scm":{name:"SVN"}}},subl:{friendlyName:"Sublime",windowsPath:"%ProgramFiles%\\Sublime Text3\\sublime_text.exe",recommendations:{"ms-vscode.sublime-keybindings":{name:"Sublime Text Keymap and Settings Importer"}}},atom:{friendlyName:"Atom",windowsPath:"%USERPROFILE%\\AppData\\Local\\atom\\bin\\atom.cmd",recommendations:{"ms-vscode.atom-keybindings":{name:"Atom Keymap"}}},brackets:{friendlyName:"Brackets",windowsPath:"%ProgramFiles(x86)%\\Brackets\\Brackets.exe",recommendations:{"ms-vscode.brackets-keybindings":{name:"Brackets Keymap"}}},notepadplusplus:{friendlyName:"Notepad++",windowsPath:"%ProgramFiles%\\Notepad++\\Notepad++.exe",recommendations:{"ms-vscode.notepadplusplus-keybindings":{name:"Notepad++ keymap"}}},vi:{friendlyName:"VIM",windowsPath:"%ProgramFiles(x86)%\\Vim\\vim80\\gvim.exe",recommendations:{"vscodevim.vim":{name:"Vim"}}},mvn:{friendlyName:"Maven",recommendations:{"vscjava.vscode-java-pack":{name:"Java",important:!0,isExtensionPack:!0,whenNotInstalled:["ASF.apache-netbeans-java","Oracle.oracle-java"]}}},gradle:{friendlyName:"Gradle",recommendations:{"vscjava.vscode-java-pack":{name:"Java",important:!0,isExtensionPack:!0,whenNotInstalled:["ASF.apache-netbeans-java","Oracle.oracle-java"]}}},ollama:{friendlyName:"Ollama",windowsPath:"%USERPROFILE%\\AppData\\Local\\Programs\\Ollama\\ollama.exe",recommendations:{"ms-windows-ai-studio.windows-ai-studio":{name:"AI Toolkit for Visual Studio Code"}}},"Microsoft Edge":{friendlyName:"Microsoft Edge",windowsPath:"%USERPROFILE%\\AppData\\Local\\Microsoft\\Edge\\Application\\msedge.exe",recommendations:{"ms-edgedevtools.vscode-edge-devtools":{name:"Microsoft Edge Developer Tools"}}},"Microsoft Edge Dev":{friendlyName:"Microsoft Edge Dev",windowsPath:"%USERPROFILE%\\AppData\\Local\\Microsoft\\Edge Dev\\Application\\msedge.exe",recommendations:{"ms-edgedevtools.vscode-edge-devtools":{name:"Microsoft Edge Developer Tools"}}},"Microsoft Edge Beta":{friendlyName:"Microsoft Edge Beta",windowsPath:"%USERPROFILE%\\AppData\\Local\\Microsoft\\Edge Beta\\Application\\msedge.exe",recommendations:{"ms-edgedevtools.vscode-edge-devtools":{name:"Microsoft Edge Developer Tools"}}},"Microsoft Edge Canary":{friendlyName:"Microsoft Edge Canary",windowsPath:"%USERPROFILE%\\AppData\\Local\\Microsoft\\Edge SxS\\Application\\msedge.exe",recommendations:{"ms-edgedevtools.vscode-edge-devtools":{name:"Microsoft Edge Developer Tools"}}},"Mozilla Firefox (x86)":{friendlyName:"Mozilla Firefox",windowsPath:"%ProgramFiles(x86)%\\Mozilla Firefox\\firefox.exe",recommendations:{"firefox-devtools.vscode-firefox-debug":{name:"Debugger for Firefox"}}},"Mozilla Firefox Developer Edition (x86)":{friendlyName:"Mozilla Firefox Developer Edition",windowsPath:"%ProgramFiles(x86)%\\Firefox Developer Edition\\firefox.exe",recommendations:{"firefox-devtools.vscode-firefox-debug":{name:"Debugger for Firefox"}}},"Mozilla Firefox":{friendlyName:"Mozilla Firefox",windowsPath:"%ProgramFiles%\\Mozilla Firefox\\firefox.exe",recommendations:{"firefox-devtools.vscode-firefox-debug":{name:"Debugger for Firefox"}}},"Mozilla Firefox Developer Edition":{friendlyName:"Mozilla Firefox Developer Edition",windowsPath:"%ProgramFiles%\\Firefox Developer Edition\\firefox.exe",recommendations:{"firefox-devtools.vscode-firefox-debug":{name:"Debugger for Firefox"}}},cordova:{friendlyName:"Cordova",windowsPath:"%APPDATA%\\npm\\cordova",recommendations:{"msjsdiag.cordova-tools":{name:"Cordova Tools"}}},gcloud:{friendlyName:"Google GCloud CLI",windowsPath:"%ProgramFiles(x86)%\\Google\\Cloud SDK\\google-cloud-sdk\\bin\\gcloud.cmd",recommendations:{"GoogleCloudTools.cloudcode":{name:"Cloud Code"}}},skaffold:{friendlyName:"Skaffold Code to Cluster",recommendations:{"ms-azuretools.vscode-containers":{name:"Docker"},"ms-kubernetes-tools.vscode-kubernetes-tools":{name:"Kubernetes"}}},minikube:{friendlyName:"MiniKube Local Kubernetes Cluster",recommendations:{"ms-azuretools.vscode-containers":{name:"Docker"},"ms-kubernetes-tools.vscode-kubernetes-tools":{name:"Kubernetes"},"ms-vscode-remote.remote-containers":{name:"Dev Containers"}}},podman:{friendlyName:"Podman",recommendations:{"ms-vscode-remote.remote-containers":{name:"Dev Containers"}}},wsl:{friendlyName:"Windows Subsystem for Linux (WSL)",windowsPath:"%WINDIR%\\system32\\lxss\\LxssManager.dll",recommendations:{"ms-vscode-remote.remote-wsl":{name:"WSL"}}}},webExtensionTips:["tyriar.luna-paint","codespaces-contrib.codeswing","ms-vscode.vscode-github-issue-notebooks","esbenp.prettier-vscode","hediet.vscode-drawio"],virtualWorkspaceExtensionTips:{"vscode-vfs":{friendlyName:"Remote Repositories",extensionId:"ms-vscode.remote-repositories",startEntry:{helpLink:"https://aka.ms/vscode-remote/remote-repositories",startConnectLabel:"Remote Repository",startCommand:"remoteHub.continueOn.openRepository",priority:5}}},remoteExtensionTips:{wsl:{friendlyName:"WSL",extensionId:"ms-vscode-remote.remote-wsl",supportedPlatforms:["Windows","Web"],startEntry:{helpLink:"https://aka.ms/vscode-remote/wsl",startConnectLabel:"WSL",startCommand:"remote-wsl.connect",priority:3}},"ssh-remote":{friendlyName:"Remote - SSH",extensionId:"ms-vscode-remote.remote-ssh",supportedPlatforms:["Windows","Linux","Mac"],startEntry:{helpLink:"https://aka.ms/vscode-remote/ssh",startConnectLabel:"SSH ",startCommand:"opensshremotes.openEmptyWindowInCurrentWindow",priority:1}},"dev-container":{friendlyName:"Dev Containers",extensionId:"ms-vscode-remote.remote-containers",supportedPlatforms:["Windows","Linux","Mac"],startEntry:{helpLink:"https://aka.ms/vscode-remote/containers",startConnectLabel:"Dev Container",startCommand:"remote-containers.reopenInContainer",priority:2}},"attached-container":{friendlyName:"Dev Containers",extensionId:"ms-vscode-remote.remote-containers"},codespaces:{friendlyName:"GitHub Codespaces",extensionId:"github.codespaces",startEntry:{helpLink:"https://aka.ms/vscode-remote-codespaces",startConnectLabel:"GitHub Codespace ",startCommand:"github.codespaces.connect",priority:4}},tunnel:{friendlyName:"Remote - Tunnels",extensionId:"ms-vscode.remote-server",startEntry:{helpLink:"https://aka.ms/remote-tunnels-doc",startConnectLabel:"Tunnel",startCommand:"remote-tunnels.connectCurrentWindowToTunnel",priority:0}},amlext:{friendlyName:"Azure Machine Learning",extensionId:"ms-toolsai.vscode-ai-remote"}},commandPaletteSuggestedCommandIds:["workbench.action.files.openFile","workbench.action.files.openFileFolder","workbench.action.files.openFolder","workbench.action.remote.showMenu","editor.action.formatDocument","editor.action.commentLine","workbench.action.tasks.runTask","workbench.action.openSettings2","workbench.action.selectTheme","workbench.action.openWalkthrough","workbench.action.openIssueReporter"],extensionKeywords:{md:["Markdown"],js:["JavaScript"],jsx:["JavaScript"],es6:["JavaScript"],html:["Html"],ts:["TypeScript"],tsx:["TypeScript"],css:["CSS"],scss:["SASS"],txt:["Text"],php:["PHP"],php3:["PHP"],php4:["PHP"],ph3:["PHP"],ph4:["PHP"],xml:["XML"],py:["Python"],pyc:["Python"],pyd:["Python"],pyo:["Python"],pyw:["Python"],pyz:["Python"],java:["Java"],class:["Java"],jar:["Java"],c:["c","objective c","objective-c"],m:["objective c","objective-c"],mm:["objective c","objective-c"],cpp:["cpp","c plus plus","c","c++"],cc:["cpp","c plus plus","c","c++"],cxx:["cpp","c plus plus","c++"],hh:["cpp","c plus plus","c++"],hpp:["cpp","c++"],h:["cpp","c plus plus","c++","c","objective c","objective-c"],sql:["sql"],sh:["bash"],bash:["bash"],zsh:["bash","zshell"],cs:["c#","csharp"],csproj:["c#","csharp"],sln:["c#","csharp"],go:["go"],sty:["latex"],tex:["latex"],ps:["powershell"],ps1:["powershell"],rs:["rust"],rslib:["rust"],hs:["haskell"],lhs:["haskell"],scm:["scheme"],ss:["scheme"],clj:["clojure"],cljs:["clojure"],cljc:["clojure"],edn:["clojure"],erl:["erlang"],hrl:["erlang"],scala:["scala"],sc:["scala"],pl:["perl"],pm:["perl"],t:["perl"],pod:["perl"],groovy:["groovy"],swift:["swift"],rb:["ruby"],rbw:["ruby"],jl:["julia"],f:["fortran"],for:["fortran"],f90:["fortran"],f95:["fortran"],coffee:["CoffeeScript"],litcoffee:["CoffeeScript"],yaml:["yaml"],yml:["yaml"],dart:["dart"],json:["json"]},extensionAllowedBadgeProviders:["api.travis-ci.com","app.fossa.io","badge.buildkite.com","badge.fury.io","badgen.net","badges.frapsoft.com","badges.gitter.im","cdn.travis-ci.com","ci.appveyor.com","circleci.com","cla.opensource.microsoft.com","codacy.com","codeclimate.com","codecov.io","coveralls.io","david-dm.org","deepscan.io","dev.azure.com","docs.rs","flat.badgen.net","gitlab.com","godoc.org","goreportcard.com","img.shields.io","isitmaintained.com","marketplace.visualstudio.com","nodesecurity.io","opencollective.com","snyk.io","travis-ci.com","travis-ci.org","visualstudio.com","vsmarketplacebadge.apphb.com"],extensionAllowedBadgeProvidersRegex:["^https:\\/\\/github\\.com\\/[^/]+\\/[^/]+\\/(actions\\/)?workflows\\/.*badge\\.svg"],crashReporter:{productName:"VSCode",companyName:"Microsoft"},appCenter:{"win32-x64":"appcenter://code?aid=a4e3233c-699c-46ec-b4f4-9c2a77254662","win32-arm64":"appcenter://code?aid=3712d786-7cc8-4f11-8b08-cc12eab6d4f7","linux-x64":"appcenter://code?aid=fba07a4d-84bd-4fc8-a125-9640fc8ce171",darwin:"appcenter://code?aid=860d6632-f65b-490b-85a8-3e72944f7774","darwin-arm64":"appcenter://code?aid=be71415d-3893-4ae5-b453-e537b9668a10","darwin-universal":"appcenter://code?aid=de75e3cc-e22f-4f42-a03f-1409c21d8af8"},enableTelemetry:!0,aiConfig:{ariaKey:"5bbf946d11a54f6783919c455abaddaf-fd62977b-c92d-4714-a45d-649d06980372-7168"},msftInternalDomains:["redmond.corp.microsoft.com","northamerica.corp.microsoft.com","fareast.corp.microsoft.com","ntdev.corp.microsoft.com","wingroup.corp.microsoft.com","southpacific.corp.microsoft.com","wingroup.windeploy.ntdev.microsoft.com","ddnet.microsoft.com","europe.corp.microsoft.com"],documentationUrl:"https://go.microsoft.com/fwlink/?LinkID=533484#vscode",serverDocumentationUrl:"https://aka.ms/vscode-server-doc",releaseNotesUrl:"https://go.microsoft.com/fwlink/?LinkID=533483#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",youTubeUrl:"https://aka.ms/vscode-youtube",requestFeatureUrl:"https://go.microsoft.com/fwlink/?LinkID=533482",reportIssueUrl:"https://github.com/Microsoft/vscode/issues/new",reportMarketplaceIssueUrl:"https://github.com/microsoft/vsmarketplace/issues/new",licenseUrl:"https://go.microsoft.com/fwlink/?LinkID=533485",serverLicenseUrl:"https://aka.ms/vscode-server-license",privacyStatementUrl:"https://go.microsoft.com/fwlink/?LinkId=521839",showTelemetryOptOut:!0,npsSurveyUrl:"https://aka.ms/vscode-nps",checksumFailMoreInfoUrl:"https://go.microsoft.com/fwlink/?LinkId=828886",electronRepository:"Microsoft/vscode-electron-prebuilt",nodejsRepository:"Microsoft/vscode-node",settingsSearchUrl:"https://bingsettingssearch.trafficmanager.net/api/Search",surveys:[{surveyId:"cpp.1",surveyUrl:"https://www.research.net/r/VBVV6C6",languageId:"cpp",editCount:10,userProbability:.15},{surveyId:"java.2",surveyUrl:"https://www.research.net/r/vscodejava",languageId:"java",editCount:10,userProbability:.3},{surveyId:"javascript.1",surveyUrl:"https://www.research.net/r/vscode-js",languageId:"javascript",editCount:10,userProbability:.05},{surveyId:"typescript.1",surveyUrl:"https://www.research.net/r/vscode-ts",languageId:"typescript",editCount:10,userProbability:.05},{surveyId:"csharp.1",surveyUrl:"https://www.research.net/r/8KGJ9V8",languageId:"csharp",editCount:10,userProbability:.1}],extensionsEnabledWithApiProposalVersion:["GitHub.copilot-chat","ms-vscode.vscode-commander","ms-vscode.vscode-copilot-vision","GitHub.vscode-pull-request-github"],extensionEnabledApiProposals:{"mrleemurray.theme-2026":["css"],"ms-azuretools.vscode-containers":["authenticationChallenges"],"ms-azuretools.vscode-azureresourcegroups":["authenticationChallenges"],"ms-azuretools.vscode-azure-github-copilot":["authenticationChallenges"],"ms-azuretools.vscode-dev-azurecloudshell":["contribEditSessions","authenticationChallenges"],"ms-toolsai.vscode-ai":["authenticationChallenges"],"TeamsDevApp.vscode-ai-foundry":["authenticationChallenges"],"ms-vscode.vscode-selfhost-test-provider":["testObserver","testRelatedCode"],"VisualStudioExptTeam.vscodeintellicode-completions":["inlineCompletionsAdditions"],"ms-vsliveshare.vsliveshare":["contribMenuBarHome","contribShareMenu","contribStatusBarItems","diffCommand","documentFiltersExclusive","fileSearchProvider","findTextInFiles","notebookLiveShare","terminalDimensions","terminalDataWriteEvent","textSearchProvider"],"ms-vscode.js-debug":["portsAttributes","findTextInFiles","workspaceTrust","tunnels","browser"],"ms-toolsai.vscode-ai-remote":["resolvers","authenticationChallenges"],"ms-python.python":["codeActionAI","contribEditorContentMenu","quickPickSortByLabel","portsAttributes","testObserver","quickPickItemTooltip","terminalDataWriteEvent","terminalExecuteCommandEvent","notebookReplDocument","notebookVariableProvider","terminalShellEnv"],"ms-python.vscode-python-envs":["terminalShellEnv","terminalDataWriteEvent","taskExecutionTerminal"],"ms-dotnettools.dotnet-interactive-vscode":["notebookMessaging"],"GitHub.codespaces":["contribEditSessions","contribMenuBarHome","contribRemoteHelp","contribViewsRemote","resolvers","tunnels","terminalDataWriteEvent","treeViewReveal","notebookKernelSource"],"ms-vscode.azure-repos":["extensionRuntime","fileSearchProvider","textSearchProvider"],"ms-vscode.remote-repositories":["canonicalUriProvider","contribEditSessions","contribRemoteHelp","contribMenuBarHome","contribViewsRemote","contribViewsWelcome","contribShareMenu","documentFiltersExclusive","editSessionIdentityProvider","extensionRuntime","fileSearchProvider","quickPickSortByLabel","workspaceTrust","shareProvider","scmActionButton","scmSelectedProvider","scmValidation","textSearchProvider","timeline"],"ms-vscode-remote.remote-wsl":["resolvers","contribRemoteHelp","contribViewsRemote","telemetry"],"ms-vscode-remote.remote-ssh":["resolvers","tunnels","terminalDataWriteEvent","contribRemoteHelp","contribViewsRemote","telemetry"],"ms-vscode.remote-server":["resolvers","tunnels","contribViewsWelcome"],"ms-vscode.remote-explorer":["contribRemoteHelp","contribViewsRemote","extensionsAny"],"ms-vscode-remote.remote-containers":["contribEditSessions","resolvers","portsAttributes","tunnels","workspaceTrust","terminalDimensions","contribRemoteHelp","contribViewsRemote"],"ms-vscode.js-debug-nightly":["portsAttributes","findTextInFiles","workspaceTrust","tunnels","browser"],"ms-vscode.lsif-browser":["documentFiltersExclusive"],"ms-vscode.vscode-speech":["speech"],"GitHub.vscode-pull-request-github":["activeComment","chatContextProvider","chatParticipantAdditions","chatParticipantPrivate","chatSessionsProvider","codiconDecoration","codeActionRanges","commentingRangeHint","commentReactor","commentReveal","commentsDraftState","commentThreadApplicability","contribAccessibilityHelpContent","contribCommentEditorActionsMenu","contribCommentPeekContext","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribEditorContentMenu","contribMultiDiffEditorMenus","contribShareMenu","diffCommand","languageModelToolResultAudience","markdownAlertSyntax","quickDiffProvider","remoteCodingAgents","shareProvider","tabInputMultiDiff","tabInputTextMerge","tokenInformation","treeItemMarkdownLabel","treeViewMarkdownMessage"],"GitHub.copilot":["inlineCompletionsAdditions","devDeviceId"],"GitHub.copilot-nightly":["inlineCompletionsAdditions","devDeviceId"],"GitHub.copilot-chat":["agentSessionsWorkspace","interactive","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","chatParticipantAdditions","defaultChatParticipant","embeddings","chatProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","codeActionAI","findTextInFiles","findTextInFiles2","textSearchProvider","textSearchProvider2","activeComment","commentReveal","contribSourceControlInputBoxMenu","contribCommentEditorActionsMenu","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","extensionAffinity","newSymbolNamesProvider","findFiles2","chatReferenceDiagnostic","extensionsAny","authLearnMore","testObserver","aiTextSearchProvider","documentFiltersExclusive","chatParticipantPrivate","contribDebugCreateConfiguration","inlineCompletionsAdditions","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelThinkingPart","languageModelToolSupportsModel","chatStatusItem","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","chatSessionsProvider","chatSessionCustomizationProvider","devDeviceId","contribEditorContentMenu","tokenInformation","toolInvocationApproveCombination","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","chatHooks","chatDebug","environmentPower","terminalTitle","languageModelPricing","chatInputNotification"],"GitHub.remotehub":["contribRemoteHelp","contribMenuBarHome","contribViewsRemote","contribViewsWelcome","documentFiltersExclusive","extensionRuntime","fileSearchProvider","quickPickSortByLabel","workspaceTrust","scmSelectedProvider","scmValidation","textSearchProvider","timeline"],"ms-python.vscode-pylance":["terminalShellEnv","portsAttributes","codeActionAI"],"ms-python.debugpy":["contribViewsWelcome","debugVisualization","portsAttributes"],"ms-toolsai.jupyter-renderers":["contribNotebookStaticPreloads"],"ms-toolsai.jupyter":["notebookDeprecated","notebookMessaging","notebookMime","portsAttributes","quickPickSortByLabel","notebookKernelSource","interactiveWindow","notebookControllerAffinityHidden","contribNotebookStaticPreloads","quickPickItemTooltip","notebookExecution","notebookCellExecution","notebookVariableProvider","notebookReplDocument"],"donjayamanne.kusto":["notebookVariableProvider"],"ms-toolsai.tensorboard":["portsAttributes"],"dbaeumer.vscode-eslint":[],"ms-vscode.azure-sphere-tools-ui":["tunnels"],"ms-azuretools.vscode-azureappservice":["terminalDataWriteEvent"],"ms-vscode.anycode":["extensionsAny"],"ms-vscode.cpptools":["terminalDataWriteEvent","chatParticipantAdditions"],"vscjava.vscode-java-pack":[],"ms-dotnettools.csdevkit":["inlineCompletionsAdditions"],"ms-dotnettools.vscodeintellicode-csharp":["inlineCompletionsAdditions"],"ms-dotnettools.vscode-dotnet-modernize":["chatParticipantAdditions","chatPromptFiles"],"microsoft-IsvExpTools.powerplatform-vscode":["fileSearchProvider","textSearchProvider"],"microsoft-IsvExpTools.powerplatform-vscode-preview":["fileSearchProvider","textSearchProvider"],"TeamsDevApp.ms-teams-vscode-extension":["chatParticipantAdditions","languageModelSystem","mcpServerDefinitions"],"ms-toolsai.datawrangler":[],"ms-vscode.vscode-commander":[],"ms-vscode.vscode-websearchforcopilot":[],"ms-vscode.vscode-copilot-vision":["chatReferenceBinaryData","codeActionAI"],"ms-autodev.vscode-autodev":["chatParticipantAdditions"],"vscjava.migrate-java-to-azure":["chatParticipantAdditions","chatParticipantPrivate"],"vscjava.vscode-java-upgrade":["chatParticipantAdditions","chatParticipantPrivate"],"FoundryLocal.foundry-local-chat":["chatProvider"],"Microsoft.foundry-local-chat":["chatProvider"],"ms-wmcp.windows-mcp-server-extension":["mcpToolDefinitions"],"openai.chatgpt":["languageModelProxy","chatSessionsProvider"],"TypeScriptTeam.native-preview":["editorHoverVerbosityLevel","multiDocumentHighlightProvider"],"ms-vscode.vscode-eng-codereview":["chatContextProvider"],"ms-vscode.vscode-chat-customizations-evaluations":["chatSessionCustomizationProvider","contribEditorContentMenu"]},tasConfig:{endpoint:"https://default.exp-tas.com/vscode/ab",telemetryEventName:"query-expfeature",assignmentContextTelemetryPropertyName:"abexp.assignmentcontext"},extensionKind:{"Shan.code-settings-sync":["ui"],"shalldie.background":["ui"],"techer.open-in-browser":["ui"],"CoenraadS.bracket-pair-colorizer-2":["ui"],"CoenraadS.bracket-pair-colorizer":["ui","workspace"],"hiro-sun.vscode-emacs":["ui","workspace"],"hnw.vscode-auto-open-markdown-preview":["ui","workspace"],"wayou.vscode-todo-highlight":["ui","workspace"],"aaron-bond.better-comments":["ui","workspace"],"vscodevim.vim":["ui"],"ollyhayes.colmak-vim":["ui"]},extensionPointExtensionKind:{typescriptServerPlugins:["workspace"]},extensionSyncedKeys:{"ritwickdey.liveserver":["liveServer.setup.version"]},extensionVirtualWorkspacesSupport:{"esbenp.prettier-vscode":{default:!1},"msjsdiag.debugger-for-chrome":{default:!1},"redhat.java":{default:!1},"HookyQR.beautify":{default:!1},"ritwickdey.LiveServer":{default:!1},"VisualStudioExptTeam.vscodeintellicode":{default:!1},"octref.vetur":{default:!1},"formulahendry.code-runner":{default:!1},"xdebug.php-debug":{default:!1},"ms-mssql.mssql":{default:!1},"christian-kohler.path-intellisense":{default:!1},"eg2.tslint":{default:!1},"eg2.vscode-npm-script":{default:!1},"donjayamanne.githistory":{default:!1},"Zignd.html-css-class-completion":{default:!1},"christian-kohler.npm-intellisense":{default:!1},"EditorConfig.EditorConfig":{default:!1},"austin.code-gnu-global":{default:!1},"johnpapa.Angular2":{default:!1},"ms-vscode.vscode-typescript-tslint-plugin":{default:!1},"DotJoshJohnson.xml":{default:!1},"techer.open-in-browser":{default:!1},"tht13.python":{default:!1},"bmewburn.vscode-intelephense-client":{default:!1},"Angular.ng-template":{default:!1},"xdebug.php-pack":{default:!1},"dbaeumer.jshint":{default:!1},"yzhang.markdown-all-in-one":{default:!1},"Dart-Code.flutter":{default:!1},"streetsidesoftware.code-spell-checker":{default:!1},"rebornix.Ruby":{default:!1},"ms-vscode.sublime-keybindings":{default:!1},"mitaki28.vscode-clang":{default:!1},"steoates.autoimport":{default:!1},"donjayamanne.python-extension-pack":{default:!1},"shd101wyy.markdown-preview-enhanced":{default:!1},"mikestead.dotenv":{default:!1},"pranaygp.vscode-css-peek":{default:!1},"ikappas.phpcs":{default:!1},"platformio.platformio-ide":{default:!1},"jchannon.csharpextensions":{default:!1},"gruntfuggly.todo-tree":{default:!1}},linkProtectionTrustedDomains:["https://*.visualstudio.com","https://*.microsoft.com","https://aka.ms","https://*.gallerycdn.vsassets.io","https://*.github.com","https://login.microsoftonline.com","https://*.vscode.dev","https://*.github.dev","https://gh.io","https://portal.azure.com","https://raw.githubusercontent.com","https://private-user-images.githubusercontent.com","https://avatars.githubusercontent.com","https://auth.openai.com"],trustedExtensionAuthAccess:{github:["vscode.github","github.remotehub","ms-vscode.remote-server","github.vscode-pull-request-github","github.codespaces","github.copilot","github.copilot-chat","ms-vsliveshare.vsliveshare","ms-azuretools.vscode-azure-github-copilot"],"github-enterprise":["vscode.github","github.remotehub","ms-vscode.remote-server","github.vscode-pull-request-github","github.codespaces","github.copilot","github.copilot-chat","ms-vsliveshare.vsliveshare","ms-azuretools.vscode-azure-github-copilot"],microsoft:["github.copilot-chat","ms-vscode.azure-repos","ms-vscode.remote-server","ms-vsliveshare.vsliveshare","ms-azuretools.vscode-azure-github-copilot","ms-azuretools.vscode-azureresourcegroups","ms-azuretools.vscode-dev-azurecloudshell","ms-edu.vscode-learning","ms-toolsai.vscode-ai","ms-toolsai.vscode-ai-remote"],"microsoft-sovereign-cloud":["ms-vscode.azure-repos","ms-vscode.remote-server","ms-vsliveshare.vsliveshare","ms-azuretools.vscode-azure-github-copilot","ms-azuretools.vscode-azureresourcegroups","ms-azuretools.vscode-dev-azurecloudshell","ms-edu.vscode-learning","ms-toolsai.vscode-ai","ms-toolsai.vscode-ai-remote"],"__GitHub.copilot-chat":["ms-azuretools.vscode-azure-github-copilot","github.vscode-pull-request-github"]},trustedExtensionProtocolHandlers:["vscode.git","vscode.github-authentication","vscode.microsoft-authentication","github.vscode-pull-request-github"],authClientIdMetadataUrl:"https://vscode.dev/oauth/client-metadata.json",inheritAuthAccountPreference:{"github.copilot":["github.copilot-chat"]},auth:{loginUrl:"https://login.microsoftonline.com/common/oauth2/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/token",redirectUrl:"https://vscode-redirect.azurewebsites.net/",clientId:"aebc6443-996d-45c2-90f0-388ff96faa56"},"configurationSync.store":{url:"https://vscode-sync.trafficmanager.net/",stableUrl:"https://vscode-sync.trafficmanager.net/",insidersUrl:"https://vscode-sync-insiders.trafficmanager.net/",canSwitch:!1,authenticationProviders:{github:{scopes:["user:email"]},microsoft:{scopes:["openid","profile","email","offline_access"]}}},"editSessions.store":{url:"https://vscode-sync.trafficmanager.net/",authenticationProviders:{microsoft:{scopes:["openid","profile","email","offline_access"]},github:{scopes:["user:email"]}}},tunnelServerQualities:{stable:{serverApplicationName:"code-server"},exploration:{serverApplicationName:"code-server-exploration"},insider:{serverApplicationName:"code-server-insiders"}},tunnelApplicationName:"code-tunnel",tunnelApplicationConfig:{editorWebUrl:"https://vscode.dev",extension:{friendlyName:"Remote - Tunnels",extensionId:"ms-vscode.remote-server"},authenticationProviders:{github:{scopes:["user:email","read:org"]},microsoft:{scopes:["46da2f7e-b5ef-422a-88d4-2a7f9de6a0b2/.default","profile","openid"]}}},win32TunnelServiceMutex:"vscode-tunnelservice",win32TunnelMutex:"vscode-tunnel",aiGeneratedWorkspaceTrust:{title:"This workspace was generated by GitHub Copilot",checkboxText:"Trust the contents of all files in this workspace",trustOption:"Yes, I trust the contents",dontTrustOption:"No, I don't trust the contents",startupTrustRequestLearnMore:"If you don't trust the contents of the files generated by GitHub Copilot, we recommend continuing in restricted mode. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more. "},defaultChatAgent:{providerExtensionId:"vscode.github-authentication",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",publicCodeMatchesUrl:"https://aka.ms/github-copilot-match-public-code",manageSettingsUrl:"https://aka.ms/github-copilot-settings",managePlanUrl:"https://aka.ms/github-copilot-manage-plan",manageOverageUrl:"https://aka.ms/github-copilot-manage-overage",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.com"},google:{id:"google",name:"Google"},apple:{id:"apple",name:"Apple"}},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"},chatParticipantRegistry:"https://main.vscode-cdn.net/extensions/chat.json",remoteDefaultExtensionsIfInstalledLocally:["GitHub.copilot","GitHub.copilot-chat","GitHub.vscode-pull-request-github"],extensionConfigurationPolicy:{"github.copilot.nextEditSuggestions.enabled":{name:"CopilotNextEditSuggestions",minimumVersion:"1.99",category:"InteractiveSession",description:"Whether to enable next edit suggestions (NES). NES can propose a next edit based on your recent changes."},"github.copilot.chat.reviewSelection.enabled":{name:"CopilotReviewSelection",minimumVersion:"1.104",category:"InteractiveSession",description:"Enables code review on current selection."},"github.copilot.chat.reviewAgent.enabled":{name:"CopilotReviewAgent",minimumVersion:"1.104",category:"InteractiveSession",description:"Enables the code review agent."},"github.copilot.chat.claudeAgent.enabled":{name:"Claude3PIntegration",minimumVersion:"1.113",category:"InteractiveSession",description:"Enable Claude Agent sessions in VS Code. Start and resume agentic coding sessions powered by Anthropic Claude Agent SDK directly in the editor. Uses your existing Copilot subscription."}},win32ContextMenu:{x64:{clsid:"1C6DF0C0-192A-4451-BE36-6A59A86A692E"},arm64:{clsid:"F5EA5883-1DA8-4A05-864A-D5DE2D2B2854"}},chatSessionRecommendations:[{extensionId:"openai.chatgpt",extensionName:"Codex - OpenAI's coding agent",displayName:"Codex Agent",name:"codex",description:"Codex is OpenAI's coding agent that helps you write, review, and ship code faster.",postInstallCommand:"chatgpt.newCodexPanel"},{extensionId:"GitHub.copilot-chat",extensionName:"GitHub Copilot Chat",displayName:"Background Agent",name:"cli",description:"Delegate tasks to a background agent.",postInstallCommand:"workbench.action.chat.openNewSessionSidebar.copilotcli"},{extensionId:"GitHub.copilot-chat",extensionName:"GitHub Copilot Chat",displayName:"Cloud Agent",name:"cloud",description:"Delegate tasks to the GitHub Copilot Cloud Agent. The agent works asynchronously in the cloud to implement changes, iterates via chat, and can create or update pull requests as needed.",postInstallCommand:"workbench.action.chat.openNewSessionSidebar.copilot-cloud-agent"}],builtInExtensionsEnabledWithAutoUpdates:["GitHub.copilot-chat"],version:"1.119.0",commit:"8b640eef5a6c6089c029249d48efa5c99adf7d51",date:"2026-05-05T11:23:50-07:00"},Object.keys(oi).length===0&&Object.assign(oi,{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:[]}});Fr=oi});function jD(n,r){return n===r?!0:!n||!r?!1:typeof n=="string"||typeof r=="string"?n===r:n.id===r.id}function qa(n){let r=[];if(xn.test(n)){let e=j1.exec(n);for(;e?.length;){let t=e[1].trim();t&&r.push(t),e=j1.exec(n)}}return Mr(r)}function J1(n){return n.reduce((r,e)=>`${r}[${e}]`,"")}function GD(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function JD(n,r,e){return n.trim()?xn.test(n)?h(1991,null,n):Ef.getConfigurationProperties()[n]!==void 0&&(!e||!QD.has(e.toLowerCase()))?h(1989,null,n):r.policy?.name&&Ef.getPolicyConfigurations().get(r.policy?.name)!==void 0?h(1988,null,n,r.policy?.name,Ef.getPolicyConfigurations().get(r.policy?.name)):null:h(1990,null)}var lr,yf,If,wf,bf,Sf,xf,Pd,Ms,Pf,Ov,G1,j1,Uo,xn,Ef,QD,no=I(()=>{Jt();q();Oe();xe();et();z1();Xi();$();xd();lr={Configuration:"base.contributions.configuration"};yf={properties:{},patternProperties:{}},If={properties:{},patternProperties:{}},wf={properties:{},patternProperties:{}},bf={properties:{},patternProperties:{}},Sf={properties:{},patternProperties:{}},xf={properties:{},patternProperties:{}},Pd={properties:{},patternProperties:{}},Ms="vscode://schemas/settings/resourceLanguage",Pf=Pt.as(Lv.JSONContribution),Ov=class extends T{constructor(){super();this.registeredConfigurationDefaults=[];this.overrideIdentifiers=new Set;this._onDidSchemaChange=this._register(new b);this.onDidSchemaChange=this._onDidSchemaChange.event;this._onDidUpdateConfiguration=this._register(new b);this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event;this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:h(1993,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Pf.registerSchema(Ms,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){let i=new Set;this.doRegisterConfigurations(e,t,i),Pf.registerSchema(Ms,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){let t=new Set;this.doDeregisterConfigurations(e,t),Pf.registerSchema(Ms,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){let i=new Set;this.doDeregisterConfigurations(t,i),this.doRegisterConfigurations(e,!1,i),Pf.registerSchema(Ms,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);let i=[];for(let{overrides:o,source:s}of e)for(let a in o){t.add(a);let l=this.configurationDefaultsOverrides.get(a)??this.configurationDefaultsOverrides.set(a,{configurationDefaultOverrides:[]}).get(a),c=o[a];if(l.configurationDefaultOverrides.push({value:c,source:s}),xn.test(a)){let d=this.mergeDefaultConfigurationsForOverrideIdentifier(a,c,s,l.configurationDefaultOverrideValue);if(!d)continue;l.configurationDefaultOverrideValue=d,this.updateDefaultOverrideProperty(a,d,s),i.push(...qa(a))}else{let d=this.mergeDefaultConfigurationsForConfigurationProperty(a,c,s,l.configurationDefaultOverrideValue);if(!d)continue;l.configurationDefaultOverrideValue=d;let u=this.configurationProperties[a];u&&(this.updatePropertyDefaultValue(a,u),this.updateSchema(a,u))}}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(e){let t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(let i of e){let o=this.registeredConfigurationDefaults.indexOf(i);o!==-1&&this.registeredConfigurationDefaults.splice(o,1)}for(let{overrides:i,source:o}of e)for(let s in i){let a=this.configurationDefaultsOverrides.get(s);if(!a)continue;let l=a.configurationDefaultOverrides.findIndex(c=>o?jD(c.source,o):c.value===i[s]);if(l!==-1){if(a.configurationDefaultOverrides.splice(l,1),a.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(s),xn.test(s)){let c;for(let d of a.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(s,d.value,d.source,c);c&&!Jp(c.value)?(a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(s,c,o)):(this.configurationDefaultsOverrides.delete(s),delete this.configurationProperties[s],delete this.defaultLanguageConfigurationOverridesNode.properties[s])}else{let c;for(let u of a.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(s,u.value,u.source,c);a.configurationDefaultOverrideValue=c;let d=this.configurationProperties[s];d&&(this.updatePropertyDefaultValue(s,d),this.updateSchema(s,d))}t.add(s)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,i){let o={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:t.value,description:h(1992,null,H1(e)),$ref:Ms,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=o,this.defaultLanguageConfigurationOverridesNode.properties[e]=o}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,o){let s=o?.value||{},a=o?.source??new Map;if(!(a instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(let l of Object.keys(t)){let c=t[l];if(Ge(c)&&(Hr(s[l])||Ge(s[l]))){if(s[l]={...s[l]??{},...c},i)for(let u in c)a.set(`${l}.${u}`,i)}else s[l]=c,i?a.set(l,i):a.delete(l)}return{value:s,source:a}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,o){let s=this.configurationProperties[e],a=o?.value??s?.defaultDefaultValue,l=i;if(Ge(t)&&(s!==void 0&&s.type==="object"||s===void 0&&(Hr(a)||Ge(a)))){if(l=o?.source??new Map,!(l instanceof Map)){console.error("defaultValueSource is not a Map");return}for(let d in t)i&&l.set(`${e}.${d}`,i);t={...Ge(a)?a:{},...t}}return{value:t,source:l}}deltaConfiguration(e){let t=!1,i=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,i),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,i),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,i),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,i),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}doDeregisterConfigurations(e,t){let i=o=>{if(o.properties)for(let s in o.properties){t.add(s);let a=this.configurationProperties[s];a?.policy?.name&&this.policyConfigurations.delete(a.policy.name),delete this.configurationProperties[s],this.removeFromSchema(s,o.properties[s])}o.allOf?.forEach(s=>i(s))};for(let o of e){i(o);let s=this.configurationContributors.indexOf(o);s!==-1&&this.configurationContributors.splice(s,1)}}validateAndRegisterProperties(e,t=!0,i,o,s=4,a){s=Vt(e.scope)?s:e.scope;let l=e.properties;if(l)for(let d in l){let u=l[d];if(u.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&JD(d,u,i?.id)){delete l[d];continue}u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),xn.test(d)?u.scope=void 0:(u.scope=Vt(u.scope)?s:u.scope,u.restricted=Vt(u.restricted)?!!o?.includes(d):u.restricted),u.experiment?u.tags?.some(v=>v.toLowerCase()==="onexp")||(u.tags=u.tags??[],u.tags.push("onExP")):u.tags?.some(v=>v.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${d}'. Please use 'experiment' property instead.`),u.experiment={mode:"startup"});let f=l[d].hasOwnProperty("included")&&!l[d].included,m=l[d].policy?.name;f?(this.excludedConfigurationProperties[d]=l[d],m&&(this.policyConfigurations.set(m,d),a.add(d)),delete l[d]):(a.add(d),m&&this.policyConfigurations.set(m,d),this.configurationProperties[d]=l[d],!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage))}let c=e.allOf;if(c)for(let d of c)this.validateAndRegisterProperties(d,t,i,o,s,a)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){let e=new Map;for(let[t,i]of this.configurationDefaultsOverrides)i.configurationDefaultOverrideValue&&e.set(t,i.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){let t=i=>{let o=i.properties;if(o)for(let a in o)this.updateSchema(a,o[a]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(yf.properties[e]=t,t.scope){case 1:If.properties[e]=t;break;case 2:bf.properties[e]=t;break;case 3:wf.properties[e]=t;break;case 7:Sf.properties[e]=t;break;case 4:xf.properties[e]=t;break;case 5:Pd.properties[e]=t;break;case 6:Pd.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete yf.properties[e],t.scope){case 1:delete If.properties[e];break;case 2:delete bf.properties[e];break;case 3:delete wf.properties[e];break;case 7:delete Sf.properties[e];break;case 4:delete xf.properties[e];break;case 5:case 6:delete Pd.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,i={type:"object",description:h(1994,null),errorMessage:h(1995,null),$ref:Ms};this.updatePropertyDefaultValue(t,i),yf.properties[t]=i,If.properties[t]=i,wf.properties[t]=i,bf.properties[t]=i,Sf.properties[t]=i,xf.properties[t]=i,Pd.properties[t]=i}}registerOverridePropertyPatternKey(){let e={type:"object",description:h(1994,null),errorMessage:h(1995,null),$ref:Ms};yf.patternProperties[Uo]=e,If.patternProperties[Uo]=e,wf.patternProperties[Uo]=e,bf.patternProperties[Uo]=e,Sf.patternProperties[Uo]=e,xf.patternProperties[Uo]=e,Pd.patternProperties[Uo]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue,o,s;i&&(!t.disallowConfigurationDefault||!i.source)&&(o=i.value,s=i.source),Hr(o)&&(o=t.defaultDefaultValue,s=void 0),Hr(o)&&(o=GD(t.type)),t.default=o,t.defaultValueSource=s}},G1="\\[([^\\]]+)\\]",j1=new RegExp(G1,"g"),Uo=`^(${G1})+$`,xn=new RegExp(Uo);Ef=new Ov;Pt.add(lr.Configuration,Ef);QD=new Set(Fr.defaultChatAgent?[Fr.defaultChatAgent.extensionId,Fr.defaultChatAgent.chatExtensionId].map(n=>n.toLowerCase()):[])});var XD,X1=I(()=>{X();bd();xe();no();Xi();XD=Pt.as(lr.Configuration);XD.registerConfiguration({id:"update",order:15,title:h(2845,null),type:"object",properties:{"update.mode":{type:"string",enum:["none","manual","start","default"],default:"default",scope:1,description:h(2846,null),tags:["usesOnlineServices"],enumDescriptions:[h(2841,null),h(2840,null),h(2844,null),h(2836,null)],policy:{name:"UpdateMode",category:"Update",minimumVersion:"1.67",localization:{description:{key:"updateMode",value:h(2846,null)},enumDescriptions:[{key:"none",value:h(2841,null)},{key:"manual",value:h(2840,null)},{key:"start",value:h(2844,null)},{key:"default",value:h(2836,null)}]}}},"update.channel":{type:"string",default:"default",scope:1,description:h(2846,null),deprecationMessage:h(2837,null,"update.mode")},"update.enableWindowsBackgroundUpdates":{type:"boolean",default:!0,scope:1,title:h(2839,null),description:h(2838,null),included:F&&!Pr},"update.showReleaseNotes":{type:"boolean",default:!0,scope:1,description:h(2843,null),tags:["usesOnlineServices"]},"update.showPostInstallInfo":{type:"boolean",default:!1,scope:1,description:h(2842,null),tags:["usesOnlineServices"]},"update.titleBar":{type:"boolean",default:!0,scope:1,description:h(2847,null),included:!Pr}}})});function Fv(n,r){return r&&(n.stack||n.stacktrace)?h(116,null,Z1(n),Y1(n.stack)||Y1(n.stacktrace)):Z1(n)}function Y1(n){return Array.isArray(n)?n.join(`
`):n}function Z1(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?h(115,null,n.message):n.message||h(113,null)}function _r(n=null,r=!1){if(!n)return h(113,null);if(Array.isArray(n)){let e=at(n),t=_r(e[0],r);return e.length>1?h(114,null,t,e.length):t}if(Fe(n))return n;if(n.detail){let e=n.detail;if(e.error)return Fv(e.error,r);if(e.exception)return Fv(e.exception,r)}return n.stack?Fv(n,r):n.message?n.message:h(113,null)}var No=I(()=>{Jt();Oe();xe()});function oo(n,r){let{os:e,tildify:t,relative:i}=r;if(i){let a=YD(n,i,e);if(typeof a=="string")return a}let o=n.fsPath;if(e===1&&!F?o=o.replace(/\//g,"\\"):e!==1&&F&&(o=o.replace(/\\/g,"/")),e!==1&&t?.userHome){let a=t.userHome.fsPath,l;n.scheme!==t.userHome.scheme&&n.path[0]===pe.sep&&n.path[1]!==pe.sep?l=t.userHome.with({path:n.path}).fsPath:l=o,o=ZD(l,a,e)}return(e===1?dt:pe).normalize(Cd(o,e===1))}function YD(n,r,e){let t=e===1?dt:pe,i=e===3?We:Ua,o=r.getWorkspace(),s=o.folders.at(0);if(!s)return;n.scheme!==s.uri.scheme&&n.path[0]===pe.sep&&n.path[1]!==pe.sep&&(n=s.uri.with({path:n.path}));let a=r.getWorkspaceFolder(n);if(!a)return;let l;if(i.isEqual(a.uri,n)?l="":l=i.relativePath(a.uri,n)??"",l&&(l=t.normalize(l)),o.folders.length>1&&!r.noPrefix){let c=a.name?a.name:i.basenameOrAuthority(a.uri);l=l?`${c} \u2022 ${l}`:c}return l}function Cd(n,r=F){return yv(n,r)?n.charAt(0).toUpperCase()+n.slice(1):n}function ZD(n,r,e=Ut){if(e===1||!n||!r)return n;let t=Wv.original===r?Wv.normalized:void 0;t||(t=r,F&&(t=wn(t)),t=`${ji(t,pe.sep)}${pe.sep}`,Wv={original:r,normalized:t});let i=n;return F&&(i=wn(i)),(e===3?i.startsWith(t):Mo(i,t))?`~/${i.substr(t.length)}`:n}function tx(n,r){return V||r?n.replace(/\(&&\w\)|&&/g,"").replace(/&/g,V?"&":"&&"):n.replace(/&&|&/g,e=>e==="&"?"&&":"&")}function Td(n,r){let e=n.replace(/\(&&\w\)|&&/g,"");if(r)return e;if(V)return{withMnemonic:e,withoutMnemonic:e};let t;return F?t=n.replace(/&&|&/g,i=>i==="&"?"&&":"&"):t=n.replace(/&&/g,"_"),{withMnemonic:t,withoutMnemonic:e}}function rx(n){if(n.endsWith("]")){let r=n.lastIndexOf(" [",n.length-2);if(r!==-1){let e=ex(n.substring(0,r)),t=n.substring(r);return{name:e.name+t,parentPath:e.parentPath}}}return ex(n)}function ex(n){let r=n.indexOf("/")!==-1?pe:dt,e=r.basename(n),t=r.dirname(n);return e.length?{name:e,parentPath:t}:{name:t,parentPath:""}}var Wv,so=I(()=>{ni();we();X();gt();ar();Wv=Object.create(null)});function _d(n){let r=n;return r?[r.on,r.pause,r.resume,r.destroy].every(e=>typeof e=="function"):!1}function Tf(n){let r=n;return r?_d(r.stream)&&Array.isArray(r.buffer)&&typeof r.ended=="boolean":!1}function Bo(n,r){return new Uv(n,r)}function ix(n,r){let e=[],t;for(;(t=n.read())!==null;)e.push(t);return r(e)}function nx(n,r,e){let t=[],i;for(;(i=n.read())!==null&&t.length<e;)t.push(i);return i===null&&t.length>0?r(t):{read:()=>{if(t.length>0)return t.shift();if(typeof i<"u"){let o=i;return i=void 0,o}return n.read()}}}function _f(n,r){return new Promise((e,t)=>{let i=[];Ka(n,{onData:o=>{r&&i.push(o)},onError:o=>{r?t(o):e(void 0)},onEnd:()=>{e(r?r(i):void 0)}})})}function Ka(n,r,e){n.on("error",t=>{e?.isCancellationRequested||r.onError(t)}),n.on("end",()=>{e?.isCancellationRequested||r.onEnd()}),n.on("data",t=>{e?.isCancellationRequested||r.onData(t)})}function ox(n,r){return new Promise((e,t)=>{let i=new j,o=[],s=c=>{if(o.push(c),o.length>r)return i.dispose(),n.pause(),e({stream:n,buffer:o,ended:!1})},a=c=>(i.dispose(),t(c)),l=()=>(i.dispose(),e({stream:n,buffer:o,ended:!0}));i.add(G(()=>n.removeListener("error",a))),n.on("error",a),i.add(G(()=>n.removeListener("end",l))),n.on("end",l),i.add(G(()=>n.removeListener("data",s))),n.on("data",s)})}function sx(n){let r=!1;return{read:()=>r?null:(r=!0,n)}}function za(n,r,e){let t=Bo(e);return Ka(n,{onData:i=>t.write(r.data(i)),onError:i=>t.error(r.error?r.error(i):i),onEnd:()=>t.end()}),t}var Uv,Os=I(()=>{He();$();Uv=class{constructor(r,e){this.reducer=r;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(r){if(!this.state.destroyed){if(this.state.flowing)this.emitData(r);else if(this.buffer.data.push(r),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(e=>this.pendingWritePromises.push(e))}}error(r){this.state.destroyed||(this.state.flowing?this.emitError(r):this.buffer.error.push(r))}end(r){this.state.destroyed||(typeof r<"u"&&this.write(r),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(r){this.listeners.data.slice(0).forEach(e=>e(r))}emitError(r){this.listeners.error.length===0?nt(r):this.listeners.error.slice(0).forEach(e=>e(r))}emitEnd(){this.listeners.end.slice(0).forEach(r=>r())}on(r,e){if(!this.state.destroyed)switch(r){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(r,e){if(this.state.destroyed)return;let t;switch(r){case"data":t=this.listeners.data;break;case"end":t=this.listeners.end;break;case"error":t=this.listeners.error;break}if(t){let i=t.indexOf(e);i>=0&&t.splice(i,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 r=[...this.pendingWritePromises];this.pendingWritePromises.length=0,r.forEach(e=>e())}flowErrors(){if(this.listeners.error.length>0){for(let r of this.buffer.error)this.emitError(r);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 r2(n,r,e=0){let t=r.byteLength,i=n.byteLength;if(t===0)return 0;if(t===1)return n.indexOf(r[0],e);if(t>i-e)return-1;let o=t2.value;o.fill(r.length);for(let c=0;c<r.length;c++)o[r[c]]=r.length-c-1;let s=e+r.length-1,a=s,l=-1;for(;s<i;)if(n[s]===r[a]){if(a===0){l=s;break}s--,a--}else s+=Math.max(r.length-a,o[n[s]]),a=r.length-1;return l}function i2(n,r){return n[r]*2**24+n[r+1]*2**16+n[r+2]*2**8+n[r+3]}function n2(n,r,e){n[e+3]=r,r=r>>>8,n[e+2]=r,r=r>>>8,n[e+1]=r,r=r>>>8,n[e]=r}function o2(n,r){return n[r+0]<<0>>>0|n[r+1]<<8>>>0|n[r+2]<<16>>>0|n[r+3]<<24>>>0}function s2(n,r,e){n[e+0]=r&255,r=r>>>8,n[e+1]=r&255,r=r>>>8,n[e+2]=r&255,r=r>>>8,n[e+3]=r&255}function a2(n,r){return n[r]}function l2(n,r,e){n[e]=r}function lx(n){return ix(n,r=>H.concat(r))}function cx(n){return sx(n)}function Fs(n){return _f(n,r=>H.concat(r))}async function dx(n){return n.ended?H.concat(n.buffer):H.concat([...n.buffer,await Fs(n.stream)])}function ux(n){return za(n,{data:r=>typeof r=="string"?H.fromString(r):H.wrap(r)},r=>H.concat(r))}function px(n){return Bo(r=>H.concat(r),n)}function fx({buffer:n}){let r="";for(let e=0;e<n.length;e++){let t=n[e];r+=ax[t>>>4],r+=ax[t&15]}return r}var kd,t2,Nv,Bv,H,ax,ot=I(()=>{Yn();Os();kd=typeof Buffer<"u",t2=new rr(()=>new Uint8Array(256)),H=class n{static alloc(r){return kd?new n(Buffer.allocUnsafe(r)):new n(new Uint8Array(r))}static wrap(r){return kd&&!Buffer.isBuffer(r)&&(r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)),new n(r)}static fromString(r,e){return!(e?.dontUseNodeBuffer||!1)&&kd?new n(Buffer.from(r)):(Nv||(Nv=new TextEncoder),new n(Nv.encode(r)))}static fromByteArray(r){let e=n.alloc(r.length);for(let t=0,i=r.length;t<i;t++)e.buffer[t]=r[t];return e}static concat(r,e){if(typeof e>"u"){e=0;for(let o=0,s=r.length;o<s;o++)e+=r[o].byteLength}let t=n.alloc(e),i=0;for(let o=0,s=r.length;o<s;o++){let a=r[o];t.set(a,i),i+=a.byteLength}return t}static isNativeBuffer(r){return kd&&Buffer.isBuffer(r)}constructor(r){this.buffer=r,this.byteLength=this.buffer.byteLength}clone(){let r=n.alloc(this.byteLength);return r.set(this),r}toString(){return kd?this.buffer.toString():(Bv||(Bv=new TextDecoder(void 0,{ignoreBOM:!0})),Bv.decode(this.buffer))}slice(r,e){return new n(this.buffer.subarray(r,e))}set(r,e){if(r instanceof n)this.buffer.set(r.buffer,e);else if(r instanceof Uint8Array)this.buffer.set(r,e);else if(r instanceof ArrayBuffer)this.buffer.set(new Uint8Array(r),e);else if(ArrayBuffer.isView(r))this.buffer.set(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),e);else throw new Error("Unknown argument 'array'")}readUInt32BE(r){return i2(this.buffer,r)}writeUInt32BE(r,e){n2(this.buffer,r,e)}readUInt32LE(r){return o2(this.buffer,r)}writeUInt32LE(r,e){s2(this.buffer,r,e)}readUInt8(r){return a2(this.buffer,r)}writeUInt8(r,e){l2(this.buffer,r,e)}indexOf(r,e=0){return r2(this.buffer,r instanceof n?r.buffer:r,e)}equals(r){return this===r?!0:this.byteLength!==r.byteLength?!1:this.buffer.every((e,t)=>e===r.buffer[t])}};ax="0123456789abcdef"});var mx=I(()=>{Oe();$();wt()});function se(n,r,e){let t=null,i=null;if(typeof e.value=="function"?(t="value",i=e.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof e.get=="function"&&(t="get",i=e.get),!i)throw new Error("not supported");let o=`$memoize$${r}`;e[t]=function(...s){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,s)}),this[o]}}var Vo=I(()=>{mx()});function hx(n){return JSON.stringify(n,c2)}function gx(n){let r=JSON.parse(n);return r=Yi(r),r}function c2(n,r){return r instanceof RegExp?{$mid:2,source:r.source,flags:r.flags}:r}function Yi(n,r=0){if(!n||r>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return x.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof H||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let e=0;e<n.length;++e)n[e]=Yi(n[e],r+1);else for(let e in n)Object.hasOwnProperty.call(n,e)&&(n[e]=Yi(n[e],r+1))}return n}var Rd=I(()=>{ot();ce();nf()});function Ja(n){switch(n){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}function kf(n){switch(n){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}function ja(n){let r=0;for(let e=0;;e+=7){let t=n.read(1);if(r|=(t.buffer[0]&127)<<e,!(t.buffer[0]&128))return r}}function Ga(n,r){if(r===0){n.write(d2);return}let e=0;for(let i=r;i!==0;i=i>>>7)e++;let t=H.alloc(e);for(let i=0;r!==0;i++)t.buffer[i]=r&127,r=r>>>7,r>0&&(t.buffer[i]|=128);n.write(t)}function Ho(n){let r=H.alloc(1);return r.writeUInt8(n,0),r}function Qa(n,r){if(typeof r>"u")n.write(Ws.Undefined);else if(typeof r=="string"){let e=H.fromString(r);n.write(Ws.String),Ga(n,e.byteLength),n.write(e)}else if(H.isNativeBuffer(r)){let e=H.wrap(r);n.write(Ws.Buffer),Ga(n,e.byteLength),n.write(e)}else if(r instanceof H)n.write(Ws.VSBuffer),Ga(n,r.byteLength),n.write(r);else if(Array.isArray(r)){n.write(Ws.Array),Ga(n,r.length);for(let e of r)Qa(n,e)}else if(typeof r=="number"&&(r|0)===r)n.write(Ws.Uint),Ga(n,r);else{let e=H.fromString(JSON.stringify(r));n.write(Ws.Object),Ga(n,e.byteLength),n.write(e)}}function Xa(n){switch(n.read(1).readUInt8(0)){case 0:return;case 1:return n.read(ja(n)).toString();case 2:return n.read(ja(n)).buffer;case 3:return n.read(ja(n));case 4:{let e=ja(n),t=[];for(let i=0;i<e;i++)t.push(Xa(n));return t}case 5:return JSON.parse(n.read(ja(n)).toString());case 6:return ja(n)}}function Md(n){return{call(r,e,t){return n.then(i=>i.call(r,e,t))},listen(r,e){let t=new dd;return n.then(i=>t.input=i.listen(r,e)),t.event}}}function vx(n){let r=!1;return{call(e,t,i){return r?n.call(e,t,i):lt(0).then(()=>r=!0).then(()=>n.call(e,t,i))},listen(e,t){if(r)return n.listen(e,t);let i=new dd;return lt(0).then(()=>r=!0).then(()=>i.input=n.listen(e,t)),i.event}}}var d2,Dd,Ad,Ws,Ld,Us,Ya,Za,Rf,tt,Pn=I(()=>{Jt();he();ot();wt();Vo();He();q();Pa();$();Rd();ar();Oe();d2=Ho(0);Dd=class{constructor(r){this.buffer=r;this.pos=0}read(r){let e=this.buffer.slice(this.pos,this.pos+r);return this.pos+=e.byteLength,e}},Ad=class{constructor(){this.buffers=[]}get buffer(){return H.concat(this.buffers)}write(r){this.buffers.push(r)}};Ws={Undefined:Ho(0),String:Ho(1),Buffer:Ho(2),VSBuffer:Ho(3),Array:Ho(4),Object:Ho(5),Uint:Ho(6)};Ld=class{constructor(r,e,t=null,i=1e3){this.protocol=r;this.ctx=e;this.logger=t;this.timeoutDelay=i;this.channels=new Map;this.activeRequests=new Map;this.pendingRequests=new Map;this.protocolListener=this.protocol.onMessage(o=>this.onRawMessage(o)),this.sendResponse({type:200})}registerChannel(r,e){this.channels.set(r,e),setTimeout(()=>this.flushPendingRequests(r),0)}sendResponse(r){switch(r.type){case 200:{let e=this.send([r.type]);this.logger?.logOutgoing(e,0,1,kf(r.type));return}case 201:case 202:case 204:case 203:{let e=this.send([r.type,r.id],r.data);this.logger?.logOutgoing(e,r.id,1,kf(r.type),r.data);return}}}send(r,e=void 0){let t=new Ad;return Qa(t,r),Qa(t,e),this.sendBuffer(t.buffer)}sendBuffer(r){try{return this.protocol.send(r),r.byteLength}catch{return 0}}onRawMessage(r){let e=new Dd(r),t=Xa(e),i=Xa(e),o=t[0];switch(o){case 100:return this.logger?.logIncoming(r.byteLength,t[1],1,`${Ja(o)}: ${t[2]}.${t[3]}`,i),this.onPromise({type:o,id:t[1],channelName:t[2],name:t[3],arg:i});case 102:return this.logger?.logIncoming(r.byteLength,t[1],1,`${Ja(o)}: ${t[2]}.${t[3]}`,i),this.onEventListen({type:o,id:t[1],channelName:t[2],name:t[3],arg:i});case 101:return this.logger?.logIncoming(r.byteLength,t[1],1,`${Ja(o)}`),this.disposeActiveRequest({type:o,id:t[1]});case 103:return this.logger?.logIncoming(r.byteLength,t[1],1,`${Ja(o)}`),this.disposeActiveRequest({type:o,id:t[1]})}}onPromise(r){let e=this.channels.get(r.channelName);if(!e){this.collectPendingRequest(r);return}let t=new $e,i;try{i=e.call(this.ctx,r.name,r.arg,t.token)}catch(a){i=Promise.reject(a)}let o=r.id;i.then(a=>{this.sendResponse({id:o,data:a,type:201})},a=>{a instanceof Error?this.sendResponse({id:o,data:{message:a.message,name:a.name,stack:a.stack?a.stack.split(`
`):void 0},type:202}):this.sendResponse({id:o,data:a,type:203})}).finally(()=>{s.dispose(),this.activeRequests.delete(r.id)});let s=G(()=>t.cancel());this.activeRequests.set(r.id,s)}onEventListen(r){let e=this.channels.get(r.channelName);if(!e){this.collectPendingRequest(r);return}let t=r.id,o=e.listen(this.ctx,r.name,r.arg)(s=>this.sendResponse({id:t,data:s,type:204}));this.activeRequests.set(r.id,o)}disposeActiveRequest(r){let e=this.activeRequests.get(r.id);e&&(e.dispose(),this.activeRequests.delete(r.id))}collectPendingRequest(r){let e=this.pendingRequests.get(r.channelName);e||(e=[],this.pendingRequests.set(r.channelName,e));let t=setTimeout(()=>{console.error(`Unknown channel: ${r.channelName}`),r.type===100&&this.sendResponse({id:r.id,data:{name:"Unknown channel",message:`Channel name '${r.channelName}' timed out after ${this.timeoutDelay}ms`,stack:void 0},type:202})},this.timeoutDelay);e.push({request:r,timeoutTimer:t})}flushPendingRequests(r){let e=this.pendingRequests.get(r);if(e){for(let t of e)switch(clearTimeout(t.timeoutTimer),t.request.type){case 100:this.onPromise(t.request);break;case 102:this.onEventListen(t.request);break}this.pendingRequests.delete(r)}}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),ut(this.activeRequests.values()),this.activeRequests.clear()}},Us=class{constructor(r,e=null){this.protocol=r;this.isDisposed=!1;this.state=0;this.activeRequests=new Set;this.handlers=new Map;this.lastRequestId=0;this._onDidInitialize=new b;this.onDidInitialize=this._onDidInitialize.event;this.protocolListener=this.protocol.onMessage(t=>this.onBuffer(t)),this.logger=e}getChannel(r){let e=this;return{call(t,i,o){return e.isDisposed?Promise.reject(new xt):e.requestPromise(r,t,i,o)},listen(t,i){return e.isDisposed?S.None:e.requestEvent(r,t,i)}}}requestPromise(r,e,t,i=Ce.None){let o=this.lastRequestId++,a={id:o,type:100,channelName:r,name:e,arg:t};if(i.isCancellationRequested)return Promise.reject(new xt);let l,c;return new Promise((u,f)=>{if(i.isCancellationRequested)return f(new xt);let m=()=>{let C=w=>{switch(w.type){case 201:this.handlers.delete(o),u(w.data);break;case 202:{this.handlers.delete(o);let _=new Error(w.data.message);_.stack=Array.isArray(w.data.stack)?w.data.stack.join(`
`):w.data.stack,_.name=w.data.name,f(_);break}case 203:this.handlers.delete(o),f(w.data);break}};this.handlers.set(o,C),this.sendRequest(a)},v=null;this.state===1?m():(v=Ji(C=>this.whenInitialized()),v.then(()=>{v=null,m()}));let y=()=>{v?(v.cancel(),v=null):this.sendRequest({id:o,type:101}),f(new xt)};l=i.onCancellationRequested(y),c={dispose:Xn(()=>{y(),l.dispose()})},this.activeRequests.add(c)}).finally(()=>{l?.dispose(),this.activeRequests.delete(c)})}requestEvent(r,e,t){let i=this.lastRequestId++,s={id:i,type:102,channelName:r,name:e,arg:t},a=null,l=new b({onWillAddFirstListener:()=>{let d=()=>{this.activeRequests.add(l),this.sendRequest(s)};this.state===1?d():(a=Ji(u=>this.whenInitialized()),a.then(()=>{a=null,d()}))},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(l),this.sendRequest({id:i,type:103})),this.handlers.delete(i)}}),c=d=>l.fire(d.data);return this.handlers.set(i,c),l.event}sendRequest(r){switch(r.type){case 100:case 102:{let e=this.send([r.type,r.id,r.channelName,r.name],r.arg);this.logger?.logOutgoing(e,r.id,0,`${Ja(r.type)}: ${r.channelName}.${r.name}`,r.arg);return}case 101:case 103:{let e=this.send([r.type,r.id]);this.logger?.logOutgoing(e,r.id,0,Ja(r.type));return}}}send(r,e=void 0){let t=new Ad;return Qa(t,r),Qa(t,e),this.sendBuffer(t.buffer)}sendBuffer(r){try{return this.protocol.send(r),r.byteLength}catch{return 0}}onBuffer(r){let e=new Dd(r),t=Xa(e),i=Xa(e),o=t[0];switch(o){case 200:return this.logger?.logIncoming(r.byteLength,0,0,kf(o)),this.onResponse({type:t[0]});case 201:case 202:case 204:case 203:return this.logger?.logIncoming(r.byteLength,t[1],0,kf(o),i),this.onResponse({type:t[0],id:t[1],data:i})}}onResponse(r){if(r.type===200){this.state=1,this._onDidInitialize.fire();return}this.handlers.get(r.id)?.(r)}get onDidInitializePromise(){return S.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===1?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),ut(this.activeRequests.values()),this.activeRequests.clear(),this._onDidInitialize.dispose()}};E([se],Us.prototype,"onDidInitializePromise",1);Ya=class{constructor(r,e,t){this.channels=new Map;this._connections=new Set;this._onDidAddConnection=new b;this.onDidAddConnection=this._onDidAddConnection.event;this._onDidRemoveConnection=new b;this.onDidRemoveConnection=this._onDidRemoveConnection.event;this.disposables=new j;this.disposables.add(r(({protocol:i,onDidClientDisconnect:o})=>{let s=S.once(i.onMessage),a=new j,l=s(c=>{let d=new Dd(c),u=Xa(d),f=new Ld(i,u,e,t),m=new Us(i,e);this.channels.forEach((y,C)=>f.registerChannel(C,y));let v={channelServer:f,channelClient:m,ctx:u};this._connections.add(v),this._onDidAddConnection.fire(v),a.add(o(()=>{f.dispose(),m.dispose(),this._connections.delete(v),this._onDidRemoveConnection.fire(v),this.disposables.delete(a),a.dispose()}))});a.add(l),this.disposables.add(a)}))}get connections(){let r=[];return this._connections.forEach(e=>r.push(e)),r}getChannel(r,e){let t=this;return{call(i,o,s){let a;if(sd(e)){let c=SS(t.connections.filter(e));a=c?Promise.resolve(c):S.toPromise(S.filter(t.onDidAddConnection,e))}else a=e.routeCall(t,i,o);let l=a.then(c=>c.channelClient.getChannel(r));return Md(l).call(i,o,s)},listen(i,o){if(sd(e))return t.getMulticastEvent(r,e,i,o);let s=e.routeEvent(t,i,o).then(a=>a.channelClient.getChannel(r));return Md(s).listen(i,o)}}}getMulticastEvent(r,e,t,i){let o=this,s,a=new b({onWillAddFirstListener:()=>{s=new j;let l=new Xp,c=new Map,d=f=>{let v=f.channelClient.getChannel(r).listen(t,i),y=l.add(v);c.set(f,y)},u=f=>{let m=c.get(f);m&&(m.dispose(),c.delete(f))};o.connections.filter(e).forEach(d),S.filter(o.onDidAddConnection,e)(d,void 0,s),o.onDidRemoveConnection(u,void 0,s),l.event(a.fire,a,s),s.add(l)},onDidRemoveLastListener:()=>{s?.dispose(),s=void 0}});return o.disposables.add(a),a.event}registerChannel(r,e){this.channels.set(r,e);for(let t of this._connections)t.channelServer.registerChannel(r,e)}dispose(){this.disposables.dispose();for(let r of this._connections)r.channelClient.dispose(),r.channelServer.dispose();this._connections.clear(),this.channels.clear(),this._onDidAddConnection.dispose(),this._onDidRemoveConnection.dispose()}},Za=class{constructor(r,e,t=null){let i=new Ad;Qa(i,e),r.send(i.buffer),this.channelClient=new Us(r,t),this.channelServer=new Ld(r,e,t)}getChannel(r){return this.channelClient.getChannel(r)}registerChannel(r,e){this.channelServer.registerChannel(r,e)}dispose(){this.channelClient.dispose(),this.channelServer.dispose()}};Rf=class{constructor(r){this.fn=r}routeCall(r){return this.route(r)}routeEvent(r){return this.route(r)}async route(r){for(let e of r.connections)if(await Promise.resolve(this.fn(e.ctx)))return Promise.resolve(e);return await S.toPromise(r.onDidAddConnection),await this.route(r)}};(i=>{function n(o,s,a){let l=o,c=a?.disableMarshalling,d=new Map;for(let u in l)e(u)&&d.set(u,S.buffer(l[u],u,!0,void 0,s));return new class{listen(u,f,m){let v=d.get(f);if(v)return v;let y=l[f];if(typeof y=="function"){if(t(f))return y.call(l,m);if(e(f))return d.set(f,S.buffer(l[f],f,!0,void 0,s)),d.get(f)}throw new ri(`Event not found: ${f}`)}call(u,f,m){let v=l[f];if(typeof v=="function"){if(!c&&Array.isArray(m))for(let C=0;C<m.length;C++)m[C]=Yi(m[C]);let y=v.apply(l,m);return y instanceof Promise||(y=Promise.resolve(y)),y}throw new ri(`Method not found: ${f}`)}}}i.fromService=n;function r(o,s){let a=s?.disableMarshalling;return new Proxy({},{get(l,c){if(typeof c=="string")return s?.properties?.has(c)?s.properties.get(c):t(c)?function(d){return o.listen(c,d)}:e(c)?o.listen(c):async function(...d){let u;s&&!Vt(s.context)?u=[s.context,...d]:u=d;let f=await o.call(c,u);return a?f:Yi(f)};throw new ri(`Property not found: ${String(c)}`)}})}i.toService=r;function e(o){return o[0]==="o"&&o[1]==="n"&&fv(o.charCodeAt(2))}function t(o){return/^onDynamic/.test(o)&&fv(o.charCodeAt(9))}})(tt||={})});function yx(n){return u2.test(n)}var u2,ke,Xt=I(()=>{u2=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ke=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n=new Uint8Array(16),r=[];for(let e=0;e<256;e++)r.push(e.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128;let t=0,i="";return i+=r[n[t++]],i+=r[n[t++]],i+=r[n[t++]],i+=r[n[t++]],i+="-",i+=r[n[t++]],i+=r[n[t++]],i+="-",i+=r[n[t++]],i+=r[n[t++]],i+="-",i+=r[n[t++]],i+=r[n[t++]],i+="-",i+=r[n[t++]],i+=r[n[t++]],i+=r[n[t++]],i+=r[n[t++]],i+=r[n[t++]],i+=r[n[t++]],i}})()});function $o(){return Vv||(Vv=H.alloc(0)),Vv}function Ix(n){switch(n){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 Kv,Vv,Od,Ii,Fd,Wd,Ud,Nd,Ns,Hv,$v,qv,Df,zv=I(()=>{ot();q();$();Pn();(s=>{s.enableDiagnostics=!1,s.records=[];let e=new WeakMap,t=0;function i(a,l){if(!e.has(a)){let c=String(++t);e.set(a,c)}return e.get(a)}function o(a,l,c,d){}s.traceSocketEvent=o})(Kv||={});Vv=null;Od=class{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(r){this._chunks.push(r),this._totalLength+=r.byteLength}read(r){return this._read(r,!0)}peek(r){return this._read(r,!1)}_read(r,e){if(r===0)return $o();if(r>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===r){let s=this._chunks[0];return e&&(this._chunks.shift(),this._totalLength-=r),s}if(this._chunks[0].byteLength>r){let s=this._chunks[0].slice(0,r);return e&&(this._chunks[0]=this._chunks[0].slice(r),this._totalLength-=r),s}let t=H.alloc(r),i=0,o=0;for(;r>0;){let s=this._chunks[o];if(s.byteLength>r){let a=s.slice(0,r);t.set(a,i),i+=r,e&&(this._chunks[o]=s.slice(r),this._totalLength-=r),r-=r}else t.set(s,i),i+=s.byteLength,e?(this._chunks.shift(),this._totalLength-=s.byteLength):o++,r-=s.byteLength}return t}};Ii=class{constructor(r,e,t,i){this.type=r;this.id=e;this.ack=t;this.data=i;this.writtenTime=0}get size(){return this.data.byteLength}},Fd=class extends T{constructor(e){super();this._onMessage=this._register(new b);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 Od,this._register(this._socket.onData(t=>this.acceptChunk(t))),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 t=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=t.readUInt32BE(9),this._state.messageType=t.readUInt8(0),this._state.id=t.readUInt32BE(1),this._state.ack=t.readUInt32BE(5),this._socket.traceSocketEvent("protocolHeaderRead",{messageType:Ix(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{let i=this._state.messageType,o=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",t),this._onMessage.fire(new Ii(i,o,s,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}},Wd=class{constructor(r){this._writeNowTimeout=null;this._isDisposed=!1,this._isPaused=!1,this._socket=r,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(r){if(this._isDisposed)return;r.writtenTime=Date.now(),this.lastWriteTime=Date.now();let e=H.alloc(13);e.writeUInt8(r.type,0),e.writeUInt32BE(r.id,1),e.writeUInt32BE(r.ack,5),e.writeUInt32BE(r.data.byteLength,9),this._socket.traceSocketEvent("protocolHeaderWrite",{messageType:Ix(r.type),id:r.id,ack:r.ack,messageSize:r.data.byteLength}),this._socket.traceSocketEvent("protocolMessageWrite",r.data),this._writeSoon(e,r.data)}_bufferAdd(r,e){let t=this._totalLength===0;return this._data.push(r,e),this._totalLength+=r.byteLength+e.byteLength,t}_bufferTake(){let r=H.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,r}_writeSoon(r,e){this._bufferAdd(r,e)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;let r=this._bufferTake();this._socket.traceSocketEvent("protocolWrite",{byteLength:r.byteLength}),this._socket.write(r)}},Ud=class extends T{constructor(e){super();this._onMessage=this._register(new b);this.onMessage=this._onMessage.event;this._onDidDispose=this._register(new b);this.onDidDispose=this._onDidDispose.event;this._socket=e,this._socketWriter=this._register(new Wd(this._socket)),this._socketReader=this._register(new Fd(this._socket)),this._register(this._socketReader.onMessage(t=>{t.type===1&&this._onMessage.fire(t.data)})),this._register(this._socket.onClose(()=>this._onDidDispose.fire()))}drain(){return this._socketWriter.drain()}getSocket(){return this._socket}sendDisconnect(){}send(e){this._socketWriter.write(new Ii(1,0,0,e))}},Nd=class n extends Za{constructor(e,t,i=null){super(e,t,i);this.protocol=e}static fromSocket(e,t){return new n(new Ud(e),t)}get onDidDispose(){return this.protocol.onDidDispose}dispose(){super.dispose();let e=this.protocol.getSocket();this.protocol.sendDisconnect(),this.protocol.dispose(),e.end()}},Ns=class{constructor(){this._hasListeners=!1;this._isDeliveringMessages=!1;this._bufferedMessages=[];this._emitter=new b({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(r){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(r):this._emitter.fire(r):this._bufferedMessages.push(r)}flushBuffer(){this._bufferedMessages=[]}},Hv=class{constructor(r){this.data=r,this.next=null}},$v=class{constructor(){this._first=null,this._last=null}length(){let r=0,e=this._first;for(;e;)e=e.next,r++;return r}peek(){return this._first?this._first.data:null}toArray(){let r=[],e=0,t=this._first;for(;t;)r[e++]=t.data,t=t.next;return r}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(r){let e=new Hv(r);if(!this._first){this._first=e,this._last=e;return}this._last.next=e,this._last=e}},qv=class n{static{this._HISTORY_LENGTH=10}static{this._INSTANCE=null}static getInstance(){return n._INSTANCE||(n._INSTANCE=new n),n._INSTANCE}constructor(){this.lastRuns=[];let r=Date.now();for(let e=0;e<n._HISTORY_LENGTH;e++)this.lastRuns[e]=r-1e3*e;setInterval(()=>{for(let e=n._HISTORY_LENGTH;e>=1;e--)this.lastRuns[e]=this.lastRuns[e-1];this.lastRuns[0]=Date.now()},1e3)}load(){let r=Date.now(),e=(1+n._HISTORY_LENGTH)*1e3,t=0;for(let i=0;i<n._HISTORY_LENGTH;i++)r-this.lastRuns[i]<=e&&t++;return 1-t/n._HISTORY_LENGTH}hasHighLoad(){return this.load()>=.5}},Df=class{constructor(r){this._onControlMessage=new Ns;this.onControlMessage=this._onControlMessage.event;this._onMessage=new Ns;this.onMessage=this._onMessage.event;this._onDidDispose=new Ns;this.onDidDispose=this._onDidDispose.event;this._onSocketClose=new Ns;this.onSocketClose=this._onSocketClose.event;this._onSocketTimeout=new Ns;this.onSocketTimeout=this._onSocketTimeout.event;this._loadEstimator=r.loadEstimator??qv.getInstance(),this._shouldSendKeepAlive=r.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new $v,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 j,this._socket=r.socket,this._socketWriter=this._socketDisposables.add(new Wd(this._socket)),this._socketReader=this._socketDisposables.add(new Fd(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(e=>this._receiveMessage(e))),this._socketDisposables.add(this._socket.onClose(e=>this._onSocketClose.fire(e))),r.initialChunk&&this._socketReader.acceptChunk(r.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 r=new Ii(5,0,0,$o());this._socketWriter.write(r),this._socketWriter.flush()}}sendPause(){let r=new Ii(7,0,0,$o());this._socketWriter.write(r)}sendResume(){let r=new Ii(8,0,0,$o());this._socketWriter.write(r)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(r,e){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new j,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=r,this._socketWriter=this._socketDisposables.add(new Wd(this._socket)),this._socketReader=this._socketDisposables.add(new Fd(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(t=>this._receiveMessage(t))),this._socketDisposables.add(this._socket.onClose(t=>this._onSocketClose.fire(t))),this._socketReader.acceptChunk(e)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;let r=new Ii(3,0,this._incomingAckId,$o());this._socketWriter.write(r);let e=this._outgoingUnackMsg.toArray();for(let t=0,i=e.length;t<i;t++)this._socketWriter.write(e[t]);this._recvAckCheck()}acceptDisconnect(){this._onDidDispose.fire()}_receiveMessage(r){if(r.ack>this._outgoingAckId){this._outgoingAckId=r.ack;do{let e=this._outgoingUnackMsg.peek();if(e&&e.id<=r.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(r.type){case 0:break;case 1:{if(r.id>this._incomingMsgId)if(r.id!==this._incomingMsgId+1){let e=Date.now();e-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=e,this._socketWriter.write(new Ii(6,0,0,$o())))}else this._incomingMsgId=r.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(r.data);break}case 2:{this._onControlMessage.fire(r.data);break}case 3:break;case 5:{this._onDidDispose.fire();break}case 6:{let e=this._outgoingUnackMsg.toArray();for(let t=0,i=e.length;t<i;t++)this._socketWriter.write(e[t]);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(r){let e=++this._outgoingMsgId;this._incomingAckId=this._incomingMsgId;let t=new Ii(1,e,this._incomingAckId,r);this._outgoingUnackMsg.push(t),this._isReconnecting||(this._socketWriter.write(t),this._recvAckCheck())}sendControl(r){let e=new Ii(2,0,0,r);this._socketWriter.write(e)}_sendAckCheck(){if(this._incomingMsgId<=this._incomingAckId||this._incomingAckTimeout)return;let r=Date.now()-this._incomingMsgLastTime;if(r>=2e3){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},2e3-r+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;let r=this._outgoingUnackMsg.peek(),e=Date.now()-r.writtenTime,t=Date.now()-this._socketReader.lastReadTime,i=Date.now()-this._lastSocketTimeoutTime;if(e>=2e4&&t>=2e4&&i>=2e4&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:e,timeSinceLastReceivedSomeData:t});return}let o=Math.max(2e4-e,2e4-t,2e4-i,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;let r=new Ii(3,0,this._incomingAckId,$o());this._socketWriter.write(r)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;let r=new Ii(9,0,this._incomingAckId,$o());this._socketWriter.write(r)}}});import{createHash as bx}from"crypto";import{createConnection as wx,createServer as m2}from"net";import{createDeflateRaw as h2,createInflateRaw as g2}from"zlib";function Sx(n,r,{debugLabel:e,skipWebSocketFrames:t=!1,disableWebSocketCompression:i=!1,enableMessageSplitting:o=!0}){if(n.headers.upgrade===void 0||n.headers.upgrade.toLowerCase()!=="websocket"){r.end("HTTP/1.1 400 Bad Request");return}let s=n.headers["sec-websocket-key"],a=bx("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")}`],d=!1;if(!t&&!i&&n.headers["sec-websocket-extensions"]){let u=Array.isArray(n.headers["sec-websocket-extensions"])?n.headers["sec-websocket-extensions"]:[n.headers["sec-websocket-extensions"]];for(let f of u)if(!/\b((server_max_window_bits)|(server_no_context_takeover)|(client_no_context_takeover))\b/.test(f)){if(/\b(permessage-deflate)\b/.test(f)){d=!0,c.push("Sec-WebSocket-Extensions: permessage-deflate");break}if(/\b(x-webkit-deflate-frame)\b/.test(f)){d=!0,c.push("Sec-WebSocket-Extensions: x-webkit-deflate-frame");break}}}return r.write(c.join(`\r
`)+`\r
\r
`),r.setTimeout(0),r.setNoDelay(!0),t?new ao(r,e):new jv(new ao(r,e),d,null,!0,o)}function y2(n,r){if(r===0)return;let e=n.byteLength>>>2;for(let l=0;l<e;l++){let c=n.readUInt32BE(l*4);n.writeUInt32BE(c^r,l*4)}let t=e*4,i=n.byteLength-t,o=r>>>24&255,s=r>>>16&255,a=r>>>8&255;i>=1&&n.writeUInt8(n.readUInt8(t)^o,t),i>=2&&n.writeUInt8(n.readUInt8(t+1)^s,t+1),i>=3&&n.writeUInt8(n.readUInt8(t+2)^a,t+2)}function xx(n,r,e){let i=bx("sha256").update(n).digest("hex").substr(0,8);if(process.platform==="win32")return`\\\\.\\pipe\\${i}-${e}-${r}-sock`;let o=e.substr(0,4),s=r.substr(0,6),a;return process.platform!=="darwin"&&Af&&!process.env.VSCODE_PORTABLE?a=N(Af,`vscode-${i}-${o}-${s}.sock`):a=N(n,`${o}-${s}.sock`),w2(a),a}function w2(n){let r=I2[Gn];typeof r=="number"&&n.length>=r&&console.warn(`WARNING: IPC handle "${n}" is longer than ${r} chars, try a shorter --user-data-dir`)}function Px(n){return new Promise((r,e)=>{let t=m2();t.on("error",e),t.listen(n,()=>{t.removeListener("error",e),r(new Xv(t))})})}function Ex(n,r){return new Promise((e,t)=>{let i,o=()=>{i.removeListener("error",t),e(Nd.fromSocket(new ao(i,`ipc-client${r}`),r))};typeof n=="string"?i=wx(n,o):i=wx(n,o),i.once("error",t)})}var v2,ao,jv,Gv,Jv,Qv,Af,I2,Xv,Bd=I(()=>{ot();He();q();$();we();X();Xt();Pn();zv();v2=3e4,ao=class{constructor(r,e=""){this._canWrite=!0;this.debugLabel=e,this.socket=r,this.traceSocketEvent("created",{type:"NodeSocket"}),this._errorListener=i=>{if(this.traceSocketEvent("error",{code:i?.code,message:i?.message}),i){if(i.code==="EPIPE")return;nt(i)}},this.socket.on("error",this._errorListener);let t;this._closeListener=i=>{this.traceSocketEvent("close",{hadError:i}),this._canWrite=!1,t&&clearTimeout(t)},this.socket.on("close",this._closeListener),this._endListener=()=>{this.traceSocketEvent("nodeEndReceived"),this._canWrite=!1,t=setTimeout(()=>r.destroy(),v2)},this.socket.on("end",this._endListener)}traceSocketEvent(r,e){Kv.traceSocketEvent(this.socket,this.debugLabel,r,e)}dispose(){this.socket.off("error",this._errorListener),this.socket.off("close",this._closeListener),this.socket.off("end",this._endListener),this.socket.destroy()}onData(r){let e=t=>{this.traceSocketEvent("read",t),r(H.wrap(t))};return this.socket.on("data",e),{dispose:()=>this.socket.off("data",e)}}onClose(r){let e=t=>{r({type:0,hadError:t,error:void 0})};return this.socket.on("close",e),{dispose:()=>this.socket.off("close",e)}}onEnd(r){let e=()=>{r()};return this.socket.on("end",e),{dispose:()=>this.socket.off("end",e)}}write(r){if(!(this.socket.destroyed||!this._canWrite))try{this.traceSocketEvent("write",r),this.socket.write(r.buffer,e=>{if(e){if(e.code==="EPIPE")return;nt(e)}})}catch(e){if(e.code==="EPIPE")return;nt(e)}}end(){this.traceSocketEvent("nodeEndSent"),this.socket.end()}drain(){return this.traceSocketEvent("nodeDrainBegin"),new Promise((r,e)=>{if(this.socket.bufferSize===0){this.traceSocketEvent("nodeDrainEnd"),r();return}let t=()=>{this.socket.off("close",t),this.socket.off("end",t),this.socket.off("error",t),this.socket.off("timeout",t),this.socket.off("drain",t),this.traceSocketEvent("nodeDrainEnd"),r()};this.socket.on("close",t),this.socket.on("end",t),this.socket.on("error",t),this.socket.on("timeout",t),this.socket.on("drain",t)})}},jv=class extends T{constructor(e,t,i,o,s=!0){super();this._onData=this._register(new b);this._onClose=this._register(new b);this._isEnded=!1;this._state={state:1,readLen:2,fin:0,compressed:!1,firstFrameOfMessage:!0,mask:0,opcode:0};this.socket=e,this._maxSocketMessageLength=s?262144:1/0,this.traceSocketEvent("created",{type:"WebSocketNodeSocket",permessageDeflate:t,inflateBytesLength:i?.byteLength||0,recordInflateBytes:o}),this._flowManager=this._register(new Gv(this,t,i,o,this._onData,(a,l)=>this._write(a,l))),this._register(this._flowManager.onError(a=>{console.error(a),nt(a),this._onClose.fire({type:0,hadError:!0,error:a})})),this._incomingData=new Od,this._register(this.socket.onData(a=>this._acceptChunk(a))),this._register(this.socket.onClose(async a=>{this._flowManager.isProcessingReadQueue()&&await S.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,t){this.socket.traceSocketEvent(e,t)}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 t=0;for(;t<e.byteLength;)this._flowManager.writeMessage(e.slice(t,Math.min(t+this._maxSocketMessageLength,e.byteLength)),{compressed:!0,opcode:2}),t+=this._maxSocketMessageLength}_write(e,{compressed:t,opcode:i}){if(this._isEnded)return;this.traceSocketEvent("webSocketNodeSocketWrite",e);let o=2;e.byteLength<126?o+=0:e.byteLength<2**16?o+=2:o+=8;let s=H.alloc(o),a=t?64:0,l=i&15;if(s.writeUInt8(128|a|l,0),e.byteLength<126)s.writeUInt8(e.byteLength,1);else if(e.byteLength<2**16){s.writeUInt8(126,1);let c=1;s.writeUInt8(e.byteLength>>>8&255,++c),s.writeUInt8(e.byteLength>>>0&255,++c)}else{s.writeUInt8(127,1);let c=1;s.writeUInt8(0,++c),s.writeUInt8(0,++c),s.writeUInt8(0,++c),s.writeUInt8(0,++c),s.writeUInt8(e.byteLength>>>24&255,++c),s.writeUInt8(e.byteLength>>>16&255,++c),s.writeUInt8(e.byteLength>>>8&255,++c),s.writeUInt8(e.byteLength>>>0&255,++c)}this.socket.write(H.concat([s,e]))}end(){this._isEnded=!0,this.socket.end()}_acceptChunk(e){if(e.byteLength!==0){for(this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;)if(this._state.state===1){let t=this._incomingData.peek(this._state.readLen),i=t.readUInt8(0),o=(i&128)>>>7,s=(i&64)>>>6,a=i&15,l=t.readUInt8(1),c=(l&128)>>>7,d=l&127;this._state.state=2,this._state.readLen=2+(c?4:0)+(d===126?2:0)+(d===127?8:0),this._state.fin=o,this._state.firstFrameOfMessage&&(this._state.compressed=!!s),this._state.firstFrameOfMessage=!!o,this._state.mask=0,this._state.opcode=a,this.traceSocketEvent("webSocketNodeSocketPeekedHeader",{headerSize:this._state.readLen,compressed:this._state.compressed,fin:this._state.fin,opcode:this._state.opcode})}else if(this._state.state===2){let t=this._incomingData.read(this._state.readLen),i=t.readUInt8(1),o=(i&128)>>>7,s=i&127,a=1;s===126?s=t.readUInt8(++a)*2**8+t.readUInt8(++a):s===127&&(s=t.readUInt8(++a)*0+t.readUInt8(++a)*0+t.readUInt8(++a)*0+t.readUInt8(++a)*0+t.readUInt8(++a)*2**24+t.readUInt8(++a)*2**16+t.readUInt8(++a)*2**8+t.readUInt8(++a));let l=0;o&&(l=t.readUInt8(++a)*2**24+t.readUInt8(++a)*2**16+t.readUInt8(++a)*2**8+t.readUInt8(++a)),this._state.state=3,this._state.readLen=s,this._state.mask=l,this.traceSocketEvent("webSocketNodeSocketPeekedHeader",{bodySize:this._state.readLen,compressed:this._state.compressed,fin:this._state.fin,mask:this._state.mask,opcode:this._state.opcode})}else if(this._state.state===3){let t=this._incomingData.read(this._state.readLen);this.traceSocketEvent("webSocketNodeSocketReadData",t),y2(t,this._state.mask),this.traceSocketEvent("webSocketNodeSocketUnmaskedData",t),this._state.state=1,this._state.readLen=2,this._state.mask=0,this._state.opcode<=2?this._flowManager.acceptFrame(t,this._state.compressed,!!this._state.fin):this._state.opcode===9&&this._flowManager.writeMessage(t,{compressed:!1,opcode:10})}}}async drain(){this.traceSocketEvent("webSocketNodeSocketDrainBegin"),this._flowManager.isProcessingWriteQueue()&&await S.toPromise(this._flowManager.onDidFinishProcessingWriteQueue),await this.socket.drain(),this.traceSocketEvent("webSocketNodeSocketDrainEnd")}},Gv=class extends T{constructor(e,t,i,o,s,a){super();this._tracer=e;this._onData=s;this._writeFn=a;this._onError=this._register(new b);this.onError=this._onError.event;this._writeQueue=[];this._readQueue=[];this._onDidFinishProcessingReadQueue=this._register(new b);this.onDidFinishProcessingReadQueue=this._onDidFinishProcessingReadQueue.event;this._onDidFinishProcessingWriteQueue=this._register(new b);this.onDidFinishProcessingWriteQueue=this._onDidFinishProcessingWriteQueue.event;this._isProcessingWriteQueue=!1;this._isProcessingReadQueue=!1;t?(this._zlibInflateStream=this._register(new Jv(this._tracer,o,i,{windowBits:15})),this._zlibDeflateStream=this._register(new Qv(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:H.alloc(0)}setRecordInflateBytes(e){this._zlibInflateStream?.setRecordInflateBytes(e)}writeMessage(e,t){this._writeQueue.push({data:e,options:t}),this._processWriteQueue()}async _processWriteQueue(){if(!this._isProcessingWriteQueue){for(this._isProcessingWriteQueue=!0;this._writeQueue.length>0;){let{data:e,options:t}=this._writeQueue.shift();if(this._zlibDeflateStream&&t.compressed){let i=await this._deflateMessage(this._zlibDeflateStream,e);this._writeFn(i,t)}else this._writeFn(e,{...t,compressed:!1})}this._isProcessingWriteQueue=!1,this._onDidFinishProcessingWriteQueue.fire()}}isProcessingWriteQueue(){return this._isProcessingWriteQueue}_deflateMessage(e,t){return new Promise((i,o)=>{e.write(t),e.flush(s=>i(s))})}acceptFrame(e,t,i){this._readQueue.push({data:e,isCompressed:t,isLastFrameOfMessage:i}),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 t=await this._inflateFrame(this._zlibInflateStream,e.data,e.isLastFrameOfMessage);this._onData.fire(t)}else this._onData.fire(e.data)}this._isProcessingReadQueue=!1,this._onDidFinishProcessingReadQueue.fire()}}isProcessingReadQueue(){return this._isProcessingReadQueue}_inflateFrame(e,t,i){return new Promise((o,s)=>{e.write(t),i&&e.write(H.fromByteArray([0,0,255,255])),e.flush(a=>o(a))})}},Jv=class extends T{constructor(e,t,i,o){super();this._tracer=e;this._onError=this._register(new b);this.onError=this._onError.event;this._recordedInflateBytes=[];this._pendingInflateData=[];this._recordInflateBytes=t,this._zlibInflate=g2(o),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(H.wrap(s))}),i&&(this._tracer.traceSocketEvent("zlibInflateInitialWrite",i.buffer),this._zlibInflate.write(i.buffer),this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateInitialFlushFired"),this._pendingInflateData.length=0}))}get recordedInflateBytes(){return this._recordInflateBytes?H.concat(this._recordedInflateBytes):H.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 t=H.concat(this._pendingInflateData);this._pendingInflateData.length=0,e(t)})}dispose(){this._recordedInflateBytes.length=0,this._pendingInflateData.length=0;try{this._zlibInflate.close()}catch{}super.dispose()}},Qv=class extends T{constructor(e,t){super();this._tracer=e;this._onError=this._register(new b);this.onError=this._onError.event;this._pendingDeflateData=[];this._zlibDeflate=h2({windowBits:15}),this._zlibDeflate.on("error",i=>{this._tracer.traceSocketEvent("zlibDeflateError",{message:i?.message,code:i?.code}),this._onError.fire(i)}),this._zlibDeflate.on("data",i=>{this._tracer.traceSocketEvent("zlibDeflateData",i),this._pendingDeflateData.push(H.wrap(i))})}write(e){this._tracer.traceSocketEvent("zlibDeflateWrite",e.buffer),this._zlibDeflate.write(e.buffer)}flush(e){this._zlibDeflate.flush(2,()=>{this._tracer.traceSocketEvent("zlibDeflateFlushFired");let t=H.concat(this._pendingDeflateData);this._pendingDeflateData.length=0,t=t.slice(0,t.byteLength-4),e(t)})}dispose(){this._pendingDeflateData.length=0;try{this._zlibDeflate.close()}catch{}super.dispose()}};Af=process.env.XDG_RUNTIME_DIR,I2={2:107,1:103};Xv=class n extends Ya{static toClientConnectionEvent(r){let e=S.fromNodeEventEmitter(r,"connection");return S.map(e,t=>({protocol:new Ud(new ao(t,"ipc-server-connection")),onDidClientDisconnect:S.once(S.fromNodeEventEmitter(t,"close"))}))}constructor(r){super(n.toClientConnectionEvent(r)),this.server=r}dispose(){super.dispose(),this.server&&(this.server.close(),this.server=null)}}});import Vd from"electron";var Zv,rt,Ai=I(()=>{He();ze();Zv=class{constructor(){this.mapListenerToWrapper=new WeakMap}on(r,e){let t=(i,...o)=>{this.validateEvent(r,i)&&e(i,...o)};return this.mapListenerToWrapper.set(e,t),Vd.ipcMain.on(r,t),this}once(r,e){return Vd.ipcMain.once(r,(t,...i)=>{this.validateEvent(r,t)&&e(t,...i)}),this}handle(r,e){return Vd.ipcMain.handle(r,(t,...i)=>this.validateEvent(r,t)?e(t,...i):Promise.reject(`Invalid channel '${r}' or sender for ipcMain.handle() usage.`)),this}removeHandler(r){return Vd.ipcMain.removeHandler(r),this}removeListener(r,e){let t=this.mapListenerToWrapper.get(e);return t&&(Vd.ipcMain.removeListener(r,t),this.mapListenerToWrapper.delete(e)),this}validateEvent(r,e){if(!r?.startsWith("vscode:"))return nt(`Refused to handle ipcMain event for channel '${r}' because the channel is unknown.`),!1;let t=e.senderFrame,i=t?.url;if(!i||i==="about:blank")return!0;let o="unknown";try{o=new URL(i).host}catch{return nt(`Refused to handle ipcMain event for channel '${r}' because of a malformed URL '${i}'.`),!1}return process.env.VSCODE_DEV&&i===process.env.DEV_WINDOW_SRC&&(o==="localhost"||o.startsWith("localhost:"))?!0:o!==Fa?(nt(`Refused to handle ipcMain event for channel '${r}' because of a bad origin of '${o}'.`),!1):t?.parent!==null?(nt(`Refused to handle ipcMain event for channel '${r}' because sender of origin '${o}' is not a main frame.`),!1):!0}},rt=new Zv});import*as Hd from"os";async function Lf(){if(qo)return;if(!F){qo={release:Hd.release(),buildNumber:0};return}let n,r;try{let e=await import("@vscode/windows-registry"),t="SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",i=e.GetStringRegKey("HKEY_LOCAL_MACHINE",t,"CurrentBuild");i!==void 0&&(n=parseInt(i,10),isNaN(n)&&(n=void 0));let o=e.GetDWORDRegKey("HKEY_LOCAL_MACHINE",t,"CurrentMajorVersionNumber"),s=e.GetDWORDRegKey("HKEY_LOCAL_MACHINE",t,"CurrentMinorVersionNumber");o!==void 0&&s!==void 0&&i!==void 0&&(r=`${o}.${s}.${i}`)}catch{}finally{qo={release:r||Hd.release(),buildNumber:n||b2()}}}async function Cx(){return qo||await Lf(),qo.release}async function Mf(){return qo||await Lf(),qo.buildNumber}function Tx(){return qo?.release??Hd.release()}function b2(){let n=/(\d+)\.(\d+)\.(\d+)/g.exec(Hd.release());return n&&n.length===4?parseInt(n[3],10):0}var qo,el=I(()=>{X()});var _x,kx,Rx=I(()=>{_x="vscode:contextmenu",kx="vscode:onCloseContextMenu"});import{Menu as S2,MenuItem as ey}from"electron";function Dx(){rt.on(_x,(n,r,e,t,i)=>{let o=Ax(n,t,e);o.popup({x:i?i.x:void 0,y:i?i.y:void 0,positioningItem:i?i.positioningItem:void 0,callback:()=>{o&&n.sender.send(kx,r)}})})}function Ax(n,r,e){let t=new S2;return e.forEach(i=>{let o;i.type==="separator"?o=new ey({type:i.type}):Array.isArray(i.submenu)?o=new ey({submenu:Ax(n,r,i.submenu),label:i.label}):o=new ey({label:i.label,type:i.type,accelerator:i.accelerator,checked:i.checked,enabled:i.enabled,visible:i.visible,click:(s,a,l)=>n.sender.send(r,i.id,l)}),t.append(o)}),t}var Lx=I(()=>{Ai();Rx()});var Of,Mx=I(()=>{Of=class{constructor(r,e){this.sender=r;this.onMessage=e}send(r){try{this.sender.send("vscode:message",r.buffer)}catch{}}disconnect(){this.sender.send("vscode:disconnect",null)}}});function Ox(n,r){let e=S.fromNodeEventEmitter(rt,r,(i,o)=>({event:i,message:o})),t=S.filter(e,({event:i})=>i.sender.id===n);return S.map(t,({message:i})=>i&&H.wrap(i))}var Ff,Fx=I(()=>{Ai();ot();q();$();Pn();Mx();Ff=class n extends Ya{static{this.Clients=new Map}static getOnDidClientConnect(){let r=S.fromNodeEventEmitter(rt,"vscode:hello",({sender:e})=>e);return S.map(r,e=>{let t=e.id;n.Clients.get(t)?.dispose();let o=new b;n.Clients.set(t,G(()=>o.fire()));let s=Ox(t,"vscode:message"),a=S.any(S.signal(Ox(t,"vscode:disconnect")),o.event);return{protocol:new Of(e,s),onDidClientDisconnect:a}})}constructor(){super(n.getOnDidClientConnect())}}});var ty,Wf,Wx=I(()=>{ot();q();Pn();ty=class{constructor(r){this.port=r;this.onMessage=S.fromDOMEventEmitter(this.port,"message",e=>e.data?H.wrap(e.data):H.alloc(0)),r.start()}send(r){this.port.postMessage(r.buffer)}disconnect(){this.port.close()}},Wf=class extends Za{constructor(r,e){let t=new ty(r);super(t,e),this.protocol=t}dispose(){this.protocol.disconnect(),super.dispose()}}});var Ko,Uf=I(()=>{Ai();q();Xt();Wx();Ko=class extends Wf{constructor(r,e){super({addEventListener:(t,i)=>r.addListener(t,i),removeEventListener:(t,i)=>r.removeListener(t,i),postMessage:t=>r.postMessage(t),start:()=>r.start(),close:()=>r.close()},e)}}});function cr(n){return iy(n,0)}function iy(n,r){switch(typeof n){case"object":return n===null?lo(349,r):Array.isArray(n)?P2(n,r):E2(n,r);case"string":return Nx(n,r);case"boolean":return x2(n,r);case"number":return lo(n,r);case"undefined":return lo(937,r);default:return lo(617,r)}}function lo(n,r){return(r<<5)-r+n|0}function x2(n,r){return lo(n?433:863,r)}function Nx(n,r){r=lo(149417,r);for(let e=0,t=n.length;e<t;e++)r=lo(n.charCodeAt(e),r);return r}function P2(n,r){return r=lo(104579,r),n.reduce((e,t)=>iy(t,e),r)}function E2(n,r){return r=lo(181387,r),Object.keys(n).sort().reduce((e,t)=>(e=Nx(t,e),iy(n[t],e)),r)}function ry(n,r,e=32){let t=e-r,i=~((1<<t)-1);return(n<<r|(i&n)>>>t)>>>0}function $d(n,r=32){return n instanceof ArrayBuffer?fx(H.wrap(new Uint8Array(n))):(n>>>0).toString(16).padStart(r/4,"0")}var Ux,En=I(()=>{ot();ar();Ux=class n{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(r){let e=r.length;if(e===0)return;let t=this._buff,i=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=r.charCodeAt(0),a=0);;){let l=s;if(ZS(s))if(a+1<e){let c=r.charCodeAt(a+1);mv(c)?(a++,l=e1(s,c)):l=65533}else{o=s;break}else mv(s)&&(l=65533);if(i=this._push(t,i,l),a++,a<e)s=r.charCodeAt(a);else break}this._buffLen=i,this._leftoverHighSurrogate=o}_push(r,e,t){return t<128?r[e++]=t:t<2048?(r[e++]=192|(t&1984)>>>6,r[e++]=128|(t&63)>>>0):t<65536?(r[e++]=224|(t&61440)>>>12,r[e++]=128|(t&4032)>>>6,r[e++]=128|(t&63)>>>0):(r[e++]=240|(t&1835008)>>>18,r[e++]=128|(t&258048)>>>12,r[e++]=128|(t&4032)>>>6,r[e++]=128|(t&63)>>>0),e>=64&&(this._step(),e-=64,this._totalLen+=64,r[0]=r[64],r[1]=r[65],r[2]=r[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()),$d(this._h0)+$d(this._h1)+$d(this._h2)+$d(this._h3)+$d(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 r=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(r/4294967296),!1),this._buffDV.setUint32(60,r%4294967296,!1),this._step()}_step(){let r=n._bigBlock32,e=this._buffDV;for(let u=0;u<64;u+=4)r.setUint32(u,e.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)r.setUint32(u,ry(r.getUint32(u-12,!1)^r.getUint32(u-32,!1)^r.getUint32(u-56,!1)^r.getUint32(u-64,!1),1),!1);let t=this._h0,i=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=i&o|~i&s,c=1518500249):u<40?(l=i^o^s,c=1859775393):u<60?(l=i&o|i&s|o&s,c=2400959708):(l=i^o^s,c=3395469782),d=ry(t,5)+l+a+c+r.getUint32(u*4,!1)&4294967295,a=s,s=o,o=ry(i,30),i=t,t=d;this._h0=this._h0+t&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}});var Bx,tl,qd=I(()=>{Z();Bx=O("encryptionService"),tl=O("encryptionMainService")});var wi,vr,si=I(()=>{Z();wi=O("environmentService"),vr=wi});function Vx(n){return n.getFullYear()+"-"+String(n.getMonth()+1).padStart(2,"0")+"-"+String(n.getDate()).padStart(2,"0")+"T"+String(n.getHours()).padStart(2,"0")+":"+String(n.getMinutes()).padStart(2,"0")+":"+String(n.getSeconds()).padStart(2,"0")+"."+(n.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}var C2,T2,oy,h7,g7,v7,Hx=I(()=>{xe();Yn();X();C2=60,T2=C2*60,oy=T2*24,h7=oy*7,g7=oy*30,v7=oy*365});function _2(n,r){return Kd(n["inspect-extensions"],n["inspect-brk-extensions"],5870,r,n.debugId,n.extensionEnvironment)}function Kd(n,r,e,t,i,o){let a=Number(r||n)||(t?null:e),l=a?!!r:!1,c;if(o)try{c=JSON.parse(o)}catch{}return{port:a,break:l,debugId:i,env:c}}function qx(n,r,e){if(!r)return;let t=n.quality;if(t==="stable")return e==="short"?"VS Code":"Visual Studio Code";if(t==="insider")return e==="short"?"VS Code Insiders":"Visual Studio Code Insiders";if(t==="exploration")return e==="short"?"VS Code Exploration":"Visual Studio Code Exploration"}var $x,Ae,Kx=I(()=>{Hx();Vo();ze();we();yi();gt();ce();$x=/^([^.]+\..+)[:=](.+)$/,Ae=class{constructor(r,e,t,i=!1){this._args=r;this.paths=e;this.productService=t;this.isEmbeddedApp=i}get appRoot(){return Le(st.asFileUri("").fsPath)}get userHome(){return x.file(this.paths.homeDir)}get userDataPath(){return this.paths.userDataDir}get appSettingsHome(){return x.file(N(this.userDataPath,"User"))}get tmpDir(){return x.file(this.paths.tmpDir)}get cacheHome(){return x.file(this.userDataPath)}get stateResource(){return oe(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:W.vscodeUserData})}get userDataSyncHome(){return oe(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){let r=Vx(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=N(this.userDataPath,"logs",r)}return x.file(this.args.logsPath)}get sync(){return this.args.sync}get workspaceStorageHome(){return oe(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return oe(this.appSettingsHome,"History")}get keyboardLayoutResource(){return oe(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){let r=St.VSCODE_PORTABLE;return r?x.file(N(r,"argv.json")):oe(this.userHome,this.productService.dataFolderName,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return x.file(N(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){let r=this.args["builtin-extensions-dir"];return r?Er(r):kt(N(st.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){let r=this.args["extensions-download-dir"];return r?x.file(Er(r)):x.file(N(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){let r=this.args["extensions-dir"];if(r)return Er(r);let e=St.VSCODE_EXTENSIONS;if(e)return e;let t=St.VSCODE_PORTABLE;return t?N(t,"extensions"):oe(this.userHome,this.productService.dataFolderName,"extensions").fsPath}get appSharedDataHome(){let r=this.args["shared-data-dir"];if(r)return x.file(Er(r));let e=St.VSCODE_PORTABLE;return e?x.file(N(e,"shared-data")):oe(this.userHome,this.productService.sharedDataFolderName)}get extensionDevelopmentLocationURI(){let r=this.args.extensionDevelopmentPath;if(Array.isArray(r))return r.map(e=>/^[^:/?#]+?:\/\//.test(e)?x.parse(e):x.file(kt(e)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(r=>r==="ui"||r==="workspace"||r==="web"?r:"workspace")}get extensionTestsLocationURI(){let r=this.args.extensionTestsPath;if(r)return/^[^:/?#]+?:\/\//.test(r)?x.parse(r):x.file(kt(r))}get disableExtensions(){if(this.args["disable-extensions"])return!0;let r=this.args["disable-extension"];if(r){if(typeof r=="string")return[r];if(Array.isArray(r)&&r.length>0)return r}return!1}get skipBuiltinExtensions(){let r=St.VSCODE_SKIP_BUILTIN_EXTENSIONS;return r?r.split(",").map(e=>e.trim()).filter(e=>e):[]}get debugExtensionHost(){return _2(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!St.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(r=>!$x.test(r))}get extensionLogLevel(){let r=[];for(let e of this.args.log||[]){let t=$x.exec(e);t?.[1]&&t[2]&&r.push([t[1],t[2]])}return r.length?r:void 0}get serviceMachineIdResource(){return oe(x.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 r=St.VSCODE_PORTABLE;return r?x.file(N(r,"policy.json")):oe(this.userHome,this.productService.dataFolderName,"policy.json")}}get agentSessionsWorkspace(){return oe(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(r){this.args.continueOn=r}get parentAppUserRoamingDataHome(){return this.paths.parentAppUserDataDir?x.file(this.paths.parentAppUserDataDir).with({scheme:W.vscodeUserData}):void 0}get parentAppUserHome(){return this.paths.parentAppUserHomeDir?x.file(this.paths.parentAppUserHomeDir):void 0}get parentAppExtensionsHome(){if(this.parentAppUserHome)return oe(this.parentAppUserHome,"extensions")}get parentAppNameShort(){return qx(this.productService,this.isEmbeddedApp,"short")}get parentAppNameLong(){return qx(this.productService,this.isEmbeddedApp,"long")}get args(){return this._args}};E([se],Ae.prototype,"appRoot",1),E([se],Ae.prototype,"userHome",1),E([se],Ae.prototype,"userDataPath",1),E([se],Ae.prototype,"appSettingsHome",1),E([se],Ae.prototype,"tmpDir",1),E([se],Ae.prototype,"cacheHome",1),E([se],Ae.prototype,"stateResource",1),E([se],Ae.prototype,"userRoamingDataHome",1),E([se],Ae.prototype,"userDataSyncHome",1),E([se],Ae.prototype,"sync",1),E([se],Ae.prototype,"workspaceStorageHome",1),E([se],Ae.prototype,"localHistoryHome",1),E([se],Ae.prototype,"keyboardLayoutResource",1),E([se],Ae.prototype,"argvResource",1),E([se],Ae.prototype,"isExtensionDevelopment",1),E([se],Ae.prototype,"untitledWorkspacesHome",1),E([se],Ae.prototype,"builtinExtensionsPath",1),E([se],Ae.prototype,"extensionsDownloadLocation",1),E([se],Ae.prototype,"extensionsPath",1),E([se],Ae.prototype,"appSharedDataHome",1),E([se],Ae.prototype,"extensionDevelopmentLocationURI",1),E([se],Ae.prototype,"extensionDevelopmentKind",1),E([se],Ae.prototype,"extensionTestsLocationURI",1),E([se],Ae.prototype,"debugExtensionHost",1),E([se],Ae.prototype,"logLevel",1),E([se],Ae.prototype,"extensionLogLevel",1),E([se],Ae.prototype,"serviceMachineIdResource",1),E([se],Ae.prototype,"disableTelemetry",1),E([se],Ae.prototype,"disableExperiments",1),E([se],Ae.prototype,"disableWorkspaceTrust",1),E([se],Ae.prototype,"useInMemorySecretStorage",1),E([se],Ae.prototype,"policyFile",1),E([se],Ae.prototype,"agentSessionsWorkspace",1),E([se],Ae.prototype,"parentAppUserRoamingDataHome",1),E([se],Ae.prototype,"parentAppUserHome",1),E([se],Ae.prototype,"parentAppExtensionsHome",1),E([se],Ae.prototype,"parentAppNameShort",1),E([se],Ae.prototype,"parentAppNameLong",1)});import{homedir as k2,tmpdir as R2}from"os";function zx(n,r){return Kd(n["inspect-ptyhost"],n["inspect-brk-ptyhost"],5877,r,n.extensionEnvironment)}function jx(n,r){return Kd(n["inspect-agenthost"],n["inspect-brk-agenthost"],5878,r,n.extensionEnvironment)}function Gx(n,r){return Kd(n["inspect-sharedprocess"],n["inspect-brk-sharedprocess"],5879,r,n.extensionEnvironment)}function D2(n,r){if(!process.isEmbeddedApp||St.VSCODE_DEV)return;let e=r.quality,t;if(e==="stable")t="Code";else if(e==="insider")t="Code - Insiders";else if(e==="exploration")t="Code - Exploration";else return;let i=ed(n,t);return N(i,"User")}function A2(n,r){if(!process.isEmbeddedApp||St.VSCODE_DEV)return;let e=r.quality,t;if(e==="stable")t=".vscode";else if(e==="insider")t=".vscode-insiders";else if(e==="exploration")t=".vscode-exploration";else return;return N(n,t)}function L2(){return!!process.isEmbeddedApp}var Nf,zd=I(()=>{Kx();_p();we();yi();Nf=class extends Ae{constructor(r,e){let t=k2();super(r,{homeDir:t,tmpDir:R2(),userDataDir:ed(r,e.nameShort),parentAppUserDataDir:D2(r,e),parentAppUserHomeDir:A2(t,e)},e,L2())}}});var _e,bi,Lt=I(()=>{Vo();we();X();Bd();si();zd();Z();_e=wi,bi=class extends Nf{constructor(){super(...arguments);this._snapEnv={}}get backupHome(){return N(this.userDataPath,"Backups")}get mainIPCHandle(){return xx(this.userDataPath,"main",this.productService.version)}get mainLockfile(){return N(this.userDataPath,"code.lock")}get disableUpdates(){return!!this.args["disable-updates"]}get isPortable(){return!!process.env.VSCODE_PORTABLE}get crossOriginIsolated(){return!!this.args["enable-coi"]}get enableRDPDisplayTracking(){return!!this.args["enable-rdp-display-tracking"]}get codeCachePath(){return process.env.VSCODE_CODE_CACHE_PATH||void 0}get useCodeCache(){return!!this.codeCachePath}unsetSnapExportedVariables(){if(re){for(let e in process.env)if(e.endsWith("_VSCODE_SNAP_ORIG")){let t=e.slice(0,-17);if(this._snapEnv[t])continue;process.env[t]&&(this._snapEnv[t]=process.env[t]),process.env[e]?process.env[t]=process.env[e]:delete process.env[t]}}}restoreSnapExportedVariables(){if(re)for(let e in this._snapEnv)process.env[e]=this._snapEnv[e],delete this._snapEnv[e]}};E([se],bi.prototype,"backupHome",1),E([se],bi.prototype,"mainIPCHandle",1),E([se],bi.prototype,"mainLockfile",1),E([se],bi.prototype,"disableUpdates",1),E([se],bi.prototype,"isPortable",1),E([se],bi.prototype,"crossOriginIsolated",1),E([se],bi.prototype,"enableRDPDisplayTracking",1),E([se],bi.prototype,"codeCachePath",1),E([se],bi.prototype,"useCodeCache",1)});function sy(...n){switch(n.length){case 1:return h(2019,null,n[0]);case 2:return h(2020,null,n[0],n[1]);case 3:return h(2021,null,n[0],n[1],n[2]);default:return}}var M2,O2,zo,Jx=I(()=>{zi();He();xe();M2=h(2018,null),O2=h(2017,null),zo=class n{constructor(){this._input="";this._start=0;this._current=0;this._tokens=[];this._errors=[];this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(r){switch(r.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return r.isTripleEq?"===":"==";case 4:return r.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">";case 8:return">=";case 9:return"=~";case 10:return r.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 r.lexeme;case 18:return r.lexeme;case 19:return r.lexeme;case 20:return"EOF";default:throw qp(`unhandled token type: ${JSON.stringify(r)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(r=>r.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(r){return this._input=r,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(sy("==","=~"));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(sy("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(sy("||"));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(r){return this._isAtEnd()||this._input.charCodeAt(this._current)!==r?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(r){this._tokens.push({type:r,offset:this._start})}_error(r){let e=this._start,t=this._input.substring(this._start,this._current),i={type:19,offset:this._start,lexeme:t};this._errors.push({offset:e,lexeme:t,additionalInfo:r}),this._tokens.push(i)}_string(){this.stringRe.lastIndex=this._start;let r=this.stringRe.exec(this._input);if(r){this._current=this._start+r[0].length;let e=this._input.substring(this._start,this._current),t=n._keywords.get(e);t?this._addToken(t):this._tokens.push({type:17,lexeme:e,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(M2);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let r=this._current,e=!1,t=!1;for(;;){if(r>=this._input.length){this._current=r,this._error(O2);return}let o=this._input.charCodeAt(r);if(e)e=!1;else if(o===47&&!t){r++;break}else o===91?t=!0:o===92?e=!0:o===93&&(t=!1);r++}for(;r<this._input.length&&n._regexFlags.has(this._input.charCodeAt(r));)r++;this._current=r;let i=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:i,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}});function jd(n,r){return n.cmp(r)}function qf(n,r){if(typeof n=="string"){let e=parseFloat(n);isNaN(e)||(n=e)}return typeof n=="string"||typeof n=="number"?r(n):kr.INSTANCE}function Yx(n){let r=null;for(let e=0,t=n.length;e<t;e++){let i=n[e].substituteConstants();if(n[e]!==i&&r===null){r=[];for(let o=0;o<e;o++)r[o]=n[o]}r!==null&&(r[e]=i)}return r===null?n:r}function Zx(n,r){return n<r?-1:n>r?1:0}function Hs(n,r,e,t){return n<e?-1:n>e?1:r<t?-1:r>t?1:0}function Xx(n){return n.type===9?n.expr:[n]}var dr,F2,W2,U2,N2,B2,Qx,V2,H2,$2,q2,ay,yr,kr,Wr,Bs,Gd,Bf,Vf,Jd,Vs,rl,Qd,Xd,Yd,Zd,ly,Hf,eu,$f,o9,eP=I(()=>{zi();X();ar();Jx();Z();xe();He();dr=new Map;dr.set("false",!1);dr.set("true",!0);dr.set("isMac",V);dr.set("isLinux",re);dr.set("isWindows",F);dr.set("isWeb",Pr);dr.set("isMacNative",V&&!Pr);dr.set("isEdge",sS);dr.set("isFirefox",nS);dr.set("isChrome",jg);dr.set("isSafari",oS);F2=Object.prototype.hasOwnProperty,W2={regexParsingWithErrorRecovery:!0},U2=h(1998,null),N2=h(1999,null),B2=h(2001,null),Qx=h(1997,null),V2=h(2004,null),H2=h(2005,null),$2=h(2002,null),q2=h(2003,null),ay=class n{constructor(r=W2){this._config=r;this._scanner=new zo;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(r){if(r===""){this._parsingErrors.push({message:U2,offset:0,lexeme:"",additionalInfo:N2});return}this._tokens=this._scanner.reset(r).scan(),this._current=0,this._parsingErrors=[];try{let e=this._expr();if(!this._isAtEnd()){let t=this._peek(),i=t.type===17?H2:void 0;throw this._parsingErrors.push({message:V2,offset:t.offset,lexeme:zo.getLexeme(t),additionalInfo:i}),n._parseError}return e}catch(e){if(e!==n._parseError)throw e;return}}_expr(){return this._or()}_or(){let r=[this._and()];for(;this._matchOne(16);){let e=this._and();r.push(e)}return r.length===1?r[0]:yr.or(...r)}_and(){let r=[this._term()];for(;this._matchOne(15);){let e=this._term();r.push(e)}return r.length===1?r[0]:yr.and(...r)}_term(){if(this._matchOne(2)){let r=this._peek();switch(r.type){case 11:return this._advance(),kr.INSTANCE;case 12:return this._advance(),Wr.INSTANCE;case 0:{this._advance();let e=this._expr();return this._consume(1,Qx),e?.negate()}case 17:return this._advance(),Vs.create(r.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",r)}}return this._primary()}_primary(){let r=this._peek();switch(r.type){case 11:return this._advance(),yr.true();case 12:return this._advance(),yr.false();case 0:{this._advance();let e=this._expr();return this._consume(1,Qx),e}case 17:{let e=r.lexeme;if(this._advance(),this._matchOne(9)){let i=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),i.type!==10)throw this._errExpectedButGot("REGEX",i);let o=i.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1)),l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",i)}return Zd.create(e,l)}switch(i.type){case 10:case 19:{let o=[i.lexeme];this._advance();let s=this._peek(),a=0;for(let f=0;f<i.lexeme.length;f++)i.lexeme.charCodeAt(f)===40?a++:i.lexeme.charCodeAt(f)===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 f=0;f<s.lexeme.length;f++)s.lexeme.charCodeAt(f)===40?a++:i.lexeme.charCodeAt(f)===41&&a--}if(a<0)break;o.push(zo.getLexeme(s)),this._advance(),s=this._peek()}let l=o.join(""),c=l.lastIndexOf("/"),d=c===l.length-1?void 0:this._removeFlagsGY(l.substring(c+1)),u;try{u=new RegExp(l.substring(1,c),d)}catch{throw this._errExpectedButGot("REGEX",i)}return yr.regex(e,u)}case 18:{let o=i.lexeme;this._advance();let s=null;if(!QS(o)){let a=o.indexOf("/"),l=o.lastIndexOf("/");if(a!==l&&a>=0){let c=o.slice(a+1,l),d=o[l+1]==="i"?"i":"";try{s=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",i)}}}if(s===null)throw this._errExpectedButGot("REGEX",i);return Zd.create(e,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,B2);let i=this._value();return yr.notIn(e,i)}switch(this._peek().type){case 3:{this._advance();let i=this._value();if(this._previous().type===18)return yr.equals(e,i);switch(i){case"true":return yr.has(e);case"false":return yr.not(e);default:return yr.equals(e,i)}}case 4:{this._advance();let i=this._value();if(this._previous().type===18)return yr.notEquals(e,i);switch(i){case"true":return yr.not(e);case"false":return yr.has(e);default:return yr.notEquals(e,i)}}case 5:return this._advance(),Xd.create(e,this._value());case 6:return this._advance(),Yd.create(e,this._value());case 7:return this._advance(),rl.create(e,this._value());case 8:return this._advance(),Qd.create(e,this._value());case 13:return this._advance(),yr.in(e,this._value());default:return yr.has(e)}}case 20:throw this._parsingErrors.push({message:$2,offset:r.offset,lexeme:"",additionalInfo:q2}),n._parseError;default:throw this._errExpectedButGot(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let r=this._peek();switch(r.type){case 17:case 18:return this._advance(),r.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(r){return r.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(r){return this._check(r)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(r,e){if(this._check(r))return this._advance();throw this._errExpectedButGot(e,this._peek())}_errExpectedButGot(r,e,t){let i=h(2000,null,r,zo.getLexeme(e)),o=e.offset,s=zo.getLexeme(e);return this._parsingErrors.push({message:i,offset:o,lexeme:s,additionalInfo:t}),n._parseError}_check(r){return this._peek().type===r}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},yr=class{static false(){return kr.INSTANCE}static true(){return Wr.INSTANCE}static has(r){return Bs.create(r)}static equals(r,e){return Gd.create(r,e)}static notEquals(r,e){return Jd.create(r,e)}static regex(r,e){return Zd.create(r,e)}static in(r,e){return Bf.create(r,e)}static notIn(r,e){return Vf.create(r,e)}static not(r){return Vs.create(r)}static and(...r){return Hf.create(r,null,!0)}static or(...r){return eu.create(r,null,!0)}static greater(r,e){return rl.create(r,e)}static greaterEquals(r,e){return Qd.create(r,e)}static smaller(r,e){return Xd.create(r,e)}static smallerEquals(r,e){return Yd.create(r,e)}static{this._parser=new ay({regexParsingWithErrorRecovery:!1})}static deserialize(r){return r==null?void 0:this._parser.parse(r)}};kr=class n{constructor(){this.type=0}static{this.INSTANCE=new n}cmp(r){return this.type-r.type}equals(r){return r.type===this.type}substituteConstants(){return this}evaluate(r){return!1}serialize(){return"false"}keys(){return[]}map(r){return this}negate(){return Wr.INSTANCE}},Wr=class n{constructor(){this.type=1}static{this.INSTANCE=new n}cmp(r){return this.type-r.type}equals(r){return r.type===this.type}substituteConstants(){return this}evaluate(r){return!0}serialize(){return"true"}keys(){return[]}map(r){return this}negate(){return kr.INSTANCE}},Bs=class n{constructor(r,e){this.key=r;this.negated=e;this.type=2}static create(r,e=null){let t=dr.get(r);return typeof t=="boolean"?t?Wr.INSTANCE:kr.INSTANCE:new n(r,e)}cmp(r){return r.type!==this.type?this.type-r.type:Zx(this.key,r.key)}equals(r){return r.type===this.type?this.key===r.key:!1}substituteConstants(){let r=dr.get(this.key);return typeof r=="boolean"?r?Wr.INSTANCE:kr.INSTANCE:this}evaluate(r){return!!r.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(r){return r.mapDefined(this.key)}negate(){return this.negated||(this.negated=Vs.create(this.key,this)),this.negated}},Gd=class n{constructor(r,e,t){this.key=r;this.value=e;this.negated=t;this.type=4}static create(r,e,t=null){if(typeof e=="boolean")return e?Bs.create(r,t):Vs.create(r,t);let i=dr.get(r);return typeof i=="boolean"?e===(i?"true":"false")?Wr.INSTANCE:kr.INSTANCE:new n(r,e,t)}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.value,r.key,r.value)}equals(r){return r.type===this.type?this.key===r.key&&this.value===r.value:!1}substituteConstants(){let r=dr.get(this.key);if(typeof r=="boolean"){let e=r?"true":"false";return this.value===e?Wr.INSTANCE:kr.INSTANCE}return this}evaluate(r){return r.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(r){return r.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=Jd.create(this.key,this.value,this)),this.negated}},Bf=class n{constructor(r,e){this.key=r;this.valueKey=e;this.type=10;this.negated=null}static create(r,e){return new n(r,e)}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.valueKey,r.key,r.valueKey)}equals(r){return r.type===this.type?this.key===r.key&&this.valueKey===r.valueKey:!1}substituteConstants(){return this}evaluate(r){let e=r.getValue(this.valueKey),t=r.getValue(this.key);if(Array.isArray(e)){if(e.includes(t))return!0;if(F&&typeof t=="string"&&t.startsWith("file:///")){let i=t.toLowerCase();return e.some(o=>typeof o=="string"&&o.toLowerCase()===i)}return!1}if(typeof t=="string"&&typeof e=="object"&&e!==null){if(F2.call(e,t))return!0;if(F&&t.startsWith("file:///")){let i=t.toLowerCase();return Object.keys(e).some(o=>o.toLowerCase()===i)}return!1}return!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(r){return r.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=Vf.create(this.key,this.valueKey)),this.negated}},Vf=class n{constructor(r,e){this.key=r;this.valueKey=e;this.type=11;this._negated=Bf.create(r,e)}static create(r,e){return new n(r,e)}cmp(r){return r.type!==this.type?this.type-r.type:this._negated.cmp(r._negated)}equals(r){return r.type===this.type?this._negated.equals(r._negated):!1}substituteConstants(){return this}evaluate(r){return!this._negated.evaluate(r)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(r){return r.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},Jd=class n{constructor(r,e,t){this.key=r;this.value=e;this.negated=t;this.type=5}static create(r,e,t=null){if(typeof e=="boolean")return e?Vs.create(r,t):Bs.create(r,t);let i=dr.get(r);return typeof i=="boolean"?e===(i?"true":"false")?kr.INSTANCE:Wr.INSTANCE:new n(r,e,t)}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.value,r.key,r.value)}equals(r){return r.type===this.type?this.key===r.key&&this.value===r.value:!1}substituteConstants(){let r=dr.get(this.key);if(typeof r=="boolean"){let e=r?"true":"false";return this.value===e?kr.INSTANCE:Wr.INSTANCE}return this}evaluate(r){return r.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(r){return r.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=Gd.create(this.key,this.value,this)),this.negated}},Vs=class n{constructor(r,e){this.key=r;this.negated=e;this.type=3}static create(r,e=null){let t=dr.get(r);return typeof t=="boolean"?t?kr.INSTANCE:Wr.INSTANCE:new n(r,e)}cmp(r){return r.type!==this.type?this.type-r.type:Zx(this.key,r.key)}equals(r){return r.type===this.type?this.key===r.key:!1}substituteConstants(){let r=dr.get(this.key);return typeof r=="boolean"?r?kr.INSTANCE:Wr.INSTANCE:this}evaluate(r){return!r.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(r){return r.mapNot(this.key)}negate(){return this.negated||(this.negated=Bs.create(this.key,this)),this.negated}};rl=class n{constructor(r,e,t){this.key=r;this.value=e;this.negated=t;this.type=12}static create(r,e,t=null){return qf(e,i=>new n(r,i,t))}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.value,r.key,r.value)}equals(r){return r.type===this.type?this.key===r.key&&this.value===r.value:!1}substituteConstants(){return this}evaluate(r){return typeof this.value=="string"?!1:parseFloat(r.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(r){return r.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=Yd.create(this.key,this.value,this)),this.negated}},Qd=class n{constructor(r,e,t){this.key=r;this.value=e;this.negated=t;this.type=13}static create(r,e,t=null){return qf(e,i=>new n(r,i,t))}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.value,r.key,r.value)}equals(r){return r.type===this.type?this.key===r.key&&this.value===r.value:!1}substituteConstants(){return this}evaluate(r){return typeof this.value=="string"?!1:parseFloat(r.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(r){return r.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=Xd.create(this.key,this.value,this)),this.negated}},Xd=class n{constructor(r,e,t){this.key=r;this.value=e;this.negated=t;this.type=14}static create(r,e,t=null){return qf(e,i=>new n(r,i,t))}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.value,r.key,r.value)}equals(r){return r.type===this.type?this.key===r.key&&this.value===r.value:!1}substituteConstants(){return this}evaluate(r){return typeof this.value=="string"?!1:parseFloat(r.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(r){return r.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=Qd.create(this.key,this.value,this)),this.negated}},Yd=class n{constructor(r,e,t){this.key=r;this.value=e;this.negated=t;this.type=15}static create(r,e,t=null){return qf(e,i=>new n(r,i,t))}cmp(r){return r.type!==this.type?this.type-r.type:Hs(this.key,this.value,r.key,r.value)}equals(r){return r.type===this.type?this.key===r.key&&this.value===r.value:!1}substituteConstants(){return this}evaluate(r){return typeof this.value=="string"?!1:parseFloat(r.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(r){return r.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=rl.create(this.key,this.value,this)),this.negated}},Zd=class n{constructor(r,e){this.key=r;this.regexp=e;this.type=7;this.negated=null}static create(r,e){return new n(r,e)}cmp(r){if(r.type!==this.type)return this.type-r.type;if(this.key<r.key)return-1;if(this.key>r.key)return 1;let e=this.regexp?this.regexp.source:"",t=r.regexp?r.regexp.source:"";return e<t?-1:e>t?1:0}equals(r){if(r.type===this.type){let e=this.regexp?this.regexp.source:"",t=r.regexp?r.regexp.source:"";return this.key===r.key&&e===t}return!1}substituteConstants(){return this}evaluate(r){let e=r.getValue(this.key);return this.regexp?this.regexp.test(e):!1}serialize(){let r=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${r}`}keys(){return[this.key]}map(r){return r.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=ly.create(this)),this.negated}},ly=class n{constructor(r){this._actual=r;this.type=8}static create(r){return new n(r)}cmp(r){return r.type!==this.type?this.type-r.type:this._actual.cmp(r._actual)}equals(r){return r.type===this.type?this._actual.equals(r._actual):!1}substituteConstants(){return this}evaluate(r){return!this._actual.evaluate(r)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(r){return new n(this._actual.map(r))}negate(){return this._actual}};Hf=class n{constructor(r,e){this.expr=r;this.negated=e;this.type=6}static create(r,e,t){return n._normalizeArr(r,e,t)}cmp(r){if(r.type!==this.type)return this.type-r.type;if(this.expr.length<r.expr.length)return-1;if(this.expr.length>r.expr.length)return 1;for(let e=0,t=this.expr.length;e<t;e++){let i=jd(this.expr[e],r.expr[e]);if(i!==0)return i}return 0}equals(r){if(r.type===this.type){if(this.expr.length!==r.expr.length)return!1;for(let e=0,t=this.expr.length;e<t;e++)if(!this.expr[e].equals(r.expr[e]))return!1;return!0}return!1}substituteConstants(){let r=Yx(this.expr);return r===this.expr?this:n.create(r,this.negated,!1)}evaluate(r){for(let e=0,t=this.expr.length;e<t;e++)if(!this.expr[e].evaluate(r))return!1;return!0}static _normalizeArr(r,e,t){let i=[],o=!1;for(let s of r)if(s){if(s.type===1){o=!0;continue}if(s.type===0)return kr.INSTANCE;if(s.type===6){i.push(...s.expr);continue}i.push(s)}if(i.length===0&&o)return Wr.INSTANCE;if(i.length!==0){if(i.length===1)return i[0];i.sort(jd);for(let s=1;s<i.length;s++)i[s-1].equals(i[s])&&(i.splice(s,1),s--);if(i.length===1)return i[0];for(;i.length>1;){let s=i[i.length-1];if(s.type!==9)break;i.pop();let a=i.pop(),l=i.length===0,c=eu.create(s.expr.map(d=>n.create([d,a],null,t)),null,l);c&&(i.push(c),i.sort(jd))}if(i.length===1)return i[0];if(t){for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++)if(i[s].negate().equals(i[a]))return kr.INSTANCE;if(i.length===1)return i[0]}return new n(i,e)}}serialize(){return this.expr.map(r=>r.serialize()).join(" && ")}keys(){let r=[];for(let e of this.expr)r.push(...e.keys());return r}map(r){return new n(this.expr.map(e=>e.map(r)),null)}negate(){if(!this.negated){let r=[];for(let e of this.expr)r.push(e.negate());this.negated=eu.create(r,this,!0)}return this.negated}},eu=class n{constructor(r,e){this.expr=r;this.negated=e;this.type=9}static create(r,e,t){return n._normalizeArr(r,e,t)}cmp(r){if(r.type!==this.type)return this.type-r.type;if(this.expr.length<r.expr.length)return-1;if(this.expr.length>r.expr.length)return 1;for(let e=0,t=this.expr.length;e<t;e++){let i=jd(this.expr[e],r.expr[e]);if(i!==0)return i}return 0}equals(r){if(r.type===this.type){if(this.expr.length!==r.expr.length)return!1;for(let e=0,t=this.expr.length;e<t;e++)if(!this.expr[e].equals(r.expr[e]))return!1;return!0}return!1}substituteConstants(){let r=Yx(this.expr);return r===this.expr?this:n.create(r,this.negated,!1)}evaluate(r){for(let e=0,t=this.expr.length;e<t;e++)if(this.expr[e].evaluate(r))return!0;return!1}static _normalizeArr(r,e,t){let i=[],o=!1;if(r){for(let s=0,a=r.length;s<a;s++){let l=r[s];if(l){if(l.type===0){o=!0;continue}if(l.type===1)return Wr.INSTANCE;if(l.type===9){i=i.concat(l.expr);continue}i.push(l)}}if(i.length===0&&o)return kr.INSTANCE;i.sort(jd)}if(i.length!==0){if(i.length===1)return i[0];for(let s=1;s<i.length;s++)i[s-1].equals(i[s])&&(i.splice(s,1),s--);if(i.length===1)return i[0];if(t){for(let s=0;s<i.length;s++)for(let a=s+1;a<i.length;a++)if(i[s].negate().equals(i[a]))return Wr.INSTANCE;if(i.length===1)return i[0]}return new n(i,e)}}serialize(){return this.expr.map(r=>r.serialize()).join(" || ")}keys(){let r=[];for(let e of this.expr)r.push(...e.keys());return r}map(r){return new n(this.expr.map(e=>e.map(r)),null)}negate(){if(!this.negated){let r=[];for(let e of this.expr)r.push(e.negate());for(;r.length>1;){let e=r.shift(),t=r.shift(),i=[];for(let o of Xx(e))for(let s of Xx(t))i.push(Hf.create([o,s],null,!1));r.unshift(n.create(i,null,!1))}this.negated=n.create(r,this,!0)}return this.negated}},$f=class n extends Bs{static{this._info=[]}static all(){return n._info.values()}constructor(r,e,t){super(r,null),this._defaultValue=e,typeof t=="object"?n._info.push({...t,key:r}):t!==!0&&n._info.push({key:r,description:t,type:e!=null?typeof e:void 0})}bindTo(r){return r.createKey(this.key,this._defaultValue)}getValue(r){return r.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(r){return Gd.create(this.key,r)}notEqualsTo(r){return Jd.create(this.key,r)}greater(r){return rl.create(this.key,r)}},o9=O("contextKeyService")});function Cn(){return new Date().toISOString()}function iu(n){return Ki(n)}function K2(n,r){return n!==0&&n<=r}function ou(n,r,e){switch(r){case 1:n.trace(e);break;case 2:n.debug(e);break;case 3:n.info(e);break;case 4:n.warn(e);break;case 5:n.error(e);break;case 0:break;default:throw new Error(`Invalid log level ${r}`)}}function il(n,r=!1){let e="";for(let t=0;t<n.length;t++){let i=n[t];if(i instanceof Error&&(i=_r(i,r)),typeof i=="object")try{i=JSON.stringify(i)}catch{}e+=(t>0?" ":"")+i}return e}function tP(n){if(n.verbose)return 1;if(typeof n.logLevel=="string"){let r=j2(n.logLevel.toLowerCase());if(r!==void 0)return r}return nu}function z2(n){switch(n){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 j2(n){switch(n){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 B,ai,nu,tu,$s,Kf,zf,ru,cy,jf,b9,te=I(()=>{xe();No();q();En();$();Cr();X();gt();Oe();ce();eP();Z();B=O("logService"),ai=O("loggerService");nu=3;tu=class extends T{constructor(){super(...arguments);this.level=nu;this._onDidChangeLogLevel=this._register(new b)}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 K2(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}},$s=class extends tu{constructor(e){super();this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.canLog(1)&&this.log(1,il([e,...t],!0))}debug(e,...t){this.canLog(2)&&this.log(2,il([e,...t]))}info(e,...t){this.canLog(3)&&this.log(3,il([e,...t]))}warn(e,...t){this.canLog(4)&&this.log(4,il([e,...t]))}error(e,...t){if(this.canLog(5))if(e instanceof Error){let i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(5,il(i))}else this.log(5,il([e,...t]))}flush(){}},Kf=class extends tu{constructor(r=nu){super(),this.setLevel(r),this.useColors=!F}trace(r,...e){this.canLog(1)&&(this.useColors?console.log(`\x1B[90m[main ${Cn()}]\x1B[0m`,r,...e):console.log(`[main ${Cn()}]`,r,...e))}debug(r,...e){this.canLog(2)&&(this.useColors?console.log(`\x1B[90m[main ${Cn()}]\x1B[0m`,r,...e):console.log(`[main ${Cn()}]`,r,...e))}info(r,...e){this.canLog(3)&&(this.useColors?console.log(`\x1B[90m[main ${Cn()}]\x1B[0m`,r,...e):console.log(`[main ${Cn()}]`,r,...e))}warn(r,...e){this.canLog(4)&&(this.useColors?console.warn(`\x1B[93m[main ${Cn()}]\x1B[0m`,r,...e):console.warn(`[main ${Cn()}]`,r,...e))}error(r,...e){this.canLog(5)&&(this.useColors?console.error(`\x1B[91m[main ${Cn()}]\x1B[0m`,r,...e):console.error(`[main ${Cn()}]`,r,...e))}flush(){}},zf=class extends tu{constructor(e){super();this.loggers=e;e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(let i of this.loggers)i.trace(e,...t)}debug(e,...t){for(let i of this.loggers)i.debug(e,...t)}info(e,...t){for(let i of this.loggers)i.info(e,...t)}warn(e,...t){for(let i of this.loggers)i.warn(e,...t)}error(e,...t){for(let i of this.loggers)i.error(e,...t)}flush(){for(let e of this.loggers)e.flush()}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}},ru=class extends T{constructor(e,t,i){super();this.logLevel=e;this.logsHome=t;this._loggers=new mt;this._onDidChangeLoggers=this._register(new b);this.onDidChangeLoggers=this._onDidChangeLoggers.event;this._onDidChangeLogLevel=this._register(new b);this.onDidChangeLogLevel=this._onDidChangeLogLevel.event;this._onDidChangeVisibility=this._register(new b);this.onDidChangeVisibility=this._onDidChangeVisibility.event;if(i)for(let o of i)this._loggers.set(o.resource,{logger:void 0,info:o})}getLoggerEntry(e){return Fe(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){let i=this.toResource(e),o=Fe(e)?e:t?.id??cr(i.toString()).toString(16),s=this._loggers.get(i)?.logger,a=t?.logLevel==="always"?1:t?.logLevel;s||(s=this.doCreateLogger(i,a??this.getLogLevel(i)??this.logLevel,{...t,id:o}));let l={logger:s,info:{resource:i,id:o,logLevel:a,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(l.info),this._loggers.set(i,l),s}toResource(e){return Fe(e)?oe(this.logsHome,`${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`):e}setLogLevel(e,t){if(x.isUri(e)){let i=e,o=t,s=this._loggers.get(i);s&&o!==s.info.logLevel&&(s.info.logLevel=o===this.logLevel?void 0:o,s.logger?.setLevel(o),this._loggers.set(s.info.resource,s),this._onDidChangeLogLevel.fire([i,o]))}else{this.logLevel=e;for(let[i,o]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&o.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){let i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){let t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){let t=this.toResource(e),i=this._loggers.get(t);i&&(i.logger&&i.logger.dispose(),this._loggers.delete(t),this._onDidChangeLoggers.fire({added:[],removed:[i.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()}},cy=class{constructor(){this.onDidChangeLogLevel=new b().event}setLevel(r){}getLevel(){return 3}trace(r,...e){}debug(r,...e){}info(r,...e){}warn(r,...e){}error(r,...e){}critical(r,...e){}dispose(){}flush(){}},jf=class extends cy{};b9=new $f("logLevel",z2(3))});var li,Tn,rP,Gf,dy=I(()=>{he();q();$();Rd();Oe();li=class n extends T{constructor(e,t=Object.create(null)){super();this.database=e;this.options=t;this._onDidChangeStorage=this._register(new ks);this.onDidChangeStorage=this._onDidChangeStorage.event;this.state=0;this.cache=new Map;this.flushDelayer=this._register(new Tr(n.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((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===2)return;let i=!1;Vt(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get 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,t){let i=this.cache.get(e);return Vt(i)?t:i}getBoolean(e,t){let i=this.get(e);return Vt(i)?t:i==="true"}getNumber(e,t){let i=this.get(e);return Vt(i)?t:parseInt(i,10)}getObject(e,t){let i=this.get(e);return Vt(i)?t:gx(i)}async set(e,t,i=!1){if(this.state===2)return;if(Vt(t))return this.delete(e,i);let o=Ge(t)||Array.isArray(t)?hx(t):String(t);if(this.cache.get(e)!==o)return this.cache.set(e,o),this.pendingInserts.set(e,o),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!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:t}),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}},Tn=class{constructor(){this.onDidChangeItemsExternal=S.None;this.items=new Map}async getItems(){return this.items}async updateItems(r){r.insert?.forEach((e,t)=>this.items.set(t,e)),r.delete?.forEach(e=>this.items.delete(e))}async optimize(){}async close(){}},rP="__$__migratedStorageMarker",Gf=class n extends li{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,t){this.fallbackStorage=e,this.isFallbackStorageReadonly=t}static{this.INTERNAL_KEY_PREFIX="__$__"}get(e,t){if(!e.startsWith(n.INTERNAL_KEY_PREFIX)&&!this.migratedKeys.has(e)&&Hr(super.get(e))){this.migratedKeys.add(e);let i=this.fallbackStorage?.items.get(e);Hr(i)||(this.set(e,i),this.isFallbackStorageReadonly||this.fallbackStorage?.delete(e),this.persistMigratedKeys())}return super.get(e,t)}loadMigratedKeys(){let e=super.get(rP);if(e)try{return new Set(JSON.parse(e))}catch{}return new Set}persistMigratedKeys(){this.set(rP,JSON.stringify([...this.migratedKeys]))}}});var uy,py,Jf,fy,co,nl,Kr,qs=I(()=>{Jt();Ta();zi();ar();uy=class{constructor(){this._value="";this._pos=0}reset(r){return this._value=r,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(r){let e=r.charCodeAt(0),t=this._value.charCodeAt(this._pos);return e-t}value(){return this._value[this._pos]}},py=class{constructor(r=!0){this._caseSensitive=r}reset(r){return this._value=r,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let r=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(r)this._from++;else break;else r=!1;return this}cmp(r){return this._caseSensitive?Zp(r,this._value,0,r.length,this._from,this._to):Rs(r,this._value,0,r.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},Jf=class{constructor(r=!0,e=!0){this._splitOnBackslash=r;this._caseSensitive=e}reset(r){this._from=0,this._to=0,this._value=r,this._valueLen=r.length;for(let e=r.length-1;e>=0;e--,this._valueLen--){let t=this._value.charCodeAt(e);if(!(t===47||this._splitOnBackslash&&t===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let r=!0;for(;this._to<this._valueLen;this._to++){let e=this._value.charCodeAt(this._to);if(e===47||this._splitOnBackslash&&e===92)if(r)this._from++;else break;else r=!1}return this}cmp(r){return this._caseSensitive?Zp(r,this._value,0,r.length,this._from,this._to):Rs(r,this._value,0,r.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},fy=class{constructor(r,e){this._ignorePathCasing=r;this._ignoreQueryAndFragment=e;this._states=[];this._stateIdx=0}reset(r){return this._value=r,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new Jf(!1,!this._ignorePathCasing(r)),this._pathIterator.reset(r.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(r)||(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(r){if(this._states[this._stateIdx]===1)return pd(r,this._value.scheme);if(this._states[this._stateIdx]===2)return pd(r,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(r);if(this._states[this._stateIdx]===4)return ud(r,this._value.query);if(this._states[this._stateIdx]===5)return ud(r,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}},co=class n{static{this.Val=Symbol("undefined_placeholder")}static wrap(r){return r===void 0?n.Val:r}static unwrap(r){return r===n.Val?void 0:r}},nl=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 r=this.right;return this.right=r.left,r.left=this,this.updateHeight(),r.updateHeight(),r}rotateRight(){let r=this.left;return this.left=r.right,r.right=this,this.updateHeight(),r.updateHeight(),r}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}},Kr=class n{static forUris(r=()=>!1,e=()=>!1){return new n(new fy(r,e))}static forPaths(r=!1){return new n(new Jf(void 0,!r))}static forStrings(){return new n(new uy)}static forConfigKeys(){return new n(new py)}constructor(r){this._iter=r}clear(){this._root=void 0}fill(r,e){if(e){let t=e.slice(0);ev(t);for(let i of t)this.set(i,r)}else{let t=r.slice(0);ev(t);for(let i of t)this.set(i[0],i[1])}}set(r,e){let t=this._iter.reset(r),i;this._root||(this._root=new nl,this._root.segment=t.value());let o=[];for(i=this._root;;){let a=t.cmp(i.segment);if(a>0)i.left||(i.left=new nl,i.left.segment=t.value()),o.push([-1,i]),i=i.left;else if(a<0)i.right||(i.right=new nl,i.right.segment=t.value()),o.push([1,i]),i=i.right;else if(t.hasNext())t.next(),i.mid||(i.mid=new nl,i.mid.segment=t.value()),o.push([0,i]),i=i.mid;else break}let s=co.unwrap(i.value);i.value=co.wrap(e),i.key=r;for(let a=o.length-1;a>=0;a--){let l=o[a][1];l.updateHeight();let c=l.balanceFactor();if(c<-1||c>1){let d=o[a][0],u=o[a+1][0];if(d===1&&u===1)o[a][1]=l.rotateLeft();else if(d===-1&&u===-1)o[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(r){return co.unwrap(this._getNode(r)?.value)}_getNode(r){let e=this._iter.reset(r),t=this._root;for(;t;){let i=e.cmp(t.segment);if(i>0)t=t.left;else if(i<0)t=t.right;else if(e.hasNext())e.next(),t=t.mid;else break}return t}has(r){let e=this._getNode(r);return!(e?.value===void 0&&e?.mid===void 0)}delete(r){return this._delete(r,!1)}deleteSuperstr(r){return this._delete(r,!0)}_delete(r,e){let t=this._iter.reset(r),i=[],o=this._root;for(;o;){let s=t.cmp(o.segment);if(s>0)i.push([-1,o]),o=o.left;else if(s<0)i.push([1,o]),o=o.right;else if(t.hasNext())t.next(),i.push([0,o]),o=o.mid;else break}if(o){if(e?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){let s=[[1,o]],a=this._min(o.right,s);if(a.key){o.key=a.key,o.value=a.value,o.segment=a.segment;let l=a.right;if(s.length>1){let[d,u]=s[s.length-1];switch(d){case-1:u.left=l;break;case 0:Ca(!1);case 1:Ca(!1)}}else o.right=l;let c=this._balanceByStack(s);if(i.length>0){let[d,u]=i[i.length-1];switch(d){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}}else{let s=o.left??o.right;if(i.length>0){let[a,l]=i[i.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(i)??this._root}}_min(r,e){for(;r.left;)e.push([-1,r]),r=r.left;return r}_balanceByStack(r){for(let e=r.length-1;e>=0;e--){let t=r[e][1];t.updateHeight();let i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),r[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),r[e][1]=t.rotateRight()),e>0)switch(r[e-1][0]){case-1:r[e-1][1].left=r[e][1];break;case 1:r[e-1][1].right=r[e][1];break;case 0:r[e-1][1].mid=r[e][1];break}else return r[0][1]}}findSubstr(r){let e=this._iter.reset(r),t=this._root,i;for(;t;){let o=e.cmp(t.segment);if(o>0)t=t.left;else if(o<0)t=t.right;else if(e.hasNext())e.next(),i=co.unwrap(t.value)||i,t=t.mid;else break}return t&&co.unwrap(t.value)||i}findSuperstr(r){return this._findSuperstrOrElement(r,!1)}_findSuperstrOrElement(r,e){let t=this._iter.reset(r),i=this._root;for(;i;){let o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else return i.mid?this._entries(i.mid):e?co.unwrap(i.value):void 0}}hasElementOrSubtree(r){return this._findSuperstrOrElement(r,!0)!==void 0}forEach(r){for(let[e,t]of this)r(t,e)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(r){let e=[];return this._dfsEntries(r,e),e[Symbol.iterator]()}_dfsEntries(r,e){r&&(r.left&&this._dfsEntries(r.left,e),r.value!==void 0&&e.push([r.key,co.unwrap(r.value)]),r.mid&&this._dfsEntries(r.mid,e),r.right&&this._dfsEntries(r.right,e))}_isBalanced(){let r=e=>{if(!e)return!0;let t=e.balanceFactor();return t<-1||t>1?!1:r(e.left)&&r(e.right)};return r(this._root)}}});function Ks(n){return n.create===!0}function Si(n){return!!(n.capabilities&2)}function iP(n){return!!(n.capabilities&524288)}function su(n){return!!(n.capabilities&8)}function Xf(n){return!!(n.capabilities&131072)}function nP(n){return!!(n.capabilities&262144)}function po(n){return!!(n.capabilities&4)}function Yf(n){return!!(n.capabilities&16)}function Zf(n){return Si(n)?!!(n.capabilities&16384):!1}function my(n){return Si(n)?!!(n.capabilities&32768):!1}function oP(n){return!!(n.capabilities&65536)}function zr(n,r){return ol.create(n,r)}function fo(n){return n||zr(h(2221,null),"Unknown")}function G2(n,r){return n.name=r?`${r} (FileSystemError)`:"FileSystemError",n}function au(n){if(!n)return"Unknown";if(n instanceof ol)return n.code;let r=/^(.+) \(FileSystemError\)$/.exec(n.name);if(!r)return"Unknown";switch(r[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 jr(n){if(n instanceof Yt)return n.fileOperationResult;switch(au(n)){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 sP(n,r,e){return!n||!r||n===r||r.length>n.length?!1:(r.charAt(r.length-1)!==Bt&&(r+=Bt),e?Mo(n,r):n.indexOf(r)===0)}function hy(n){if(!(typeof n.size!="number"||typeof n.mtime!="number"))return n.mtime.toString(29)+n.size.toString(31)}var Me,ol,uo,Qf,Yt,sl,al,em,tm,_n,je=I(()=>{qs();we();ar();Oe();ce();xe();Z();X();ze();Yn();Me=O("fileService");ol=class n extends Error{constructor(e,t){super(e);this.code=t}static create(e,t){let i=new n(e.toString(),t);return G2(i,t),i}};uo=class{constructor(r,e,t){this.resource=r;this.operation=e;this.target=t}isOperation(r){return this.operation===r}},Qf=class n{constructor(r,e){this.ignorePathCasing=e;this.correlationId=void 0;this.added=new rr(()=>{let r=Kr.forUris(()=>this.ignorePathCasing);return r.fill(this.rawAdded.map(e=>[e,!0])),r});this.updated=new rr(()=>{let r=Kr.forUris(()=>this.ignorePathCasing);return r.fill(this.rawUpdated.map(e=>[e,!0])),r});this.deleted=new rr(()=>{let r=Kr.forUris(()=>this.ignorePathCasing);return r.fill(this.rawDeleted.map(e=>[e,!0])),r});this.rawAdded=[];this.rawUpdated=[];this.rawDeleted=[];for(let t of r){switch(t.type){case 1:this.rawAdded.push(t.resource);break;case 0:this.rawUpdated.push(t.resource);break;case 2:this.rawDeleted.push(t.resource);break}this.correlationId!==n.MIXED_CORRELATION&&(typeof t.cId=="number"?this.correlationId===void 0?this.correlationId=t.cId:this.correlationId!==t.cId&&(this.correlationId=n.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=n.MIXED_CORRELATION))}}static{this.MIXED_CORRELATION=null}contains(r,...e){return this.doContains(r,{includeChildren:!1},...e)}affects(r,...e){return this.doContains(r,{includeChildren:!0},...e)}doContains(r,e,...t){if(!r)return!1;let i=t.length>0;return!!((!i||t.includes(1))&&(this.added.value.get(r)||e.includeChildren&&this.added.value.findSuperstr(r))||(!i||t.includes(0))&&(this.updated.value.get(r)||e.includeChildren&&this.updated.value.findSuperstr(r))||(!i||t.includes(2))&&(this.deleted.value.findSubstr(r)||e.includeChildren&&this.deleted.value.findSuperstr(r)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(r){return this.correlationId===r}hasCorrelation(){return typeof this.correlationId=="number"}};Yt=class extends Error{constructor(e,t,i){super(e);this.fileOperationResult=t;this.options=i}},sl=class extends Yt{constructor(e,t,i,o){super(e,t,o);this.fileOperationResult=t;this.size=i}},al=class extends Yt{constructor(e,t,i){super(e,2,i);this.stat=t}},em={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},tm="";_n=class n{static{this.KB=1024}static{this.MB=n.KB*n.KB}static{this.GB=n.MB*n.KB}static{this.TB=n.GB*n.KB}static formatSize(r){return Ki(r)||(r=0),r<n.KB?h(2216,null,r.toFixed(0)):r<n.MB?h(2218,null,(r/n.KB).toFixed(2)):r<n.GB?h(2219,null,(r/n.MB).toFixed(2)):r<n.TB?h(2217,null,(r/n.GB).toFixed(2)):h(2220,null,(r/n.TB).toFixed(2))}}});function $t(n){let r=n;return typeof r?.id=="string"&&x.isUri(r.uri)}function jo(n,r){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:Pe(n)}:r?J2:Q2;let e=n;return e.configuration?{id:e.id,configPath:e.configuration}:e.folders.length===1?{id:e.id,uri:e.folders[0].uri}:{id:e.id}}function ct(n){let r=n;return typeof r?.id=="string"&&x.isUri(r.configPath)}function aP(n){let r=n;if(r?.uri)return{id:r.id,uri:x.revive(r.uri)};let e=n;if(e?.configPath)return{id:e.id,configPath:x.revive(e.configPath)};if(n?.id)return{id:n.id}}function vy(n,r){return Je.isEqualOrParent(n,r.untitledWorkspacesHome)}function kn(n){return(typeof n=="string"?ba(n):f1(n))===X2}var e8,J2,Q2,rm,lu,X2,lP,gy,Rr=I(()=>{xe();we();qs();gt();ce();Z();ze();e8=O("contextService");J2={id:"ext-dev"},Q2={id:"empty-window"};rm=class{constructor(r,e){this.raw=e;this.uri=r.uri,this.index=r.index,this.name=r.name}toResource(r){return oe(this.uri,r)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}},lu="code-workspace",X2=`.${lu}`,lP=[{name:h(2890,null),extensions:[lu]}],gy="workspace.json"});var Rt,Zi=I(()=>{Z();Rt=O("IUriIdentityService")});function cP(n){let r=n;return!!(r&&typeof r=="object"&&typeof r.id=="string"&&typeof r.isDefault=="boolean"&&typeof r.name=="string"&&x.isUri(r.location)&&x.isUri(r.globalStorageHome)&&x.isUri(r.settingsResource)&&x.isUri(r.keybindingsResource)&&x.isUri(r.tasksResource)&&x.isUri(r.snippetsHome)&&x.isUri(r.promptsHome)&&x.isUri(r.extensionsResource)&&x.isUri(r.mcpResource)&&x.isUri(r.agentPluginsHome))}function im(n,r,e,t,i,o){return{id:n,name:r,location:e,isDefault:!1,icon:i?.icon,globalStorageHome:o&&i?.useDefaultFlags?.globalState?o.globalStorageHome:oe(e,"globalStorage"),settingsResource:o&&i?.useDefaultFlags?.settings?o.settingsResource:oe(e,"settings.json"),keybindingsResource:o&&i?.useDefaultFlags?.keybindings?o.keybindingsResource:oe(e,"keybindings.json"),tasksResource:o&&i?.useDefaultFlags?.tasks?o.tasksResource:oe(e,"tasks.json"),snippetsHome:o&&i?.useDefaultFlags?.snippets?o.snippetsHome:oe(e,"snippets"),promptsHome:o&&i?.useDefaultFlags?.prompts?o.promptsHome:oe(e,"prompts"),extensionsResource:o&&i?.useDefaultFlags?.extensions?o.extensionsResource:oe(e,"extensions.json"),mcpResource:o&&i?.useDefaultFlags?.mcp?o.mcpResource:oe(e,"mcp.json"),agentPluginsHome:o?o.agentPluginsHome:oe(e,"agent-plugins"),cacheHome:oe(t,n),useDefaultFlags:i?.useDefaultFlags,isTransient:i?.transient,workspaces:i?.workspaces}}var Dr,ll,en=I(()=>{En();q();$();gt();ce();xe();si();je();Z();te();Rr();Zi();he();Xt();ar();Oe();Dr=O("IUserDataProfilesService");ll=class extends T{constructor(e,t,i,o){super();this.environmentService=e;this.fileService=t;this.uriIdentityService=i;this.logService=o;this._onDidChangeProfiles=this._register(new b);this.onDidChangeProfiles=this._onDidChangeProfiles.event;this._onWillCreateProfile=this._register(new b);this.onWillCreateProfile=this._onWillCreateProfile.event;this._onWillRemoveProfile=this._register(new b);this.onWillRemoveProfile=this._onWillRemoveProfile.event;this._onDidResetWorkspaces=this._register(new b);this.onDidResetWorkspaces=this._onDidResetWorkspaces.event;this.profileCreationPromises=new Map;this.transientProfilesObject={profiles:[],emptyWindows:new Map};this.profilesHome=oe(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=oe(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(),t=[e];try{for(let o of this.getStoredProfiles()){if(this.isInvalidProfile(o)){this.logService.warn("Skipping the invalid stored profile",o.location||o.name);continue}let s=qr(o.location);t.push(im(s,o.name,o.location,this.profilesCacheHome,{icon:o.icon,useDefaultFlags:o.useDefaultFlags},e))}}catch(o){this.logService.error(o)}let i=new Map;if(t.length)try{let o=this.getStoredProfileAssociations();if(o.workspaces)for(let[s,a]of Object.entries(o.workspaces)){let l=x.parse(s),c=t.find(d=>d.id===a);if(c){let d=c.workspaces?c.workspaces.slice(0):[];d.push(l),c.workspaces=d}}if(o.emptyWindows)for(let[s,a]of Object.entries(o.emptyWindows)){let l=t.find(c=>c.id===a);l&&i.set(s,l)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,emptyWindows:i}}return this._profilesObject}isInvalidProfile(e){return!!(!e.name||!Fe(e.name)||!e.location||e.isSystem||this.uriIdentityService.extUri.basename(this.uriIdentityService.extUri.dirname(e.location))==="builtin")}createDefaultProfile(){let e=im("__default__profile__",h(2849,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){let t="Temp",i=new RegExp(`${Lo(t)}\\s(\\d+)`),o=0;for(let a of this.profiles){let l=i.exec(a.name),c=l?parseInt(l[1]):0;o=c>o?c:o}let s=`${t} ${o+1}`;return this.createProfile(cr(ke()).toString(16),s,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(cr(ke()).toString(16),e,t,i)}async createProfile(e,t,i,o){return await this.doCreateProfile(e,t,i,o)}async doCreateProfile(e,t,i,o){if(!Fe(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(t);return s||(s=(async()=>{try{if(this.profiles.find(u=>u.id===e||!u.isTransient&&!i?.transient&&u.name===t))throw new Error(`Profile with ${t} name already exists`);let l=o?this.getWorkspace(o):void 0;x.isUri(l)&&(i={...i,workspaces:[l]});let c=im(e,t,this.uriIdentityService.extUri.joinPath(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(c.location);let d=[];return this._onWillCreateProfile.fire({profile:c,join(u){d.push(u)}}),await vt.settled(d),l&&!x.isUri(l)&&this.updateEmptyWindowAssociation(l,c,!!c.isTransient),this.updateProfiles([c],[],[]),c}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,s)),s}async updateProfile(e,t){let i=[];for(let s of this.profiles){let a;if(e.id===s.id)s.isDefault?t.workspaces&&(a=s,a.workspaces=t.workspaces):a=im(s.id,t.name??s.name,s.location,this.profilesCacheHome,{icon:t.icon===null?void 0:t.icon??s.icon,transient:t.transient??s.isTransient,useDefaultFlags:t.useDefaultFlags??s.useDefaultFlags,workspaces:t.workspaces??s.workspaces},this.defaultProfile);else if(t.workspaces){let l=s.workspaces?.filter(c=>!t.workspaces?.some(d=>this.uriIdentityService.extUri.isEqual(c,d)));s.workspaces?.length!==l?.length&&(a=s,a.workspaces=l)}a&&i.push(a)}if(!i.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],i);let o=this.profiles.find(s=>s.id===e.id);if(!o)throw new Error(`Profile '${e.name}' was not updated`);return o}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");let t=this.profiles.find(o=>o.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);let i=[];this._onWillRemoveProfile.fire({profile:t,join(o){i.push(o)}});try{await Promise.allSettled(i)}catch(o){this.logService.error(o)}this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(o){jr(o)!==1&&this.logService.error(o)}}async setProfileForWorkspace(e,t){let i=this.profiles.find(s=>s.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);let o=this.getWorkspace(e);if(x.isUri(o)){let s=i.workspaces?[...i.workspaces]:[];s.some(a=>this.uriIdentityService.extUri.isEqual(a,o))||(s.push(o),await this.updateProfile(i,{workspaces:s}))}else this.updateEmptyWindowAssociation(o,i,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,t=!1){let i=this.getWorkspace(e);if(x.isUri(i)){let o=this.getProfileForWorkspace(e);o&&this.updateProfile(o,{workspaces:o.workspaces?.filter(s=>!this.uriIdentityService.extUri.isEqual(s,i))})}else this.updateEmptyWindowAssociation(i,void 0,t),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=this.uriIdentityService.extUri.joinPath(this.profilesHome,"builtin");if(await this.fileService.exists(e))try{await this.fileService.del(e,{recursive:!0})}catch(i){this.logService.error(i)}let t=await this.fileService.resolve(this.profilesHome);await Promise.all((t.children||[]).filter(i=>i.isDirectory&&this.profiles.every(o=>!this.uriIdentityService.extUri.isEqual(o.location,i.resource))).map(i=>this.fileService.del(i.resource,{recursive:!0})))}}catch(e){this.logService.error("Error deleting redundant profile folders",e)}try{let e=this.getStoredProfiles(),t=[];for(let i of this.getStoredProfiles())this.isInvalidProfile(i)?this.logService.warn(`Invalid user data profile found: ${i.name}`):t.push(i);e.length!==t.length&&this.saveStoredProfiles(t)}catch(e){this.logService.error("Error removing invalid stored profiles",e)}}async cleanUpTransientProfiles(){let e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){let t=this.getWorkspace(e);return x.isUri(t)?this.profiles.find(i=>i.workspaces?.some(o=>this.uriIdentityService.extUri.isEqual(o,t))):this.profilesObject.emptyWindows.get(t)??this.transientProfilesObject.emptyWindows.get(t)}getWorkspace(e){return $t(e)?e.uri:ct(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i,o=!1){let s=[...this.profiles,...e],a=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];let l=[];for(let c of s){if(t.some(d=>c.id===d.id)){for(let d of[...this.profilesObject.emptyWindows.keys()])c.id===this.profilesObject.emptyWindows.get(d)?.id&&this.profilesObject.emptyWindows.delete(d);continue}if(!c.isDefault){c=i.find(u=>c.id===u.id)??c;let d=a.find(u=>c.id===u.id);if(c.isTransient)this.transientProfilesObject.profiles.push(c);else if(d){for(let[u,f]of this.transientProfilesObject.emptyWindows.entries())if(c.id===f.id){this.transientProfilesObject.emptyWindows.delete(u),this.profilesObject.emptyWindows.set(u,c);break}}}c.workspaces?.length===0&&(c.workspaces=void 0),l.push(c)}this.updateStoredProfiles(l),o||this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateEmptyWindowAssociation(e,t,i){i=t?.isTransient?!0:i,i?t?this.transientProfilesObject.emptyWindows.set(e,t):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),t?this.profilesObject.emptyWindows.set(e,t):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){let t=[],i={},o={};for(let s of e)if(!s.isTransient&&(s.isDefault||t.push({location:s.location,name:s.name,icon:s.icon,useDefaultFlags:s.useDefaultFlags}),s.workspaces))for(let a of s.workspaces)i[a.toString()]=s.id;for(let[s,a]of this.profilesObject.emptyWindows.entries())o[s.toString()]=a.id;this.saveStoredProfileAssociations({workspaces:i,emptyWindows:o}),this.saveStoredProfiles(t),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}};ll=E([g(0,wi),g(1,Me),g(2,Rt),g(3,B)],ll)});function sm(n){let r=n.get(mo);if(r)try{return JSON.parse(r)}catch{}return Object.create(null)}function nm(n){return n.isDefault||!!n.useDefaultFlags?.globalState}async function Z2(n,r,e,t,i,o,s,a){let l=k=>{try{return JSON.parse(k)}catch{return k}},c=new Map,d=new Map;n.forEach((k,A)=>{c.set(A,k),d.set(A,l(k))});let u=new Map,f=new Map;r.forEach((k,A)=>{u.set(A,k),f.set(A,l(k))});let m=new Map,v=new Map;e.forEach((k,A)=>{m.set(A,k),v.set(A,l(k))});let y=new Map,C=new Map;t.forEach((k,A)=>{y.set(A,k),C.set(A,l(k))}),console.group(i!==s?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);let w=[];c.forEach((k,A)=>{w.push({key:A,value:k})}),console.table(w),console.groupEnd(),console.log(d),console.group(`Storage: Application Shared (path: ${o})`);let _=[];if(u.forEach((k,A)=>{_.push({key:A,value:k})}),console.table(_),console.groupEnd(),console.log(f),i!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);let k=[];m.forEach((A,de)=>{k.push({key:de,value:A})}),console.table(k),console.groupEnd(),console.log(v)}console.group(`Storage: Workspace (path: ${a})`);let D=[];y.forEach((k,A)=>{D.push({key:A,value:k})}),console.table(D),console.groupEnd(),console.log(C)}var du,mo,dP,cu,om,Rn=I(()=>{he();q();$();hn();Oe();dy();Z();en();du="__$__isNewStorageMarker",mo="__$__targetStorageMarker",dP=O("storageService");cu=class n extends T{constructor(e={flushInterval:n.DEFAULT_FLUSH_INTERVAL}){super();this._onDidChangeValue=this._register(new ks);this._onDidChangeTarget=this._register(new ks);this.onDidChangeTarget=this._onDidChangeTarget.event;this._onWillSaveState=this._register(new b);this.onWillSaveState=this._onWillSaveState.event;this.runFlushWhenIdle=this._register(new Qt);this._workspaceKeyTargets=void 0;this._profileKeyTargets=void 0;this._applicationKeyTargets=void 0;this._applicationSharedKeyTargets=void 0;this.flushWhenIdleScheduler=this._register(new gr(()=>this.doFlushWhenIdle(),e.flushInterval))}static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}onDidChangeValue(e,t,i){return S.filter(this._onDidChangeValue.event,o=>o.scope===e&&(t===void 0||o.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=gd(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){ut([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{Ve("code/willInitStorage");try{await this.doInitialize()}finally{Ve("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){let{key:i,external:o}=t;if(i===mo){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:i,target:this.getKeyTargets(e)[i],external:o})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(let i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,o,s=!1){if(Vt(t)){this.remove(e,i,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,o),this.getStorage(i)?.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){let i=[],o=this.getKeyTargets(e);for(let s of Object.keys(o))o[s]===t&&i.push(s);return i}updateKeyTarget(e,t,i,o=!1){let s=this.getKeyTargets(t);typeof i=="number"?s[e]!==i&&(s[e]=i,this.getStorage(t)?.set(mo,JSON.stringify(s),o)):typeof s[e]=="number"&&(delete s[e],this.getStorage(t)?.set(mo,JSON.stringify(s),o))}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 t=this.getStorage(e);return t?sm(t):Object.create(null)}isNew(e){return this.getBoolean(du,e)===!0}async flush(e=0){this._onWillSaveState.fire({reason:e});let t=this.getStorage(-1),i=this.getStorage(-2),o=this.getStorage(0),s=this.getStorage(1);switch(e){case 0:await vt.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),o?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case 1:await vt.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),o?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){let e=this.getStorage(-1)?.items??new Map,t=this.getStorage(-2)?.items??new Map,i=this.getStorage(0)?.items??new Map,o=this.getStorage(1)?.items??new Map;return Z2(e,t,i,o,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,t){return this.emitWillSaveState(0),cP(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||nm(t)&&nm(e))}switchData(e,t,i){this.withPausedEmitters(()=>{let o=new Set;for(let[s,a]of e)o.add(s),t.get(s)!==a&&this.emitDidChangeValue(i,{key:s,external:!0});for(let[s]of t.items)o.has(s)||this.emitDidChangeValue(i,{key:s,external:!0})})}};om=class extends cu{constructor(){super();this.applicationStorage=this._register(new li(new Tn,{hint:1}));this.applicationSharedStorage=this._register(new li(new Tn,{hint:1}));this.profileStorage=this._register(new li(new Tn,{hint:1}));this.workspaceStorage=this._register(new li(new Tn,{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}}});var am,Et,xi=I(()=>{Z();am=O("stateReadService"),Et=O("stateService")});function uu(n){return!!n.workspaceUri}function lm(n){return!!n.folderUri}function Iy(n){return!!n.fileUri}function eA(n,r){if(Pr)return!1;let e=Go(n,r),t=n.getValue("window");return t?.menuStyle==="native"?!(!V&&!e):t?.menuStyle==="custom"?!1:e}function wy(n,r){return Pr?!1:V?!0:eA(n,r)}function uP(n){let r=n.getValue("window.menuBarVisibility");return r==="default"||r==="compact"&&wy(n)||V&&Op?"classic":r}function Go(n,r){return r||(r=pP(n)),r==="native"}function pP(n){if(Pr)return"custom";let r=n.getValue("window");if(r){if(V&&r.nativeTabs===!0||V&&r.nativeFullScreen===!1)return"native";let i=r.titleBarStyle;if(i==="native"||i==="custom")return i}return"custom"}function tA(n){if(Pr||V||pP(n)==="native")return"native";let e=n.getValue("window")?.controlsStyle;return e==="custom"||e==="hidden"?e:"native"}function pu(n){if(Pr||Go(n))return!1;if(!V){let r=tA(n);if(r==="custom"||r==="hidden")return!1}return!0}function cm(n){let r=n.getValue("window");return!r||typeof r.nativeFullScreen!="boolean"||r.nativeTabs?!0:r.nativeFullScreen!==!1}function mP(n=0){return 1.2**n}var yy,fP,hP,gP,by,Jo=I(()=>{X();yy={WIDTH:400,WIDTH_WITH_VERTICAL_PANEL:600,HEIGHT:270};fP=35;hP={width:1200,height:800},gP={width:1440,height:900},by={width:1024,height:768}});import rA from"electron";var Dn,vP,tn=I(()=>{Jo();Dn=function(n=1,r=!1){let e=r?gP:hP;return{width:e.width,height:e.height,mode:n}},vP=function(){let n=by.width,r=by.height,e=rA.screen.getPrimaryDisplay().workArea,t=Math.max(e.x+e.width/2-n/2,0),i=Math.max(e.y+e.height/2-r/2,0);return{x:t,y:i,width:n,height:r,mode:1}}});function Xo(n,r){let e=Math.pow(10,r);return Math.round(n*e)/e}var R,Qo,cl,Yo,Sy=I(()=>{zi();R=class{constructor(r,e,t,i=1){this._rgbaBrand=void 0;this.r=Math.min(255,Math.max(0,r))|0,this.g=Math.min(255,Math.max(0,e))|0,this.b=Math.min(255,Math.max(0,t))|0,this.a=Xo(Math.max(Math.min(1,i),0),3)}static equals(r,e){return r.r===e.r&&r.g===e.g&&r.b===e.b&&r.a===e.a}},Qo=class n{constructor(r,e,t,i){this._hslaBrand=void 0;this.h=Math.max(Math.min(360,r),0)|0,this.s=Xo(Math.max(Math.min(1,e),0),3),this.l=Xo(Math.max(Math.min(1,t),0),3),this.a=Xo(Math.max(Math.min(1,i),0),3)}static equals(r,e){return r.h===e.h&&r.s===e.s&&r.l===e.l&&r.a===e.a}static fromRGBA(r){let e=r.r/255,t=r.g/255,i=r.b/255,o=r.a,s=Math.max(e,t,i),a=Math.min(e,t,i),l=0,c=0,d=(a+s)/2,u=s-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),s){case e:l=(t-i)/u+(t<i?6:0);break;case t:l=(i-e)/u+2;break;case i:l=(e-t)/u+4;break}l*=60,l=Math.round(l)}return new n(l,c,d,o)}static _hue2rgb(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}static toRGBA(r){let e=r.h/360,{s:t,l:i,a:o}=r,s,a,l;if(t===0)s=a=l=i;else{let c=i<.5?i*(1+t):i+t-i*t,d=2*i-c;s=n._hue2rgb(d,c,e+1/3),a=n._hue2rgb(d,c,e),l=n._hue2rgb(d,c,e-1/3)}return new R(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}},cl=class n{constructor(r,e,t,i){this._hsvaBrand=void 0;this.h=Math.max(Math.min(360,r),0)|0,this.s=Xo(Math.max(Math.min(1,e),0),3),this.v=Xo(Math.max(Math.min(1,t),0),3),this.a=Xo(Math.max(Math.min(1,i),0),3)}static equals(r,e){return r.h===e.h&&r.s===e.s&&r.v===e.v&&r.a===e.a}static fromRGBA(r){let e=r.r/255,t=r.g/255,i=r.b/255,o=Math.max(e,t,i),s=Math.min(e,t,i),a=o-s,l=o===0?0:a/o,c;return a===0?c=0:o===e?c=((t-i)/a%6+6)%6:o===t?c=(i-e)/a+2:c=(e-t)/a+4,new n(Math.round(c*60),l,o,r.a)}static toRGBA(r){let{h:e,s:t,v:i,a:o}=r,s=i*t,a=s*(1-Math.abs(e/60%2-1)),l=i-s,[c,d,u]=[0,0,0];return e<60?(c=s,d=a):e<120?(c=a,d=s):e<180?(d=s,u=a):e<240?(d=a,u=s):e<300?(c=a,u=s):e<=360&&(c=s,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new R(c,d,u,o)}},Yo=class n{static fromHex(r){return n.Format.CSS.parseHex(r)||n.red}static equals(r,e){return!r&&!e?!0:!r||!e?!1:r.equals(e)}get hsla(){return this._hsla?this._hsla:Qo.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:cl.fromRGBA(this.rgba)}constructor(r){if(r)if(r instanceof R)this.rgba=r;else if(r instanceof Qo)this._hsla=r,this.rgba=Qo.toRGBA(r);else if(r instanceof cl)this._hsva=r,this.rgba=cl.toRGBA(r);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(r){return!!r&&R.equals(this.rgba,r.rgba)&&Qo.equals(this.hsla,r.hsla)&&cl.equals(this.hsva,r.hsva)}getRelativeLuminance(){let r=n._relativeLuminanceForComponent(this.rgba.r),e=n._relativeLuminanceForComponent(this.rgba.g),t=n._relativeLuminanceForComponent(this.rgba.b),i=.2126*r+.7152*e+.0722*t;return Xo(i,4)}reduceRelativeLuminace(r,e){let{r:t,g:i,b:o}=r.rgba,s=this.getContrastRatio(r);for(;s<e&&(t>0||i>0||o>0);)t-=Math.max(0,Math.ceil(t*.1)),i-=Math.max(0,Math.ceil(i*.1)),o-=Math.max(0,Math.ceil(o*.1)),s=this.getContrastRatio(new n(new R(t,i,o)));return new n(new R(t,i,o))}increaseRelativeLuminace(r,e){let{r:t,g:i,b:o}=r.rgba,s=this.getContrastRatio(r);for(;s<e&&(t<255||i<255||o<255);)t=Math.min(255,t+Math.ceil((255-t)*.1)),i=Math.min(255,i+Math.ceil((255-i)*.1)),o=Math.min(255,o+Math.ceil((255-o)*.1)),s=this.getContrastRatio(new n(new R(t,i,o)));return new n(new R(t,i,o))}static _relativeLuminanceForComponent(r){let e=r/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}getContrastRatio(r){let e=this.getRelativeLuminance(),t=r.getRelativeLuminance();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)}isDarker(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3<128}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(r){let e=this.getRelativeLuminance(),t=r.getRelativeLuminance();return e>t}isDarkerThan(r){let e=this.getRelativeLuminance(),t=r.getRelativeLuminance();return e<t}ensureConstrast(r,e){let t=this.getRelativeLuminance(),i=r.getRelativeLuminance();if(this.getContrastRatio(r)<e){if(i<t){let l=this.reduceRelativeLuminace(r,e),c=this.getContrastRatio(l);if(c<e){let d=this.increaseRelativeLuminace(r,e),u=this.getContrastRatio(d);return c>u?l:d}return l}let s=this.increaseRelativeLuminace(r,e),a=this.getContrastRatio(s);if(a<e){let l=this.reduceRelativeLuminace(r,e),c=this.getContrastRatio(l);return a>c?s:l}return s}return r}lighten(r){return new n(new Qo(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*r,this.hsla.a))}darken(r){return new n(new Qo(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*r,this.hsla.a))}transparent(r){let{r:e,g:t,b:i,a:o}=this.rgba;return new n(new R(e,t,i,o*r))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new n(new R(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}blend(r){let e=r.rgba,t=this.rgba.a,i=e.a,o=t+i*(1-t);if(o<1e-6)return n.transparent;let s=this.rgba.r*t/o+e.r*i*(1-t)/o,a=this.rgba.g*t/o+e.g*i*(1-t)/o,l=this.rgba.b*t/o+e.b*i*(1-t)/o;return new n(new R(s,a,l,o))}mix(r,e=.5){let t=Math.min(Math.max(e,0),1),i=this.rgba,o=r.rgba,s=i.r+(o.r-i.r)*t,a=i.g+(o.g-i.g)*t,l=i.b+(o.b-i.b)*t,c=i.a+(o.a-i.a)*t;return new n(new R(s,a,l,c))}makeOpaque(r){if(this.isOpaque()||r.rgba.a!==1)return this;let{r:e,g:t,b:i,a:o}=this.rgba;return new n(new R(r.rgba.r-o*(r.rgba.r-e),r.rgba.g-o*(r.rgba.g-t),r.rgba.b-o*(r.rgba.b-i),1))}flatten(...r){let e=r.reduceRight((t,i)=>n._flatten(i,t));return n._flatten(this,e)}static _flatten(r,e){let t=1-r.rgba.a;return new n(new R(t*e.rgba.r+r.rgba.a*r.rgba.r,t*e.rgba.g+r.rgba.a*r.rgba.g,t*e.rgba.b+r.rgba.a*r.rgba.b))}toString(){return this._toString||(this._toString=n.Format.CSS.format(this)),this._toString}toNumber32Bit(){return this._toNumber32Bit||(this._toNumber32Bit=(this.rgba.r<<24|this.rgba.g<<16|this.rgba.b<<8|this.rgba.a*255<<0)>>>0),this._toNumber32Bit}static getLighterColor(r,e,t){if(r.isLighterThan(e))return r;t=t||.5;let i=r.getRelativeLuminance(),o=e.getRelativeLuminance();return t=t*(o-i)/o,r.lighten(t)}static getDarkerColor(r,e,t){if(r.isDarkerThan(e))return r;t=t||.5;let i=r.getRelativeLuminance(),o=e.getRelativeLuminance();return t=t*(i-o)/i,r.darken(t)}static{this.white=new n(new R(255,255,255,1))}static{this.black=new n(new R(0,0,0,1))}static{this.red=new n(new R(255,0,0,1))}static{this.blue=new n(new R(0,0,255,1))}static{this.green=new n(new R(0,255,0,1))}static{this.cyan=new n(new R(0,255,255,1))}static{this.lightgrey=new n(new R(211,211,211,1))}static{this.transparent=new n(new R(0,0,0,0))}};(r=>{let n;(t=>{let e;(C=>{function i(w){return w.rgba.a===1?`rgb(${w.rgba.r}, ${w.rgba.g}, ${w.rgba.b})`:r.Format.CSS.formatRGBA(w)}C.formatRGB=i;function o(w){return`rgba(${w.rgba.r}, ${w.rgba.g}, ${w.rgba.b}, ${+w.rgba.a.toFixed(2)})`}C.formatRGBA=o;function s(w){return w.hsla.a===1?`hsl(${w.hsla.h}, ${Math.round(w.hsla.s*100)}%, ${Math.round(w.hsla.l*100)}%)`:r.Format.CSS.formatHSLA(w)}C.formatHSL=s;function a(w){return`hsla(${w.hsla.h}, ${Math.round(w.hsla.s*100)}%, ${Math.round(w.hsla.l*100)}%, ${w.hsla.a.toFixed(2)})`}C.formatHSLA=a;function l(w){let _=w.toString(16);return _.length!==2?"0"+_:_}function c(w){return`#${l(w.rgba.r)}${l(w.rgba.g)}${l(w.rgba.b)}`}C.formatHex=c;function d(w,_=!1){return _&&w.rgba.a===1?r.Format.CSS.formatHex(w):`#${l(w.rgba.r)}${l(w.rgba.g)}${l(w.rgba.b)}${l(Math.round(w.rgba.a*255))}`}C.formatHexA=d;function u(w){return w.isOpaque()?r.Format.CSS.formatHex(w):r.Format.CSS.formatRGBA(w)}C.format=u;function f(w){if(w==="transparent")return r.transparent;if(w.startsWith("#"))return v(w);if(w.startsWith("rgba(")){let _=w.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);if(!_)throw new Error("Invalid color format "+w);let D=parseInt(_.groups?.r??"0"),k=parseInt(_.groups?.g??"0"),A=parseInt(_.groups?.b??"0"),de=parseFloat(_.groups?.a??"0");return new r(new R(D,k,A,de))}if(w.startsWith("rgb(")){let _=w.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);if(!_)throw new Error("Invalid color format "+w);let D=parseInt(_.groups?.r??"0"),k=parseInt(_.groups?.g??"0"),A=parseInt(_.groups?.b??"0");return new r(new R(D,k,A))}return m(w)}C.parse=f;function m(w){switch(w){case"aliceblue":return new r(new R(240,248,255,1));case"antiquewhite":return new r(new R(250,235,215,1));case"aqua":return new r(new R(0,255,255,1));case"aquamarine":return new r(new R(127,255,212,1));case"azure":return new r(new R(240,255,255,1));case"beige":return new r(new R(245,245,220,1));case"bisque":return new r(new R(255,228,196,1));case"black":return new r(new R(0,0,0,1));case"blanchedalmond":return new r(new R(255,235,205,1));case"blue":return new r(new R(0,0,255,1));case"blueviolet":return new r(new R(138,43,226,1));case"brown":return new r(new R(165,42,42,1));case"burlywood":return new r(new R(222,184,135,1));case"cadetblue":return new r(new R(95,158,160,1));case"chartreuse":return new r(new R(127,255,0,1));case"chocolate":return new r(new R(210,105,30,1));case"coral":return new r(new R(255,127,80,1));case"cornflowerblue":return new r(new R(100,149,237,1));case"cornsilk":return new r(new R(255,248,220,1));case"crimson":return new r(new R(220,20,60,1));case"cyan":return new r(new R(0,255,255,1));case"darkblue":return new r(new R(0,0,139,1));case"darkcyan":return new r(new R(0,139,139,1));case"darkgoldenrod":return new r(new R(184,134,11,1));case"darkgray":return new r(new R(169,169,169,1));case"darkgreen":return new r(new R(0,100,0,1));case"darkgrey":return new r(new R(169,169,169,1));case"darkkhaki":return new r(new R(189,183,107,1));case"darkmagenta":return new r(new R(139,0,139,1));case"darkolivegreen":return new r(new R(85,107,47,1));case"darkorange":return new r(new R(255,140,0,1));case"darkorchid":return new r(new R(153,50,204,1));case"darkred":return new r(new R(139,0,0,1));case"darksalmon":return new r(new R(233,150,122,1));case"darkseagreen":return new r(new R(143,188,143,1));case"darkslateblue":return new r(new R(72,61,139,1));case"darkslategray":return new r(new R(47,79,79,1));case"darkslategrey":return new r(new R(47,79,79,1));case"darkturquoise":return new r(new R(0,206,209,1));case"darkviolet":return new r(new R(148,0,211,1));case"deeppink":return new r(new R(255,20,147,1));case"deepskyblue":return new r(new R(0,191,255,1));case"dimgray":return new r(new R(105,105,105,1));case"dimgrey":return new r(new R(105,105,105,1));case"dodgerblue":return new r(new R(30,144,255,1));case"firebrick":return new r(new R(178,34,34,1));case"floralwhite":return new r(new R(255,250,240,1));case"forestgreen":return new r(new R(34,139,34,1));case"fuchsia":return new r(new R(255,0,255,1));case"gainsboro":return new r(new R(220,220,220,1));case"ghostwhite":return new r(new R(248,248,255,1));case"gold":return new r(new R(255,215,0,1));case"goldenrod":return new r(new R(218,165,32,1));case"gray":return new r(new R(128,128,128,1));case"green":return new r(new R(0,128,0,1));case"greenyellow":return new r(new R(173,255,47,1));case"grey":return new r(new R(128,128,128,1));case"honeydew":return new r(new R(240,255,240,1));case"hotpink":return new r(new R(255,105,180,1));case"indianred":return new r(new R(205,92,92,1));case"indigo":return new r(new R(75,0,130,1));case"ivory":return new r(new R(255,255,240,1));case"khaki":return new r(new R(240,230,140,1));case"lavender":return new r(new R(230,230,250,1));case"lavenderblush":return new r(new R(255,240,245,1));case"lawngreen":return new r(new R(124,252,0,1));case"lemonchiffon":return new r(new R(255,250,205,1));case"lightblue":return new r(new R(173,216,230,1));case"lightcoral":return new r(new R(240,128,128,1));case"lightcyan":return new r(new R(224,255,255,1));case"lightgoldenrodyellow":return new r(new R(250,250,210,1));case"lightgray":return new r(new R(211,211,211,1));case"lightgreen":return new r(new R(144,238,144,1));case"lightgrey":return new r(new R(211,211,211,1));case"lightpink":return new r(new R(255,182,193,1));case"lightsalmon":return new r(new R(255,160,122,1));case"lightseagreen":return new r(new R(32,178,170,1));case"lightskyblue":return new r(new R(135,206,250,1));case"lightslategray":return new r(new R(119,136,153,1));case"lightslategrey":return new r(new R(119,136,153,1));case"lightsteelblue":return new r(new R(176,196,222,1));case"lightyellow":return new r(new R(255,255,224,1));case"lime":return new r(new R(0,255,0,1));case"limegreen":return new r(new R(50,205,50,1));case"linen":return new r(new R(250,240,230,1));case"magenta":return new r(new R(255,0,255,1));case"maroon":return new r(new R(128,0,0,1));case"mediumaquamarine":return new r(new R(102,205,170,1));case"mediumblue":return new r(new R(0,0,205,1));case"mediumorchid":return new r(new R(186,85,211,1));case"mediumpurple":return new r(new R(147,112,219,1));case"mediumseagreen":return new r(new R(60,179,113,1));case"mediumslateblue":return new r(new R(123,104,238,1));case"mediumspringgreen":return new r(new R(0,250,154,1));case"mediumturquoise":return new r(new R(72,209,204,1));case"mediumvioletred":return new r(new R(199,21,133,1));case"midnightblue":return new r(new R(25,25,112,1));case"mintcream":return new r(new R(245,255,250,1));case"mistyrose":return new r(new R(255,228,225,1));case"moccasin":return new r(new R(255,228,181,1));case"navajowhite":return new r(new R(255,222,173,1));case"navy":return new r(new R(0,0,128,1));case"oldlace":return new r(new R(253,245,230,1));case"olive":return new r(new R(128,128,0,1));case"olivedrab":return new r(new R(107,142,35,1));case"orange":return new r(new R(255,165,0,1));case"orangered":return new r(new R(255,69,0,1));case"orchid":return new r(new R(218,112,214,1));case"palegoldenrod":return new r(new R(238,232,170,1));case"palegreen":return new r(new R(152,251,152,1));case"paleturquoise":return new r(new R(175,238,238,1));case"palevioletred":return new r(new R(219,112,147,1));case"papayawhip":return new r(new R(255,239,213,1));case"peachpuff":return new r(new R(255,218,185,1));case"peru":return new r(new R(205,133,63,1));case"pink":return new r(new R(255,192,203,1));case"plum":return new r(new R(221,160,221,1));case"powderblue":return new r(new R(176,224,230,1));case"purple":return new r(new R(128,0,128,1));case"rebeccapurple":return new r(new R(102,51,153,1));case"red":return new r(new R(255,0,0,1));case"rosybrown":return new r(new R(188,143,143,1));case"royalblue":return new r(new R(65,105,225,1));case"saddlebrown":return new r(new R(139,69,19,1));case"salmon":return new r(new R(250,128,114,1));case"sandybrown":return new r(new R(244,164,96,1));case"seagreen":return new r(new R(46,139,87,1));case"seashell":return new r(new R(255,245,238,1));case"sienna":return new r(new R(160,82,45,1));case"silver":return new r(new R(192,192,192,1));case"skyblue":return new r(new R(135,206,235,1));case"slateblue":return new r(new R(106,90,205,1));case"slategray":return new r(new R(112,128,144,1));case"slategrey":return new r(new R(112,128,144,1));case"snow":return new r(new R(255,250,250,1));case"springgreen":return new r(new R(0,255,127,1));case"steelblue":return new r(new R(70,130,180,1));case"tan":return new r(new R(210,180,140,1));case"teal":return new r(new R(0,128,128,1));case"thistle":return new r(new R(216,191,216,1));case"tomato":return new r(new R(255,99,71,1));case"turquoise":return new r(new R(64,224,208,1));case"violet":return new r(new R(238,130,238,1));case"wheat":return new r(new R(245,222,179,1));case"white":return new r(new R(255,255,255,1));case"whitesmoke":return new r(new R(245,245,245,1));case"yellow":return new r(new R(255,255,0,1));case"yellowgreen":return new r(new R(154,205,50,1));default:return null}}function v(w){let _=w.length;if(_===0||w.charCodeAt(0)!==35)return null;if(_===7){let D=16*y(w.charCodeAt(1))+y(w.charCodeAt(2)),k=16*y(w.charCodeAt(3))+y(w.charCodeAt(4)),A=16*y(w.charCodeAt(5))+y(w.charCodeAt(6));return new r(new R(D,k,A,1))}if(_===9){let D=16*y(w.charCodeAt(1))+y(w.charCodeAt(2)),k=16*y(w.charCodeAt(3))+y(w.charCodeAt(4)),A=16*y(w.charCodeAt(5))+y(w.charCodeAt(6)),de=16*y(w.charCodeAt(7))+y(w.charCodeAt(8));return new r(new R(D,k,A,de/255))}if(_===4){let D=y(w.charCodeAt(1)),k=y(w.charCodeAt(2)),A=y(w.charCodeAt(3));return new r(new R(16*D+D,16*k+k,16*A+A))}if(_===5){let D=y(w.charCodeAt(1)),k=y(w.charCodeAt(2)),A=y(w.charCodeAt(3)),de=y(w.charCodeAt(4));return new r(new R(16*D+D,16*k+k,16*A+A,(16*de+de)/255))}return null}C.parseHex=v;function y(w){switch(w){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e=t.CSS||={})})(n=r.Format||={})})(Yo||={})});var Te,qt=I(()=>{Z();Te=O("productService")});var An,dl=I(()=>{Z();An=O("themeMainService")});import xy from"electron";function ul(n,r,e,t){let i=n.get(An),o=n.get(Te),s=n.get(ue),a=n.get(_e),l=s.getValue("window"),c={backgroundColor:i.getBackgroundColor(),minWidth:yy.WIDTH,minHeight:yy.HEIGHT,title:o.nameLong,show:r.mode!==0&&r.mode!==3,x:r.x,y:r.y,width:r.width,height:r.height,webPreferences:{...t,enableWebSQL:!1,spellcheck:!1,zoomFactor:mP(r.zoomLevel??l?.zoomLevel),autoplayPolicy:"user-gesture-required",enableBlinkFeatures:"HighlightAPI",sandbox:!0,enableDeprecatedPaste:!0},experimentalDarkMode:!0};if(F){let f=l?.border||"default";f==="system"&&(f="default"),f!=="default"&&(f==="off"?c.accentColor=!1:typeof f=="string"&&(c.accentColor=f))}if(re?c.icon=N(a.appRoot,"resources/linux/code.png"):F&&(a.isBuilt?process.isEmbeddedApp&&(c.icon=N(a.appRoot,"resources/win32/sessions.ico")):c.icon=N(a.appRoot,"resources/win32/code_150x150.png")),V&&(c.acceptFirstMouse=!0,l?.clickThroughInactive===!1&&(c.acceptFirstMouse=!1)),e?.disableFullscreen?c.fullscreen=!1:V&&!cm(s)&&(c.fullscreenable=!1),V&&l?.nativeTabs===!0&&(c.tabbingIdentifier=o.nameShort),!Go(s,e?.forceNativeTitlebar?"native":void 0)&&(c.titleBarStyle="hidden",V||(c.frame=!1),pu(s)))if(V)c.titleBarOverlay=!0;else{let f=i.getWindowSplash(void 0)?.colorInfo.titleBarBackground??i.getBackgroundColor(),m=Yo.fromHex(f).isDarker()?"#FFFFFF":"#000000";c.titleBarOverlay={height:29,color:f,symbolColor:m}}return e?.alwaysOnTop&&(c.alwaysOnTop=!0),c}function um(n){let r,e=Number.MIN_VALUE;for(let t of n)t.lastFocusTime>e&&(e=t.lastFocusTime,r=t);return r}function Ln(){return xy.BrowserWindow.getAllWindows().filter(n=>!n.webContents.isOffscreen())}var qe,pl,Kt=I(()=>{Sy();we();X();et();Lt();Z();qt();dl();Jo();tn();qe=O("windowsMainService");(t=>{function n(i,o,s=xy.screen.getAllDisplays()){if(i.trace(`window#validateWindowState: validating window state on ${s.length} display(s)`,o),typeof o.x!="number"||typeof o.y!="number"||typeof o.width!="number"||typeof o.height!="number"){i.trace("window#validateWindowState: unexpected type of state values");return}if(o.width<=0||o.height<=0){i.trace("window#validateWindowState: unexpected negative values");return}if(s.length===1){let c=e(s[0]);if(i.trace("window#validateWindowState: single monitor working area",c),c){let d=function(){!o||typeof o.x!="number"||typeof o.y!="number"||!c||(o.x<c.x&&(o.x=c.x),o.y<c.y&&(o.y=c.y))};d(),o.width>c.width&&(o.width=c.width),o.height>c.height&&(o.height=c.height),o.x>c.x+c.width-128&&(o.x=c.x+c.width-o.width),o.y>c.y+c.height-128&&(o.y=c.y+c.height-o.height),d()}return o}if(o.display&&o.mode===3){let c=s.find(d=>d.id===o.display);if(c&&typeof c.bounds?.x=="number"&&typeof c.bounds?.y=="number"){i.trace("window#validateWindowState: restoring fullscreen to previous display");let d=Dn(3);return d.x=c.bounds.x,d.y=c.bounds.y,d}}let a,l;try{a=xy.screen.getDisplayMatching({x:o.x,y:o.y,width:o.width,height:o.height}),l=e(a),i.trace("window#validateWindowState: multi-monitor working area",l)}catch(c){i.error("window#validateWindowState: error finding display for window state",c)}if(a&&r(o,a))return o;i.trace("window#validateWindowState: state is outside of the multi-monitor working area")}t.validateWindowState=n;function r(i,o){if(typeof i.x!="number"||typeof i.y!="number"||typeof i.width!="number"||typeof i.height!="number"||i.width<=0||i.height<=0)return!1;let s=e(o);return!!(s&&i.x+i.width>s.x&&i.y+i.height>s.y&&i.x<s.x+s.width&&i.y<s.y+s.height)}t.validateWindowStateOnDisplay=r;function e(i){if(i.workArea.width>0&&i.workArea.height>0)return i.workArea;if(i.bounds.width>0&&i.bounds.height>0)return i.bounds}})(pl||={})});import Li from"electron";var ye,Mn,Ct=I(()=>{Ai();he();q();$();X();yi();Oe();Z();te();xi();tn();Lt();Kt();ye=O("lifecycleMainService"),Mn=class extends T{constructor(e,t,i){super();this.logService=e;this.stateService=t;this.environmentMainService=i;this._onBeforeShutdown=this._register(new b);this.onBeforeShutdown=this._onBeforeShutdown.event;this._onWillShutdown=this._register(new b);this.onWillShutdown=this._onWillShutdown.event;this._onWillLoadWindow=this._register(new b);this.onWillLoadWindow=this._onWillLoadWindow.event;this._onBeforeCloseWindow=this._register(new b);this.onBeforeCloseWindow=this._onBeforeCloseWindow.event;this._quitRequested=!1;this._wasRestarted=!1;this._phase=1;this.windowToCloseRequest=new Set;this.oneTimeListenerTokenGenerator=0;this.windowCounter=0;this.pendingQuitPromise=void 0;this.pendingQuitPromiseResolve=void 0;this.pendingWillShutdownPromise=void 0;this.mapWindowIdToPendingUnload=new Map;this.phaseWhen=new Map;this.relaunchHandler=void 0;this.resolveRestarted(),this.when(2).then(()=>this.registerListeners())}static{this.QUIT_AND_RESTART_KEY="lifecycle.quitAndRestart"}get quitRequested(){return this._quitRequested}get wasRestarted(){return this._wasRestarted}get phase(){return this._phase}resolveRestarted(){this._wasRestarted=!!this.stateService.getItem(Mn.QUIT_AND_RESTART_KEY),this._wasRestarted&&this.stateService.removeItem(Mn.QUIT_AND_RESTART_KEY)}registerListeners(){let e=()=>{this._quitRequested||(this.trace("Lifecycle#app.on(before-quit)"),this._quitRequested=!0,this.trace("Lifecycle#onBeforeShutdown.fire()"),this._onBeforeShutdown.fire(),V&&this.windowCounter===0&&this.fireOnWillShutdown(1))};Li.app.addListener("before-quit",e);let t=()=>{this.trace("Lifecycle#app.on(window-all-closed)"),(this._quitRequested||!V)&&Li.app.quit()};Li.app.addListener("window-all-closed",t),Li.app.once("will-quit",i=>{this.trace("Lifecycle#app.on(will-quit) - begin"),i.preventDefault(),this.fireOnWillShutdown(1).finally(()=>{this.trace("Lifecycle#app.on(will-quit) - after fireOnWillShutdown"),this.resolvePendingQuitPromise(!1),Li.app.removeListener("before-quit",e),Li.app.removeListener("window-all-closed",t),this.trace("Lifecycle#app.on(will-quit) - calling app.quit()"),Li.app.quit()})})}fireOnWillShutdown(e){if(this.pendingWillShutdownPromise)return this.pendingWillShutdownPromise;let t=this.logService;this.trace("Lifecycle#onWillShutdown.fire()");let i=[];return this._onWillShutdown.fire({reason:e,join(o,s){t.trace(`Lifecycle#onWillShutdown - begin '${o}'`),i.push(s.finally(()=>{t.trace(`Lifecycle#onWillShutdown - end '${o}'`)}))}}),this.pendingWillShutdownPromise=(async()=>{try{await vt.settled(i)}catch(o){this.logService.error(o)}try{await this.stateService.close()}catch(o){this.logService.error(o)}})(),this.pendingWillShutdownPromise}set phase(e){if(e<this.phase)throw new Error("Lifecycle cannot go backwards");if(this._phase===e)return;this.trace(`lifecycle (main): phase changed (value: ${e})`),this._phase=e;let t=this.phaseWhen.get(this._phase);t&&(t.open(),this.phaseWhen.delete(this._phase))}async when(e){if(e<=this._phase)return;let t=this.phaseWhen.get(e);t||(t=new bn,this.phaseWhen.set(e,t)),await t.wait()}registerWindow(e){let t=new j;this.windowCounter++,t.add(e.onWillLoad(o=>this._onWillLoadWindow.fire({window:e,workspace:o.workspace,reason:o.reason})));let i=yn(e.win);t.add(S.fromNodeEventEmitter(i,"close")(o=>{let s=e.id;this.windowToCloseRequest.delete(s)||(this.trace(`Lifecycle#window.on('close') - window ID ${e.id}`),o.preventDefault(),this.unload(e,1).then(a=>{if(a){this.windowToCloseRequest.delete(s);return}this.windowToCloseRequest.add(s),this.trace(`Lifecycle#onBeforeCloseWindow.fire() - window ID ${s}`),this._onBeforeCloseWindow.fire(e),e.close()}))})),t.add(S.fromNodeEventEmitter(i,"closed")(()=>{this.trace(`Lifecycle#window.on('closed') - window ID ${e.id}`),this.windowCounter--,t.dispose(),this.windowCounter===0&&(!V||this._quitRequested)&&this.fireOnWillShutdown(1)}))}registerAuxWindow(e){let t=yn(e.win),i=new j;i.add(S.fromNodeEventEmitter(t,"close")(o=>{this.trace(`Lifecycle#auxWindow.on('close') - window ID ${e.id}`),this._quitRequested&&(this.trace("Lifecycle#auxWindow.on('close') - preventDefault() because quit requested"),o.preventDefault())})),i.add(S.fromNodeEventEmitter(t,"closed")(()=>{this.trace(`Lifecycle#auxWindow.on('closed') - window ID ${e.id}`),i.dispose()}))}async reload(e,t){await this.unload(e,3)||e.reload(t)}unload(e,t){let i=this.mapWindowIdToPendingUnload.get(e.id);if(i)return i;let o=this.doUnload(e,t).finally(()=>{this.mapWindowIdToPendingUnload.delete(e.id)});return this.mapWindowIdToPendingUnload.set(e.id,o),o}async doUnload(e,t){if(!e.isReady)return!1;this.trace(`Lifecycle#unload() - window ID ${e.id}`);let i=this._quitRequested?2:t,o=await this.onBeforeUnloadWindowInRenderer(e,i);return o?(this.trace(`Lifecycle#unload() - veto in renderer (window ID ${e.id})`),this.handleWindowUnloadVeto(o)):(await this.onWillUnloadWindowInRenderer(e,i),!1)}handleWindowUnloadVeto(e){return e?(this.resolvePendingQuitPromise(!0),this._quitRequested=!1,!0):!1}resolvePendingQuitPromise(e){this.pendingQuitPromiseResolve&&(this.pendingQuitPromiseResolve(e),this.pendingQuitPromiseResolve=void 0,this.pendingQuitPromise=void 0)}onBeforeUnloadWindowInRenderer(e,t){return new Promise(i=>{let o=this.oneTimeListenerTokenGenerator++,s=`vscode:ok${o}`,a=`vscode:cancel${o}`;rt.once(s,()=>{i(!1)}),rt.once(a,()=>{i(!0)}),e.send("vscode:onBeforeUnload",{okChannel:s,cancelChannel:a,reason:t})})}onWillUnloadWindowInRenderer(e,t){return new Promise(i=>{let s=`vscode:reply${this.oneTimeListenerTokenGenerator++}`;rt.once(s,()=>i()),e.send("vscode:onWillUnload",{replyChannel:s,reason:t})})}quit(e){return this.doQuit(e).then(t=>{if(!t&&e)try{if(F){let i=Zr();i!==process.cwd()&&process.chdir(i)}}catch(i){this.logService.error(i)}return t})}doQuit(e){return this.trace(`Lifecycle#quit() - begin (willRestart: ${e})`),this.pendingQuitPromise?(this.trace("Lifecycle#quit() - returning pending quit promise"),this.pendingQuitPromise):(e&&this.stateService.setItem(Mn.QUIT_AND_RESTART_KEY,!0),this.pendingQuitPromise=new Promise(t=>{this.pendingQuitPromiseResolve=t,this.trace("Lifecycle#quit() - calling app.quit()"),Li.app.quit()}),this.pendingQuitPromise)}trace(e){this.environmentMainService.args["enable-smoke-test-driver"]?this.logService.info(e):this.logService.trace(e)}setRelaunchHandler(e){this.relaunchHandler=e}async relaunch(e){this.trace("Lifecycle#relaunch()");let t=process.argv.slice(1);if(e?.addArgs&&t.push(...e.addArgs),e?.removeArgs)for(let s of e.removeArgs){let a=t.indexOf(s);a>=0&&t.splice(a,1)}let i=()=>{this.relaunchHandler?.handleRelaunch(e)||(this.trace("Lifecycle#relaunch() - calling app.relaunch()"),Li.app.relaunch({args:t}))};Li.app.once("quit",i),await this.quit(!0)&&Li.app.removeListener("quit",i)}async kill(e){this.trace("Lifecycle#kill()"),await this.fireOnWillShutdown(2),await Promise.race([lt(1e3),(async()=>{for(let t of Ln())if(t&&!t.isDestroyed()){let i;t.webContents&&!t.webContents.isDestroyed()?i=new Promise(o=>t.once("closed",o)):i=Promise.resolve(),t.destroy(),await i}})()]),Li.app.exit(e)}};Mn=E([g(0,B),g(1,Et),g(2,_e)],Mn)});import*as Py from"fs";var On,Ey,IP=I(()=>{he();q();Cr();we();nr();On=class n{constructor(r,e=Object.create(null)){this.path=r;this.name=Pe(this.path),this.logger=new Ey(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 S.None}static{this.BUSY_OPEN_TIMEOUT=2e3}static{this.MAX_HOST_PARAMETERS=256}async getItems(){let r=await this.whenConnected,e=new Map;return(await this.all(r,"SELECT * FROM ItemTable")).forEach(i=>e.set(i.key,i.value)),this.logger.isTracing&&this.logger.trace(`[storage ${this.name}] getItems(): ${e.size} rows`),e}async updateItems(r){let e=await this.whenConnected;return this.doUpdateItems(e,r)}doUpdateItems(r,e){return this.logger.isTracing&&this.logger.trace(`[storage ${this.name}] updateItems(): insert(${e.insert?RS(e.insert):"0"}), delete(${e.delete?DS(e.delete):"0"})`),this.transaction(r,()=>{let t=e.insert,i=e.delete;if(t&&t.size>0){let o=[];o.push([]);let s=0;t.forEach((a,l)=>{let c=o[s];c.length>n.MAX_HOST_PARAMETERS&&(s++,c=[],o.push(c)),c.push(l,a)}),o.forEach(a=>{this.prepare(r,`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 t.forEach((d,u)=>{l.push(u),c+=d.length}),`Keys: ${l.join(", ")} Length: ${c}`})})}if(i?.size){let o=[];o.push([]);let s=0;i.forEach(a=>{let l=o[s];l.length>n.MAX_HOST_PARAMETERS&&(s++,l=[],o.push(l)),l.push(a)}),o.forEach(a=>{this.prepare(r,`DELETE FROM ItemTable WHERE key IN (${new Array(a.length).fill("?").join(",")})`,l=>l.run(a),()=>{let l=[];return i.forEach(c=>{l.push(c)}),`Keys: ${l.join(", ")}`})})}})}async optimize(){this.logger.trace(`[storage ${this.name}] vacuum()`);let r=await this.whenConnected;return this.exec(r,"VACUUM")}async close(r){this.logger.trace(`[storage ${this.name}] close()`);let e=await this.whenConnected;return this.doClose(e,r)}doClose(r,e){return new Promise((t,i)=>{r.db.close(o=>(o&&this.handleSQLiteError(r,`[storage ${this.name}] close(): ${o}`),this.path===n.IN_MEMORY_PATH?t():!r.isErroneous&&!r.isInMemory?this.backup().then(t,s=>(this.logger.error(`[storage ${this.name}] backup(): ${s}`),t())):typeof e=="function"?Py.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(t,i):i(o||new Error("Database has errors or is in-memory without recovery option"))))})}backup(){let r=this.toBackupPath(this.path);return Q.copy(this.path,r,{preserveSymlinks:!1})}toBackupPath(r){return`${r}.backup`}async checkIntegrity(r){this.logger.trace(`[storage ${this.name}] checkIntegrity(full: ${r})`);let e=await this.whenConnected,t=await this.get(e,r?"PRAGMA integrity_check":"PRAGMA quick_check"),i=r?t.integrity_check:t.quick_check;return e.isErroneous?`${i} (last error: ${e.lastError})`:e.isInMemory?`${i} (in-memory!)`:i}async connect(r,e=!0){this.logger.trace(`[storage ${this.name}] open(${r}, retryOnBusy: ${e})`);try{return await this.doConnect(r)}catch(t){if(this.logger.error(`[storage ${this.name}] open(): Unable to open DB due to ${t}`),t.code==="SQLITE_BUSY"&&e)return await lt(n.BUSY_OPEN_TIMEOUT),this.connect(r,!1);try{await Py.promises.unlink(r);try{await Q.rename(this.toBackupPath(r),r,!1)}catch{}return await this.doConnect(r)}catch(i){return this.logger.error(`[storage ${this.name}] open(): Unable to use backup due to ${i}`),this.doConnect(n.IN_MEMORY_PATH)}}}handleSQLiteError(r,e){r.isErroneous=!0,r.lastError=e,this.logger.error(e)}doConnect(r){return new Promise((e,t)=>{import("@vscode/sqlite3").then(i=>{let o=this.logger.isTracing?i.default.verbose().Database:i.default.Database,s={db:new o(r,a=>{if(a)return s.db&&a.code!=="SQLITE_CANTOPEN"?s.db.close(()=>t(a)):t(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(()=>t(c)))}),isInMemory:r===n.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}`))},t)})}exec(r,e){return new Promise((t,i)=>{r.db.exec(e,o=>o?(this.handleSQLiteError(r,`[storage ${this.name}] exec(): ${o}`),i(o)):t())})}get(r,e){return new Promise((t,i)=>{r.db.get(e,(o,s)=>o?(this.handleSQLiteError(r,`[storage ${this.name}] get(): ${o}`),i(o)):t(s))})}all(r,e){return new Promise((t,i)=>{r.db.all(e,(o,s)=>o?(this.handleSQLiteError(r,`[storage ${this.name}] all(): ${o}`),i(o)):t(s))})}transaction(r,e){return new Promise((t,i)=>{r.db.serialize(()=>{r.db.run("BEGIN TRANSACTION"),e(),r.db.run("END TRANSACTION",o=>o?(this.handleSQLiteError(r,`[storage ${this.name}] transaction(): ${o}`),i(o)):t())})})}prepare(r,e,t,i){let o=r.db.prepare(e),s=a=>{this.handleSQLiteError(r,`[storage ${this.name}] prepare(): ${a} (${e}). Details: ${i()}`)};o.on("error",s),t(o),o.finalize(a=>{a&&s(a),o.removeListener("error",s)})}},Ey=class n{static{this.VSCODE_TRACE_STORAGE="VSCODE_TRACE_STORAGE"}constructor(r){r&&typeof r.logTrace=="function"&&process.env[n.VSCODE_TRACE_STORAGE]&&(this.logTrace=r.logTrace),r&&typeof r.logError=="function"&&(this.logError=r.logError)}get isTracing(){return!!this.logTrace}trace(r){this.logTrace?.(r)}error(r){this.logError?.(r)}}});var Ke,j6,Cy,Ty,wP,pm,fm,fu,bP,fl,mm,mu,Zt=I(()=>{Z();Ke=O("telemetryService"),j6=O("customEndpointTelemetryService"),Cy="telemetry.currentSessionDate",Ty="telemetry.firstSessionDate",wP="telemetry.lastSessionDate",pm="telemetry.machineId",fm="telemetry.sqmId",fu="telemetry.devDeviceId",bP="telemetry",fl="telemetry.telemetryLevel",mm="telemetry.enableCrashReporter",mu="telemetry.enableTelemetry"});import*as ky from"fs";var js,hm,gm,vm,ml,hl,ym,_y,hu,Ry=I(()=>{Jt();he();q();$();we();_s();ce();nr();dy();IP();te();Rn();Zt();Rr();ze();js=class n extends T{constructor(e,t){super();this.logService=e;this.fileService=t;this._onDidChangeStorage=this._register(new b);this.onDidChangeStorage=this._onDidChangeStorage.event;this._onDidCloseStorage=this._register(new b);this.onDidCloseStorage=this._onDidCloseStorage.event;this._storage=this._register(new li(new Tn,{hint:1}));this.initializePromise=void 0;this.whenInitPromise=new At;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=this._register(await this.doCreate());this._storage.dispose(),this._storage=e,this._register(e.onDidChangeStorage(i=>this._onDidChangeStorage.fire(i))),await this.doInit(e);let t=e.getBoolean(du);t===void 0?e.set(du,!0):t&&e.set(du,!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,t){return this._storage.get(e,t)}set(e,t){return this._storage.set(e,t)}delete(e){return this._storage.delete(e)}optimize(){return this._storage.optimize()}async close(){let e=new ii(!1);await this.doClose(),e.stop(),e.elapsed()>n.LOG_SLOW_CLOSE_THRESHOLD&&await this.logSlowClose(e),this._onDidCloseStorage.fire()}async logSlowClose(e){if(this.path)try{let t=bS(Array.from(this._storage.items.entries()).map(([o,s])=>({key:o,length:s.length})),(o,s)=>s.length-o.length,5).map(o=>`${o.key}:${o.length}`).join(", "),i=(await this.fileService.stat(x.file(this.path))).size;this.logService.warn(`[storage main] detected slow close() operation: Time: ${e.elapsed()}ms, DB size: ${i}b, Large Keys: ${t}`)}catch(t){this.logService.error("[storage main] figuring out stats for slow DB on close() resulted in an error",t)}}async doClose(){this.initializePromise&&await this.initializePromise,this.state=2,await this._storage.close()}},hm=class n extends js{constructor(e,t,i,o){super(i,o);this.profile=e;this.options=t}static{this.STORAGE_NAME="state.vscdb"}get path(){if(!this.options.useInMemoryStorage)return N(this.profile.globalStorageHome.with({scheme:W.file}).fsPath,n.STORAGE_NAME)}async doCreate(){return new li(new On(this.path??On.IN_MEMORY_PATH,{logging:this.createLoggingOptions()}),this.path?void 0:{hint:1})}},gm=class extends hm{},vm=class extends hm{constructor(r,e,t,i){super(e.defaultProfile,r,t,i)}async doInit(r){await super.doInit(r),this.updateTelemetryState(r)}updateTelemetryState(r){r.get(Ty,void 0)===void 0&&r.set(Ty,new Date().toUTCString());let t=r.get(Cy,void 0),i=new Date().toUTCString();r.set(wP,typeof t>"u"?null:t),r.set(Cy,i)}},ml=class n extends js{constructor(e,t,i,o,s,a){super(o,s);this.options=e;this.storageFolderPath=t;this.applicationStorage=i;this.crossAppIPCService=a}static{this.STORAGE_NAME="state.vscdb"}get path(){if(!this.options.useInMemoryStorage)return N(this.storageFolderPath,n.STORAGE_NAME)}async doCreate(){let{storageFilePath:e,wasCreated:t}=await this.prepareStorageFolder();this.logService.info(`[shared storage] Creating shared storage database at '${e}' (wasCreated: ${t})`),this.sharedDatabase=new _y(e,{logging:this.createLoggingOptions(),useWAL:!0,busyTimeout:2e3},this.crossAppIPCService,this.logService),this._register(this.sharedDatabase),this.logService.info(`[shared storage] Initializing fallback application storage (type: ${this.applicationStorage instanceof hl?"host":"local"}, 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=this._register(new Gf(this.sharedDatabase,{hint:t?0:void 0}));return i.setFallbackStorage(this.applicationStorage.storage,this.applicationStorage instanceof hl),i}async doInit(e){await super.doInit(e),this.sharedDatabase?.setInitialized()}get applicationStorageItems(){return this.applicationStorage.items}async prepareStorageFolder(){if(this.options.useInMemoryStorage)return{storageFilePath:On.IN_MEMORY_PATH,wasCreated:!0};let e=N(this.storageFolderPath,n.STORAGE_NAME);return await Q.exists(this.storageFolderPath)?{storageFilePath:e,wasCreated:!1}:(await ky.promises.mkdir(this.storageFolderPath,{recursive:!0}),{storageFilePath:e,wasCreated:!0})}},hl=class extends js{constructor(e,t,i){super(t,i);this.path=e}async doCreate(){this.logService.info(`[shared storage] Opening host application storage at '${this.path}'`);try{return new li(new On(this.path,{logging:this.createLoggingOptions()}))}catch(e){throw this.logService.error(`[shared storage] Failed to open host application storage at '${this.path}': ${e}`),e}}},ym=class n extends js{constructor(e,t,i,o,s){super(i,s);this.workspace=e;this.options=t;this.environmentService=o}static{this.WORKSPACE_STORAGE_NAME="state.vscdb"}static{this.WORKSPACE_META_NAME="workspace.json"}get path(){if(!this.options.useInMemoryStorage)return N(this.environmentService.workspaceStorageHome.with({scheme:W.file}).fsPath,this.workspace.id,n.WORKSPACE_STORAGE_NAME)}async doCreate(){let{storageFilePath:e,wasCreated:t}=await this.prepareWorkspaceStorageFolder();return new li(new On(e,{logging:this.createLoggingOptions()}),{hint:this.options.useInMemoryStorage?1:t?0:void 0})}async prepareWorkspaceStorageFolder(){if(this.options.useInMemoryStorage)return{storageFilePath:On.IN_MEMORY_PATH,wasCreated:!0};let e=N(this.environmentService.workspaceStorageHome.with({scheme:W.file}).fsPath,this.workspace.id),t=N(e,n.WORKSPACE_STORAGE_NAME);return await Q.exists(e)?{storageFilePath:t,wasCreated:!1}:(await ky.promises.mkdir(e,{recursive:!0}),this.ensureWorkspaceStorageFolderMeta(e),{storageFilePath:t,wasCreated:!0})}async ensureWorkspaceStorageFolderMeta(e){let t;if($t(this.workspace)?t={folder:this.workspace.uri.toString()}:ct(this.workspace)&&(t={workspace:this.workspace.configPath.toString()}),t)try{let i=N(e,n.WORKSPACE_META_NAME);await Q.exists(i)||await Q.writeFile(i,JSON.stringify(t,void 0,2))}catch(i){this.logService.error(`[storage main] ensureWorkspaceStorageFolderMeta(): Unable to create workspace storage metadata due to ${i}`)}}},_y=class extends T{constructor(e,t,i,o){super();this.crossAppIPCService=i;this.logService=o;this._onDidChangeItemsExternal=this._register(new b);this.onDidChangeItemsExternal=this._onDidChangeItemsExternal.event;this.initialized=!1;this.database=new On(e,t),this.registerListeners()}registerListeners(){this._register(this.crossAppIPCService.onDidReceiveMessage(e=>{if(e.type!=="sharedStorage:changed")return;if(!this.initialized){this.logService.trace("[shared storage] Ignoring cross-app IPC message received before initialization");return}let{changed:t,deleted:i}=e.data;this.logService.trace(`[shared storage] Received cross-app IPC change: ${t?.length??0} changed, ${i?.length??0} deleted`),this._onDidChangeItemsExternal.fire({changed:t?new Map(t):void 0,deleted:i?new Set(i):void 0})}))}setInitialized(){this.initialized=!0}async getItems(){let e=await this.database.getItems();return this.logService.trace(`[shared storage] Initialized with ${e.size} items`),e}async updateItems(e){await this.database.updateItems(e);let t=e.insert?.size??0,i=e.delete?.size??0;this.logService.trace(`[shared storage] Sending cross-app IPC change: ${t} changed, ${i} deleted`),this.crossAppIPCService.sendMessage({type:"sharedStorage:changed",data:{changed:e.insert?Array.from(e.insert.entries()):void 0,deleted:e.delete?Array.from(e.delete.values()):void 0}})}async optimize(){return this.database.optimize()}async close(e){return this.database.close(e)}},hu=class extends js{get path(){}async doCreate(){return new li(new Tn,{hint:1})}}});var Dy,vu,gl,Ay=I(()=>{he();ot();$();Oe();si();je();te();Dy=class extends T{constructor(e,t,i,o){super();this.storagePath=e;this.logService=i;this.fileService=o;this.storage=Object.create(null);this.lastSavedStorageContents="";this.initializing=void 0;this.closing=void 0;this.flushDelayer=this._register(new Tr(t===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,t){let i=this.storage[e];return Vt(i)?t:i}setItem(e,t){this.setItems([{key:e,data:t}])}setItems(e){let t=!1;for(let{key:i,data:o}of e)this.storage[i]!==o&&(Vt(o)?Hr(this.storage[i])||(this.storage[i]=void 0,t=!0):(this.storage[i]=o,t=!0));t&&this.save()}removeItem(e){Hr(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,H.fromString(e),{atomic:{postfix:".vsctmp"}}),this.lastSavedStorageContents=e}catch(t){this.logService.error(t)}}async close(){return this.closing||(this.closing=this.flushDelayer.trigger(()=>this.doSave(),0)),this.closing}},vu=class extends T{constructor(r,e,t,i){super(),this.fileStorage=this._register(new Dy(e.stateResource,r,t,i))}async init(){await this.fileStorage.init()}getItem(r,e){return this.fileStorage.getItem(r,e)}};vu=E([g(1,wi),g(2,B),g(3,Me)],vu);gl=class extends vu{setItem(r,e){this.fileStorage.setItem(r,e)}setItems(r){this.fileStorage.setItems(r)}removeItem(r){this.fileStorage.removeItem(r)}close(){return this.fileStorage.close()}}});var Zo,Mi,Im,SP=I(()=>{ce();si();je();te();xi();Zi();en();Oe();Ay();Zo=class extends ll{constructor(e,t,i,o,s){super(i,o,t,s);this.stateReadonlyService=e;this.nativeEnvironmentService=i}getStoredProfiles(){return this.stateReadonlyService.getItem(Zo.PROFILES_KEY,[]).map(t=>({...t,location:Fe(t.location)?this.uriIdentityService.extUri.joinPath(this.profilesHome,t.location):x.revive(t.location)}))}getStoredProfileAssociations(){return this.stateReadonlyService.getItem(Zo.PROFILE_ASSOCIATIONS_KEY,{})}getDefaultProfileExtensionsLocation(){return this.uriIdentityService.extUri.joinPath(x.file(this.nativeEnvironmentService.extensionsPath).with({scheme:this.profilesHome.scheme}),"extensions.json")}};Zo=E([g(0,am),g(1,Rt),g(2,vr),g(3,Me),g(4,B)],Zo);Mi=class extends Zo{constructor(e,t,i,o,s){super(e,t,i,o,s);this.stateService=e}saveStoredProfiles(e){e.length?this.stateService.setItem(Mi.PROFILES_KEY,e.map(t=>({...t,location:this.uriIdentityService.extUri.relativePath(this.profilesHome,t.location)}))):this.stateService.removeItem(Mi.PROFILES_KEY)}saveStoredProfileAssociations(e){e.emptyWindows||e.workspaces?this.stateService.setItem(Mi.PROFILE_ASSOCIATIONS_KEY,e):this.stateService.removeItem(Mi.PROFILE_ASSOCIATIONS_KEY)}};Mi=E([g(0,Et),g(1,Rt),g(2,vr),g(3,Me),g(4,B)],Mi);Im=class extends Mi{constructor(r,e,t,i){super(new gl(0,e,i,t),r,e,t,i)}async init(){return await this.stateService.init(),super.init()}};Im=E([g(0,Rt),g(1,vr),g(2,Me),g(3,B)],Im)});function oA(n){let r=n.parentAppUserHome;if(r)return xP(n.args,r)}function xP(n,r){let e=n["agent-plugins-dir"];if(e)return Er(e);let t=St.VSCODE_AGENT_PLUGINS;if(t)return t;let i=St.VSCODE_PORTABLE;return i?N(i,"agent-plugins"):oe(r,"agent-plugins").fsPath}var Ur,vl,es=I(()=>{gt();si();je();Z();te();qt();Zi();en();SP();xi();ce();yi();we();Ur=Dr,vl=class extends Mi{constructor(r,e,t,i,o,s){super(r,e,t,i,o),this.agentPluginsHome=x.file(xP(t.args,oe(t.userHome,s.dataFolderName)))}createDefaultProfile(){let r={...super.createDefaultProfile(),agentPluginsHome:this.agentPluginsHome};if(!process.isEmbeddedApp)return r;let e=this.environmentService.parentAppUserRoamingDataHome;if(!e)return r;let t=oA(this.nativeEnvironmentService);return{...r,keybindingsResource:oe(e,"keybindings.json"),promptsHome:oe(e,"prompts"),mcpResource:oe(e,"mcp.json"),agentPluginsHome:t?x.file(t):this.agentPluginsHome}}getAssociatedEmptyWindows(){let r=[];for(let e of this.profilesObject.emptyWindows.keys())r.push({id:e});return r}};vl=E([g(0,Et),g(1,Rt),g(2,vr),g(3,Me),g(4,B),g(5,Te)],vl)});import*as Ly from"electron";var yu,yl,My=I(()=>{he();q();$();Z();te();yu=O("crossAppIPCService"),yl=class extends T{constructor(e){super();this.logService=e;this._connected=!1;this._isServer=!1;this.reconnectTimer=this._register(new Ls);this._onDidConnect=this._register(new b);this.onDidConnect=this._onDidConnect.event;this._onDidDisconnect=this._register(new b);this.onDidDisconnect=this._onDidDisconnect.event;this._onDidReceiveMessage=this._register(new b);this.onDidReceiveMessage=this._onDidReceiveMessage.event}get isSupported(){return Ly.crossAppIPC!==void 0}get initialized(){return this.ipc!==void 0}get connected(){return this._connected}get isServer(){return this._isServer}initialize(){if(this.ipc)return;let e=Ly.crossAppIPC;if(!e){this.logService.info("CrossAppIPCService: crossAppIPC not available");return}let t=e.createCrossAppIPC();this.ipc=t,t.on("connected",()=>{this._connected=!0,this._isServer=t.isServer,this.logService.info(`CrossAppIPCService: connected (isServer=${t.isServer})`),this._onDidConnect.fire(t.isServer)}),t.on("message",i=>{this._onDidReceiveMessage.fire(i.data)}),t.on("disconnected",i=>{this.logService.info(`CrossAppIPCService: disconnected (${i})`),this._connected=!1,this._isServer=!1,this._onDidDisconnect.fire(i),i==="peer-disconnected"&&this.reconnectTimer.cancelAndSet(()=>t.connect(),1e3)}),t.connect(),this.logService.info("CrossAppIPCService: connecting to peer")}sendMessage(e){this.ipc?.connected&&this.ipc.postMessage(e)}dispose(){this.ipc?.close(),super.dispose()}};yl=E([g(0,B)],yl)});var ts,Il,Ir,wl,Fn=I(()=>{ce();q();$();we();si();je();Z();Ct();te();Rn();Ry();en();es();Zi();ze();My();ts=O("storageMainService"),Il=class extends T{constructor(e,t,i,o,s,a,l){super();this.logService=e;this.environmentService=t;this.userDataProfilesService=i;this.lifecycleMainService=o;this.fileService=s;this.uriIdentityService=a;this.crossAppIPCService=l;this.shutdownReason=void 0;this._onDidChangeProfileStorage=this._register(new b);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(3),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[,t]of this.mapProfileToStorage)e.join("profileStorage",t.close());for(let[,t]of this.mapWorkspaceToStorage)e.join("workspaceStorage",t.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 t=this.mapProfileToStorage.get(e.profile.id);t&&e.join(t.close())}))}createApplicationStorage(){this.logService.trace("StorageMainService: creating application storage");let e=new vm(this.getStorageOptions(),this.userDataProfilesService,this.logService,this.fileService);return this._register(S.once(e.onDidCloseStorage)(()=>{this.logService.trace("StorageMainService: closed application storage")})),e}createApplicationSharedStorage(){this.logService.info("StorageMainService: creating application shared storage");let e=N(this.environmentService.appSharedDataHome.with({scheme:W.file}).fsPath,"sharedStorage"),t=this.applicationStorage,i=this.environmentService.parentAppUserRoamingDataHome;if(i){let s=N(i.with({scheme:W.file}).fsPath,"globalStorage","state.vscdb");this.logService.info(`StorageMainService: creating application shared storage with host app fallback at '${s}'`),t=this._register(new hl(s,this.logService,this.fileService))}else this.logService.info("StorageMainService: creating application shared storage with local application storage fallback");let o=new ml(this.getStorageOptions(),e,t,this.logService,this.fileService,this.crossAppIPCService);return this._register(S.once(o.onDidCloseStorage)(()=>{this.logService.trace("StorageMainService: closed application shared storage")})),o}profileStorage(e){if(nm(e))return this.applicationStorage;let t=this.mapProfileToStorage.get(e.id);if(!t){this.logService.trace(`StorageMainService: creating profile storage (${e.name})`),t=this._register(this.createProfileStorage(e)),this.mapProfileToStorage.set(e.id,t);let i=t.onDidChangeStorage(o=>this._onDidChangeProfileStorage.fire({...o,storage:t,profile:e}));S.once(t.onDidCloseStorage)(()=>{this.logService.trace(`StorageMainService: closed profile storage (${e.name})`),this.mapProfileToStorage.delete(e.id),i.dispose()})}return t}createProfileStorage(e){return this.shutdownReason===2?new hu(this.logService,this.fileService):new gm(e,this.getStorageOptions(),this.logService,this.fileService)}workspaceStorage(e){let t=this.mapWorkspaceToStorage.get(e.id);return t||(this.logService.trace(`StorageMainService: creating workspace storage (${e.id})`),t=this._register(this.createWorkspaceStorage(e)),this.mapWorkspaceToStorage.set(e.id,t),S.once(t.onDidCloseStorage)(()=>{this.logService.trace(`StorageMainService: closed workspace storage (${e.id})`),this.mapWorkspaceToStorage.delete(e.id)})),t}createWorkspaceStorage(e){return this.shutdownReason===2?new hu(this.logService,this.fileService):new ym(e,this.getStorageOptions(),this.logService,this.environmentService,this.fileService)}isUsed(e){let t=x.file(e);for(let i of[this.applicationStorage,this.applicationSharedStorage,...this.mapProfileToStorage.values(),...this.mapWorkspaceToStorage.values()])if(i.path&&this.uriIdentityService.extUri.isEqualOrParent(x.file(i.path),t))return!0;return!1}};Il=E([g(0,B),g(1,vr),g(2,Ur),g(3,ye),g(4,Me),g(5,Rt),g(6,yu)],Il);Ir=O("applicationStorageMainService"),wl=class extends cu{constructor(e,t){super();this.userDataProfilesService=e;this.storageMainService=t;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:W.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")}};wl=E([g(0,Dr),g(1,ts)],wl)});import{app as aA}from"electron";var bu,bl,Oy=I(()=>{wt();q();En();$();ce();Xt();et();qd();Lt();Z();te();Rn();Fn();Kt();bu=O("proxyAuthService"),bl=class extends T{constructor(e,t,i,o,s,a){super();this.logService=e;this.windowsMainService=t;this.encryptionMainService=i;this.applicationStorageMainService=o;this.configurationService=s;this.environmentMainService=a;this.PROXY_CREDENTIALS_SERVICE_KEY="proxy-credentials://";this.pendingProxyResolves=new Map;this.currentDialog=void 0;this.cancelledAuthInfoHashes=new Set;this.sessionCredentials=new Map;this.registerListeners()}registerListeners(){let e=S.fromNodeEventEmitter(aA,"login",(t,i,o,s,a)=>({event:t,authInfo:{...s,attempt:o.firstAuthAttempt?1:2},callback:a}));this._register(e(this.onLogin,this))}async lookupAuthorization(e){return this.onLogin({authInfo:e})}async onLogin({event:e,authInfo:t,callback:i}){if(!t.isProxy)return;e?.preventDefault();let o=String(cr({scheme:t.scheme,host:t.host,port:t.port})),s,a=this.pendingProxyResolves.get(o);if(a)this.logService.trace("auth#onLogin (proxy) - pending proxy handling found"),s=await a;else{this.logService.trace("auth#onLogin (proxy) - no pending proxy handling found, starting new"),a=this.resolveProxyCredentials(t,o),this.pendingProxyResolves.set(o,a);try{s=await a}finally{this.pendingProxyResolves.delete(o)}}return i?.(s?.username,s?.password),s}async resolveProxyCredentials(e,t){this.logService.trace("auth#resolveProxyCredentials (proxy) - enter");try{let i=await this.doResolveProxyCredentials(e,t);if(i)return this.logService.trace("auth#resolveProxyCredentials (proxy) - got credentials"),i;this.logService.trace("auth#resolveProxyCredentials (proxy) - did not get credentials")}finally{this.logService.trace("auth#resolveProxyCredentials (proxy) - exit")}}async doResolveProxyCredentials(e,t){if(this.logService.trace("auth#doResolveProxyCredentials - enter",e),this.environmentMainService.extensionTestsLocationURI){try{let d=Buffer.from(e.realm,"base64").toString("utf-8");if(d.startsWith("{"))return JSON.parse(d)}catch{}return}let i=(this.configurationService.getValue("http.proxy")||"").trim()||(process.env.https_proxy||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.HTTP_PROXY||"").trim()||void 0;if(i?.indexOf("@")!==-1){let d=x.parse(i),u=d.authority.indexOf("@");if(u!==-1){if(e.attempt>1){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - ignoring previously used config/envvar credentials");return}this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - found config/envvar credentials to use");let f=d.authority.substring(0,u),m=f.indexOf(":");return m!==-1?{username:f.substring(0,m),password:f.substring(m+1)}:{username:f,password:""}}}let o=e.attempt===1&&this.sessionCredentials.get(t);if(o){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - found session credentials to use");let{username:d,password:u}=o;return{username:d,password:u}}let s,a;try{let d=this.applicationStorageMainService.get(this.PROXY_CREDENTIALS_SERVICE_KEY+t,-1);if(d){let u=JSON.parse(await this.encryptionMainService.decrypt(d));s=u.username,a=u.password}}catch(d){this.logService.error(d)}if(e.attempt===1&&typeof s=="string"&&typeof a=="string")return this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - found stored credentials to use"),this.sessionCredentials.set(t,{username:s,password:a}),{username:s,password:a};let l=this.currentDialog,c=this.currentDialog=(async()=>{await l;let d=await this.showProxyCredentialsDialog(e,t,s,a);return this.currentDialog===c&&(this.currentDialog=void 0),d})();return c}async showProxyCredentialsDialog(e,t,i,o){if(this.cancelledAuthInfoHashes.has(t)){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - login dialog was cancelled before, not showing again");return}let s=this.windowsMainService.getFocusedWindow()||this.windowsMainService.getLastActiveWindow();if(!s){this.logService.trace("auth#doResolveProxyCredentials (proxy) - exit - no opened window found to show dialog in");return}this.logService.trace(`auth#doResolveProxyCredentials (proxy) - asking window ${s.id} to handle proxy login`);let a=this.sessionCredentials.get(t),l={authInfo:e,username:a?.username??i,password:a?.password??o,replyChannel:`vscode:proxyAuthResponse:${ke()}`};s.sendWhenReady("vscode:openProxyAuthenticationDialog",Ce.None,l);let c=await new Promise(d=>{let u=async(f,m,v)=>{if(m===l.replyChannel)if(this.logService.trace(`auth#doResolveProxyCredentials - exit - received credentials from window ${s.id}`),s.win?.webContents.off("ipc-message",u),v){let y={username:v.username,password:v.password};try{if(v.remember){let C=await this.encryptionMainService.encrypt(JSON.stringify(y));this.applicationStorageMainService.store(this.PROXY_CREDENTIALS_SERVICE_KEY+t,C,-1,1)}else this.applicationStorageMainService.remove(this.PROXY_CREDENTIALS_SERVICE_KEY+t,-1)}catch(C){this.logService.error(C)}d({username:y.username,password:y.password})}else this.cancelledAuthInfoHashes.add(t),d(void 0)};s.win?.webContents.on("ipc-message",u)});return this.sessionCredentials.set(t,c),c}};bl=E([g(0,B),g(1,qe),g(2,tl),g(3,Ir),g(4,ue),g(5,_e)],bl)});var Wn,Sl=I(()=>{Z();Wn=O("backupMainService")});function PP(n){return typeof n?.backupFolder=="string"}function EP(n){let r=[];try{Array.isArray(n.workspaces)&&(r=n.workspaces.map(e=>({workspace:{id:e.id,configPath:x.parse(e.configURIPath)},remoteAuthority:e.remoteAuthority})))}catch{}return r}function CP(n){let r=[];try{Array.isArray(n.folders)&&(r=n.folders.map(e=>({folderUri:x.parse(e.folderUri),remoteAuthority:e.remoteAuthority})))}catch{}return r}var TP=I(()=>{ce()});function _P(n){return n?.hasOwnProperty("folderUri")}var kP=I(()=>{});import{createHash as Fy}from"crypto";function ho(n){function r(){let e=n.scheme===W.file?hr(n):n.toString();return re||(e=e.toLowerCase()),Fy("md5").update(e).digest("hex")}return{id:r(),configPath:n}}function wm(n,r){function e(){if(n.scheme!==W.file)return Fy("md5").update(n.toString()).digest("hex");if(!r)return;let i;return re?i=r.ino:V?i=r.birthtime.getTime():F&&(typeof r.birthtimeMs=="number"?i=Math.floor(r.birthtimeMs):i=r.birthtime.getTime()),Fy("md5").update(n.fsPath).update(i?String(i):"").digest("hex")}let t=e();if(typeof t=="string")return{id:t,uri:n}}function Su(){return{id:(Date.now()+Math.round(Math.random()*1e3)).toString()}}var IV,bm=I(()=>{ze();X();gt();IV=128/4});import{createHash as cA}from"crypto";var go,RP=I(()=>{ni();ze();we();X();gt();nr();TP();et();Lt();xi();je();te();kP();Rr();bm();go=class{constructor(r,e,t,i){this.configurationService=e;this.logService=t;this.stateService=i;this.workspaces=[];this.folders=[];this.emptyWindows=[];this.backupUriComparer=Je;this.backupPathComparer={isEqual:(r,e)=>Fo(r,e,!re)};this.backupHome=r.backupHome}static{this.backupWorkspacesMetadataStorageKey="backupWorkspaces"}async initialize(){let r=this.stateService.getItem(go.backupWorkspacesMetadataStorageKey)??{workspaces:[],folders:[],emptyWindows:[]};this.emptyWindows=await this.validateEmptyWorkspaces(r.emptyWindows),this.workspaces=await this.validateWorkspaces(EP(r)),this.folders=await this.validateFolders(CP(r)),this.storeWorkspacesMetadata()}getWorkspaceBackups(){return this.isHotExitOnExitAndWindowClose()?[]:this.workspaces.slice(0)}getFolderBackups(){return this.isHotExitOnExitAndWindowClose()?[]:this.folders.slice(0)}isHotExitEnabled(){return this.getHotExitConfig()!==em.OFF}isHotExitOnExitAndWindowClose(){return this.getHotExitConfig()===em.ON_EXIT_AND_WINDOW_CLOSE}getHotExitConfig(){return this.configurationService.getValue()?.files?.hotExit||em.ON_EXIT}getEmptyWindowBackups(){return this.emptyWindows.slice(0)}registerWorkspaceBackup(r,e){this.workspaces.some(i=>r.workspace.id===i.workspace.id)||(this.workspaces.push(r),this.storeWorkspacesMetadata());let t=N(this.backupHome,r.workspace.id);return e?this.moveBackupFolder(t,e).then(()=>t):t}async moveBackupFolder(r,e){if(await Q.exists(r)&&await this.convertToEmptyWindowBackup(r),await Q.exists(e))try{await Q.rename(e,r,!1)}catch(t){this.logService.error(`Backup: Could not move backup folder to new location: ${t.toString()}`)}}registerFolderBackup(r){return this.folders.some(e=>this.backupUriComparer.isEqual(r.folderUri,e.folderUri))||(this.folders.push(r),this.storeWorkspacesMetadata()),N(this.backupHome,this.getFolderHash(r))}registerEmptyWindowBackup(r){return this.emptyWindows.some(e=>!!e.backupFolder&&this.backupPathComparer.isEqual(e.backupFolder,r.backupFolder))||(this.emptyWindows.push(r),this.storeWorkspacesMetadata()),N(this.backupHome,r.backupFolder)}async validateWorkspaces(r){if(!Array.isArray(r))return[];let e=new Set,t=[];for(let i of r){let o=i.workspace;if(!ct(o))return[];if(!e.has(o.id)){e.add(o.id);let s=N(this.backupHome,o.id);await this.doHasBackups(s)?o.configPath.scheme!==W.file||await Q.exists(o.configPath.fsPath)?t.push(i):await this.convertToEmptyWindowBackup(s):await this.deleteStaleBackup(s)}}return t}async validateFolders(r){if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){let o=i.folderUri,s=this.backupUriComparer.getComparisonKey(o);if(!t.has(s)){t.add(s);let a=N(this.backupHome,this.getFolderHash(i));await this.doHasBackups(a)?o.scheme!==W.file||await Q.exists(o.fsPath)?e.push(i):await this.convertToEmptyWindowBackup(a):await this.deleteStaleBackup(a)}}return e}async validateEmptyWorkspaces(r){if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){let o=i.backupFolder;if(typeof o!="string")return[];if(!t.has(o)){t.add(o);let s=N(this.backupHome,o);await this.doHasBackups(s)?e.push(i):await this.deleteStaleBackup(s)}}return e}async deleteStaleBackup(r){try{await Q.rm(r,1)}catch(e){this.logService.error(`Backup: Could not delete stale backup: ${e.toString()}`)}}prepareNewEmptyWindowBackup(){let r=Su();for(;this.emptyWindows.some(e=>!!e.backupFolder&&this.backupPathComparer.isEqual(e.backupFolder,r.id));)r=Su();return{backupFolder:r.id}}async convertToEmptyWindowBackup(r){let e=this.prepareNewEmptyWindowBackup(),t=N(this.backupHome,e.backupFolder);try{await Q.rename(r,t,!1)}catch(i){return this.logService.error(`Backup: Could not rename backup folder: ${i.toString()}`),!1}return this.emptyWindows.push(e),!0}async getDirtyWorkspaces(){let r=[];for(let e of this.workspaces)await this.hasBackups(e)&&r.push(e);for(let e of this.folders)await this.hasBackups(e)&&r.push(e);return r}hasBackups(r){let e;return PP(r)?e=N(this.backupHome,r.backupFolder):_P(r)?e=N(this.backupHome,this.getFolderHash(r)):e=N(this.backupHome,r.workspace.id),this.doHasBackups(e)}async doHasBackups(r){try{let e=await Q.readdir(r);for(let t of e)try{if((await Q.readdir(N(r,t))).length>0)return!0}catch{}}catch{}return!1}storeWorkspacesMetadata(){let r={workspaces:this.workspaces.map(({workspace:e,remoteAuthority:t})=>{let i={id:e.id,configURIPath:e.configPath.toString()};return t&&(i.remoteAuthority=t),i}),folders:this.folders.map(({folderUri:e,remoteAuthority:t})=>{let i={folderUri:e.toString()};return t&&(i.remoteAuthority=t),i}),emptyWindows:this.emptyWindows.map(({backupFolder:e,remoteAuthority:t})=>{let i={backupFolder:e};return t&&(i.remoteAuthority=t),i})};this.stateService.setItem(go.backupWorkspacesMetadataStorageKey,r)}getFolderHash(r){let e=r.folderUri,t;return e.scheme===W.file?t=re?e.fsPath:e.fsPath.toLowerCase():t=e.toString().toLowerCase(),cA("md5").update(t).digest("hex")}};go=E([g(0,_e),g(1,ue),g(2,B),g(3,Et)],go)});function xu(n,r,e=dA){let t=n.find((f,m)=>f.length>0&&f[0]!=="-"&&r.hasOwnProperty(f)&&r[f].type==="subcommand"),i={},o=["_"],s=[],a={},l;for(let f in r){let m=r[f];m.type==="subcommand"?f===t&&(l=m):(m.alias&&(i[f]=m.alias),m.type==="string"||m.type==="string[]"?(o.push(f),m.deprecates&&o.push(...m.deprecates)):m.type==="boolean"&&(s.push(f),m.deprecates&&s.push(...m.deprecates)),m.global&&(a[f]=m))}if(l&&t){let f=a;for(let C in l.options)f[C]=l.options[C];let m=n.filter(C=>C!==t),v=e.getSubcommandReporter?e.getSubcommandReporter(t):void 0,y=xu(m,f,v);return{[t]:y,_:[]}}let c=(0,DP.default)(n,{string:o,boolean:s,alias:i}),d={},u=c;d._=c._.map(f=>String(f)).filter(f=>f.length>0),delete u._;for(let f in r){let m=r[f];if(m.type==="subcommand")continue;m.alias&&delete u[m.alias];let v=u[f];if(m.deprecates)for(let y of m.deprecates)u.hasOwnProperty(y)&&(v||(v=u[y],v&&e.onDeprecatedOption(y,m.deprecationMessage||h(2044,null,f))),delete u[y]);if(typeof v<"u"){if(m.type==="string[]"){if(Array.isArray(v)||(v=[v]),!m.allowEmptyValue){let y=v.filter(C=>C.length>0);y.length!==v.length&&(e.onEmptyValue(f),v=y.length>0?y:void 0)}}else m.type==="string"&&(Array.isArray(v)?(v=v.pop(),e.onMultipleValues(f,v)):!v&&!m.allowEmptyValue&&(e.onEmptyValue(f),v=void 0));d[f]=v,m.deprecationMessage&&e.onDeprecatedOption(f,m.deprecationMessage)}delete u[f]}for(let f in u)e.onUnknownOption(f);return d}var DP,JV,Wy,Sm,dA,Uy=I(()=>{DP=Fb(Bg(),1);X();xe();JV={o:h(2069,null),e:h(2053,null),t:h(2083,null),m:h(2064,null)},Wy=["tunnel","serve-web","agent"],Sm={chat:{type:"subcommand",description:"Pass in a prompt to run in a chat session in the current working directory.",options:{_:{type:"string[]",description:h(2073,null)},mode:{type:"string",cat:"o",alias:"m",args:"mode",description:h(2041,null)},"add-file":{type:"string[]",cat:"o",alias:"a",args:"path",description:h(2036,null)},maximize:{type:"boolean",cat:"o",description:h(2040,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:h(2076,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:h(2067,null)},profile:{type:"string",cat:"o",args:"profileName",description:h(2072,null)},help:{type:"boolean",alias:"h",description:h(2055,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:h(2042,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:h(2042,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:h(2042,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:h(2045,null)},merge:{type:"boolean",cat:"o",alias:"m",args:["path1","path2","base","result"],description:h(2065,null)},add:{type:"boolean",cat:"o",alias:"a",args:"folder",description:h(2035,null)},remove:{type:"boolean",cat:"o",args:"folder",description:h(2074,null)},goto:{type:"boolean",cat:"o",alias:"g",args:"file:line[:character]",description:h(2054,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:h(2066,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:h(2075,null)},agents:{type:"boolean",cat:"o",deprecates:["sessions"],description:h(2038,null)},wait:{type:"boolean",cat:"o",alias:"w",description:h(2093,null)},waitMarkerFilePath:{type:"string"},locale:{type:"string",cat:"o",args:"locale",description:h(2061,null)},"user-data-dir":{type:"string",cat:"o",args:"dir",description:h(2090,null)},profile:{type:"string",cat:"o",args:"profileName",description:h(2072,null)},help:{type:"boolean",cat:"o",alias:"h",description:h(2055,null)},"extensions-dir":{type:"string",deprecates:["extensionHomePath"],cat:"e",args:"dir",description:h(2052,null)},"extensions-download-dir":{type:"string"},"builtin-extensions-dir":{type:"string"},"shared-data-dir":{type:"string"},"list-extensions":{type:"boolean",cat:"e",description:h(2060,null)},"agent-plugins-dir":{type:"string"},"agents-user-data-dir":{type:"string"},"agents-extensions-dir":{type:"string"},"show-versions":{type:"boolean",cat:"e",description:h(2077,null)},category:{type:"string",allowEmptyValue:!0,cat:"e",description:h(2039,null),args:"category"},"install-extension":{type:"string[]",cat:"e",args:"ext-id | path",description:h(2059,null)},"pre-release":{type:"boolean",cat:"e",description:h(2058,null)},"uninstall-extension":{type:"string[]",cat:"e",args:"ext-id",description:h(2085,null)},"update-extensions":{type:"boolean",cat:"e",description:h(2088,null)},"enable-proposed-api":{type:"string[]",allowEmptyValue:!0,cat:"e",args:"ext-id",description:h(2051,null)},"add-mcp":{type:"string[]",cat:"m",args:"json",description:h(2037,null)},version:{type:"boolean",cat:"t",alias:"v",description:h(2092,null)},verbose:{type:"boolean",cat:"t",global:!0,description:h(2091,null)},log:{type:"string[]",cat:"t",args:"level",global:!0,description:h(2063,null)},status:{type:"boolean",alias:"s",cat:"t",description:h(2078,null)},"prof-startup":{type:"boolean",cat:"t",description:h(2071,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:h(2048,null)},"disable-extension":{type:"string[]",cat:"t",args:"ext-id",description:h(2047,null)},sync:{type:"string",cat:"t",description:h(2084,null),args:["on | off"]},"inspect-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugPluginHost"],args:"port",cat:"t",description:h(2057,null)},"inspect-brk-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugBrkPluginHost"],args:"port",cat:"t",description:h(2056,null)},"disable-lcd-text":{type:"boolean",cat:"t",description:h(2050,null)},"disable-gpu":{type:"boolean",cat:"t",description:h(2049,null)},"disable-chromium-sandbox":{type:"boolean",cat:"t",description:h(2046,null)},sandbox:{type:"boolean"},"locate-shell-integration-path":{type:"string",cat:"t",args:["shell"],description:h(2062,null)},telemetry:{type:"boolean",cat:"t",description:h(2081,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-search":{type:"string",deprecates:["debugSearch"],allowEmptyValue:!0},"inspect-brk-search":{type:"string",deprecates:["debugBrkSearch"],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"},"disable-updates":{type:"boolean"},"share-secrets-with-agents-app":{type:"boolean"},transient:{type:"boolean",cat:"t",description:h(2082,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"},"open-chat-session":{type:"string"},"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[]"}},dA={onUnknownOption:()=>{},onMultipleValues:()=>{},onEmptyValue:()=>{},onDeprecatedOption:()=>{}}});var xm,AP=I(()=>{q();$();xm=class extends T{constructor(){super(...arguments);this._onCloseEmitter=this._register(new b);this._onReloadEmitter=this._register(new b);this._onTerminateEmitter=this._register(new b);this._onAttachEmitter=this._register(new b)}static{this.ChannelName="extensionhostdebugservice"}call(e,t,i){switch(t){case"close":return Promise.resolve(this._onCloseEmitter.fire({sessionId:i[0]}));case"reload":return Promise.resolve(this._onReloadEmitter.fire({sessionId:i[0]}));case"terminate":return Promise.resolve(this._onTerminateEmitter.fire({sessionId:i[0]}));case"attach":return Promise.resolve(this._onAttachEmitter.fire({sessionId:i[0],port:i[1],subId:i[2]}))}throw new Error("Method not implemented.")}listen(e,t,i){switch(t){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 Pm,LP=I(()=>{ot();$();Xt();Bd();Uy();Kt();AP();Pm=class extends xm{constructor(e){super();this.windowsMainService=e}call(e,t,i){return t==="openExtensionDevelopmentHostWindow"?this.openExtensionDevelopmentHostWindow(i[0],i[1]):t==="attachToCurrentWindowRenderer"?this.attachToCurrentWindowRenderer(i[0]):super.call(e,t,i)}async attachToCurrentWindowRenderer(e){let t=this.windowsMainService.getWindowById(e);return t?.win?this.openCdp(t.win,!0):{success:!1}}async openExtensionDevelopmentHostWindow(e,t){let i=xu(e,Sm);i.debugRenderer=t;let o=i.extensionDevelopmentPath;if(!o)return{success:!1};let[s]=await this.windowsMainService.openExtensionDevelopmentHostWindow(o,{context:5,cli:i,forceProfile:i.profile,forceTempProfile:i["profile-temp"]});if(!t)return{success:!0};let a=s.win;return a?this.openCdp(a,!1):{success:!0}}async openCdpServer(e,t){let{createServer:i}=await import("http"),o=i((d,u)=>{if(d.url==="/json/list"||d.url==="/json"){u.setHeader("Content-Type","application/json"),u.end(JSON.stringify([{description:"VS Code Renderer",devtoolsFrontendUrl:"",id:e,title:"VS Code Renderer",type:"page",url:"vscode://renderer",webSocketDebuggerUrl:c}]));return}else if(d.url==="/json/version"){u.setHeader("Content-Type","application/json"),u.end(JSON.stringify({Browser:"VS Code Renderer","Protocol-Version":"1.3",webSocketDebuggerUrl:c}));return}u.statusCode=404,u.end()});await new Promise(d=>o.listen(0,"127.0.0.1",d));let s=o.address(),a=typeof s=="object"&&s?s.port:0,c=`${typeof s=="string"?s:`ws://127.0.0.1:${s?.port}`}/${e}`;return o.on("upgrade",(d,u)=>{if(!d.url?.includes(e)){u.end();return}let f=Sx(d,u,{debugLabel:"extension-host-cdp-"+ke(),enableMessageSplitting:!1});f&&t(f)}),{server:o,wsUrl:c,port:a}}async openCdp(e,t){let i=e.webContents.debugger,o=i.isAttached()?1/0:0,s=ke(),a=t?`page-${s}`:void 0,{server:l,wsUrl:c,port:d}=await this.openCdpServer(s,u=>{o++===0&&i.attach();let f=new j;f.add(u);let m=C=>{f.isDisposed||u.write(H.fromString(JSON.stringify(C)))},v=(C,w,_,D)=>m({method:w,params:_,sessionId:D||a}),y=()=>{u.end(),f.dispose()};e.addListener("close",y),f.add(G(()=>e.removeListener("close",y))),i.addListener("message",v),f.add(G(()=>i.removeListener("message",v))),f.add(u.onData(C=>{let w;try{w=JSON.parse(C.toString())}catch(D){console.error("error reading cdp line",D);return}if(t){let D={targetId:s,type:"page",title:"VS Code Renderer",url:"vscode://renderer"};if(w.method==="Target.setDiscoverTargets"){m({id:w.id,sessionId:w.sessionId,result:{}}),m({method:"Target.targetCreated",sessionId:w.sessionId,params:{targetInfo:{...D,attached:!1,canAccessOpener:!1}}});return}if(w.method==="Target.attachToTarget"){m({id:w.id,sessionId:w.sessionId,result:{sessionId:a}}),m({method:"Target.attachedToTarget",params:{sessionId:a,targetInfo:{...D,attached:!0,canAccessOpener:!1},waitingForDebugger:!1}});return}if(w.method==="Target.setAutoAttach"||w.method==="Target.attachToBrowserTarget"){m({id:w.id,sessionId:w.sessionId,result:w.method==="Target.attachToBrowserTarget"?{sessionId:"browser"}:{}});return}if(w.method==="Target.getTargets"){m({id:w.id,sessionId:w.sessionId,result:{targetInfos:[{...D,attached:!0}]}});return}}let _=w.sessionId===a?void 0:w.sessionId;i.sendCommand(w.method,w.params,_).then(D=>m({id:w.id,sessionId:w.sessionId,result:D})).catch(D=>m({id:w.id,sessionId:w.sessionId,error:{code:0,message:D.message}}))})),f.add(u.onClose(()=>{--o===0&&i.detach()}))});return e.on("close",()=>l.close()),{rendererDebugAddr:c,success:!0,port:d}}}});function Eu(n){let r=n;return!!r?.hostName&&!!r?.errorMessage}var uA,Pu,Em=I(()=>{Z();uA="diagnosticsService",Pu=O(uA)});function By(n,r=!1){let e=0,t=n.length,i="",o=0,s=16,a=0;function l(y){let C=0,w=0;for(;C<y;){let _=n.charCodeAt(e);if(_>=48&&_<=57)w=w*16+_-48;else if(_>=65&&_<=70)w=w*16+_-65+10;else if(_>=97&&_<=102)w=w*16+_-97+10;else break;e++,C++}return C<y&&(w=-1),w}function c(y){e=y,i="",o=0,s=16,a=0}function d(){let y=e;if(n.charCodeAt(e)===48)e++;else for(e++;e<n.length&&Pl(n.charCodeAt(e));)e++;if(e<n.length&&n.charCodeAt(e)===46)if(e++,e<n.length&&Pl(n.charCodeAt(e)))for(e++;e<n.length&&Pl(n.charCodeAt(e));)e++;else return a=3,n.substring(y,e);let C=e;if(e<n.length&&(n.charCodeAt(e)===69||n.charCodeAt(e)===101))if(e++,(e<n.length&&n.charCodeAt(e)===43||n.charCodeAt(e)===45)&&e++,e<n.length&&Pl(n.charCodeAt(e))){for(e++;e<n.length&&Pl(n.charCodeAt(e));)e++;C=e}else a=3;return n.substring(y,C)}function u(){let y="",C=e;for(;;){if(e>=t){y+=n.substring(C,e),a=2;break}let w=n.charCodeAt(e);if(w===34){y+=n.substring(C,e),e++;break}if(w===92){if(y+=n.substring(C,e),e++,e>=t){a=2;break}switch(n.charCodeAt(e++)){case 34:y+='"';break;case 92:y+="\\";break;case 47:y+="/";break;case 98:y+="\b";break;case 102:y+="\f";break;case 110:y+=`
`;break;case 114:y+="\r";break;case 116:y+="	";break;case 117:{let D=l(4);D>=0?y+=String.fromCharCode(D):a=4;break}default:a=5}C=e;continue}if(w>=0&&w<=31)if(Cm(w)){y+=n.substring(C,e),a=2;break}else a=6;e++}return y}function f(){if(i="",a=0,o=e,e>=t)return o=t,s=17;let y=n.charCodeAt(e);if(Ny(y)){do e++,i+=String.fromCharCode(y),y=n.charCodeAt(e);while(Ny(y));return s=15}if(Cm(y))return e++,i+=String.fromCharCode(y),y===13&&n.charCodeAt(e)===10&&(e++,i+=`
`),s=14;switch(y){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++,i=u(),s=10;case 47:{let C=e-1;if(n.charCodeAt(e+1)===47){for(e+=2;e<t&&!Cm(n.charCodeAt(e));)e++;return i=n.substring(C,e),s=12}if(n.charCodeAt(e+1)===42){e+=2;let w=t-1,_=!1;for(;e<w;){if(n.charCodeAt(e)===42&&n.charCodeAt(e+1)===47){e+=2,_=!0;break}e++}return _||(e++,a=1),i=n.substring(C,e),s=13}return i+=String.fromCharCode(y),e++,s=16}case 45:if(i+=String.fromCharCode(y),e++,e===t||!Pl(n.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 i+=d(),s=11;default:for(;e<t&&m(y);)e++,y=n.charCodeAt(e);if(o!==e){switch(i=n.substring(o,e),i){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return i+=String.fromCharCode(y),e++,s=16}}function m(y){if(Ny(y)||Cm(y))return!1;switch(y){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let y;do y=f();while(y>=12&&y<=15);return y}return{setPosition:c,getPosition:()=>e,scan:r?v:f,getToken:()=>s,getTokenValue:()=>i,getTokenOffset:()=>o,getTokenLength:()=>e-o,getTokenError:()=>a}}function Ny(n){return n===32||n===9||n===11||n===12||n===160||n===5760||n>=8192&&n<=8203||n===8239||n===8287||n===12288||n===65279}function Cm(n){return n===10||n===13||n===8232||n===8233}function Pl(n){return n>=48&&n<=57}function Oi(n,r=[],e=Tm.DEFAULT){let t=null,i=[],o=[];function s(l){Array.isArray(i)?i.push(l):t!==null&&(i[t]=l)}return El(n,{onObjectBegin:()=>{let l={};s(l),o.push(i),i=l,t=null},onObjectProperty:l=>{t=l},onObjectEnd:()=>{i=o.pop()},onArrayBegin:()=>{let l=[];s(l),o.push(i),i=l,t=null},onArrayEnd:()=>{i=o.pop()},onLiteralValue:s,onError:(l,c,d)=>{r.push({error:l,offset:c,length:d})}},e),i[0]}function MP(n,r=[],e=Tm.DEFAULT){let t={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(l){t.type==="property"&&(t.length=l-t.offset,t=t.parent)}function o(l){return t.children.push(l),l}El(n,{onObjectBegin:l=>{t=o({type:"object",offset:l,length:-1,parent:t,children:[]})},onObjectProperty:(l,c,d)=>{t=o({type:"property",offset:c,length:-1,parent:t,children:[]}),t.children.push({type:"string",value:l,offset:c,length:d,parent:t})},onObjectEnd:(l,c)=>{t.length=l+c-t.offset,t=t.parent,i(l+c)},onArrayBegin:(l,c)=>{t=o({type:"array",offset:l,length:-1,parent:t,children:[]})},onArrayEnd:(l,c)=>{t.length=l+c-t.offset,t=t.parent,i(l+c)},onLiteralValue:(l,c,d)=>{o({type:rs(l),offset:c,length:d,parent:t,value:l}),i(c+d)},onSeparator:(l,c,d)=>{t.type==="property"&&(l===":"?t.colonOffset=c:l===","&&i(c))},onError:(l,c,d)=>{r.push({error:l,offset:c,length:d})}},e);let a=t.children[0];return a&&delete a.parent,a}function Vy(n,r){if(!n)return;let e=n;for(let t of r)if(typeof t=="string"){if(e.type!=="object"||!Array.isArray(e.children))return;let i=!1;for(let o of e.children)if(Array.isArray(o.children)&&o.children[0].value===t){e=o.children[1],i=!0;break}if(!i)return}else{let i=t;if(e.type!=="array"||i<0||!Array.isArray(e.children)||i>=e.children.length)return;e=e.children[i]}return e}function El(n,r,e=Tm.DEFAULT){let t=By(n,!1);function i(K){return K?()=>K(t.getTokenOffset(),t.getTokenLength()):()=>!0}function o(K){return K?ve=>K(ve,t.getTokenOffset(),t.getTokenLength()):()=>!0}let s=i(r.onObjectBegin),a=o(r.onObjectProperty),l=i(r.onObjectEnd),c=i(r.onArrayBegin),d=i(r.onArrayEnd),u=o(r.onLiteralValue),f=o(r.onSeparator),m=i(r.onComment),v=o(r.onError),y=e&&e.disallowComments,C=e&&e.allowTrailingComma;function w(){for(;;){let K=t.scan();switch(t.getTokenError()){case 4:_(14);break;case 5:_(15);break;case 3:_(13);break;case 1:y||_(11);break;case 2:_(12);break;case 6:_(16);break}switch(K){case 12:case 13:y?_(10):m();break;case 16:_(1);break;case 15:case 14:break;default:return K}}}function _(K,ve=[],yt=[]){if(v(K),ve.length+yt.length>0){let Ot=t.getToken();for(;Ot!==17;){if(ve.indexOf(Ot)!==-1){w();break}else if(yt.indexOf(Ot)!==-1)break;Ot=w()}}}function D(K){let ve=t.getTokenValue();return K?u(ve):a(ve),w(),!0}function k(){switch(t.getToken()){case 11:{let K=0;try{K=JSON.parse(t.getTokenValue()),typeof K!="number"&&(_(2),K=0)}catch{_(2)}u(K);break}case 7:u(null);break;case 8:u(!0);break;case 9:u(!1);break;default:return!1}return w(),!0}function A(){return t.getToken()!==10?(_(3,[],[2,5]),!1):(D(!1),t.getToken()===6?(f(":"),w(),J()||_(4,[],[2,5])):_(5,[],[2,5]),!0)}function de(){s(),w();let K=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(K||_(4,[],[]),f(","),w(),t.getToken()===2&&C)break}else K&&_(6,[],[]);A()||_(4,[],[2,5]),K=!0}return l(),t.getToken()!==2?_(7,[2],[]):w(),!0}function L(){c(),w();let K=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(K||_(4,[],[]),f(","),w(),t.getToken()===4&&C)break}else K&&_(6,[],[]);J()||_(4,[],[4,5]),K=!0}return d(),t.getToken()!==4?_(8,[4],[]):w(),!0}function J(){switch(t.getToken()){case 3:return L();case 1:return de();case 10:return D(!0);default:return k()}}return w(),t.getToken()===17?e.allowEmptyContent?!0:(_(4,[],[]),!1):J()?(t.getToken()!==17&&_(9,[],[]),!0):(_(4,[],[]),!1)}function rs(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(n){if(Array.isArray(n))return"array"}else return"null";return"object"}default:return"null"}}var Tm,rn=I(()=>{(r=>r.DEFAULT={allowTrailingComma:!0})(Tm||={})});var _m,Ue,Cu=I(()=>{ar();_m=(i=>(i[i.Ignore=0]="Ignore",i[i.Info=1]="Info",i[i.Warning=2]="Warning",i[i.Error=3]="Error",i))(_m||{});(a=>{let n="error",r="warning",e="warn",t="info",i="ignore";function o(l){return l?$r(n,l)?3:$r(r,l)||$r(e,l)?2:$r(t,l)?1:0:0}a.fromValue=o;function s(l){switch(l){case 3:return n;case 2:return r;case 1:return t;default:return i}}a.toString=s})(_m||={});Ue=_m});function or(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;let r=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([e,t])=>{r[e]=t&&typeof t=="object"?or(t):t}),r}function OP(n){if(!n||typeof n!="object")return n;let r=[n];for(;r.length>0;){let e=r.shift();Object.freeze(e);for(let t in e)if(FP.call(e,t)){let i=e[t];typeof i=="object"&&!Object.isFrozen(i)&&!AS(i)&&r.push(i)}}return n}function WP(n,r){return $y(n,r,new Set)}function $y(n,r,e){if(Vt(n))return n;let t=r(n);if(typeof t<"u")return t;if(Array.isArray(n)){let i=[];for(let o of n)i.push($y(o,r,e));return i}if(Ge(n)){if(e.has(n))throw new Error("Cannot clone recursive data-structure");e.add(n);let i={};for(let o in n)FP.call(n,o)&&(i[o]=$y(n[o],r,e));return e.delete(n),i}return n}function km(n,r,e=!0){return Ge(n)?(Ge(r)&&Object.keys(r).forEach(t=>{t in n?e&&(Ge(n[t])&&Ge(r[t])?km(n[t],r[t],e):n[t]=r[t]):n[t]=r[t]}),n):r}function ci(n,r){if(n===r)return!0;if(n==null||r===null||r===void 0||typeof n!=typeof r||typeof n!="object"||Array.isArray(n)!==Array.isArray(r))return!1;let e,t;if(Array.isArray(n)){if(n.length!==r.length)return!1;for(e=0;e<n.length;e++)if(!ci(n[e],r[e]))return!1}else{let i=[];for(t in n)i.push(t);i.sort();let o=[];for(t in r)o.push(t);if(o.sort(),!ci(i,o))return!1;for(e=0;e<i.length;e++)if(!ci(n[i[e]],r[i[e]]))return!1}return!0}function Rm(n){let r=new Set;return JSON.stringify(n,(e,t)=>{if(Ge(t)||Array.isArray(t)){if(r.has(t))return"[Circular]";r.add(t)}return typeof t=="bigint"?`[BigInt ${t.toString()}]`:t})}function qy(n,r){let e=r.toLowerCase(),t=Object.keys(n).find(i=>i.toLowerCase()===e);return t?n[t]:n[r]}var FP,di=I(()=>{Oe();FP=Object.prototype.hasOwnProperty});function Dm(n,r){let e=or(n),t=(e.buttons??[]).map(a=>Td(a).withMnemonic),i=(n.buttons||[]).map((a,l)=>l),o=0,s=e.cancelId??t.length-1;if(t.length>1){let a=typeof s=="number"?t[s]:void 0;if(re||V){if(typeof a=="string"&&t.length>1&&s!==1){t.splice(s,1),t.splice(1,0,a);let l=i[s];i.splice(s,1),i.splice(1,0,l),s=1}re&&t.length>1&&(t=t.reverse(),i=i.reverse(),o=t.length-1,typeof a=="string"&&(s=o-1))}else if(F&&typeof a=="string"&&t.length>1&&s!==t.length-1){t.splice(s,1),t.push(a);let l=i[s];i.splice(s,1),i.push(l),s=t.length-1}}return e.buttons=t,e.defaultId=o,e.cancelId=s,e.noLink=!0,e.title=e.title||r.nameLong,{options:e,buttonIndeces:i}}var bH,SH,Ky=I(()=>{gt();Cu();xe();Z();so();X();di();bH=O("dialogService"),SH=O("fileDialogService")});import Js from"electron";var ui,Cl,Qs=I(()=>{he();En();so();$();vd();X();nr();xe();Ky();Z();te();qt();Rr();ui=O("dialogMainService"),Cl=class{constructor(r,e){this.logService=r;this.productService=e;this.windowFileDialogLocks=new Map;this.windowDialogQueues=new Map;this.noWindowDialogueQueue=new Di}pickFileFolder(r,e){return this.doPick({...r,pickFolders:!0,pickFiles:!0,title:h(2028,null)},e)}pickFolder(r,e){let t={...r,pickFolders:!0,title:h(2030,null)};return F&&(t={...t,buttonLabel:Td(h(2033,null)).withMnemonic}),this.doPick(t,e)}pickFile(r,e){return this.doPick({...r,pickFiles:!0,title:h(2029,null)},e)}pickWorkspace(r,e){let t=h(2032,null),i=Td(h(2031,null)).withMnemonic,o=lP;return this.doPick({...r,pickFiles:!0,title:t,filters:o,buttonLabel:i},e)}async doPick(r,e){let t={title:r.title,buttonLabel:r.buttonLabel,filters:r.filters,defaultPath:r.defaultPath};(typeof r.pickFiles=="boolean"||typeof r.pickFolders=="boolean")&&(t.properties=void 0,r.pickFiles&&r.pickFolders&&(t.properties=["multiSelections","openDirectory","openFile","createDirectory"])),t.properties||(t.properties=["multiSelections",r.pickFolders?"openDirectory":"openFile","createDirectory"]),V&&t.properties.push("treatPackageAsDirectory");let i=await this.showOpenDialog(t,(e||Js.BrowserWindow.getFocusedWindow())??void 0);if(i?.filePaths&&i.filePaths.length>0)return i.filePaths}getWindowDialogQueue(r){if(r){let e=this.windowDialogQueues.get(r.id);return e||(e=new Di,this.windowDialogQueues.set(r.id,e)),e}else return this.noWindowDialogueQueue}showMessageBox(r,e){return this.getWindowDialogQueue(e).queue(async()=>{let{options:t,buttonIndeces:i}=Dm(r,this.productService),o;return e?o=await Js.dialog.showMessageBox(e,t):o=await Js.dialog.showMessageBox(t),{response:i[o.response],checkboxChecked:o.checkboxChecked}})}async showSaveDialog(r,e){let t=this.acquireFileDialogLock(r,e);if(!t)return this.logService.error("[DialogMainService]: file save dialog is already or will be showing for the window with the same configuration"),{canceled:!0,filePath:""};try{return await this.getWindowDialogQueue(e).queue(async()=>{let i;return e?i=await Js.dialog.showSaveDialog(e,r):i=await Js.dialog.showSaveDialog(r),i.filePath=this.normalizePath(i.filePath),i})}finally{ut(t)}}normalizePath(r){return r&&V&&(r=Sn(r)),r}normalizePaths(r){return r.map(e=>this.normalizePath(e))}async showOpenDialog(r,e){r.defaultPath&&(await Q.exists(r.defaultPath)||(r.defaultPath=void 0));let t=this.acquireFileDialogLock(r,e);if(!t)return this.logService.error("[DialogMainService]: file open dialog is already or will be showing for the window with the same configuration"),{canceled:!0,filePaths:[]};try{return await this.getWindowDialogQueue(e).queue(async()=>{let i;return e?i=await Js.dialog.showOpenDialog(e,r):i=await Js.dialog.showOpenDialog(r),i.filePaths=this.normalizePaths(i.filePaths),i})}finally{ut(t)}}acquireFileDialogLock(r,e){if(!e)return T.None;this.logService.trace("[DialogMainService]: request to acquire file dialog lock",r);let t=this.windowFileDialogLocks.get(e.id);t||(t=new Set,this.windowFileDialogLocks.set(e.id,t));let i=cr(r);if(!t.has(i))return this.logService.trace("[DialogMainService]: new file dialog lock created",r),t.add(i),G(()=>{this.logService.trace("[DialogMainService]: file dialog lock disposed",r),t?.delete(i),t?.size===0&&this.windowFileDialogLocks.delete(e.id)})}};Cl=E([g(0,B),g(1,Te)],Cl)});async function NP(n,r,e){for(let i of n){let o=i.openedWorkspace;if(ct(o)){let s=await e(o);if(s){if(s.folders.some(a=>Je.isEqualOrParent(r,a.uri)))return i}else if(Je.isEqualOrParent(r,o.configPath))return i}}let t=n.filter(i=>$t(i.openedWorkspace)&&Je.isEqualOrParent(r,i.openedWorkspace.uri));if(t.length)return t.sort((i,o)=>-(i.openedWorkspace.uri.path.length-o.openedWorkspace.uri.path.length))[0]}function vo(n,r){for(let e of n)if(ct(e.openedWorkspace)&&Je.isEqual(e.openedWorkspace.configPath,r)||$t(e.openedWorkspace)&&Je.isEqual(e.openedWorkspace.uri,r))return e}function BP(n,r){let e=t=>r.some(i=>Je.isEqual(x.file(i),x.file(t)));for(let t of n)if(t.config?.extensionDevelopmentPath?.some(i=>e(i)))return t}var zy=I(()=>{gt();ce();Rr()});function VP(n,r,e){let t,i,o,s,a;if(r){for(s=r.offset,a=s+r.length,o=s;o>0&&!Tu(n,o-1);)o--;let D=a;for(;D<n.length&&!Tu(n,D);)D++;i=n.substring(o,D),t=pA(i,e)}else i=n,t=0,o=0,s=0,a=n.length;let l=fA(e,n),c=!1,d=0,u;e.insertSpaces?u=jy(" ",e.tabSize||4):u="	";let f=By(i,!1),m=!1;function v(){return l+jy(u,t+d)}function y(){let D=f.scan();for(c=!1;D===15||D===14;)c=c||D===14,D=f.scan();return m=D===16||f.getTokenError()!==0,D}let C=[];function w(D,k,A){!m&&k<a&&A>s&&n.substring(k,A)!==D&&C.push({offset:k,length:A-k,content:D})}let _=y();if(_!==17){let D=f.getTokenOffset()+o,k=jy(u,t);w(k,o,D)}for(;_!==17;){let D=f.getTokenOffset()+f.getTokenLength()+o,k=y(),A="";for(;!c&&(k===12||k===13);){let L=f.getTokenOffset()+o;w(" ",D,L),D=f.getTokenOffset()+f.getTokenLength()+o,A=k===12?v():"",k=y()}if(k===2)_!==1&&(d--,A=v());else if(k===4)_!==3&&(d--,A=v());else{switch(_){case 3:case 1:d++,A=v();break;case 5:case 12:A=v();break;case 13:c?A=v():A=" ";break;case 6:A=" ";break;case 10:if(k===6){A="";break}case 7:case 8:case 9:case 11:case 2:case 4:k===12||k===13?A=" ":k!==5&&k!==17&&(m=!0);break;case 16:m=!0;break}c&&(k===12||k===13)&&(A=v())}let de=f.getTokenOffset()+o;w(A,D,de),_=k}return C}function jy(n,r){let e="";for(let t=0;t<r;t++)e+=n;return e}function pA(n,r){let e=0,t=0,i=r.tabSize||4;for(;e<n.length;){let o=n.charAt(e);if(o===" ")t++;else if(o==="	")t+=i;else break;e++}return Math.floor(t/i)}function fA(n,r){for(let e=0;e<r.length;e++){let t=r.charAt(e);if(t==="\r")return e+1<r.length&&r.charAt(e+1)===`
`?`\r
`:"\r";if(t===`
`)return`
`}return n&&n.eol||`
`}function Tu(n,r){return`\r
`.indexOf(n.charAt(r))!==-1}var HP=I(()=>{rn()});function Jy(n,r,e,t,i){let o=r.slice(),a=MP(n,[]),l,c;for(;o.length>0&&(c=o.pop(),l=Vy(a,o),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 d=Vy(l,[c]);if(d!==void 0)if(e===void 0){if(!d.parent)throw new Error("Malformed AST");let u=l.children.indexOf(d.parent),f,m=d.parent.offset+d.parent.length;if(u>0){let v=l.children[u-1];f=v.offset+v.length}else f=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return Tl(n,{offset:f,length:m-f,content:""},t)}else return Tl(n,{offset:d.offset,length:d.length,content:JSON.stringify(e)},t);else{if(e===void 0)return[];let u=`${JSON.stringify(c)}: ${JSON.stringify(e)}`,f=i?i(l.children.map(v=>v.children[0].value)):l.children.length,m;if(f>0){let v=l.children[f-1];m={offset:v.offset+v.length,length:0,content:","+u}}else l.children.length===0?m={offset:l.offset+1,length:0,content:u}:m={offset:l.offset+1,length:0,content:u+","};return Tl(n,m,t)}}else if(l.type==="array"&&typeof c=="number"&&Array.isArray(l.children))if(e!==void 0){let d=`${JSON.stringify(e)}`,u;if(l.children.length===0||c===0)u={offset:l.offset+1,length:0,content:l.children.length===0?d:d+","};else{let f=c===-1||c>l.children.length?l.children.length:c,m=l.children[f-1];u={offset:m.offset+m.length,length:0,content:","+d}}return Tl(n,u,t)}else{let d=c,u=l.children[d],f;if(l.children.length===1)f={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===d){let m=l.children[d-1],v=m.offset+m.length,y=l.offset+l.length;f={offset:v,length:y-2-v,content:""}}else f={offset:u.offset,length:l.children[d+1].offset-u.offset,content:""};return Tl(n,f,t)}else throw new Error(`Can not add ${typeof c!="number"?"index":"property"} to parent of type ${l.type}`);else return e===void 0?[]:Tl(n,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(e)},t)}function Tl(n,r,e){let t=Gy(n,r),i=r.offset,o=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;i>0&&!Tu(t,i-1);)i--;for(;o<t.length&&!Tu(t,o);)o++}let s=VP(t,{offset:i,length:o-i},e);for(let l=s.length-1;l>=0;l--){let c=s[l];t=Gy(t,c),i=Math.min(i,c.offset),o=Math.max(o,c.offset+c.length),o+=c.content.length-c.length}let a=n.length-(t.length-o)-i;return[{offset:i,length:a,content:t.substring(i,o)}]}function Gy(n,r){return n.substring(0,r.offset)+r.content+n.substring(r.offset+r.length)}function Qy(n,r){let e=r.slice(0).sort((i,o)=>{let s=i.offset-o.offset;return s===0?i.length-o.length:s}),t=n.length;for(let i=e.length-1;i>=0;i--){let o=e[i];if(o.offset+o.length<=t)n=Gy(n,o);else throw new Error("Overlapping edit");t=o.offset}return n}var Xy=I(()=>{rn();HP()});function yo(n){return n.scheme===W.vscodeRemote?n.authority:void 0}var _l=I(()=>{ze()});function Am(n){return n.hasOwnProperty("workspace")}function _u(n){return n.hasOwnProperty("folderUri")}function qP(n){return n.hasOwnProperty("fileUri")}function KP(n){return zP(n)||jP(n)}function zP(n){let r=n;return typeof r?.path=="string"&&(!r.name||typeof r.name=="string")}function jP(n){let r=n;return typeof r?.uri=="string"&&(!r.name||typeof r.name=="string")}function GP(n,r,e,t,i){if(n.scheme!==t.scheme)return{name:e,uri:n.toString(!0)};let o=r?void 0:i.relativePath(t,n);if(o!==void 0)o.length===0?o=".":F&&(o=$P(o));else if(n.scheme===W.file)o=n.fsPath,F&&(o=$P(o));else if(i.isEqualAuthority(n.authority,t.authority))o=n.path;else return{name:e,uri:n.toString(!0)};return{name:e,path:o}}function $P(n){return n=Cd(n),r1(n)||(n=wn(n)),n}function JP(n,r,e){let t=[],i=new Set,o=e.dirname(r);for(let s of n){let a;if(zP(s))s.path&&(a=e.resolvePath(o,s.path));else if(jP(s))try{a=x.parse(s.uri),a.path[0]!==pe.sep&&(a=a.with({path:pe.sep+a.path}))}catch(l){console.warn(l)}if(a){let l=e.getComparisonKey(a);if(!i.has(l)){i.add(l);let c=s.name||e.basenameOrAuthority(a);t.push(new rm({uri:a,name:c,index:t.length},s))}}}return t}function hA(n){let r=n;return typeof r?.workspace=="object"&&typeof r.workspace.id=="string"&&typeof r.workspace.configPath=="string"}function gA(n){return typeof n?.folderUri=="string"}function vA(n){return typeof n?.fileUri=="string"}function QP(n,r){let e={workspaces:[],files:[]};if(n){let t=function(o,s){for(let a=0;a<o.length;a++)try{s(o[a],a)}catch(l){r.warn(`Error restoring recent entry ${JSON.stringify(o[a])}: ${l.toString()}. Skip entry.`)}},i=n;Array.isArray(i.entries)&&t(i.entries,o=>{let s=o.label,a=o.remoteAuthority;hA(o)?e.workspaces.push({label:s,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:x.parse(o.workspace.configPath)}}):gA(o)?e.workspaces.push({label:s,remoteAuthority:a,folderUri:x.parse(o.folderUri)}):vA(o)&&e.files.push({label:s,remoteAuthority:a,fileUri:x.parse(o.fileUri)})})}return e}function XP(n){let r={entries:[]},e=(t,i)=>t&&t!==i.fsPath&&t!==i.path;for(let t of n.workspaces)_u(t)?r.entries.push({folderUri:t.folderUri.toString(),label:e(t.label,t.folderUri)?t.label:void 0,remoteAuthority:t.remoteAuthority}):r.entries.push({workspace:{id:t.workspace.id,configPath:t.workspace.configPath.toString()},label:e(t.label,t.workspace.configPath)?t.label:void 0,remoteAuthority:t.remoteAuthority});for(let t of n.files)r.entries.push({fileUri:t.fileUri.toString(),label:e(t.label,t.fileUri)?t.label:void 0,remoteAuthority:t.remoteAuthority});return r}var Yy,Lm=I(()=>{ni();rn();Xy();so();ze();we();X();gt();ce();Z();_l();Rr();Yy=O("workspacesService")});import*as Zy from"fs";import yA from"electron";var pi,kl,is=I(()=>{q();rn();$();ze();we();gt();nr();xe();Sl();Qs();Lt();Z();te();es();zy();Rr();Lm();bm();pi=O("workspacesManagementMainService"),kl=class extends T{constructor(e,t,i,o,s){super();this.environmentMainService=e;this.logService=t;this.userDataProfilesMainService=i;this.backupMainService=o;this.dialogMainService=s;this._onDidDeleteUntitledWorkspace=this._register(new b);this.onDidDeleteUntitledWorkspace=this._onDidDeleteUntitledWorkspace.event;this._onDidEnterWorkspace=this._register(new b);this.onDidEnterWorkspace=this._onDidEnterWorkspace.event;this.untitledWorkspaces=[];this.untitledWorkspacesHome=this.environmentMainService.untitledWorkspacesHome}async initialize(){this.untitledWorkspaces=[];try{let e=(await Q.readdir(this.untitledWorkspacesHome.with({scheme:W.file}).fsPath)).map(t=>oe(this.untitledWorkspacesHome,t,gy));for(let t of e){let i=ho(t),o=await this.resolveLocalWorkspace(t);o?this.untitledWorkspaces.push({workspace:i,remoteAuthority:o.remoteAuthority}):await this.deleteUntitledWorkspace(i)}}catch(e){e.code!=="ENOENT"&&this.logService.warn(`Unable to read folders in ${this.untitledWorkspacesHome} (${e}).`)}}resolveLocalWorkspace(e){return this.doResolveLocalWorkspace(e,t=>Zy.promises.readFile(t,"utf8"))}doResolveLocalWorkspace(e,t){if(this.isWorkspacePath(e)&&e.scheme===W.file)try{let i=t(e.fsPath);return i instanceof Promise?i.then(o=>this.doResolveWorkspace(e,o),o=>{}):this.doResolveWorkspace(e,i)}catch{return}}isWorkspacePath(e){return vy(e,this.environmentMainService)||kn(e)}doResolveWorkspace(e,t){try{let i=this.doParseStoredWorkspace(e,t),o=ho(e);return{id:o.id,configPath:o.configPath,folders:JP(i.folders,o.configPath,Je),remoteAuthority:i.remoteAuthority,transient:i.transient}}catch(i){this.logService.warn(i.toString())}}doParseStoredWorkspace(e,t){let i=Oi(t);if(i&&Array.isArray(i.folders))i.folders=i.folders.filter(o=>KP(o));else throw new Error(`${e.toString(!0)} looks like an invalid workspace file.`);return i}async createUntitledWorkspace(e,t){let{workspace:i,storedWorkspace:o}=this.newUntitledWorkspace(e,t),s=i.configPath.fsPath;return await Zy.promises.mkdir(Le(s),{recursive:!0}),await Q.writeFile(s,JSON.stringify(o,null,"	")),this.untitledWorkspaces.push({workspace:i,remoteAuthority:t}),i}newUntitledWorkspace(e=[],t){let i=(Date.now()+Math.round(Math.random()*1e3)).toString(),o=oe(this.untitledWorkspacesHome,i),s=oe(o,gy),a=[];for(let l of e)a.push(GP(l.uri,!0,l.name,o,Je));return{workspace:ho(s),storedWorkspace:{folders:a,remoteAuthority:t}}}async getWorkspaceIdentifier(e){return ho(e)}isUntitledWorkspace(e){return vy(e.configPath,this.environmentMainService)}async deleteUntitledWorkspace(e){this.isUntitledWorkspace(e)&&(await this.doDeleteUntitledWorkspace(e),this.userDataProfilesMainService.unsetWorkspace(e),this._onDidDeleteUntitledWorkspace.fire(e))}async doDeleteUntitledWorkspace(e){let t=hr(e.configPath);try{await Q.rm(Le(t));let i=N(this.environmentMainService.workspaceStorageHome.with({scheme:W.file}).fsPath,e.id);await Q.exists(i)&&await Q.writeFile(N(i,"obsolete"),""),this.untitledWorkspaces=this.untitledWorkspaces.filter(o=>o.workspace.id!==e.id)}catch(i){this.logService.warn(`Unable to delete untitled workspace ${t} (${i}).`)}}getUntitledWorkspaces(){return this.untitledWorkspaces}async enterWorkspace(e,t,i){if(!e?.win||!e.isReady||!await this.isValidTargetWorkspacePath(e,t,i))return;let s=await this.doEnterWorkspace(e,ho(i));if(s)return this._onDidEnterWorkspace.fire({window:e,workspace:s.workspace}),s}async isValidTargetWorkspacePath(e,t,i){return i?ct(e.openedWorkspace)&&Je.isEqual(e.openedWorkspace.configPath,i)?!1:vo(t,i)?(await this.dialogMainService.showMessageBox({type:"info",buttons:[h(2901,null)],message:h(2903,null,qr(i)),detail:h(2902,null)},yA.BrowserWindow.getFocusedWindow()??void 0),!1):!0:!0}async doEnterWorkspace(e,t){if(!e.config)return;e.focus();let i;return e.config.extensionDevelopmentPath||(e.config.backupPath?i=await this.backupMainService.registerWorkspaceBackup({workspace:t,remoteAuthority:e.remoteAuthority},e.config.backupPath):i=this.backupMainService.registerWorkspaceBackup({workspace:t,remoteAuthority:e.remoteAuthority})),ct(e.openedWorkspace)&&this.isUntitledWorkspace(e.openedWorkspace)&&await this.deleteUntitledWorkspace(e.openedWorkspace),e.config.workspace=t,e.config.backupPath=i,{workspace:t,backupPath:i}}};kl=E([g(0,_e),g(1,B),g(2,Ur),g(3,Wn),g(4,ui)],kl)});function YP(n,...r){let e=r.reduce((o,s)=>(o[s]=!0,o),{}),t=[/^ELECTRON_.+$/,/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,/^SNAP(|_.*)$/,/^GDK_PIXBUF_.+$/];Object.keys(n).filter(o=>!e[o]).forEach(o=>{for(let s=0;s<t.length;s++)if(o.search(t[s])!==-1){delete n[o];break}})}function Mm(n){n&&(delete n.DEBUG,re&&delete n.LD_PRELOAD)}var ku=I(()=>{X()});import{MessageChannelMain as IA,app as ZP,utilityProcess as wA}from"electron";import{StringDecoder as e0}from"string_decoder";function bA(n){return typeof n.responseWindowId=="number"}var sr,ns,os=I(()=>{$();q();te();he();ze();Kt();Cu();Zt();Ct();ku();di();X();Ha();sr=class extends T{constructor(e,t,i){super();this.logService=e;this.telemetryService=t;this.lifecycleMainService=i;this.id=String(++sr.ID_COUNTER);this._onStdout=this._register(new b);this.onStdout=this._onStdout.event;this._onStderr=this._register(new b);this.onStderr=this._onStderr.event;this._onMessage=this._register(new b);this.onMessage=this._onMessage.event;this._onSpawn=this._register(new b);this.onSpawn=this._onSpawn.event;this._onExit=this._register(new b);this.onExit=this._onExit.event;this._onCrash=this._register(new b);this.onCrash=this._onCrash.event;this.process=void 0;this.processPid=void 0;this.configuration=void 0}static{this.ID_COUNTER=0}static{this.all=new Map}static getAll(){return Array.from(sr.all.values())}log(e,t){let i;switch(this.configuration?.correlationId?i=`[UtilityProcess id: ${this.configuration?.correlationId}, type: ${this.configuration?.type}, pid: ${this.processPid??"<none>"}]: ${e}`:i=`[UtilityProcess type: ${this.configuration?.type}, pid: ${this.processPid??"<none>"}]: ${e}`,t){case Ue.Error:this.logService.error(i);break;case Ue.Warning:this.logService.warn(i);break;case Ue.Info:this.logService.trace(i);break}}validateCanStart(){return this.process?(this.log("Cannot start utility process because it is already running...",Ue.Error),!1):!0}start(e){let t=this.doStart(e);return t&&e.payload&&this.postMessage(e.payload)&&this.log("payload sent via postMessage()",Ue.Info),t}doStart(e){if(!this.validateCanStart())return!1;this.configuration=e;let t=`${this.configuration.type}-${this.id}`,i=st.asFileUri("bootstrap-fork.js").fsPath,o=this.configuration.args??[],s=[...this.configuration.execArgv??[]],a=this.configuration.allowLoadingUnsignedLibraries,l=ZP.commandLine.getSwitchValue("js-flags");l&&s.push(`--js-flags=${l}`);let c=this.configuration.respondToAuthRequestsFromMainProcess,d="pipe",u=this.createEnv(e);return this.log("creating new...",Ue.Info),this.process=wA.fork(i,o,{serviceName:t,env:u,execArgv:s,allowLoadingUnsignedLibraries:a,respondToAuthRequestsFromMainProcess:c,stdio:d}),this.registerListeners(this.process,this.configuration,t),!0}createEnv(e){let t=e.env?{...e.env}:{...or(process.env)};t.VSCODE_ESM_ENTRYPOINT=e.entryPoint,typeof e.parentLifecycleBound=="number"&&(t.VSCODE_PARENT_PID=String(e.parentLifecycleBound)),t.VSCODE_CRASH_REPORTER_PROCESS_TYPE=e.type,F&&(W1()?t.NODE_DISABLE_UNC_ACCESS_CHECKS="1":t.NODE_UNC_HOST_ALLOWLIST=M1().join("\\")),Mm(t);for(let i of Object.keys(t))t[i]=String(t[i]);return t}registerListeners(e,t,i){if(e.stdout){let o=new e0("utf-8");this._register(S.fromNodeEventEmitter(e.stdout,"data")(s=>this._onStdout.fire(typeof s=="string"?s:o.write(s))))}if(e.stderr){let o=new e0("utf-8");this._register(S.fromNodeEventEmitter(e.stderr,"data")(s=>this._onStderr.fire(typeof s=="string"?s:o.write(s))))}this._register(S.fromNodeEventEmitter(e,"message")(o=>this._onMessage.fire(o))),this._register(S.fromNodeEventEmitter(e,"spawn")(()=>{this.processPid=e.pid,typeof e.pid=="number"&&sr.all.set(e.pid,{pid:e.pid,name:bA(t)?`${t.name} [${t.responseWindowId}]`:t.name}),this.log("successfully created",Ue.Info),this._onSpawn.fire(e.pid)})),this._register(S.fromNodeEventEmitter(e,"exit")(o=>{this.log(`received exit event with code ${o}`,Ue.Info),this._onExit.fire({pid:this.processPid,code:o,signal:"unknown"}),this.onDidExitOrCrashOrKill()})),this._register(S.fromNodeEventEmitter(ZP,"child-process-gone",(o,s)=>({event:o,details:s}))(({details:o})=>{o.type==="Utility"&&o.name===i&&(this.log(`crashed with code ${o.exitCode} and reason '${o.reason}'`,Ue.Error),this.telemetryService.publicLog2("utilityprocesscrash",{type:t.type,reason:o.reason,code:o.exitCode}),this._onCrash.fire({pid:this.processPid,code:o.exitCode,reason:o.reason}),this.onDidExitOrCrashOrKill())}))}once(e,t){let i=this._register(this._onMessage.event(o=>{o===e&&(i.dispose(),t())}))}postMessage(e,t){return this.process?(this.process.postMessage(e,t),!0):!1}connect(e){let{port1:t,port2:i}=new IA;return this.postMessage(e,[i]),t}enableInspectPort(){if(!this.process||typeof this.processPid!="number")return!1;this.log("enabling inspect port",Ue.Info);let e=process;return typeof e._debugProcess=="function"?(e._debugProcess(this.processPid),!0):!1}kill(){if(!this.process)return;this.log("attempting to kill the process...",Ue.Info),this.process.kill()?(this.log("successfully killed the process",Ue.Info),this.onDidExitOrCrashOrKill()):this.log("unable to kill the process",Ue.Warning)}onDidExitOrCrashOrKill(){typeof this.processPid=="number"&&sr.all.delete(this.processPid),this.process=void 0}async waitForExit(e){this.process&&(this.log("waiting to exit...",Ue.Info),await Promise.race([S.toPromise(this.onExit),lt(e)]),this.process&&(this.log(`did not exit within ${e}ms, will kill it now...`,Ue.Info),this.kill()))}};sr=E([g(0,B),g(1,Ke),g(2,ye)],sr);ns=class extends sr{constructor(e,t,i,o){super(e,i,o);this.windowsMainService=t}start(e){let t=this.windowsMainService.getWindowById(e.responseWindowId);if(!t?.win||t.win.isDestroyed()||t.win.webContents.isDestroyed())return this.log("Refusing to start utility process because requesting window cannot be found or is destroyed...",Ue.Error),!0;if(!super.doStart(e))return!1;this.registerWindowListeners(t.win,e);let o=this.connect(e.payload);return t.win.webContents.postMessage(e.responseChannel,e.responseNonce,[o]),!0}registerWindowListeners(e,t){if(t.windowLifecycleBound){let i=t.windowLifecycleGraceTime,o=i&&i>0?()=>this.waitForExit(i):()=>this.kill();this._register(S.filter(this.lifecycleMainService.onWillLoadWindow,s=>s.window.win===e)(o)),this._register(S.fromNodeEventEmitter(e,"closed")(o))}}};ns=E([g(0,B),g(1,qe),g(2,Ke),g(3,ye)],ns)});import{app as eI}from"electron";var SA,Dl,Rl,tI=I(()=>{Ai();wt();Z();Kt();Rr();is();Oe();te();os();SA="diagnosticsMainService",Dl=O(SA),Rl=class{constructor(r,e,t){this.windowsMainService=r;this.workspacesManagementMainService=e;this.logService=t}async getRemoteDiagnostics(r){let e=this.windowsMainService.getWindows();return(await Promise.all(e.map(async i=>{let o=i.remoteAuthority;if(!o)return;let s=`vscode:getDiagnosticInfoResponse${i.id}`,a={includeProcesses:r.includeProcesses,folders:r.includeWorkspaceMetadata?await this.getFolderURIs(i):void 0};return new Promise(l=>{i.sendWhenReady("vscode:getDiagnosticInfo",Ce.None,{replyChannel:s,args:a}),rt.once(s,(c,d)=>{d||l({hostName:o,errorMessage:`Unable to resolve connection to '${o}'.`}),l(d)}),setTimeout(()=>{l({hostName:o,errorMessage:`Connection to '${o}' could not be established`})},5e3)})}))).filter(i=>!!i)}async getMainDiagnostics(){this.logService.trace("Received request for main process info from other instance.");let r=[];for(let o of Ln()){let s=this.windowsMainService.getWindowById(o.id);s?r.push(await this.codeWindowToInfo(s)):r.push(this.browserWindowToInfo(o))}let e=[];for(let{pid:o,name:s}of sr.getAll())e.push({pid:o,name:s});let t=[],i=eI;return typeof i.getGPULogMessages=="function"&&(t=i.getGPULogMessages()),{mainPID:process.pid,mainArguments:process.argv.slice(1),windows:r,pidToNames:e,screenReader:!!eI.accessibilitySupportEnabled,gpuFeatureStatus:eI.getGPUFeatureStatus(),gpuLogMessages:t}}async codeWindowToInfo(r){let e=await this.getFolderURIs(r),t=yn(r.win);return this.browserWindowToInfo(t,e,r.remoteAuthority)}browserWindowToInfo(r,e=[],t){return{id:r.id,pid:r.webContents.getOSProcessId(),title:r.getTitle(),folderURIs:e,remoteAuthority:t}}async getFolderURIs(r){let e=[],t=r.openedWorkspace;if($t(t))e.push(t.uri);else if(ct(t)){let i=await this.workspacesManagementMainService.resolveLocalWorkspace(t.configPath);i&&i.folders.forEach(s=>{e.push(s.uri)})}return e}};Rl=E([g(0,qe),g(1,pi),g(2,B)],Rl)});import{safeStorage as xA,app as PA}from"electron";var Un,Al,t0=I(()=>{we();X();qd();_p();te();qt();Un=xA,Al=class{constructor(r,e){this.logService=r;this.productService=e;PA.commandLine.getSwitchValue("password-store")==="basic"&&(this.logService.trace("[EncryptionMainService] setting usePlainTextEncryption to true..."),Un.setUsePlainTextEncryption?.(!0),this.logService.trace("[EncryptionMainService] set usePlainTextEncryption to true")),F&&process.isEmbeddedApp&&this.initializeWithHostEncryptionKey()}initializeWithHostEncryptionKey(){if(!Un.initWithExistingKey){this.logService.trace("[EncryptionMainService] initWithExistingKey API is not available");return}let r=this.productService.embedded?.win32SiblingExeBasename;if(!r){this.logService.warn("[EncryptionMainService] Host product name not available in embedded product config");return}let e=Hg(r),t=N(e,"Local State");this.logService.info(`[EncryptionMainService] Initializing encryption with host app key from: ${t}`);try{Un.initWithExistingKey(t)?this.logService.info("[EncryptionMainService] Successfully initialized encryption with host app key"):this.logService.error("[EncryptionMainService] Failed to initialize encryption with host app key")}catch(i){this.logService.error("[EncryptionMainService] Error initializing encryption with host app key:",i)}}async encrypt(r){this.logService.trace("[EncryptionMainService] Encrypting value...");try{let e=JSON.stringify(Un.encryptString(r));return this.logService.trace("[EncryptionMainService] Encrypted value."),e}catch(e){throw this.logService.error(e),e}}async decrypt(r){let e;try{if(e=JSON.parse(r),!e.data)throw new Error(`[EncryptionMainService] Invalid encrypted value: ${r}`);let t=Buffer.from(e.data);this.logService.trace("[EncryptionMainService] Decrypting value...");let i=Un.decryptString(t);return this.logService.trace("[EncryptionMainService] Decrypted value."),i}catch(t){throw this.logService.error(t),t}}isEncryptionAvailable(){this.logService.trace("[EncryptionMainService] Checking if encryption is available...");let r=Un.isEncryptionAvailable();return this.logService.trace("[EncryptionMainService] Encryption is available: ",r),Promise.resolve(r)}getKeyStorageProvider(){if(F)return Promise.resolve("dpapi");if(V)return Promise.resolve("keychain_access");if(Un.getSelectedStorageBackend)try{this.logService.trace("[EncryptionMainService] Getting selected storage backend...");let r=Un.getSelectedStorageBackend();return this.logService.trace("[EncryptionMainService] Selected storage backend: ",r),Promise.resolve(r)}catch(r){this.logService.error(r)}return Promise.resolve("unknown")}async setUsePlainTextEncryption(){if(F)throw new Error("Setting plain text encryption is not supported on Windows.");if(V)throw new Error("Setting plain text encryption is not supported on macOS.");if(!Un.setUsePlainTextEncryption)throw new Error("Setting plain text encryption is not supported.");this.logService.trace("[EncryptionMainService] Setting usePlainTextEncryption to true..."),Un.setUsePlainTextEncryption(!0),this.logService.trace("[EncryptionMainService] Set usePlainTextEncryption to true")}};Al=E([g(0,B),g(1,Te)],Al)});var Mt,Ru,rI,Du,r0,i0,Au=I(()=>{xe();Mt="workbench.action.browser",Ru=(L=>(L.Open=`${Mt}.open`,L.NewTab=`${Mt}.newTab`,L.QuickOpen=`${Mt}.quickOpen`,L.OpenOrList=`${Mt}.openOrList`,L.CloseAll=`${Mt}.closeAll`,L.CloseAllInGroup=`${Mt}.closeAllInGroup`,L.GoBack=`${Mt}.goBack`,L.GoForward=`${Mt}.goForward`,L.Reload=`${Mt}.reload`,L.HardReload=`${Mt}.hardReload`,L.FocusUrlInput=`${Mt}.focusUrlInput`,L.OpenExternal=`${Mt}.openExternal`,L.OpenSettings=`${Mt}.openSettings`,L.AddElementToChat=`${Mt}.addElementToChat`,L.AddConsoleLogsToChat=`${Mt}.addConsoleLogsToChat`,L.ToggleDevTools=`${Mt}.toggleDevTools`,L.ClearGlobalStorage=`${Mt}.clearGlobalStorage`,L.ClearWorkspaceStorage=`${Mt}.clearWorkspaceStorage`,L.ClearEphemeralStorage=`${Mt}.clearEphemeralStorage`,L.ShowFind=`${Mt}.showFind`,L.HideFind=`${Mt}.hideFind`,L.FindNext=`${Mt}.findNext`,L.FindPrevious=`${Mt}.findPrevious`,L))(Ru||{}),rI="browserView",Du=[.25,1/3,.5,2/3,.75,.8,.9,1,1.1,1.25,1.5,1.75,2,2.5,3,4,5],r0=Du.indexOf(1),i0=999});var iI,n0=I(()=>{iI="browserViewGroup"});function EA(){let n=new j;return n[Symbol.dispose]=()=>n.dispose(),n}async function o0(n,r){var k=[];try{let e=Wb(k,EA());let t={};e.add(n.onEvent(J=>{if(J.method==="DOM.setChildNodes"){let{nodes:K}=J.params;for(let ve of K){if(t[ve.nodeId]=ve,ve.children)for(let yt of ve.children)t[yt.nodeId]={...yt,parentId:ve.nodeId};if(ve.pseudoElements)for(let yt of ve.pseudoElements)t[yt.nodeId]={...yt,parentId:ve.nodeId}}}}));await n.sendCommand("DOM.getDocument");let{node:i}=await n.sendCommand("DOM.describeNode",r);if(!i)throw new Error("Failed to describe node.");let o=i.nodeId;if(!o){let{nodeIds:J}=await n.sendCommand("DOM.pushNodesByBackendIdsToFrontend",{backendNodeIds:[i.backendNodeId]});if(!J?.length)throw new Error("Failed to get node ID.");o=J[0]}let{model:s}=await n.sendCommand("DOM.getBoxModel",{nodeId:o});if(!s)throw new Error("Failed to get box model.");let a=s.content;let l=s.margin;let c=Math.min(l[0],a[0]);let d=Math.min(l[1],a[1]);let u=Math.max(l[2]-l[0],a[2]-a[0]);let f=Math.max(l[5]-l[1],a[5]-a[1]);let m=await n.sendCommand("CSS.getMatchedStylesForNode",{nodeId:o});if(!m)throw new Error("Failed to get matched css.");let v=CA(m);let{outerHTML:y}=await n.sendCommand("DOM.getOuterHTML",{nodeId:o});if(!y)throw new Error("Failed to get outerHTML.");let C=s0(i.attributes);let w=[];let _=t[o]??i;for(;_;){let J=s0(_.attributes);w.unshift({tagName:_.localName,id:J.id,classNames:J.class?.trim().split(/\s+/).filter(Boolean)}),_=_.parentId?t[_.parentId]:void 0}let D;try{let{computedStyle:J}=await n.sendCommand("CSS.getComputedStyleForNode",{nodeId:o});if(J){D={};for(let K of J)K.name&&typeof K.value=="string"&&(D[K.name]=K.value)}}catch{}return{outerHTML:y,computedStyle:v,bounds:{x:c,y:d,width:u,height:f},ancestors:w,attributes:C,computedStyles:D,dimensions:{top:d,left:c,width:u,height:f}}}catch(A){var de=A,L=!0}finally{Ub(k,de,L)}}function CA(n){let r=[];if(n.inlineStyle?.cssProperties?.length){r.push("/* Inline style */"),r.push("element {");for(let e of n.inlineStyle.cssProperties)e.name&&e.value&&r.push(`  ${e.name}: ${e.value};`);r.push(`}
`)}if(n.matchedCSSRules?.length)for(let e of n.matchedCSSRules){let t=e.rule,i=t.selectorList.selectors.map(o=>o.text).join(", ");r.push(`/* Matched Rule from ${t.origin} */`),r.push(`${i} {`);for(let o of t.style.cssProperties)o.name&&o.value&&r.push(`  ${o.name}: ${o.value};`);r.push(`}
`)}if(n.inherited?.length){let e=1;for(let t of n.inherited){t.inlineStyle&&(r.push(`/* Inherited from ancestor level ${e} (inline) */`),r.push("element {"),r.push(t.inlineStyle.cssText||""),r.push(`}
`));let i=t.matchedCSSRules||[];for(let o of i){let s=o.rule,a=s.selectorList.selectors.map(l=>l.text).join(", ");r.push(`/* Inherited from ancestor level ${e} (${s.origin}) */`),r.push(`${a} {`);for(let l of s.style.cssProperties)l.name&&l.value&&r.push(`  ${l.name}: ${l.value};`);r.push(`}
`)}e++}}return`
`+r.join(`
`)}function s0(n){let r={};for(let e=0;e<n.length;e+=2){let t=n[e],i=n[e+1];r[t]=i}return r}var Om,TA,a0=I(()=>{$();Om=class extends T{constructor(e){super();this.browser=e;this._connectionPromise=e.debugger.attach().then(async t=>{try{if(await t.sendCommand("DOM.enable"),await t.sendCommand("Overlay.enable"),await t.sendCommand("CSS.enable"),this._store.isDisposed)throw t.dispose(),new Error("Inspector disposed before connection was ready");return this._register(t),t}catch(i){throw t.dispose(),i}})}async getElementData(e){let t=await this._connectionPromise,i=new j,o=new Promise((s,a)=>{i.add(e.onCancellationRequested(()=>{s(void 0)})),i.add(t.onEvent(async l=>{if(l.method!=="Overlay.inspectNodeRequested")return;let c=l.params;if(!c?.backendNodeId){a(new Error("Missing backendNodeId in inspectNodeRequested event"));return}try{let d=await o0(t,{backendNodeId:c.backendNodeId});s({...d,url:this.browser.getURL()})}catch(d){a(d)}}))});try{return await t.sendCommand("Overlay.setInspectMode",{mode:"searchForNode",highlightConfig:TA}),await o}finally{try{await t.sendCommand("Overlay.setInspectMode",{mode:"none",highlightConfig:{showInfo:!1,showStyles:!1}}),await t.sendCommand("Overlay.hideHighlight")}catch{}i.dispose()}}async getFocusedElementData(){let e=await this._connectionPromise;await e.sendCommand("Runtime.enable");let{result:t}=await e.sendCommand("Runtime.evaluate",{expression:"document.activeElement",returnByValue:!1});return t?.objectId?{...await o0(e,{objectId:t.objectId}),url:this.browser.getURL()}:void 0}async getVisualViewportScale(){try{let t=await(await this._connectionPromise).sendCommand("Page.getLayoutMetrics");if(typeof t.cssVisualViewport?.scale=="number"){let i=Number(t.cssVisualViewport.scale);if(Number.isFinite(i)&&i>0)return i}}catch{}return 1}};TA={showInfo:!0,showRulers:!1,showStyles:!0,showAccessibilityInfo:!0,showExtensionLines:!1,contrastAlgorithm:"aa",contentColor:{r:173,g:216,b:255,a:.8},paddingColor:{r:150,g:200,b:255,a:.5},borderColor:{r:120,g:180,b:255,a:.7},marginColor:{r:200,g:220,b:255,a:.4},eventTargetColor:{r:130,g:160,b:255,a:.8},shapeColor:{r:130,g:160,b:255,a:.8},shapeMarginColor:{r:130,g:160,b:255,a:.5},gridHighlightConfig:{rowGapColor:{r:140,g:190,b:255,a:.3},rowHatchColor:{r:140,g:190,b:255,a:.7},columnGapColor:{r:140,g:190,b:255,a:.3},columnHatchColor:{r:140,g:190,b:255,a:.7},rowLineColor:{r:120,g:180,b:255},columnLineColor:{r:120,g:180,b:255},rowLineDash:!0,columnLineDash:!0},flexContainerHighlightConfig:{containerBorder:{color:{r:120,g:180,b:255},pattern:"solid"},itemSeparator:{color:{r:140,g:190,b:255},pattern:"solid"},lineSeparator:{color:{r:140,g:190,b:255},pattern:"solid"},mainDistributedSpace:{hatchColor:{r:140,g:190,b:255,a:.7},fillColor:{r:140,g:190,b:255,a:.4}},crossDistributedSpace:{hatchColor:{r:140,g:190,b:255,a:.7},fillColor:{r:140,g:190,b:255,a:.4}},rowGapSpace:{hatchColor:{r:140,g:190,b:255,a:.7},fillColor:{r:140,g:190,b:255,a:.4}},columnGapSpace:{hatchColor:{r:140,g:190,b:255,a:.7},fillColor:{r:140,g:190,b:255,a:.4}}},flexItemHighlightConfig:{baseSizeBox:{hatchColor:{r:130,g:170,b:255,a:.6}},baseSizeBorder:{color:{r:120,g:180,b:255},pattern:"solid"},flexibilityArrow:{color:{r:130,g:190,b:255}}}}});var nn,Ll=I(()=>{Z();nn=O("auxiliaryWindowsMainService")});var Fm,nI,l0=I(()=>{q();$();Fm=class extends T{constructor(e,t){super();this.view=e;this.logService=t;this._sessions=this._register(new Dt);this._onSessionCreated=this._register(new b);this.onSessionCreated=this._onSessionCreated.event;this._knownTargets=new Map;this._onTargetDiscovered=this._register(new b);this.onTargetDiscovered=this._onTargetDiscovered.event;this._onTargetDestroyed=this._register(new b);this.onTargetDestroyed=this._onTargetDestroyed.event;this._onTargetInfoChanged=this._register(new b);this.onTargetInfoChanged=this._onTargetInfoChanged.event;this._isPaused=!1;this._electronDebugger=e.webContents.debugger,this._messageHandler=(i,o,s,a)=>{this.routeCDPEvent(o,s,a)}}get knownTargets(){return this._knownTargets}get isPaused(){return this._isPaused}async attach(){if(!this._targetId){let e=await this.getTargetInfo();this._targetId=e.targetId}return this.attachToTarget(this._targetId)}async attachToTarget(e){this.ensureAttached();let t=await this._electronDebugger.sendCommand("Target.attachToTarget",{targetId:e,flatten:!0});if(!this._sessions.has(t.sessionId))throw new Error(`Failed to attach to target ${e}`);return this._sessions.get(t.sessionId)}async getTargetInfo(){return this.ensureAttached(),(await this._electronDebugger.sendCommand("Target.getTargetInfo")).targetInfo}sendCommand(e,t,i){if(e==="Emulation.setDeviceMetricsOverride")return Promise.resolve({});this.ensureAttached();let o=this._electronDebugger.sendCommand(e,t,i);return e==="Page.handleJavaScriptDialog"&&this.view.webContents.emit("-cancel-dialogs"),o}ensureAttached(){this._electronDebugger.isAttached()||(this._electronDebugger.on("message",this._messageHandler),this._electronDebugger.attach("1.3"),this._electronDebugger.sendCommand("Target.setAutoAttach",{autoAttach:!0,flatten:!0,waitForDebuggerOnStart:!1}),this._electronDebugger.sendCommand("Target.setDiscoverTargets",{discover:!0}))}detachElectronDebugger(){try{if(this.view.webContents.isDestroyed()||!this._electronDebugger.isAttached())return;this._electronDebugger.removeListener("message",this._messageHandler),this._electronDebugger.detach()}catch{}}routeCDPEvent(e,t,i){if(e==="Target.attachedToTarget"){let s=t;this.registerSession(s.sessionId,s.targetInfo,s.waitingForDebugger,i)}else if(e==="Target.detachedFromTarget"){let s=t;this._sessions.deleteAndDispose(s.sessionId)}else if(e==="Target.targetDestroyed"){let s=t;this.destroyTarget(s.targetId)}else if(e==="Target.targetInfoChanged"&&!i){let s=t;this._knownTargets.has(s.targetInfo.targetId)&&(this._knownTargets.set(s.targetInfo.targetId,s.targetInfo),this._onTargetInfoChanged.fire(s.targetInfo))}else e==="Debugger.paused"?this._isPaused=!0:e==="Debugger.resumed"&&(this._isPaused=!1);let o=i?this._sessions.get(i):void 0;o&&o.emitEvent({method:e,params:t,sessionId:i})}destroyTarget(e){let t=[];for(let[i,o]of this._sessions)o.targetId===e&&t.push(i);for(let i of t)this._sessions.deleteAndDispose(i);this._knownTargets.delete(e)&&this._onTargetDestroyed.fire(e)}registerSession(e,t,i,o){if(!this._knownTargets.has(t.targetId)&&t.targetId!==this._targetId&&(this._knownTargets.set(t.targetId,t),this._onTargetDiscovered.fire(t)),this._sessions.has(e))return this._sessions.get(e);let s=new nI(o,e,t.targetId,this);return this._sessions.set(e,s),s.onClose(()=>this._sessions.deleteAndDispose(e)),this._onSessionCreated.fire({session:s,waitingForDebugger:i}),s}dispose(){this.detachElectronDebugger(),super.dispose()}},nI=class extends T{constructor(e,t,i,o){super();this.parentSessionId=e;this.sessionId=t;this.targetId=i;this._debugger=o;this._onEvent=this._register(new b);this.onEvent=this._onEvent.event;this.emitEvent=e=>this._onEvent.fire(e);this._onClose=this._register(new b);this.onClose=this._onClose.event;this._isDisposed=!1}async sendCommand(e,t){return this._debugger.sendCommand(e,t,this.sessionId)}dispose(){this._isDisposed||(this._isDisposed=!0,this._onClose.fire(),super.dispose())}}});function MA(n){return n===5||n===4||n===6||n===57}var Lu,Wm,oI,sI,_A,kA,lI,RA,DA,AA,c0,aI,LA,d0=I(()=>{Lu=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(r,e){this._keyCodeToStr[r]=e,this._strToKeyCode[e.toLowerCase()]=r}keyCodeToStr(r){return this._keyCodeToStr[r]}strToKeyCode(r){return this._strToKeyCode[r.toLowerCase()]||0}},Wm=new Lu,oI=new Lu,sI=new Lu,_A=new Array(230),kA={},lI={},RA=[],DA=Object.create(null),AA=Object.create(null),c0=[],aI=[];for(let n=0;n<=193;n++)c0[n]=-1;for(let n=0;n<=132;n++)aI[n]=-1;(function(){let r=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Del",46,"VK_DELETE","Delete",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],e=[],t=[];for(let i of r){let[o,s,a,l,c,d,u,f,m]=i;if(t[s]||(t[s]=!0,RA[s]=a,DA[a]=s,AA[a.toLowerCase()]=s,o&&(c0[s]=l,l!==0&&l!==3&&!MA(l)&&(aI[l]=s))),!e[l]){if(e[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);Wm.define(l,c),oI.define(l,f||c),sI.define(l,m||f||c)}d&&(_A[d]=l),a&&(lI[a]=d),u&&(kA[u]=l)}aI[3]=46})();(s=>{function n(a){return Wm.keyCodeToStr(a)}s.toString=n;function r(a){return Wm.strToKeyCode(a)}s.fromString=r;function e(a){return oI.keyCodeToStr(a)}s.toUserSettingsUS=e;function t(a){return sI.keyCodeToStr(a)}s.toUserSettingsGeneral=t;function i(a){return oI.strToKeyCode(a)||sI.strToKeyCode(a)}s.fromUserSettings=i;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right";case 20:return"Delete"}return Wm.keyCodeToStr(a)}s.toElectronAccelerator=o})(LA||={})});function Um(n,r){n.publicLog2("integratedBrowser.open",{source:r})}var cI=I(()=>{});import{WebContentsView as OA,webContents as FA}from"electron";var on,dI=I(()=>{$();q();ot();Au();a0();Kt();tn();Ll();l0();te();d0();Zt();cI();on=class extends T{constructor(e,t,i,o,s,a,l,c,d,u){super();this.id=e;this.owner=t;this.session=i;this.windowsMainService=l;this.auxiliaryWindowsMainService=c;this.logService=d;this.telemetryService=u;this._faviconRequestCache=new Map;this._lastScreenshot=void 0;this._lastFavicon=void 0;this._lastError=void 0;this._lastUserGestureTimestamp=-1/0;this._browserZoomIndex=r0;this._isDisposed=!1;this._consoleLogs=[];this._onDidNavigate=this._register(new b);this.onDidNavigate=this._onDidNavigate.event;this._onDidChangeLoadingState=this._register(new b);this.onDidChangeLoadingState=this._onDidChangeLoadingState.event;this._onDidChangeFocus=this._register(new b);this.onDidChangeFocus=this._onDidChangeFocus.event;this._onDidChangeVisibility=this._register(new b);this.onDidChangeVisibility=this._onDidChangeVisibility.event;this._onDidChangeDevToolsState=this._register(new b);this.onDidChangeDevToolsState=this._onDidChangeDevToolsState.event;this._onDidKeyCommand=this._register(new b);this.onDidKeyCommand=this._onDidKeyCommand.event;this._onDidChangeTitle=this._register(new b);this.onDidChangeTitle=this._onDidChangeTitle.event;this._onDidChangeFavicon=this._register(new b);this.onDidChangeFavicon=this._onDidChangeFavicon.event;this._onDidFindInPage=this._register(new b);this.onDidFindInPage=this._onDidFindInPage.event;this._onDidClose=this._register(new b);this.onDidClose=this._onDidClose.event;let f={...a?.webPreferences,nodeIntegration:!1,contextIsolation:!0,sandbox:!0,webviewTag:!1,session:this.session.electronSession,type:"browserView"};if(this._view=new OA({webPreferences:f,...a?.webContents?{webContents:a.webContents}:{}}),this._view.setBounds({x:-1e4,y:-1e4,width:1024,height:768}),this._view.setBackgroundColor("#FFFFFF"),this._ownerWindow=this.windowsMainService.getWindowById(t.mainWindowId),!this._ownerWindow)throw new Error(`Window with ID ${t.mainWindowId} not found`);this._register(this._ownerWindow.onDidClose(()=>this.dispose())),this._register(this._ownerWindow.onWillLoad(m=>{m.reason===2?this.dispose():m.reason===3&&this.setVisible(!1)})),this._view.setVisible(!1),this._ownerWindow.win?.contentView.addChildView(this._view),this._view.webContents.setWindowOpenHandler(m=>{let v=(()=>{switch(m.disposition){case"background-tab":return"background";case"foreground-tab":return"foreground";case"new-window":return"newWindow";default:return}})();return!v||!this.consumePopupPermission(v)?{action:"deny"}:{action:"allow",createWindow:y=>(Um(this.telemetryService,(()=>{switch(v){case"newWindow":return"browserLinkNewWindow";case"background":return"browserLinkBackground";case"foreground":return"browserLinkForeground"}})()),o(m.url,y,{pinned:!0,background:v==="background",parentViewId:e,auxiliaryWindow:v==="newWindow"?{x:y.x,y:y.y,width:y.width,height:y.height}:void 0}).webContents),outlivesOpener:!0}}),this._view.webContents.on("context-menu",(m,v)=>{s(this,v)}),this._view.webContents.on("destroyed",()=>{this.dispose()}),this.debugger=new Fm(this,this.logService),this._inspector=this._register(new Om(this)),this.setupEventListeners()}static{this.MAX_CONSOLE_LOG_ENTRIES=1e3}setupEventListeners(){let e=this._view.webContents;e.on("devtools-opened",()=>{this._onDidChangeDevToolsState.fire({isDevToolsOpen:!0})}),e.on("devtools-closed",()=>{this._onDidChangeDevToolsState.fire({isDevToolsOpen:!1})}),e.on("page-favicon-updated",async(o,s)=>{for(let a of s){this._faviconRequestCache.has(a)||this._faviconRequestCache.set(a,(async()=>{if(a.startsWith("data:image/"))return a;let l=await e.session.fetch(a,{cache:"force-cache"});if(!l.ok)throw new Error(`Failed to fetch favicon: ${l.status} ${l.statusText}`);let c=await l.headers.get("content-type");if(!c?.startsWith("image/"))throw new Error(`Favicon is not an image: ${c}`);let d=await l.arrayBuffer();return`data:${c};base64,${Buffer.from(d).toString("base64")}`})());try{this._lastFavicon=await this._faviconRequestCache.get(a),this._onDidChangeFavicon.fire({favicon:this._lastFavicon});return}catch{}}this._lastFavicon&&(this._lastFavicon=void 0,this._onDidChangeFavicon.fire({favicon:this._lastFavicon}))}),e.on("page-title-updated",(o,s)=>{this._onDidChangeTitle.fire({title:s})});let t=()=>{let o=e.getURL();this._onDidNavigate.fire({url:o,title:e.getTitle(),canGoBack:e.navigationHistory.canGoBack(),canGoForward:e.navigationHistory.canGoForward(),certificateError:this.session.trust.getCertificateError(o)})},i=o=>{this._onDidChangeLoadingState.fire({loading:o,error:this._lastError})};e.on("did-start-loading",()=>{this._lastError=void 0,e.isLoadingMainFrame()&&i(!0)}),e.on("did-stop-loading",()=>i(!1)),e.on("did-fail-load",(o,s,a,l,c)=>{if(c){if(s===-3){i(!1);return}this._lastError={url:l,errorCode:s,errorDescription:a,certificateError:s<=-200&&s>=-220?this.session.trust.getCertificateError(l):void 0},i(!1),this._onDidNavigate.fire({url:l,title:"",canGoBack:e.navigationHistory.canGoBack(),canGoForward:e.navigationHistory.canGoForward(),certificateError:this.session.trust.getCertificateError(l)})}}),e.on("did-finish-load",()=>i(!1)),this.session.trust.installCertErrorHandler(e),e.on("render-process-gone",(o,s)=>{this._lastError={url:e.getURL(),errorCode:s.exitCode,errorDescription:`Render process gone: ${s.reason}`},i(!1)}),e.on("did-navigate",t),e.on("did-navigate-in-page",t),e.on("did-navigate",()=>{this._consoleLogs.length=0,this._view.webContents.setZoomFactor(Du[this._browserZoomIndex]),this._view.webContents.setVisualZoomLevelLimits(1,3).catch(o=>{this.logService.error("Failed to set visual zoom level limits for browser view webContents.",o)})}),e.on("focus",()=>{this._onDidChangeFocus.fire({focused:!0})}),e.on("blur",()=>{this._onDidChangeFocus.fire({focused:!1})}),e.ipc.on("vscode:browserView:keydown",(o,s)=>{this._onDidKeyCommand.fire(s)}),e.on("before-input-event",(o,s)=>{if(s.type!=="keyDown"||this._view.getVisible()&&!e.isCrashed()&&!this.debugger.isPaused||!(s.control||s.alt||s.meta)&&s.key.length===1)return;o.preventDefault();let l=lI[s.code]||0;this._onDidKeyCommand.fire({key:s.key,keyCode:l,code:s.code,ctrlKey:s.control,shiftKey:s.shift,altKey:s.alt,metaKey:s.meta,repeat:s.isAutoRepeat})}),e.on("input-event",(o,s)=>{switch(s.type){case"rawKeyDown":case"keyDown":case"mouseDown":case"pointerDown":case"pointerUp":case"touchEnd":this._lastUserGestureTimestamp=Date.now()}}),e.on("will-prevent-unload",o=>{o.preventDefault()}),e.on("found-in-page",(o,s)=>{this._onDidFindInPage.fire({activeMatchOrdinal:s.activeMatchOrdinal,matches:s.matches,selectionArea:s.selectionArea,finalUpdate:s.finalUpdate})}),this._view.webContents.on("console-message",o=>{this._consoleLogs.push(`[${o.level}] ${o.message}`),this._consoleLogs.length>on.MAX_CONSOLE_LOG_ENTRIES&&this._consoleLogs.splice(0,this._consoleLogs.length-on.MAX_CONSOLE_LOG_ENTRIES)})}consumePopupPermission(e){switch(e){case"foreground":case"background":return!0;case"newWindow":return this._lastUserGestureTimestamp>Date.now()-1e3?(this._lastUserGestureTimestamp=-1/0,!0):!1}}get webContents(){return this._view.webContents}getState(){let e=this._view.webContents,t=e.getURL();return{url:t,title:e.getTitle(),canGoBack:e.navigationHistory.canGoBack(),canGoForward:e.navigationHistory.canGoForward(),loading:e.isLoading(),focused:e.isFocused(),visible:this._view.getVisible(),isDevToolsOpen:e.isDevToolsOpened(),lastScreenshot:this._lastScreenshot,lastFavicon:this._lastFavicon,lastError:this._lastError,certificateError:this.session.trust.getCertificateError(t),storageScope:this.session.storageScope,browserZoomIndex:this._browserZoomIndex}}toggleDevTools(){this._view.webContents.toggleDevTools()}layout(e){if(this._currentWindow?.win?.id!==e.windowId){let t=this._windowById(e.windowId);t&&(this._currentWindow?.win?.contentView.removeChildView(this._view),this._currentWindow=t,t.win?.contentView.addChildView(this._view))}this._view.setBorderRadius(Math.round(e.cornerRadius*e.zoomFactor)),this._view.setBounds({x:Math.round(e.x*e.zoomFactor),y:Math.round(e.y*e.zoomFactor),width:Math.round(e.width*e.zoomFactor),height:Math.round(e.height*e.zoomFactor)})}setBrowserZoomIndex(e){this._browserZoomIndex=Math.max(0,Math.min(e,Du.length-1));let t=Du[this._browserZoomIndex];this._view.webContents.setZoomFactor(t)}setVisible(e){this._view.getVisible()!==e&&(!e&&this._view.webContents.isFocused()&&this._currentWindow?.win?.webContents.focus(),this._view.setVisible(e),this._onDidChangeVisibility.fire({visible:e}))}getConsoleLogs(){return this._consoleLogs.join(`
`)}async getElementData(e){return this._inspector.getElementData(e)}async getFocusedElementData(){return this._inspector.getFocusedElementData()}async loadURL(e){await this._view.webContents.loadURL(e)}getURL(){return this._view.webContents.getURL()}goBack(){this._view.webContents.navigationHistory.canGoBack()&&this._view.webContents.navigationHistory.goBack()}goForward(){this._view.webContents.navigationHistory.canGoForward()&&this._view.webContents.navigationHistory.goForward()}reload(e){e?this._view.webContents.reloadIgnoringCache():this._view.webContents.reload()}canGoBack(){return this._view.webContents.navigationHistory.canGoBack()}canGoForward(){return this._view.webContents.navigationHistory.canGoForward()}async captureScreenshot(e){this._view.getVisible()||(this._view.setVisible(!0),this._view.setVisible(!1));let t=e?.quality??80;if(e?.pageRect){let a=this._view.webContents.getZoomFactor(),l=await this._inspector.getVisualViewportScale();e.screenRect={x:e.pageRect.x*l*a,y:e.pageRect.y*l*a,width:e.pageRect.width*l*a,height:e.pageRect.height*l*a}}let o=(await this._view.webContents.capturePage(e?.screenRect,{stayHidden:!0})).toJPEG(t),s=H.wrap(o);return e?.screenRect||(this._lastScreenshot=s),s}async focus(e){!e&&!this._currentWindow?.win?.isFocused()||this._view.webContents.focus()}async findInPage(e,t){this._view.webContents.findInPage(e,{matchCase:t?.matchCase??!1,forward:t?.forward??!0,findNext:t?.recompute??!1})}async stopFindInPage(e){this._view.webContents.stopFindInPage(e?"keepSelection":"clearSelection")}async getSelectedText(){if(this._view.webContents.isLoading())return"";try{return await this._view.webContents.executeJavaScriptInIsolatedWorld(i0,[{code:'window.browserViewAPI?.getSelectedText?.() ?? ""'}])}catch{return""}}async clearStorage(){await this.session.clearData()}async trustCertificate(e,t){await this.session.trust.trustCertificate(e,t),this._view.webContents.reload()}async untrustCertificate(e,t){await this.session.trust.untrustCertificate(e,t),this.dispose()}getWebContentsView(){return this._view}getElectronWindow(){return this._currentWindow?.win??void 0}dispose(){if(this._isDisposed)return;this._isDisposed=!0,this.debugger.dispose();let e=this._currentWindow?.win;e&&!e.isDestroyed()&&e.contentView.removeChildView(this._view),this._onDidClose.fire(),this._view.webContents.isDestroyed()||this._view.webContents.close({waitForBeforeUnload:!1}),super.dispose()}_windowById(e){return this._codeWindowById(e)??this._auxiliaryWindowById(e)}_codeWindowById(e){if(typeof e=="number")return this.windowsMainService.getWindowById(e)}_auxiliaryWindowById(e){if(typeof e!="number")return;let t=FA.fromId(e);if(t)return this.auxiliaryWindowsMainService.getWindowByWebContents(t)}};on=E([g(6,qe),g(7,nn),g(8,B),g(9,Ke)],on)});var Nm,WA,Bm,p0=I(()=>{Rn();Nm="browserView.sessionTrustData",WA=10080*60*1e3,Bm=class{constructor(r){this._session=r;this._trustedCertificates=new Map;this._certErrors=new Map;this._installCertVerifyProc()}_installCertVerifyProc(){this._session.electronSession.setCertificateVerifyProc((r,e)=>{let{hostname:t,errorCode:i,certificate:o,verificationResult:s}=r;return i!==0?this._certErrors.set(t,{certificate:o,error:s}):this._certErrors.delete(t),e(-3)})}installCertErrorHandler(r){r.on("certificate-error",(e,t,i,o,s)=>{e.preventDefault();let a=URL.parse(t)?.hostname;return a&&this.isCertificateTrusted(a,o.fingerprint)?s(!0):s(!1)})}getCertificateError(r){let e=URL.parse(r);if(!e||e.protocol!=="https:")return;let t=e.hostname;if(!t)return;let i=this._certErrors.get(t);if(!i)return;let o=i.certificate;return{host:t,fingerprint:o.fingerprint,error:i.error,url:r,hasTrustedException:this.isCertificateTrusted(t,o.fingerprint),issuerName:o.issuerName,subjectName:o.subjectName,validStart:o.validStart,validExpiry:o.validExpiry}}async trustCertificate(r,e){let t=this._trustedCertificates.get(r);t||(t=new Map,this._trustedCertificates.set(r,t)),t.set(e,Date.now()+WA),this.writeStorage()}async untrustCertificate(r,e){let t=this._trustedCertificates.get(r);if(t&&t.delete(e))t.size===0&&this._trustedCertificates.delete(r);else throw new Error(`Certificate not found: host=${r} fingerprint=${e}`);this.writeStorage(),await this._session.electronSession.closeAllConnections()}isCertificateTrusted(r,e){let t=this._trustedCertificates.get(r)?.get(e);return!(t===void 0||Date.now()>t)}connectStorage(r){this._storage||(this._storage=r,this.readStorage())}async clear(){this._trustedCertificates.clear(),this._certErrors.clear(),this.writeStorage(),await this._session.electronSession.closeAllConnections()}readStorage(){let r=this._storage;if(!r)return;let e=r.get(Nm,-1);if(!e)return;let t=Date.now(),i=!1;try{let s=JSON.parse(e)[this._session.id]?.trustedCerts;if(s)for(let{host:a,fingerprint:l,expiresAt:c}of s)if(c>t){let d=this._trustedCertificates.get(a);d||(d=new Map,this._trustedCertificates.set(a,d)),d.set(l,c)}else i=!0}catch{}i&&this.writeStorage()}writeStorage(){let r=this._storage;if(!r)return;let e={};try{let t=r.get(Nm,-1);t&&(e=JSON.parse(t))}catch{}if(e[this._session.id]||(e[this._session.id]={}),this._trustedCertificates.size===0)delete e[this._session.id].trustedCerts;else{let t=[];for(let[i,o]of this._trustedCertificates)for(let[s,a]of o)t.push({host:i,fingerprint:s,expiresAt:a});e[this._session.id].trustedCerts=t}Object.keys(e[this._session.id]).length===0&&delete e[this._session.id],Object.keys(e).length===0?r.remove(Nm,-1):r.store(Nm,JSON.stringify(e),-1,1)}}});import{session as uI}from"electron";var f0,sn,pI=I(()=>{gt();Au();p0();ze();f0=new Set(["pointerLock","notifications","clipboard-sanitized-write"]),sn=class n{constructor(r,e,t){this.id=r;this.electronSession=e;this.storageScope=t;this._trust=new Bm(this),this.configure(),n.knownSessions.add(e),n._bySession.set(e,this),n._byId.set(r,new WeakRef(this)),n._finalizer.register(e,r)}static{this._bySession=new WeakMap}static{this._byId=new Map}static{this._finalizer=new FinalizationRegistry(r=>{n._byId.delete(r)})}static{this.knownSessions=new WeakSet}static isBrowserViewWebContents(r){return n.knownSessions.has(r.session)}static get(r){let e=n._byId.get(r);if(!e)return;let t=e.deref();return t||n._byId.delete(r),t}static getBrowserContextIds(){let r=[];for(let[e,t]of n._byId)t.deref()?r.push(e):n._byId.delete(e);return r}static getOrCreateGlobal(){let r=uI.fromPartition("persist:vscode-browser");return n._bySession.get(r)??new n("global",r,"global")}static getOrCreateWorkspace(r,e){let t=oe(e,r,"browserStorage"),i=uI.fromPath(t.fsPath);return n._bySession.get(i)??new n(`workspace:${r}`,i,"workspace")}static getOrCreateEphemeral(r,e){if(e==="workspace"||e==="ephemeral")throw new Error(`Cannot create session with reserved type '${e}'`);let t=`${e??"ephemeral"}:${r}`,i=uI.fromPartition(`vscode-browser-${e}${r}`);return n._bySession.get(i)??new n(t,i,"ephemeral")}static getOrCreate(r,e,t,i){switch(e){case"global":return n.getOrCreateGlobal();case"workspace":if(i)return n.getOrCreateWorkspace(i,t);case"ephemeral":default:return n.getOrCreateEphemeral(r)}}get trust(){return this._trust}connectStorage(r){this._trust.connectStorage(r)}configure(){this.electronSession.setPermissionRequestHandler((r,e,t)=>t(f0.has(e))),this.electronSession.setPermissionCheckHandler((r,e,t)=>f0.has(e)),this.electronSession.registerPreloadScript({type:"frame",filePath:st.asFileUri("vs/platform/browserView/electron-browser/preload-browserView.js").fsPath})}async clearData(){await this._trust.clear(),await this.electronSession.clearData()}}});import{networkInterfaces as UA}from"os";function BA(n){let r=n.replace(/\-/g,":").toLowerCase();return!NA.has(r)}function m0(){let n=UA();for(let r in n){let e=n[r];if(e){for(let{mac:t}of e)if(BA(t))return t}}throw new Error("Unable to retrieve mac address (unexpected format)")}var NA,h0=I(()=>{NA=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"])});import{networkInterfaces as VA}from"os";async function g0(n){return fI||(fI=(async()=>await HA(n)||ke())()),fI}async function HA(n){try{let r=await import("crypto"),e=m0();return r.createHash("sha256").update(e,"utf8").digest("hex")}catch(r){n(r);return}}async function v0(n){if(F){let r=await import("@vscode/windows-registry");try{return r.GetStringRegKey("HKEY_LOCAL_MACHINE",$A,"MachineId")||""}catch(e){return n(e),""}}return""}async function Vm(n){try{return await(await import("@vscode/deviceid")).getDeviceId()}catch(r){return n(r),ke()}}var Mu,fI,$A,Ou=I(()=>{qs();Xt();h0();X();Mu=new class{_isVirtualMachineMacAddress(n){return this._virtualMachineOUIs||(this._virtualMachineOUIs=Kr.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(n)}value(){if(this._value===void 0){let n=0,r=0,e=VA();for(let t in e){let i=e[t];if(i)for(let{mac:o,internal:s}of i)s||(r+=1,this._isVirtualMachineMacAddress(o.toUpperCase())&&(n+=1))}this._value=r>0?n/r:0}return this._value}};$A="Software\\Microsoft\\SQMClient"});import{spawn as y0}from"child_process";import{statSync as qA}from"fs";function I0(n,r=[],e){if(V){let t=KA(n);if(!t)return;let i=["-n","-g","-b",t];r.length>0&&i.push("--args",...r);let o=y0("open",i,{detached:!0,stdio:"ignore"});return o.on("error",s=>e?.(s)),o.unref(),{child:o}}if(F){let t=zA(n);if(!t)return;let i=y0(t,r,{detached:!0,stdio:"ignore"});return i.on("error",o=>e?.(o)),i.unref(),{child:i}}}function KA(n){return!!process.isEmbeddedApp?n.embedded?.darwinSiblingBundleIdentifier:n.darwinSiblingBundleIdentifier}function zA(n){let e=!!process.isEmbeddedApp?n.embedded?.win32SiblingExeBasename:n.win32SiblingExeBasename;if(!e)return;let t=N(Le(process.execPath),`${e}.exe`);try{if(qA(t).isFile())return t}catch{}}var w0=I(()=>{we();X()});import*as Hm from"net";function S0(n,r,e,t=1){let i=!1;return new Promise(o=>{let s=setTimeout(()=>{if(!i)return i=!0,o(0)},e);mI(n,r,t,a=>{if(!i)return i=!0,clearTimeout(s),o(a)})})}function mI(n,r,e,t){if(r===0)return t(0);let i=new Hm.Socket;i.once("connect",()=>(b0(i),mI(n+e,r-1,e,t))),i.once("data",()=>{}),i.once("error",o=>(b0(i),o.code!=="ECONNREFUSED"?mI(n+e,r-1,e,t):t(n))),i.connect(n,"127.0.0.1")}function x0(n,r){return gI(n,0,r).then(e=>e!==0)}function gI(n,r,e,t="127.0.0.1"){let i=!1,o,s=1,a=Hm.createServer({pauseOnConnect:!0});function l(c,d){i||(i=!0,a.removeAllListeners(),a.close(),o&&clearTimeout(o),d(c))}return new Promise(c=>{o=setTimeout(()=>{l(0,c)},e),a.on("listening",()=>{l(n,c)}),a.on("error",d=>{d&&(d.code==="EADDRINUSE"||d.code==="EACCES")&&s<r?(n++,s++,a.listen(n,t)):l(0,c)}),a.on("close",()=>{l(0,c)}),a.listen(n,t)})}function b0(n){try{n.removeAllListeners("connect"),n.removeAllListeners("error"),n.end(),n.destroy(),n.unref()}catch(r){console.error(r)}}var hI,vI=I(()=>{hI={1:!0,7:!0,9:!0,11:!0,13:!0,15:!0,17:!0,19:!0,20:!0,21:!0,22:!0,23:!0,25:!0,37:!0,42:!0,43:!0,53:!0,69:!0,77:!0,79:!0,87:!0,95:!0,101:!0,102:!0,103:!0,104:!0,109:!0,110:!0,111:!0,113:!0,115:!0,117:!0,119:!0,123:!0,135:!0,137:!0,139:!0,143:!0,161:!0,179:!0,389:!0,427:!0,465:!0,512:!0,513:!0,514:!0,515:!0,526:!0,530:!0,531:!0,532:!0,540:!0,548:!0,554:!0,556:!0,563:!0,587:!0,601:!0,636:!0,989:!0,990:!0,993:!0,995:!0,1719:!0,1720:!0,1723:!0,2049:!0,3659:!0,4045:!0,5060:!0,5061:!0,6e3:!0,6566:!0,6665:!0,6666:!0,6667:!0,6668:!0,6669:!0,6697:!0,10080:!0}});var yz,yI=I(()=>{Z();yz=O("nativeHostService")});import*as P0 from"fs";import*as E0 from"child_process";async function C0(n=!1){return(II===void 0||n)&&(II=jA()),II}async function jA(){let n=await Mf();if(n===0)return!1;if(n>=22e3){let r=GA();if(r)return new Promise(e=>{try{E0.execFile(r,["--status"],t=>e(!t))}catch{e(!1)}})}else{let r=JA();if(r)try{if((await P0.promises.stat(r)).isFile())return!0}catch{}}return!1}function T0(n){let r=process.env.SystemRoot;if(r){let e=process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432");return N(r,e?"Sysnative":"System32",n)}}function GA(){return T0("wsl.exe")}function JA(){return T0("lxss\\LxssManager.dll")}var II,_0=I(()=>{we();el()});var Ml,k0=I(()=>{he();te();Ml=class{constructor(r,e,t){this._window=r;this._sessionId=e;this._logService=t}async inspect(r){await this._connect();let e=this._window.webContents.debugger;await e.sendCommand("Profiler.start"),this._logService.warn("[perf] profiling STARTED",this._sessionId),await lt(r);let t=await e.sendCommand("Profiler.stop");return this._logService.warn("[perf] profiling DONE",this._sessionId),await this._disconnect(),t.profile}async _connect(){let r=this._window.webContents.debugger;r.attach(),await r.sendCommand("Profiler.enable")}async _disconnect(){let r=this._window.webContents.debugger;await r.sendCommand("Profiler.disable"),r.detach()}};Ml=E([g(2,B)],Ml)});import{createWriteStream as QA,promises as Rz}from"fs";async function R0(n,r){let{ZipFile:e}=await import("yazl");return new Promise((t,i)=>{let o=new e;r.forEach(a=>{a.contents?o.addBuffer(typeof a.contents=="string"?Buffer.from(a.contents,"utf8"):a.contents,a.path):a.localPath&&o.addFile(a.localPath,a.path)}),o.end();let s=QA(n);o.outputStream.pipe(s),o.outputStream.once("error",i),s.once("error",i),s.once("finish",()=>t(n))})}var XA,Mz,D0=I(()=>{he();we();Oe();nr();xe();XA="end of central directory record signature not found",Mz=new RegExp(XA)});function YA(n){return n.res.statusCode&&n.res.statusCode>=200&&n.res.statusCode<300||n.res.statusCode===1223}function ZA(n){return n.res.statusCode===204}async function Ol(n){if(!YA(n))throw new Error("Server returned "+n.res.statusCode);if(ZA(n))return null;let e=(await Fs(n.stream)).toString();try{return JSON.parse(e)}catch(t){throw t.message+=`:
`+e,t}}function eL(n=!0,r=!0){if(A0===n&&L0===r)return;A0=n,L0=r;let e=Pt.as(lr.Configuration),t=wI;wI=[{id:"http",order:15,title:h(2425,null),type:"object",scope:2,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:r,markdownDescription:h(2440,null),restricted:!0}}},{id:"http",order:15,title:h(2425,null),type:"object",scope:1,properties:{"http.electronFetch":{type:"boolean",default:!1,description:h(2423,null),restricted:!0}}},{id:"http",order:15,title:h(2425,null),type:"object",scope:n?1:2,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:h(2428,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:h(2436,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:h(2430,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:h(2427,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:h(2429,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[h(2433,null),h(2434,null),h(2432,null),h(2435,null)],default:"override",markdownDescription:h(2431,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:h(2437,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificatesNode":{type:"boolean",tags:["experimental"],default:SI,markdownDescription:h(2438,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:h(2439,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:h(2424,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.webSocketAdditionalSupport":{type:"boolean",default:!0,markdownDescription:h(2441,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.experimental.networkInterfaceCheckInterval":{type:"number",default:300,minimum:-1,tags:["experimental"],markdownDescription:h(2426,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}}}}],e.updateConfigurations({add:wI,remove:t})}var Fi,bI,$m,SI,wI,A0,L0,ss=I(()=>{ot();He();q();$();xe();no();Z();Xi();Fi=O("requestService"),bI=class{constructor(r){this.original=r}toJSON(){if(!this.headers){let r=Object.create(null);for(let e in this.original)e.toLowerCase()==="authorization"||e.toLowerCase()==="proxy-authorization"?r[e]="*****":r[e]=this.original[e];this.headers=r}return this.headers}},$m=class extends T{constructor(e){super();this.logService=e;this.counter=0;this._onDidCompleteRequest=this._register(new b);this.onDidCompleteRequest=this._onDidCompleteRequest.event}async logAndRequest(e,t){let i=`#${++this.counter}: ${e.url}`;this.logService.trace(`${i} - begin`,e.type,new bI(e.headers??{}));let o=Date.now();try{let s=await t();return this.logService.trace(`${i} - end`,e.type,s.res.statusCode,s.res.headers),this._onDidCompleteRequest.fire({callSite:e.callSite,latency:Date.now()-o,statusCode:s.res.statusCode}),s}catch(s){throw this.logService.error(`${i} - error`,e.type,mr(s)),s}}};SI=!1,wI=[];eL()});import*as EI from"fs";import{exec as M0}from"child_process";import{app as Fu,BrowserWindow as qm,clipboard as as,contentTracing as O0,Menu as Wu,Notification as F0,powerMonitor as Pi,powerSaveBlocker as xI,screen as Uu,shell as PI,webContents as rL}from"electron";import{arch as iL,cpus as nL,freemem as oL,loadavg as sL,platform as aL,release as lL,totalmem as cL,type as dL}from"os";import{promisify as W0}from"util";var Wi,Xs,Fl=I(()=>{Vo();q();$();ze();we();X();ce();Ou();nr();w0();vI();xe();Qs();Lt();Z();Ct();te();yI();qt();dl();tn();Kt();Rr();is();ot();_0();k0();Ll();He();D0();et();Oy();ss();ni();wt();Wi=O("nativeHostMainService"),Xs=class extends T{constructor(e,t,i,o,s,a,l,c,d,u,f,m,v){super();this.windowsMainService=e;this.auxiliaryWindowsMainService=t;this.dialogMainService=i;this.lifecycleMainService=o;this.environmentMainService=s;this.logService=a;this.productService=l;this.themeMainService=c;this.workspacesManagementMainService=d;this.configurationService=u;this.requestService=f;this.proxyAuthService=m;this.instantiationService=v;this._onDidChangePassword=this._register(new b);this.onDidChangePassword=this._onDidChangePassword.event;this._isTracing=!1;this.activeToasts=this._register(new Dt);this.onDidOpenMainWindow=S.map(this.windowsMainService.onDidOpenWindow,y=>y.id),this.onDidTriggerWindowSystemContextMenu=S.any(S.map(this.windowsMainService.onDidTriggerSystemContextMenu,({window:y,x:C,y:w})=>({windowId:y.id,x:C,y:w})),S.map(this.auxiliaryWindowsMainService.onDidTriggerSystemContextMenu,({window:y,x:C,y:w})=>({windowId:y.id,x:C,y:w}))),this.onDidMaximizeWindow=S.any(S.map(this.windowsMainService.onDidMaximizeWindow,y=>y.id),S.map(this.auxiliaryWindowsMainService.onDidMaximizeWindow,y=>y.id)),this.onDidUnmaximizeWindow=S.any(S.map(this.windowsMainService.onDidUnmaximizeWindow,y=>y.id),S.map(this.auxiliaryWindowsMainService.onDidUnmaximizeWindow,y=>y.id)),this.onDidChangeWindowFullScreen=S.any(S.map(this.windowsMainService.onDidChangeFullScreen,y=>({windowId:y.window.id,fullscreen:y.fullscreen})),S.map(this.auxiliaryWindowsMainService.onDidChangeFullScreen,y=>({windowId:y.window.id,fullscreen:y.fullscreen}))),this.onDidChangeWindowAlwaysOnTop=S.any(S.None,S.map(this.auxiliaryWindowsMainService.onDidChangeAlwaysOnTop,y=>({windowId:y.window.id,alwaysOnTop:y.alwaysOnTop}))),this.onDidBlurMainWindow=S.filter(S.fromNodeEventEmitter(Fu,"browser-window-blur",(y,C)=>C.id),y=>!!this.windowsMainService.getWindowById(y)),this.onDidFocusMainWindow=S.any(S.map(S.filter(S.map(this.windowsMainService.onDidChangeWindowsCount,()=>this.windowsMainService.getLastActiveWindow()),y=>!!y),y=>y.id),S.filter(S.fromNodeEventEmitter(Fu,"browser-window-focus",(y,C)=>C.id),y=>!!this.windowsMainService.getWindowById(y))),this.onDidBlurMainOrAuxiliaryWindow=S.any(this.onDidBlurMainWindow,S.map(S.filter(S.fromNodeEventEmitter(Fu,"browser-window-blur",(y,C)=>this.auxiliaryWindowsMainService.getWindowByWebContents(C.webContents)),y=>!!y),y=>y.id)),this.onDidFocusMainOrAuxiliaryWindow=S.any(this.onDidFocusMainWindow,S.map(S.filter(S.fromNodeEventEmitter(Fu,"browser-window-focus",(y,C)=>this.auxiliaryWindowsMainService.getWindowByWebContents(C.webContents)),y=>!!y),y=>y.id)),this.onDidSuspendOS=S.fromNodeEventEmitter(Pi,"suspend"),this.onDidResumeOS=S.fromNodeEventEmitter(Pi,"resume"),this.onDidChangeOnBatteryPower=S.any(S.map(S.fromNodeEventEmitter(Pi,"on-ac"),()=>!1),S.map(S.fromNodeEventEmitter(Pi,"on-battery"),()=>!0)),this.onDidChangeThermalState=S.map(S.fromNodeEventEmitter(Pi,"thermal-state-change"),y=>y.state),this.onDidChangeSpeedLimit=S.map(S.fromNodeEventEmitter(Pi,"speed-limit-change"),y=>y.limit),this.onWillShutdownOS=S.fromNodeEventEmitter(Pi,"shutdown"),this.onDidLockScreen=S.fromNodeEventEmitter(Pi,"lock-screen"),this.onDidUnlockScreen=S.fromNodeEventEmitter(Pi,"unlock-screen"),this.onDidChangeColorScheme=this.themeMainService.onDidChangeColorScheme,this.onDidChangeDisplay=S.debounce(S.any(S.filter(S.fromNodeEventEmitter(Uu,"display-metrics-changed",(y,C,w)=>w),y=>!(Array.isArray(y)&&y.length===1&&y[0]==="workArea")),S.fromNodeEventEmitter(Uu,"display-added"),S.fromNodeEventEmitter(Uu,"display-removed")),()=>{},100)}get windowId(){throw new Error("Not implemented in electron-main")}async getWindows(e,t){let i=this.windowsMainService.getWindows().map(s=>({id:s.id,workspace:s.openedWorkspace??jo(s.backupPath,s.isExtensionDevelopmentHost),title:s.win?.getTitle()??"",filename:s.getRepresentedFilename(),dirty:s.isDocumentEdited()})),o=[];return t.includeAuxiliaryWindows&&o.push(...this.auxiliaryWindowsMainService.getWindows().map(s=>({id:s.id,parentId:s.parentId,title:s.win?.getTitle()??"",filename:s.getRepresentedFilename()}))),[...i,...o]}async getWindowCount(e){return this.windowsMainService.getWindowCount()}async getActiveWindowId(e){let t=this.windowsMainService.getFocusedWindow()||this.windowsMainService.getLastActiveWindow();if(t)return t.id}async getActiveWindowPosition(){let e=this.windowsMainService.getFocusedWindow()||this.windowsMainService.getLastActiveWindow();if(e)return e.getBounds()}async getNativeWindowHandle(e,t){let i=this.windowById(t,e);if(i?.win)return H.wrap(i.win.getNativeWindowHandle())}openWindow(e,t,i){return Array.isArray(t)?this.doOpenWindow(e,t,i):this.doOpenEmptyWindow(e,t)}async doOpenWindow(e,t,i=Object.create(null)){t.length>0&&await this.windowsMainService.open({context:5,contextWindowId:e,urisToOpen:t,cli:this.environmentMainService.args,forceNewWindow:i.forceNewWindow,forceReuseWindow:i.forceReuseWindow,preferNewWindow:i.preferNewWindow,diffMode:i.diffMode,mergeMode:i.mergeMode,addMode:i.addMode,removeMode:i.removeMode,gotoLineMode:i.gotoLineMode,noRecentEntry:i.noRecentEntry,waitMarkerFileURI:i.waitMarkerFileURI,remoteAuthority:i.remoteAuthority||void 0,forceProfile:i.forceProfile,forceTempProfile:i.forceTempProfile})}async doOpenEmptyWindow(e,t){await this.windowsMainService.openEmptyWindow({context:5,contextWindowId:e},t)}async openAgentsWindow(e,t){await this.windowsMainService.openAgentsWindow({context:5,contextWindowId:e,cli:this.environmentMainService.args,forceNewWindow:t?.forceNewWindow})}async launchSiblingApp(e,t){let i=[...t??[]],o=this.environmentMainService.args["agents-user-data-dir"];o&&i.push("--user-data-dir",o);let s=this.environmentMainService.args["agents-extensions-dir"];s&&i.push("--extensions-dir",s);let a=this.environmentMainService.args["shared-data-dir"];a&&i.push("--shared-data-dir",a);let l=this.environmentMainService.args["agent-plugins-dir"];l&&i.push("--agent-plugins-dir",l),I0(this.productService,i,d=>{this.logService.error("[launchSiblingApp] Failed to spawn sibling app:",d.message)})||this.logService.warn("[launchSiblingApp] Could not resolve sibling app on this platform")}async isFullScreen(e,t){return this.windowById(t?.targetWindowId,e)?.isFullScreen??!1}async toggleFullScreen(e,t){this.windowById(t?.targetWindowId,e)?.toggleFullScreen()}async getCursorScreenPoint(e){let t=Uu.getCursorScreenPoint(),i=Uu.getDisplayNearestPoint(t);return{point:t,display:i.bounds}}async isMaximized(e,t){return this.windowById(t?.targetWindowId,e)?.win?.isMaximized()??!1}async maximizeWindow(e,t){this.windowById(t?.targetWindowId,e)?.win?.maximize()}async unmaximizeWindow(e,t){this.windowById(t?.targetWindowId,e)?.win?.unmaximize()}async minimizeWindow(e,t){this.windowById(t?.targetWindowId,e)?.win?.minimize()}async moveWindowTop(e,t){this.windowById(t?.targetWindowId,e)?.win?.moveTop()}async isWindowAlwaysOnTop(e,t){return this.windowById(t?.targetWindowId,e)?.win?.isAlwaysOnTop()??!1}async toggleWindowAlwaysOnTop(e,t){let i=this.windowById(t?.targetWindowId,e);i?.win?.setAlwaysOnTop(!i.win.isAlwaysOnTop())}async setWindowAlwaysOnTop(e,t,i){this.windowById(i?.targetWindowId,e)?.win?.setAlwaysOnTop(t)}async positionWindow(e,t,i){let o=this.windowById(i?.targetWindowId,e);if(o?.win){if(o.win.isFullScreen()){let s=S.toPromise(S.once(S.fromNodeEventEmitter(o.win,"leave-full-screen")));o.win.setFullScreen(!1),await s}o.win.setBounds(t)}}async updateWindowControls(e,t){this.windowById(t?.targetWindowId,e)?.updateWindowControls(t)}async updateWindowAccentColor(e,t,i){if(!F)return;let o=this.windowById(e);if(!o)return;let s,a;t==="default"?(s=null,a=null):t==="off"?(s=!1,a=!1):(s=t,a=i??t);let l=[o];for(let c of this.auxiliaryWindowsMainService.getWindows())c.parentId===e&&l.push(c);for(let c of l)c.win?.setAccentColor(c.win.isFocused()?s:a)}async focusWindow(e,t){this.windowById(t?.targetWindowId,e)?.focus({mode:t?.mode??0})}async setMinimumSize(e,t,i){let o=this.codeWindowById(e);if(o?.win){let[s,a]=o.win.getSize(),[l,c]=o.win.getMinimumSize(),[d,u]=[t??l,i??c],[f,m]=[Math.max(s,d),Math.max(a,u)];(l!==d||c!==u)&&o.win.setMinimumSize(d,u),(s!==f||a!==m)&&o.win.setSize(f,m)}}async saveWindowSplash(e,t){let i=this.codeWindowById(e);this.themeMainService.saveWindowSplash(e,i?.openedWorkspace,t)}async setBackgroundThrottling(e,t){let i=this.codeWindowById(e);this.logService.trace(`Setting background throttling for window ${e} to '${t}'`),i?.win?.webContents?.setBackgroundThrottling(t)}async installShellCommand(e){let{source:t,target:i}=await this.getShellCommandLink();try{let{symbolicLink:o}=await ir.stat(t);if(o&&!o.dangling){let s=await Q.realpath(t);if(i===s)return}}catch(o){if(o.code!=="ENOENT")throw o}await this.installShellCommandWithPrivileges(e,t,i)}async installShellCommandWithPrivileges(e,t,i){let{response:o}=await this.showMessageBox(e,{type:"info",message:h(2373,null,this.productService.nameShort),buttons:[h(2365,null),h(2361,null)]});if(o===1)throw new xt;try{let s=`osascript -e "do shell script \\"mkdir -p /usr/local/bin && ln -sf '${i}' '${t}'\\" with administrator privileges"`;await W0(M0)(s)}catch{throw new Error(h(2362,null,t))}}async uninstallShellCommand(e){let{source:t}=await this.getShellCommandLink();try{await EI.promises.unlink(t)}catch(i){switch(i.code){case"EACCES":{let{response:o}=await this.showMessageBox(e,{type:"info",message:h(2374,null,this.productService.nameShort),buttons:[h(2365,null),h(2361,null)]});if(o===1)throw new xt;try{let s=`osascript -e "do shell script \\"rm '${t}'\\" with administrator privileges"`;await W0(M0)(s)}catch{throw new Error(h(2363,null,t))}break}case"ENOENT":break;default:throw i}}}async getShellCommandLink(){let e=Er(this.environmentMainService.appRoot,"bin","code"),t=`/usr/local/bin/${this.productService.applicationName}`;if(!await Q.exists(e))throw new Error(h(2368,null,e));return{source:t,target:e}}async showMessageBox(e,t){let i=this.windowById(t?.targetWindowId,e);return this.dialogMainService.showMessageBox(t,i?.win??void 0)}async showSaveDialog(e,t){let i=this.windowById(t?.targetWindowId,e);return this.dialogMainService.showSaveDialog(t,i?.win??void 0)}async showOpenDialog(e,t){let i=this.windowById(t?.targetWindowId,e);return this.dialogMainService.showOpenDialog(t,i?.win??void 0)}async pickFileFolderAndOpen(e,t){let i=await this.dialogMainService.pickFileFolder(t);i&&await this.doOpenPicked(await Promise.all(i.map(async o=>await ir.existsDirectory(o)?{folderUri:x.file(o)}:{fileUri:x.file(o)})),t,e)}async pickFolderAndOpen(e,t){let i=await this.dialogMainService.pickFolder(t);i&&await this.doOpenPicked(i.map(o=>({folderUri:x.file(o)})),t,e)}async pickFileAndOpen(e,t){let i=await this.dialogMainService.pickFile(t);i&&await this.doOpenPicked(i.map(o=>({fileUri:x.file(o)})),t,e)}async pickWorkspaceAndOpen(e,t){let i=await this.dialogMainService.pickWorkspace(t);i&&await this.doOpenPicked(i.map(o=>({workspaceUri:x.file(o)})),t,e)}async doOpenPicked(e,t,i){await this.windowsMainService.open({context:3,contextWindowId:i,cli:this.environmentMainService.args,urisToOpen:e,forceNewWindow:t.forceNewWindow})}async showItemInFolder(e,t){PI.showItemInFolder(t)}async setRepresentedFilename(e,t,i){this.windowById(i?.targetWindowId,e)?.setRepresentedFilename(t)}async setDocumentEdited(e,t,i){this.windowById(i?.targetWindowId,e)?.setDocumentEdited(t)}async openExternal(e,t,i){this.environmentMainService.unsetSnapExportedVariables();try{Sv(t,W.http,W.https)?this.openExternalBrowser(e,t,i):this.doOpenShellExternal(e,t)}finally{this.environmentMainService.restoreSnapExportedVariables()}return!0}async openExternalBrowser(e,t,i){let o=i??this.configurationService.getValue("workbench.externalBrowser");if(!o)return this.doOpenShellExternal(e,t);if((o.includes(pe.sep)||o.includes(dt.sep))&&!await Q.exists(o))return this.logService.error(`Configured external browser path does not exist: ${o}`),this.doOpenShellExternal(e,t);try{let{default:s,apps:a}=await import("open"),l=await s(t,{app:{name:Object.hasOwn(a,o)?a[o]:o}});F||l.stderr?.once("data",c=>(this.logService.error(`Error openening external URL '${t}' using browser '${o}': ${c.toString()}`),this.doOpenShellExternal(e,t)))}catch(s){return this.logService.error(`Unable to open external URL '${t}' using browser '${o}' due to ${s}.`),this.doOpenShellExternal(e,t)}}async doOpenShellExternal(e,t){try{await PI.openExternal(t)}catch(i){let o,s;Sv(t,W.http,W.https)?(o=!0,s=h(2366,null)):(o=!1,s=h(2367,null));let{response:a}=await this.dialogMainService.showMessageBox({type:"error",message:s,detail:i.message,buttons:o?[h(2364,null),h(2361,null)]:[h(2365,null)]},this.windowById(e)?.win??void 0);if(a===1)return;this.writeClipboardText(e,t)}}moveItemToTrash(e,t){return PI.trashItem(t)}async isAdmin(){let e;return F?e=(await import("native-is-elevated")).default():e=process.getuid?.()===0,e}async writeElevated(e,t,i,o){let s=await import("@vscode/sudo-prompt"),a=Ds(this.environmentMainService.userDataPath,"code-elevated");await Q.writeFile(a,JSON.stringify({source:t.fsPath,target:i.fsPath}));try{await new Promise((l,c)=>{let d=[`"${this.cliPath}"`];o?.unlock&&d.push("--file-chmod"),d.push("--file-write",`"${a}"`);let u={name:this.productService.nameLong.replace("-",""),icns:V&&this.environmentMainService.isBuilt?N(Le(this.environmentMainService.appRoot),`${this.productService.nameShort}.icns`):void 0};this.logService.trace(`[sudo-prompt] running command: ${d.join(" ")}`),s.exec(d.join(" "),u,(f,m,v)=>{m&&this.logService.trace(`[sudo-prompt] received stdout: ${m}`),v&&this.logService.error(`[sudo-prompt] received stderr: ${v}`),f?c(f):l(void 0)})})}finally{await EI.promises.unlink(a)}}async isRunningUnderARM64Translation(){return re||F?!1:Fu.runningUnderARM64Translation}get cliPath(){return F?this.environmentMainService.isBuilt?N(Le(process.execPath),"bin",`${this.productService.applicationName}.cmd`):N(this.environmentMainService.appRoot,"scripts","code-cli.bat"):re?this.environmentMainService.isBuilt?N(Le(process.execPath),"bin",`${this.productService.applicationName}`):N(this.environmentMainService.appRoot,"scripts","code-cli.sh"):this.environmentMainService.isBuilt?N(this.environmentMainService.appRoot,"bin","code"):N(this.environmentMainService.appRoot,"scripts","code-cli.sh")}async getOSStatistics(){return{totalmem:cL(),freemem:oL(),loadavg:sL()}}async getOSProperties(){return{arch:iL(),platform:aL(),release:lL(),type:dL(),cpus:nL()}}async getOSVirtualMachineHint(){return Mu.value()}async getOSColorScheme(){return this.themeMainService.getColorScheme()}async hasWSLFeatureInstalled(){return F&&C0()}async getScreenshot(e,t,i){let a=(await this.windowById(i?.targetWindowId,e)?.win?.webContents.capturePage(t))?.toJPEG(95);return a&&H.wrap(a)}async getProcessId(e){return this.windowById(void 0,e)?.win?.webContents.getOSProcessId()}async killProcess(e,t,i){process.kill(t,i)}async readClipboardText(e,t){this.logService.trace(`readClipboardText in window ${e} with type:`,t);let i=as.readText(t);return this.logService.trace("clipboardText.length :",i.length),i}async triggerPaste(e,t){return this.logService.trace(`Triggering paste in window ${e} with options:`,t),this.windowById(t?.targetWindowId,e)?.win?.webContents.paste()??Promise.resolve()}async readImage(){return as.readImage().toPNG()}async writeClipboardText(e,t,i){return as.writeText(t,i)}async readClipboardFindText(e){return as.readFindText()}async writeClipboardFindText(e,t){return as.writeFindText(t)}async writeClipboardBuffer(e,t,i,o){return as.writeBuffer(t,Buffer.from(i.buffer),o)}async readClipboardBuffer(e,t){return H.wrap(as.readBuffer(t))}async hasClipboard(e,t,i){return as.has(t,i)}async newWindowTab(){await this.windowsMainService.open({context:5,cli:this.environmentMainService.args,forceNewTabbedWindow:!0,forceEmpty:!0,remoteAuthority:this.environmentMainService.args.remote||void 0})}async showPreviousWindowTab(){Wu.sendActionToFirstResponder("selectPreviousTab:")}async showNextWindowTab(){Wu.sendActionToFirstResponder("selectNextTab:")}async moveWindowTabToNewWindow(){Wu.sendActionToFirstResponder("moveTabToNewWindow:")}async mergeAllWindowTabs(){Wu.sendActionToFirstResponder("mergeAllWindows:")}async toggleWindowTabsBar(){Wu.sendActionToFirstResponder("toggleTabBar:")}async updateTouchBar(e,t){this.codeWindowById(e)?.updateTouchBar(t)}async notifyReady(e){this.codeWindowById(e)?.setReady()}async relaunch(e,t){return this.lifecycleMainService.relaunch(t)}async reload(e,t){let i=this.codeWindowById(e);if(i){if(ct(i.openedWorkspace)){let o=i.openedWorkspace.configPath;if(o.scheme===W.file&&(await this.workspacesManagementMainService.resolveLocalWorkspace(o))?.transient)return this.openWindow(i.id,{forceReuseWindow:!0})}return this.lifecycleMainService.reload(i,t?.disableExtensions!==void 0?{_:[],"disable-extensions":t.disableExtensions}:void 0)}}async closeWindow(e,t){return this.windowById(t?.targetWindowId,e)?.win?.close()}async quit(e){let t=this.windowsMainService.getLastActiveWindow();t?.isExtensionDevelopmentHost&&this.windowsMainService.getWindowCount()>1&&t.win?t.win.close():this.lifecycleMainService.quit()}async exit(e,t){await this.lifecycleMainService.kill(t)}async resolveProxy(e,t){return this.codeWindowById(e)?.win?.webContents?.session?.resolveProxy(t)}async lookupAuthorization(e,t){return this.proxyAuthService.lookupAuthorization(t)}async lookupKerberosAuthorization(e,t){return this.requestService.lookupKerberosAuthorization(t)}async loadCertificates(e){return this.requestService.loadCertificates()}isPortFree(e,t){return x0(t,1e3)}findFreePort(e,t,i,o,s=1){return S0(t,i,o,s)}async openDevTools(e,t){this.windowById(t?.targetWindowId,e)?.win?.webContents.openDevTools(t?.mode?{mode:t.mode,activate:t.activate}:void 0)}async toggleDevTools(e,t){this.windowById(t?.targetWindowId,e)?.win?.webContents.toggleDevTools()}async openDevToolsWindow(e,t){let i=this.codeWindowById(e);i&&this.openChildWindow(i.win,t)}openChildWindow(e,t,i={}){let s={...this.instantiationService.invokeFunction(ul,Dn(),{forceNativeTitlebar:!0}),parent:e??void 0,...i},a=new qm(s);return a.setMenuBarVisibility(!1),a.loadURL(t),a.once("ready-to-show",()=>a.show()),a}async openGPUInfoWindow(e){let t=this.codeWindowById(e);if(t){if(typeof this.gpuInfoWindowId!="number"){let i=this.openChildWindow(t.win,"chrome://gpu");i.once("close",()=>this.gpuInfoWindowId=void 0),this.gpuInfoWindowId=i.id}if(typeof this.gpuInfoWindowId=="number"){let i=qm.fromId(this.gpuInfoWindowId);i?.isMinimized()&&i?.restore(),i?.focus()}}}async openContentTracingWindow(){if(typeof this.contentTracingWindowId!="number"){let e=this.openChildWindow(null,"chrome://tracing",{paintWhenInitiallyHidden:!1,webPreferences:{backgroundThrottling:!1}});e.webContents.once("did-finish-load",async()=>{await e.webContents.executeJavaScript(`
					window.prompt = () => '';
					null
				`),e.show()}),e.once("close",()=>this.contentTracingWindowId=void 0),this.contentTracingWindowId=e.id}if(typeof this.contentTracingWindowId=="number"){let e=qm.fromId(this.contentTracingWindowId);e?.isMinimized()&&e?.restore(),e?.focus()}}async startTracing(e,t){if(this._isTracing)throw new Error(h(2372,null,"workbench.action.stopTracing"));let i=["record-until-full","enable-sampling"];await O0.startRecording({categoryFilter:t,traceOptions:i.join(",")}),this._isTracing=!0}async stopTracing(e){if(!this._isTracing&&!this.environmentMainService.args.trace)return;this._isTracing=!1;let t=await O0.stopRecording(`${Ds(this.environmentMainService.userHome.fsPath,this.productService.applicationName)}.trace.txt`);await this.dialogMainService.showMessageBox({type:"info",message:h(2370,null),detail:h(2369,null,t),buttons:[h(2371,null)]},qm.getFocusedWindow()??void 0),this.showItemInFolder(void 0,t)}async profileRenderer(e,t,i){let o=this.codeWindowById(e);if(!o?.win)throw new Error;return await new Ml(o.win,t,this.logService).inspect(i)}async showToast(e,t){if(!F0.isSupported())return{supported:!1,clicked:!1};let i=new F0({title:t.title,body:t.body,silent:t.silent,actions:t.actions?.map(a=>({type:"button",text:a}))}),o=new j;this.activeToasts.set(t.id,o);let s=new $e;return o.add(G(()=>{this.activeToasts.deleteAndDispose(t.id),i.removeAllListeners(),i.close(),s.dispose(!0)})),new Promise(a=>{let l=c=>{a(c),o.dispose()};o.add(s.token.onCancellationRequested(()=>l({supported:!0,clicked:!1}))),i.on("click",()=>l({supported:!0,clicked:!0})),i.on("action",(c,d)=>l({supported:!0,clicked:!0,actionIndex:d})),i.on("close",()=>l({supported:!0,clicked:!1})),i.on("failed",()=>l({supported:!1,clicked:!1})),i.show()})}async clearToast(e,t){this.activeToasts.deleteAndDispose(t)}async clearToasts(){this.activeToasts.clearAndDisposeAll()}async windowsGetStringRegKey(e,t,i,o){if(!F)return;let s=await import("@vscode/windows-registry");try{return s.GetStringRegKey(t,i,o)}catch{return}}async createZipFile(e,t,i){await R0(t.fsPath,i)}async getSystemIdleState(e,t){return Pi.getSystemIdleState(t)}async getSystemIdleTime(e){return Pi.getSystemIdleTime()}async getCurrentThermalState(e){return Pi.getCurrentThermalState()}async isOnBatteryPower(e){return Pi.isOnBatteryPower()}async startPowerSaveBlocker(e,t){return xI.start(t)}async stopPowerSaveBlocker(e,t){return xI.stop(t)}async isPowerSaveBlockerStarted(e,t){return xI.isStarted(t)}windowById(e,t){return this.codeWindowById(e)??this.auxiliaryWindowById(e)??this.codeWindowById(t)}codeWindowById(e){if(typeof e=="number")return this.windowsMainService.getWindowById(e)}auxiliaryWindowById(e){if(typeof e!="number")return;let t=rL.fromId(e);if(t)return this.auxiliaryWindowsMainService.getWindowByWebContents(t)}};E([se],Xs.prototype,"cliPath",1),Xs=E([g(0,qe),g(1,nn),g(2,ui),g(3,ye),g(4,_e),g(5,B),g(6,Te),g(7,An),g(8,pi),g(9,ue),g(10,Fi),g(11,bu),g(12,Ht)],Xs)});import{clipboard as U0,Menu as uL,MenuItem as ur}from"electron";var Nu,Ys,CI=I(()=>{q();$();wt();Au();Lt();Z();dI();Xt();Kt();pI();Fn();cI();Zt();xe();Fl();ar();Nu=O("browserViewMainService"),Ys=class extends T{constructor(e,t,i,o,s,a){super();this.environmentMainService=e;this.instantiationService=t;this.windowsMainService=i;this.telemetryService=o;this.nativeHostMainService=s;this.applicationStorageMainService=a;this.browserViews=this._register(new Dt);this._activeTokens=new Map;this._keybindings=Object.create(null);this._onDidCreateBrowserView=this._register(new b);this.onDidCreateBrowserView=this._onDidCreateBrowserView.event}static isBrowserViewWebContents(e){return sn.isBrowserViewWebContents(e)}async getOrCreateBrowserView(e,t){if(this.browserViews.has(e))return this.browserViews.get(e).getState();let i=this.windowsMainService.getWindowById(t.owner.mainWindowId);if(!i)throw new Error(`Owner window with ID ${t.owner.mainWindowId} not found`);let o=sn.getOrCreate(e,t.scope,this.environmentMainService.workspaceStorageHome,i.openedWorkspace?.id),s=this.createBrowserView(e,t.owner,o);return t.initialState?.url&&s.loadURL(t.initialState.url),{...s.getState(),...t.initialState}}tryGetBrowserView(e){return this.browserViews.get(e)}async createTarget(e,t,i){let o=i?sn.get(i):void 0;return this.openNew(e,{owner:t,session:o,openOptions:{preserveFocus:!0},source:"cdpCreated"})}_getBrowserView(e){let t=this.browserViews.get(e);if(!t)throw new Error(`Browser view ${e} not found`);return t}_getViewInfo(e){return{id:e.id,owner:e.owner,state:e.getState()}}async getBrowserViews(e){let t=[];for(let[,i]of this.browserViews)e!==void 0&&i.owner.mainWindowId!==e||t.push(this._getViewInfo(i));return t}onDynamicDidNavigate(e){return this._getBrowserView(e).onDidNavigate}onDynamicDidChangeLoadingState(e){return this._getBrowserView(e).onDidChangeLoadingState}onDynamicDidChangeFocus(e){return this._getBrowserView(e).onDidChangeFocus}onDynamicDidChangeVisibility(e){return this._getBrowserView(e).onDidChangeVisibility}onDynamicDidChangeDevToolsState(e){return this._getBrowserView(e).onDidChangeDevToolsState}onDynamicDidKeyCommand(e){return this._getBrowserView(e).onDidKeyCommand}onDynamicDidChangeTitle(e){return this._getBrowserView(e).onDidChangeTitle}onDynamicDidChangeFavicon(e){return this._getBrowserView(e).onDidChangeFavicon}onDynamicDidFindInPage(e){return this._getBrowserView(e).onDidFindInPage}onDynamicDidClose(e){return this._getBrowserView(e).onDidClose}async getState(e){return this._getBrowserView(e).getState()}async destroyBrowserView(e){return this.browserViews.deleteAndDispose(e)}async layout(e,t){return this._getBrowserView(e).layout(t)}async setVisible(e,t){return this._getBrowserView(e).setVisible(t)}async loadURL(e,t){return this._getBrowserView(e).loadURL(t)}async getURL(e){return this._getBrowserView(e).getURL()}async goBack(e){return this._getBrowserView(e).goBack()}async goForward(e){return this._getBrowserView(e).goForward()}async reload(e,t){return this._getBrowserView(e).reload(t)}async toggleDevTools(e){return this._getBrowserView(e).toggleDevTools()}async canGoBack(e){return this._getBrowserView(e).canGoBack()}async canGoForward(e){return this._getBrowserView(e).canGoForward()}async captureScreenshot(e,t){return this._getBrowserView(e).captureScreenshot(t)}async focus(e,t){return this._getBrowserView(e).focus(t)}async findInPage(e,t,i){return this._getBrowserView(e).findInPage(t,i)}async stopFindInPage(e,t){return this._getBrowserView(e).stopFindInPage(t)}async getSelectedText(e){return this._getBrowserView(e).getSelectedText()}async clearStorage(e){return this._getBrowserView(e).clearStorage()}async setBrowserZoomIndex(e,t){return this._getBrowserView(e).setBrowserZoomIndex(t)}async trustCertificate(e,t,i){return this._getBrowserView(e).trustCertificate(t,i)}async untrustCertificate(e,t,i){return this._getBrowserView(e).untrustCertificate(t,i)}async clearGlobalStorage(){let e=sn.getOrCreateGlobal();e.connectStorage(this.applicationStorageMainService),await e.clearData()}async clearWorkspaceStorage(e){let t=sn.getOrCreateWorkspace(e,this.environmentMainService.workspaceStorageHome);t.connectStorage(this.applicationStorageMainService),await t.clearData()}async getConsoleLogs(e){return this._getBrowserView(e).getConsoleLogs()}async getElementData(e,t){return this._makeCancellable(t,i=>this._getBrowserView(e).getElementData(i))}async getFocusedElementData(e){return this._getBrowserView(e).getFocusedElementData()}async cancel(e){this._activeTokens.get(e)?.cancel()}async updateKeybindings(e){this._keybindings=e}async _makeCancellable(e,t){let i=new $e;this._activeTokens.set(e,i);try{return await t(i.token)}finally{this._activeTokens.delete(e),i.dispose()}}createBrowserView(e,t,i,o){if(this.browserViews.has(e))throw new Error(`Browser view with id ${e} already exists`);i.connectStorage(this.applicationStorageMainService);let s=this.instantiationService.createInstance(on,e,t,i,(a,l,c)=>{let d=this.createBrowserView(ke(),t,i,l);a&&d.loadURL(a).catch(()=>{});let u=this._getViewInfo(d);return this._onDidCreateBrowserView.fire({info:a?{...u,state:{...u.state,url:a}}:u,openOptions:c}),d},(a,l)=>this.showContextMenu(a,l),o);return this.browserViews.set(e,s),S.once(s.onDidClose)(()=>{this.browserViews.deleteAndDispose(e)}),s}async openNew(e,{owner:t,session:i,openOptions:o,source:s}){let a=ke(),l=this.createBrowserView(a,t,i||sn.getOrCreateEphemeral(a));e&&l.loadURL(e).catch(()=>{}),Um(this.telemetryService,s);let c=this._getViewInfo(l);return this._onDidCreateBrowserView.fire({info:e?{...c,state:{...c.state,url:e}}:c,openOptions:o}),l}showContextMenu(e,t){let i=e.getElectronWindow();if(!i)return;let o=e.webContents;if(o.isDestroyed())return;let s=new uL;t.linkURL&&(s.append(new ur({label:h(1986,null),click:()=>{this.openNew(t.linkURL,{owner:e.owner,session:e.session,openOptions:{preserveFocus:!0,background:!0},source:"browserLinkBackground"})}})),s.append(new ur({label:h(1985,null),click:()=>{this.nativeHostMainService.openExternal(void 0,t.linkURL)}})),s.append(new ur({type:"separator"})),s.append(new ur({label:h(1981,null),click:()=>{U0.write({text:t.linkURL,html:`<a href="${encodeURI(t.linkURL)}">${XS(t.linkText||t.linkURL)}</a>`})}}))),t.hasImageContents&&t.srcURL&&(s.items.length>0&&s.append(new ur({type:"separator"})),s.append(new ur({label:h(1984,null),click:()=>{this.openNew(t.srcURL,{owner:e.owner,session:e.session,openOptions:{preserveFocus:!0,background:!0},source:"browserLinkBackground"})}})),s.append(new ur({label:h(1979,null),click:()=>{e.webContents.copyImageAt(t.x,t.y)}})),s.append(new ur({label:h(1980,null),click:()=>{U0.writeText(t.srcURL)}}))),t.isEditable?(s.append(new ur({role:"cut",enabled:t.editFlags.canCut})),s.append(new ur({role:"copy",enabled:t.editFlags.canCopy})),s.append(new ur({role:"paste",enabled:t.editFlags.canPaste})),s.append(new ur({role:"pasteAndMatchStyle",enabled:t.editFlags.canPaste})),s.append(new ur({role:"selectAll",enabled:t.editFlags.canSelectAll}))):t.selectionText&&s.append(new ur({role:"copy"})),s.items.length===0&&(o.navigationHistory.canGoBack()&&s.append(new ur({label:h(1978,null),accelerator:this._keybindings[Ru.GoBack],click:()=>o.navigationHistory.goBack()})),o.navigationHistory.canGoForward()&&s.append(new ur({label:h(1982,null),accelerator:this._keybindings[Ru.GoForward],click:()=>o.navigationHistory.goForward()})),s.append(new ur({label:h(1987,null),accelerator:this._keybindings[Ru.Reload],click:()=>o.reload()}))),s.append(new ur({type:"separator"})),s.append(new ur({label:h(1983,null),click:()=>o.inspectElement(t.x,t.y)}));let a=e.getWebContentsView().getBounds();s.popup({window:i,x:a.x+t.x,y:a.y+t.y,sourceType:t.menuSourceType})}};Ys=E([g(0,_e),g(1,Ht),g(2,qe),g(3,Ke),g(4,Wi),g(5,Ir)],Ys)});var Vu,ls,Km,Bu,fi,N0=I(()=>{Vu={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerError:-32e3},ls=class extends Error{constructor(e,t){super(e);this.code=t;this.name="CDPError"}},Km=class extends ls{constructor(r){super(`Method not found: ${r}`,Vu.MethodNotFound),this.name="CDPMethodNotFoundError"}},Bu=class extends ls{constructor(r){super(r,Vu.InvalidParams),this.name="CDPInvalidParamsError"}},fi=class extends ls{constructor(r){super(r,Vu.ServerError),this.name="CDPServerError"}}});var Hu,B0=I(()=>{$();q();Xt();N0();Hu=class extends T{constructor(e){super();this.browserTarget=e;this.sessionId=`browser-session-${ke()}`;this._isAttachedToBrowserTarget=!1;this._autoAttach=!1;this._discover=!1;this._sessions=this._register(new Dt);this._targets=this._register(new Dt);this._autoAttachments=new WeakSet;this._handlers=new Map([["Browser.addPrivacySandboxCoordinatorKeyConfig",()=>({})],["Browser.addPrivacySandboxEnrollmentOverride",()=>({})],["Browser.close",()=>({})],["Browser.getVersion",()=>this.browserTarget.getVersion()],["Browser.resetPermissions",()=>({})],["Browser.getWindowForTarget",(e,t)=>this.handleBrowserGetWindowForTarget(e,t)],["Browser.setDownloadBehavior",()=>({})],["Browser.setWindowBounds",()=>({})],["Target.activateTarget",e=>this.handleTargetActivateTarget(e)],["Target.attachToTarget",e=>this.handleTargetAttachToTarget(e)],["Target.closeTarget",e=>this.handleTargetCloseTarget(e)],["Target.createBrowserContext",()=>this.handleTargetCreateBrowserContext()],["Target.createTarget",e=>this.handleTargetCreateTarget(e)],["Target.detachFromTarget",e=>this.handleTargetDetachFromTarget(e)],["Target.disposeBrowserContext",e=>this.handleTargetDisposeBrowserContext(e)],["Target.getBrowserContexts",()=>this.handleTargetGetBrowserContexts()],["Target.getTargets",()=>this.handleTargetGetTargets()],["Target.setAutoAttach",(e,t)=>this.handleTargetSetAutoAttach(e,t)],["Target.setDiscoverTargets",e=>this.handleTargetSetDiscoverTargets(e)],["Target.attachToBrowserTarget",()=>this.handleTargetAttachToBrowserTarget()],["Target.getTargetInfo",e=>this.handleTargetGetTargetInfo(e)]]);this._onEvent=this._register(new b);this.onEvent=this._onEvent.event;this._onClose=this._register(new b);this.onClose=this._onClose.event;this._onMessage=this._register(new b);this.onMessage=this._onMessage.event}get targetId(){return this.browserTarget.targetInfo.targetId}registerTarget(e){let t=e.targetInfo;if(!this._targets.has(t.targetId)){this._targets.set(t.targetId,e),this._discover&&this.sendEvent("Target.targetCreated",{targetInfo:e.targetInfo}),this._autoAttach&&!this._autoAttachments.has(e)&&(this._autoAttachments.add(e),e.attach()),e.onClose(()=>{this._targets.deleteAndDispose(t.targetId),this._discover&&this.sendEvent("Target.targetDestroyed",{targetId:t.targetId})}),e.onTargetInfoChanged(i=>{this._discover&&this.sendEvent("Target.targetInfoChanged",{targetInfo:i})});for(let[,i]of e.sessions)this.registerSession(i,!1);e.onSessionCreated(({session:i,waitingForDebugger:o})=>{this.registerSession(i,o)})}}notifySessionCreated(e,t){if(this._sessions.has(e.sessionId)||!e.parentSessionId||!this._sessions.has(e.parentSessionId))return;let i=this._targets.get(e.targetId);i&&i.notifySessionCreated(e,t)}registerSession(e,t){if(this._sessions.has(e.sessionId))return;this._sessions.set(e.sessionId,e);let i=this._targets.get(e.targetId);if(!i)throw new fi(`Unable to resolve target for session ${e.sessionId}`);this.sendEvent("Target.attachedToTarget",{sessionId:e.sessionId,targetInfo:i.targetInfo,waitingForDebugger:t},e.parentSessionId),e.onEvent(o=>{o.method.startsWith("Target.")||this.sendEvent(o.method,o.params,o.sessionId??e.sessionId)}),e.onClose(()=>{this._sessions.deleteAndDispose(e.sessionId),this.sendEvent("Target.detachedFromTarget",{sessionId:e.sessionId,targetId:e.targetId},e.parentSessionId)})}sendEvent(e,t,i){i||=this._isAttachedToBrowserTarget?this.sessionId:void 0,this._onMessage.fire({method:e,params:t,sessionId:i}),this._onEvent.fire({method:e,params:t,sessionId:i})}async sendCommand(e,t={},i){try{if(!i||i===this.sessionId||e.startsWith("Browser.")||e.startsWith("Target.")){let a=this._handlers.get(e);if(!a)throw new Km(e);return await a(t,i)}let o=this._sessions.get(i);if(!o)throw new fi(`Session not found: ${i}`);return await o.sendCommand(e,t)??{}}catch(o){throw o instanceof ls?o:new fi(o instanceof Error?o.message:"Unknown error")}}async sendMessage({id:e,method:t,params:i,sessionId:o}){return this.sendCommand(t,i,o).then(s=>{this._onMessage.fire({id:e,result:s,sessionId:o})}).catch(s=>{this._onMessage.fire({id:e,error:{code:s instanceof ls?s.code:Vu.ServerError,message:s.message||"Unknown error"},sessionId:o})})}handleBrowserGetWindowForTarget({targetId:e},t){let i=(t&&this._sessions.get(t)?.targetId)??e;if(!i)throw new fi("Unable to resolve target");let o=this._targets.get(i);if(!o)throw new fi("Unable to resolve target");return this.browserTarget.getWindowForTarget(o)}handleTargetGetBrowserContexts(){return{browserContextIds:this.browserTarget.getBrowserContexts()}}async handleTargetCreateBrowserContext(){return{browserContextId:await this.browserTarget.createBrowserContext()}}async handleTargetDisposeBrowserContext({browserContextId:e}){return await this.browserTarget.disposeBrowserContext(e),{}}handleTargetAttachToBrowserTarget(){return this.sendEvent("Target.attachedToTarget",{sessionId:this.sessionId,targetInfo:this.browserTarget.targetInfo,waitingForDebugger:!1}),this._isAttachedToBrowserTarget=!0,{sessionId:this.sessionId}}handleTargetActivateTarget({targetId:e}){let t=this._targets.get(e);if(!t)throw new fi("Unable to resolve target");return this.browserTarget.activateTarget(t)}async handleTargetSetAutoAttach(e,t){if(t&&t!==this.sessionId){let i=this._sessions.get(t);if(!i)throw new fi(`Session not found: ${t}`);return i.sendCommand("Target.setAutoAttach",e)}if(!e.flatten)throw new Bu("This implementation only supports auto-attach with flatten=true");return this._autoAttach=e.autoAttach??!1,{}}async handleTargetSetDiscoverTargets({discover:e=!1}){if(e!==this._discover&&(this._discover=e,this._discover))for(let t of this._targets.values())this.sendEvent("Target.targetCreated",{targetInfo:t.targetInfo});return{}}async handleTargetGetTargets(){return{targetInfos:Array.from(this._targets.values()).map(e=>e.targetInfo)}}async handleTargetGetTargetInfo({targetId:e}={}){if(!e)return{targetInfo:this.browserTarget.targetInfo};let t=this._targets.get(e);if(!t)throw new fi("Unable to resolve target");return{targetInfo:t.targetInfo}}async handleTargetAttachToTarget({targetId:e,flatten:t}){if(!t)throw new Bu("This implementation only supports attachToTarget with flatten=true");let i=this._targets.get(e);if(!i)throw new fi("Unable to resolve target");return{sessionId:(await i.attach()).sessionId}}async handleTargetDetachFromTarget({sessionId:e}){let t=this._sessions.get(e);if(!t)throw new fi(`Session not found: ${e}`);return t.dispose(),{}}async handleTargetCreateTarget({url:e,browserContextId:t}){let i=await this.browserTarget.createTarget(e||"about:blank",t);return this.registerTarget(i),this._autoAttach&&!this._autoAttachments.has(i)&&(this._autoAttachments.add(i),await i.attach()),{targetId:i.targetInfo.targetId}}async handleTargetCloseTarget({targetId:e}){try{let t=this._targets.get(e);if(!t)throw new fi("Unable to resolve target");return await this.browserTarget.closeTarget(t),{success:!0}}catch{return{success:!1}}}}});var Io,V0=I(()=>{q();$();Io=class extends T{constructor(e,t){super();this.view=e;this._targetInfo=t;this._sessions=new Map;this._onSessionCreated=this._register(new b);this.onSessionCreated=this._onSessionCreated.event;this._onClose=this._register(new b);this.onClose=this._onClose.event;this._onTargetInfoChanged=this._register(new b);this.onTargetInfoChanged=this._onTargetInfoChanged.event;this._isDisposed=!1;this._register(this.view.debugger.onTargetInfoChanged(i=>{i.targetId===this._targetInfo.targetId&&(i.title!==this._targetInfo.title||i.url!==this._targetInfo.url)&&(this._targetInfo.title=i.title,this._targetInfo.url=i.url,this._onTargetInfoChanged.fire(this.targetInfo))})),this._register(this.view.debugger.onTargetDestroyed(i=>{i===this._targetInfo.targetId&&this.dispose()}))}get sessions(){return this._sessions}get targetInfo(){return{...this._targetInfo,attached:this._sessions.size>0,browserContextId:this.view.session.id}}async attach(){let e=await this.view.debugger.attachToTarget(this.targetInfo.targetId);return this.notifySessionCreated(e,!1),e}notifySessionCreated(e,t){this._sessions.has(e.sessionId)||(this.sessions.size===0&&this._onTargetInfoChanged.fire(this.targetInfo),this._sessions.set(e.sessionId,e),e.onClose(()=>{this._sessions.delete(e.sessionId),this.sessions.size===0&&this._onTargetInfoChanged.fire(this.targetInfo)}),this._onSessionCreated.fire({session:e,waitingForDebugger:t}))}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let[,e]of this._sessions)e.dispose();this._sessions.clear(),this._onClose.fire(),super.dispose()}}}});var Wl,H0=I(()=>{$();q();dI();B0();CI();qt();pI();Xt();V0();Wl=class extends T{constructor(e,t,i,o){super();this.id=e;this.owner=t;this.browserViewMainService=i;this.productService=o;this.views=new Map;this.viewTargets=this._register(new Dt);this.knownContextIds=new Set;this.ownedContextIds=new Set;this._onDidAddView=this._register(new b);this.onDidAddView=this._onDidAddView.event;this._onDidRemoveView=this._register(new b);this.onDidRemoveView=this._onDidRemoveView.event;this._onDidDestroy=this._register(new b);this.onDidDestroy=this._onDidDestroy.event;this.debugger=this._register(new Hu(this));this._onTargetInfoChanged=this._register(new b);this.onTargetInfoChanged=this._onTargetInfoChanged.event;this.sessions=new Map;this.onSessionCreated=S.None;this.onClose=this._onDidDestroy.event}get onCDPMessage(){return this.debugger.onMessage}sendCDPMessage(e){return this.debugger.sendMessage(e)}async addView(e){if(this.views.has(e))return;let t=this.browserViewMainService.tryGetBrowserView(e);if(!t)throw new Error(`Browser view ${e} not found`);this.views.set(t.id,t),this.knownContextIds.add(t.session.id),this._onDidAddView.fire({viewId:t.id});let i=S.once(t.onDidClose)(()=>{this.removeView(e)}),o=await t.debugger.getTargetInfo();if(this.views.get(e)!==t){i.dispose();return}let s=new Io(t,o);this.viewTargets.set(t.id,s);let a=new j;a.add(i),s.onClose(()=>a.dispose()),this.debugger.registerTarget(s);for(let l of t.debugger.knownTargets.values())this.debugger.registerTarget(new Io(t,l));a.add(t.debugger.onTargetDiscovered(l=>{this.debugger.registerTarget(new Io(t,l))})),a.add(t.debugger.onSessionCreated(({session:l,waitingForDebugger:c})=>{this.debugger.notifySessionCreated(l,c)}))}async removeView(e){let t=this.views.get(e);t&&this.views.delete(e)&&(!this.ownedContextIds.has(t.session.id)&&![...this.views.values()].some(i=>i.session.id===t.session.id)&&this.knownContextIds.delete(t.session.id),this._onDidRemoveView.fire({viewId:t.id}),this.viewTargets.deleteAndDispose(e))}getVersion(){return{protocolVersion:"1.3",product:`${this.productService.nameShort}/${this.productService.version}`,revision:this.productService.commit||"unknown",userAgent:"Electron",jsVersion:process.versions.v8}}getWindowForTarget(e){if(!(e instanceof Io))throw new Error("Can only get window for BrowserView targets");let i=e.view.getWebContentsView().getBounds();return{windowId:this.owner.mainWindowId,bounds:{left:i.x,top:i.y,width:i.width,height:i.height,windowState:"normal"}}}async attach(){return new Hu(this)}notifySessionCreated(){}get targetInfo(){return{targetId:this.id,type:"browser",title:this.getVersion().product,url:"",attached:!0,canAccessOpener:!1}}async createTarget(e,t){if(t&&!this.knownContextIds.has(t))throw new Error(`Unknown browser context ${t}`);let i=await this.browserViewMainService.createTarget(e,this.owner,t);return i instanceof on?(await this.addView(i.id),this.viewTargets.get(i.id)):i}async activateTarget(e){if(!(e instanceof Io))throw new Error("Can only activate BrowserView targets")}async closeTarget(e){if(!(e instanceof Io))throw new Error("Can only close BrowserView targets");return await this.removeView(e.view.id),await this.browserViewMainService.destroyBrowserView(e.view.id),!0}getBrowserContexts(){return[...this.knownContextIds]}async createBrowserContext(){let t=sn.getOrCreateEphemeral(ke(),"cdp-created").id;return this.knownContextIds.add(t),this.ownedContextIds.add(t),t}async disposeBrowserContext(e){if(!this.ownedContextIds.has(e))throw new Error("Can only dispose browser contexts created by this group");let t=[...this.views.entries()].filter(([,i])=>i.session.id===e).map(([i])=>i);for(let i of t)await this.removeView(i),await this.browserViewMainService.destroyBrowserView(i);this.knownContextIds.delete(e),this.ownedContextIds.delete(e)}dispose(){this._onDidDestroy.fire(),super.dispose()}};Wl=E([g(2,Nu),g(3,Te)],Wl)});var TI,Ul,$0=I(()=>{$();q();Z();Xt();H0();TI=O("browserViewGroupMainService"),Ul=class extends T{constructor(e){super();this.instantiationService=e;this.groups=this._register(new Dt)}async createGroup(e){let t=ke(),i=this.instantiationService.createInstance(Wl,t,e);return this.groups.set(t,i),S.once(i.onDidDestroy)(()=>{this.groups.deleteAndLeak(t)}),t}async destroyGroup(e){this.groups.deleteAndDispose(e)}async addViewToGroup(e,t){return this._getGroup(e).addView(t)}async removeViewFromGroup(e,t){return this._getGroup(e).removeView(t)}async sendCDPMessage(e,t){return this._getGroup(e).debugger.sendMessage(t)}onDynamicDidAddView(e){return this._getGroup(e).onDidAddView}onDynamicDidRemoveView(e){return this._getGroup(e).onDidRemoveView}onDynamicDidDestroy(e){return this._getGroup(e).onDidDestroy}onDynamicCDPMessage(e){return this._getGroup(e).debugger.onMessage}_getGroup(e){let t=this.groups.get(e);if(!t)throw new Error(`Browser view group ${e} not found`);return t}};Ul=E([g(0,Ht)],Ul)});import pL from"assert";function fL(n,r){let e=(l,c)=>{console.warn(h(2097,null,l,c))},t=l=>{console.warn(h(2095,null,l))},i=(l,c)=>{console.warn(h(2094,null,l,c))},o=l=>({onUnknownOption:c=>{Wy.includes(l)||console.warn(h(2099,null,c,l))},onMultipleValues:e,onEmptyValue:t,onDeprecatedOption:i,getSubcommandReporter:Wy.includes(l)?o:void 0}),a=xu(n,Sm,r?{onUnknownOption:l=>{console.warn(h(2098,null,l))},onMultipleValues:e,onEmptyValue:t,onDeprecatedOption:i,getSubcommandReporter:o}:void 0);return a.goto&&a._.forEach(l=>pL(/^(\w:)?[^:]+(:\d*){0,2}:?$/.test(l),h(2096,null))),a}function mL(n){let r=n.findIndex(e=>!/^-/.test(e));if(r>-1)return[...n.slice(0,r),...n.slice(r+1)]}function q0(n){let[,...r]=n;if(F&&r.length>0){let t=Er(r[0]).toLowerCase(),i=Le(process.execPath).toLowerCase()+"\\";t.startsWith(i)&&t.endsWith("\\resources\\app\\out\\cli.js")&&r.shift()}process.env.VSCODE_DEV&&(r=mL(r)||[]);let e=!an(process.env);return fL(r,e)}function K0(n,...r){let e=n.indexOf("--");return e===-1?n.push(...r):n.splice(e,0,...r),n}function an(n){return n.VSCODE_CLI==="1"}var Nl=I(()=>{we();X();xe();Uy()});import*as _I from"os";function vL({useAlternateBitness:n=!1}={}){return n?$u===0?process.env["ProgramFiles(x86)"]||null:Bl===0&&process.env.ProgramW6432||null:process.env.ProgramFiles||null}async function zm({useAlternateBitness:n=!1,findPreview:r=!1}={}){let e=vL({useAlternateBitness:n});if(!e)return null;let t=N(e,"PowerShell");if(!await ir.existsDirectory(t))return null;let i=-1,o=null;for(let l of await Q.readdir(t)){let c=-1;if(r){let u=l.indexOf("-");if(u<0)continue;let f=l.substring(0,u);if(!z0.test(f)||l.substring(u+1)!=="preview")continue;c=parseInt(f,10)}else{if(!z0.test(l))continue;c=parseInt(l,10)}if(c<=i)continue;let d=N(t,l,"pwsh.exe");await ir.existsFile(d)&&(o=d,i=c)}if(!o)return null;let s=e.includes("x86")?" (x86)":"",a=r?" Preview":"";return new Zs(o,`PowerShell${a}${s}`,!0)}async function j0({findPreview:n}={}){if(!process.env.LOCALAPPDATA)return null;let r=N(process.env.LOCALAPPDATA,"Microsoft","WindowsApps");if(!await ir.existsDirectory(r))return null;let{pwshMsixDirRegex:e,pwshMsixName:t}=n?{pwshMsixDirRegex:gL,pwshMsixName:"PowerShell Preview (Store)"}:{pwshMsixDirRegex:hL,pwshMsixName:"PowerShell (Store)"};for(let i of await Q.readdir(r))if(e.test(i)){let o=N(r,i,"pwsh.exe");return new Zs(o,t)}return null}function yL(){let n=N(_I.homedir(),".dotnet","tools","pwsh.exe");return new Zs(n,".NET Core PowerShell Global Tool")}function IL(){let n=N(_I.homedir(),"scoop","apps"),r=N(n,"pwsh","current","pwsh.exe");return new Zs(r,"PowerShell (Scoop)")}function wL(){let n=N(process.env.windir,$u===1&&Bl!==1?"SysNative":"System32","WindowsPowerShell","v1.0","powershell.exe");return new Zs(n,"Windows PowerShell",!0)}async function*bL(){let n=await zm();n&&(yield n),n=await zm({useAlternateBitness:!0}),n&&(yield n),n=await j0(),n&&(yield n),n=yL(),n&&(yield n),n=await zm({findPreview:!0}),n&&(yield n),n=await j0({findPreview:!0}),n&&(yield n),n=await zm({useAlternateBitness:!0,findPreview:!0}),n&&(yield n),n=await IL(),n&&(yield n),n=wL(),n&&(yield n)}async function*kI(){for await(let n of bL())await n.exists()&&(yield n)}async function G0(){for await(let n of kI())return n;return null}var z0,hL,gL,$u,Bl,Zs,RI=I(()=>{we();nr();z0=/^\d+$/,hL=/^Microsoft.PowerShell_.*/,gL=/^Microsoft.PowerShellPreview_.*/;switch(process.arch){case"ia32":$u=1;break;case"arm":case"arm64":$u=2;break;default:$u=0;break}process.env.PROCESSOR_ARCHITEW6432?Bl=process.env.PROCESSOR_ARCHITEW6432==="ARM64"?2:0:process.env.PROCESSOR_ARCHITECTURE==="ARM64"?Bl=2:process.env.PROCESSOR_ARCHITECTURE==="X86"?Bl=1:Bl=0;Zs=class{constructor(r,e,t){this.exePath=r;this.displayName=e;this.knownToExist=t}async exists(){return this.knownToExist===void 0&&(this.knownToExist=await ir.existsFile(this.exePath)),this.knownToExist}}});import*as DI from"child_process";import{promises as J0}from"fs";function jm(n=St){return n.comspec||"cmd.exe"}function Q0(n){let r=[],e=!1,t=function(i){if(e){r.push(i);return}(!n.send(i,s=>{if(s&&console.error(s),e=!1,r.length>0){let a=r.slice(0);r=[],a.forEach(l=>t(l))}})||F)&&(e=!0)};return{send:t}}async function SL(n){if(await Q.exists(n)){let r;try{r=await J0.stat(n)}catch(e){e.message.startsWith("EACCES")&&(r=await J0.lstat(n))}return r?!r.isDirectory():!1}return!1}async function ea(n,r,e,t=St,i=SL){if(Do(n))return await i(n)?n:void 0;if(r===void 0&&(r=Zr()),Le(n)!=="."){let l=N(r,n);return await i(l)?l:void 0}let s=qy(t,"PATH");if(e===void 0&&Fe(s)&&(e=s.split(Bp)),e===void 0||e.length===0){let l=N(r,n);return await i(l)?l:void 0}for(let l of e){let c;if(Do(l)?c=N(l,n):c=N(r,l,n),F){let u=(qy(t,"PATHEXT")||".COM;.EXE;.BAT;.CMD").split(";").map(async f=>{let m=c+f;return await i(m)?m:void 0});for(let f of u){let m=await f;if(m)return m}}if(await i(c))return c}let a=N(r,n);return await i(a)?a:void 0}async function X0(n,r=!1){let e;if(F){let t=process.env.WINDIR||"C:\\Windows",i=N(t,"System32","taskkill.exe"),o=["/T"];r&&o.push("/F"),o.push("/PID",String(n)),e=DI.spawn(i,o,{stdio:["ignore","pipe","pipe"]})}else{let t=st.asFileUri("vs/base/node/terminateProcess.sh").fsPath;e=DI.spawn("/bin/sh",[t,String(n),r?"9":"15"],{stdio:["ignore","pipe","pipe"]})}return new Promise((t,i)=>{let o=[];e.stdout.on("data",s=>o.push(s)),e.stderr.on("data",s=>o.push(s)),e.on("error",i),e.on("exit",s=>{s===0?t():i(new Error(`taskkill exited with code ${s}: ${Buffer.concat(o).toString()}`))})})}var ta=I(()=>{di();we();X();yi();ku();Oe();nr();ze()});import{userInfo as xL}from"os";async function Gm(n,r){return n===1?F?EL():jm(r):PL(n,r)}function PL(n,r){if(re&&n===2||V&&n===3)return"/bin/bash";if(!AI){let e;if(F)e="/bin/bash";else{if(e=r.SHELL,!e)try{e=xL().shell}catch{}e||(e="sh"),e==="/bin/false"&&(e="/bin/bash")}AI=e}return AI}async function EL(){return LI||(LI=(await G0()).exePath),LI}var AI,LI,MI=I(()=>{X();RI();ta();AI=null;LI=null});function Z0(n,r,e){return Math.min(Math.max(n,r),e)}var eE=I(()=>{Ta()});import{spawn as CL}from"child_process";async function cs(n,r,e,t){return e["force-disable-user-env"]?(r.trace("resolveShellEnv(): skipped (--force-disable-user-env)"),{}):F?(r.trace("resolveShellEnv(): skipped (Windows)"),{}):an(t)&&!e["force-user-env"]?(r.trace("resolveShellEnv(): skipped (VSCODE_CLI is set)"),{}):(an(t)?r.trace("resolveShellEnv(): running (--force-user-env)"):r.trace("resolveShellEnv(): running (macOS/Linux)"),OI||(OI=vt.withAsyncBody(async(i,o)=>{let s=new $e,a=1e4,l=n.getValue("application.shellEnvironmentResolutionTimeout");typeof l=="number"&&(a=Z0(l,1,120)*1e3);let c=setTimeout(()=>{s.dispose(!0),o(new Error(h(2444,null)))},a);try{i(await TL(r,s.token))}catch(d){!od(d)&&!s.token.isCancellationRequested?o(new Error(h(2442,null,_r(d)))):i({})}finally{clearTimeout(c),s.dispose()}})),OI)}async function TL(n,r){let e=process.env.ELECTRON_RUN_AS_NODE;n.trace("getUnixShellEnvironment#runAsNode",e);let t=process.env.ELECTRON_NO_ATTACH_CONSOLE;n.trace("getUnixShellEnvironment#noAttach",t);let i=ke().replace(/-/g,"").substr(0,12),o=new RegExp(i+"({.*})"+i),s={...process.env,ELECTRON_RUN_AS_NODE:"1",ELECTRON_NO_ATTACH_CONSOLE:"1",VSCODE_RESOLVING_ENVIRONMENT:"1"};n.trace("getUnixShellEnvironment#env",s);let a=await Gm(Ut,s);return n.trace("getUnixShellEnvironment#shell",a),new Promise((l,c)=>{if(r.isCancellationRequested)return c(new xt);let d=Pe(a),u,f,m="";/^(?:pwsh|powershell)(?:-preview)?$/.test(d)?(u=`& '${process.execPath}' ${m} -p '''${i}'' + JSON.stringify(process.env) + ''${i}'''`,f=["-Login","-Command"]):d==="nu"?(u=`^'${process.execPath}' ${m} -p '"${i}" + JSON.stringify(process.env) + "${i}"'`,f=["-i","-l","-c"]):d==="xonsh"?(u=`import os, json; print("${i}", json.dumps(dict(os.environ)), "${i}")`,f=["-i","-l","-c"]):(u=`'${process.execPath}' ${m} -p '"${i}" + JSON.stringify(process.env) + "${i}"'`,d==="tcsh"||d==="csh"?f=["-ic"]:f=["-i","-l","-c"]),n.trace("getUnixShellEnvironment#spawn",JSON.stringify(f),u);let v=CL(a,[...f,u],{detached:!0,stdio:["ignore","pipe","pipe"],env:s});r.onCancellationRequested(()=>(v.kill(),c(new xt))),v.on("error",w=>{n.error("getUnixShellEnvironment#errorChildProcess",_r(w)),c(w)});let y=[];v.stdout.on("data",w=>y.push(w));let C=[];v.stderr.on("data",w=>C.push(w)),v.on("close",(w,_)=>{let D=Buffer.concat(y).toString("utf8");n.trace("getUnixShellEnvironment#raw",D);let k=Buffer.concat(C).toString("utf8");if(k.trim()&&n.trace("getUnixShellEnvironment#stderr",k),w||_)return c(new Error(h(2443,null,w,_)));let A=o.exec(D),de=A?A[1]:"{}";try{let L=JSON.parse(de);e?L.ELECTRON_RUN_AS_NODE=e:delete L.ELECTRON_RUN_AS_NODE,t?L.ELECTRON_NO_ATTACH_CONSOLE=t:delete L.ELECTRON_NO_ATTACH_CONSOLE,delete L.VSCODE_RESOLVING_ENVIRONMENT,delete L.XDG_RUNTIME_DIR,n.trace("getUnixShellEnvironment#result",L),l(L)}catch(L){n.error("getUnixShellEnvironment#errorCaught",_r(L)),c(L)}})})}var OI,qu=I(()=>{we();xe();wt();No();He();X();Xt();MI();Nl();he();eE()});var FI,tE,rE,WI=I(()=>{Z();FI=O("extensionHostStarter"),tE="extensionHostStarter",rE=6e3});var ds,iE=I(()=>{he();He();q();$();WI();Ct();te();Zt();os();Kt();et();ds=class extends T{constructor(e,t,i,o,s){super();this._logService=e;this._lifecycleMainService=t;this._windowsMainService=i;this._telemetryService=o;this._configurationService=s;this._extHosts=new Map;this._shutdown=!1;this._register(this._lifecycleMainService.onWillShutdown(a=>{this._shutdown=!0,a.join("extHostStarter",this._waitForAllExit(6e3))}))}static{this._lastId=0}dispose(){super.dispose()}_getExtHost(e){let t=this._extHosts.get(e);if(!t)throw new Error("Unknown extension host!");return t}onDynamicStdout(e){return this._getExtHost(e).onStdout}onDynamicStderr(e){return this._getExtHost(e).onStderr}onDynamicMessage(e){return this._getExtHost(e).onMessage}onDynamicExit(e){return this._getExtHost(e).onExit}async createExtensionHost(){if(this._shutdown)throw qi();let e=String(++ds._lastId),t=new ns(this._logService,this._windowsMainService,this._telemetryService,this._lifecycleMainService);this._extHosts.set(e,t);let i=t.onExit(({pid:o,code:s,signal:a})=>{i.dispose(),this._logService.info(`Extension host with pid ${o} exited with code: ${s}, signal: ${a}.`),setTimeout(()=>{t.dispose(),this._extHosts.delete(e)}),setTimeout(()=>{try{process.kill(o,0),this._logService.error(`Extension host with pid ${o} still exists, forcefully killing it...`),process.kill(o)}catch{}},1e3)});return{id:e}}async start(e,t){if(this._shutdown)throw qi();let i=this._getExtHost(e),o=["--skipWorkspaceStorageLock"];return this._configurationService.getValue("extensions.supportNodeGlobalNavigator")&&o.push("--supportGlobalNavigator"),i.start({...t,type:"extensionHost",name:"extension-host",entryPoint:"vs/workbench/api/node/extensionHostProcess",args:o,execArgv:t.execArgv,allowLoadingUnsignedLibraries:!0,respondToAuthRequestsFromMainProcess:!0,windowLifecycleBound:!0,windowLifecycleGraceTime:rE,correlationId:e}),{pid:await S.toPromise(i.onSpawn)}}async enableInspectPort(e){if(this._shutdown)throw qi();let t=this._extHosts.get(e);return t?t.enableInspectPort():!1}async kill(e){if(this._shutdown)throw qi();let t=this._extHosts.get(e);t&&t.kill()}async waitForExit(e,t){if(this._shutdown)throw qi();let i=this._extHosts.get(e);i&&await i.waitForExit(t)}async _killAllNow(){for(let[,e]of this._extHosts)e.kill()}async _waitForAllExit(e){let t=[];for(let[,i]of this._extHosts)t.push(i.waitForExit(e));return vt.settled(t).then(()=>{})}};ds=E([g(0,B),g(1,ye),g(2,qe),g(3,Ke),g(4,ue)],ds)});var Ku,nE=I(()=>{Z();Ku=O("externalTerminal")});var bQ,Vl,oE=I(()=>{Z();bQ=O("externalTerminal"),Vl="Terminal.app"});import*as us from"child_process";function ra(n){let r={...n.env};return YP(r),r}function aE(n){return n.errno==="ENOENT"&&n.path?new Error(h(2210,null,n.path)):n}function UI(n,r,e,t){let i="";n.on("error",o=>{e(aE(o))}),n.stderr?.on("data",o=>{i+=o.toString()}),n.on("exit",o=>{if(o===0)r(void 0);else if(i){let s=i.split(`
`,1);e(new Error(s[0]))}else e(new Error(h(2213,null,t,o)))})}function _L(n){let r="";for(let e of n)e.indexOf(" ")>=0?r+='"'+e+'"':r+=e,r+=" ";return r}var sE,zu,ln,ju,Jm,Gu,lE=I(()=>{Vo();ze();we();X();ku();nr();ta();xe();oE();sE=h(2209,null),zu=class{async getDefaultTerminalForPlatforms(){return{windows:ju.getDefaultTerminalWindows(),linux:await Gu.getDefaultTerminalLinuxReady(),osx:Vl}}},ln=class ln extends zu{static{this.CMD="cmd.exe"}openTerminal(r,e){return this.spawnTerminal(us,r,jm(),e)}spawnTerminal(r,e,t,i){let o=e.windowsExec||ln.getDefaultTerminalWindows();i&&i[1]===":"&&(i=i[0].toUpperCase()+i.substr(1));let s=Pe(o,".exe").toLowerCase();if(s==="cmder")return r.spawn(o,i?[i]:void 0),Promise.resolve(void 0);let a=["/c","start","/wait"];return o.indexOf(" ")>=0&&a.push(o),a.push(o),s==="wt"&&a.push("-d ."),new Promise((l,c)=>{let d=ra(process),u=r.spawn(t,a,{cwd:i,env:d,detached:!0});u.on("error",c),u.on("exit",()=>l())})}async runInTerminal(r,e,t,i,o){let s=o.windowsExec||ln.getDefaultTerminalWindows(),a=await ln.getWtExePath();return new Promise((l,c)=>{let d=`"${e} - ${sE}"`,u=`"${t.join('" "')}" & pause`,f=Object.assign({},ra(process),i);Object.keys(f).filter(w=>f[w]===null).forEach(w=>delete f[w]);let m={cwd:e,env:f,windowsVerbatimArguments:!0},v,y;Pe(s,".exe")==="wt"?(v=s,y=["-d",".",ln.CMD,"/c",u]):a?(v=a,y=["-d",".",s,"/c",u]):(v=ln.CMD,y=["/c","start",d,"/wait",s,"/c",`"${u}"`]),us.spawn(v,y,m).on("error",w=>{c(aE(w))}),l(void 0)})}static getDefaultTerminalWindows(){if(!ln._DEFAULT_TERMINAL_WINDOWS){let r=!!process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432");ln._DEFAULT_TERMINAL_WINDOWS=`${process.env.windir?process.env.windir:"C:\\Windows"}\\${r?"Sysnative":"System32"}\\cmd.exe`}return ln._DEFAULT_TERMINAL_WINDOWS}static async getWtExePath(){try{return await ea("wt")}catch{return}}};E([se],ln,"getWtExePath",1);ju=ln,Jm=class n extends zu{static{this.OSASCRIPT="/usr/bin/osascript"}openTerminal(r,e){return this.spawnTerminal(us,r,e)}runInTerminal(r,e,t,i,o){let s=o.osxExec||Vl;return new Promise((a,l)=>{if(s===Vl||s==="iTerm.app"){let c=s===Vl?"TerminalHelper":"iTermHelper",u=[st.asFileUri(`vs/workbench/contrib/externalTerminal/node/${c}.scpt`).fsPath,"-t",r||sE,"-w",e];for(let m of t)u.push("-a"),u.push(m);if(i){let m=Object.assign({},ra(process),i);for(let v in m){let y=m[v];y===null?(u.push("-u"),u.push(v)):(u.push("-e"),u.push(`${v}=${y}`))}}let f=us.spawn(n.OSASCRIPT,u);UI(f,a,l,s)}else if(s==="Ghostty.app"){let c=Object.assign({},ra(process),i),d=["-na","Ghostty.app","--args"];d.push("--working-directory="+e),d.push("--wait-after-command=true"),d.push("-e",...t);let u=us.spawn("/usr/bin/open",d,{env:c});UI(u,a,l,s)}else l(new Error(h(2211,null,s)))})}spawnTerminal(r,e,t){let i=e.osxExec||Vl;return new Promise((o,s)=>{let a=["-a",i];t&&a.push(t);let l=ra(process),c=r.spawn("/usr/bin/open",a,{cwd:t,env:l});c.on("error",s),c.on("exit",()=>o())})}},Gu=class n extends zu{static{this.WAIT_MESSAGE=h(2212,null)}openTerminal(r,e){return this.spawnTerminal(us,r,e)}runInTerminal(r,e,t,i,o){let s=o.linuxExec?Promise.resolve(o.linuxExec):n.getDefaultTerminalLinuxReady();return new Promise((a,l)=>{s.then(c=>{if(Pe(c).toLowerCase()==="ghostty"){let m=[];e&&m.push(`--working-directory=${e}`),m.push("--wait-after-command=true"),t.length&&m.push("-e",...t),n.spawnTerminalWithEnv(c,m,e,i,a,l);return}let u=[];c.indexOf("gnome-terminal")>=0?u.push("-x"):u.push("-e"),u.push("bash"),u.push("-c");let f=`${_L(t)}; echo; read -p "${n.WAIT_MESSAGE}" -n1;`;u.push(`''${f}''`),n.spawnTerminalWithEnv(c,u,e,i,a,l)})})}static spawnTerminalWithEnv(r,e,t,i,o,s){let a=Object.assign({},ra(process),i);Object.keys(a).filter(c=>a[c]===null).forEach(c=>delete a[c]);let l=us.spawn(r,e,{cwd:t,env:a});UI(l,o,s,r)}static async getDefaultTerminalLinuxReady(){if(!n._DEFAULT_TERMINAL_LINUX_READY)if(!re)n._DEFAULT_TERMINAL_LINUX_READY=Promise.resolve("xterm");else{let r=await Q.exists("/etc/debian_version");n._DEFAULT_TERMINAL_LINUX_READY=new Promise(e=>{r?e("x-terminal-emulator"):process.env.DESKTOP_SESSION==="gnome"||process.env.DESKTOP_SESSION==="gnome-classic"?e("gnome-terminal"):process.env.DESKTOP_SESSION==="kde-plasma"?e("konsole"):process.env.COLORTERM?e(process.env.COLORTERM):process.env.TERM?e(process.env.TERM):e("xterm")})}return n._DEFAULT_TERMINAL_LINUX_READY}spawnTerminal(r,e,t){let i=e.linuxExec?Promise.resolve(e.linuxExec):n.getDefaultTerminalLinuxReady();return new Promise((o,s)=>{i.then(a=>{let l=ra(process),d=Pe(a).toLowerCase()==="ghostty"&&t?[`--working-directory=${t}`]:[],u=r.spawn(a,d,{cwd:t,env:l});u.on("error",s),u.on("exit",()=>o())})})}}});var NI,cE=I(()=>{Z();NI=O("sandboxHelper")});var Qm,dE=I(()=>{X();ta();Qm=class n{static async checkSandboxDependenciesWith(r,e=re){if(!e)return;let[t,i]=await Promise.all([r("bwrap"),r("socat")]);return{bubblewrapInstalled:!!t,socatInstalled:!!i}}checkSandboxDependencies(){return n.checkSandboxDependenciesWith(ea)}}});function pE(n,r){switch(n){case 0:return"";case 1:return`${Ym}*?`;default:return`(?:${Xm}|${Ym}+${Xm}${r?`|${Xm}${Ym}+`:""})*?`}}function fE(n,r){if(!n)return[];let e=[],t=!1,i=!1,o="";for(let s of n){switch(s){case r:if(!t&&!i){e.push(o),o="";continue}break;case"{":t=!0;break;case"}":t=!1;break;case"[":i=!0;break;case"]":i=!1;break}o+=s}return o&&e.push(o),e}function yE(n){if(!n)return"";let r="",e=fE(n,uE);if(e.every(t=>t===Hl))r=".*";else{let t=!1;e.forEach((i,o)=>{if(i===Hl){if(t)return;r+=pE(2,o===e.length-1)}else{let s=!1,a="",l=!1,c="";for(let d of i){if(d!=="}"&&s){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===uE?u="":u=Lo(d),c+=u;continue}switch(d){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{let f=`(?:${fE(a,",").map(m=>yE(m)).join("|")})`;r+=f,s=!1,a="";break}case"]":{r+="["+c+"]",l=!1,c="";break}case"?":r+=Ym;continue;case"*":r+=pE(1);continue;default:r+=Lo(d)}}o<e.length-1&&(e[o+1]!==Hl||o+2<e.length)&&(r+=Xm)}t=i===Hl})}return r}function VI(n,r){if(!n)return Nn;let e;typeof n!="string"?e=n.pattern:e=n,e=e.trim();let t=r.ignoreCase??!1,i={...r,equals:t?$r:(l,c)=>l===c,endsWith:t?YS:(l,c)=>l.endsWith(c),isEqualOrParent:(l,c)=>eo(l,c,r.ignoreCase??!re)},o=`${t?e.toLowerCase():e}_${!!r.trimForExclusions}_${t}`,s=mE.get(o);if(s)return gE(s,n,i);let a;return RL.test(e)?s=FL(e.substring(4),e,i):(a=DL.exec(BI(e,i)))?s=WL(a[1],e,i):(r.trimForExclusions?LL:AL).test(e)?s=UL(e,i):(a=ML.exec(BI(e,i)))?s=vE(a[1].substring(1),e,!0,i):(a=OL.exec(BI(e,i)))?s=vE(a[1],e,!1,i):s=NL(e,i),mE.set(o,s),gE(s,n,i)}function gE(n,r,e){if(typeof r=="string")return n;let t=function(i,o){return e.isEqualOrParent(i,r.base)?n(pv(i.substring(r.base.length),Bt),o):null};return t.allBasenames=n.allBasenames,t.allPaths=n.allPaths,t.basenames=n.basenames,t.patterns=n.patterns,t}function BI(n,r){return r.trimForExclusions&&n.endsWith("/**")?n.substring(0,n.length-2):n}function FL(n,r,e){return function(t,i){return typeof t=="string"&&e.endsWith(t,n)?r:null}}function WL(n,r,e){let t=`/${n}`,i=`\\${n}`,o=function(a,l){return typeof a!="string"?null:l?e.equals(l,n)?r:null:e.equals(a,n)||e.endsWith(a,t)||e.endsWith(a,i)?r:null},s=[n];return o.basenames=s,o.patterns=[r],o.allBasenames=s,o}function UL(n,r){let e=wE(n.slice(1,-1).split(",").map(a=>VI(a,r)).filter(a=>a!==Nn),n),t=e.length;if(!t)return Nn;if(t===1)return e[0];let i=function(a,l){for(let c=0,d=e.length;c<d;c++)if(e[c](a,l))return n;return null},o=e.find(a=>!!a.allBasenames);o&&(i.allBasenames=o.allBasenames);let s=e.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(i.allPaths=s),i}function vE(n,r,e,t){let i=Bt===pe.sep,o=i?n:n.replace(kL,Bt),s=Bt+o,a=pe.sep+n,l;return e?l=function(c,d){return typeof c=="string"&&(t.equals(c,o)||t.endsWith(c,s)||!i&&(t.equals(c,n)||t.endsWith(c,a)))?r:null}:l=function(c,d){return typeof c=="string"&&(t.equals(c,o)||!i&&t.equals(c,n))?r:null},l.allPaths=[(e?"*/":"./")+n],l}function NL(n,r){try{let e=new RegExp(`^${yE(n)}$`,r.ignoreCase?"i":void 0);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Nn}}function IE(n,r={}){if(!n)return hE;if(typeof n=="string"||BL(n)){let e=VI(n,r);if(e===Nn)return hE;let t=function(i,o){return!!e(i,o)};return e.allBasenames&&(t.allBasenames=e.allBasenames),e.allPaths&&(t.allPaths=e.allPaths),t}return VL(n,r)}function BL(n){let r=n;return r?typeof r.base=="string"&&typeof r.pattern=="string":!1}function VL(n,r){let e=wE(Object.getOwnPropertyNames(n).map(a=>HL(a,n[a],r)).filter(a=>a!==Nn)),t=e.length;if(!t)return Nn;if(!e.some(a=>!!a.requiresSiblings)){if(t===1)return e[0];let a=function(d,u){let f;for(let m=0,v=e.length;m<v;m++){let y=e[m](d,u);if(typeof y=="string")return y;ff(y)&&(f||(f=[]),f.push(y))}return f?(async()=>{for(let m of f){let v=await m;if(typeof v=="string")return v}return null})():null},l=e.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);let c=e.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}let i=function(a,l,c){let d,u;for(let f=0,m=e.length;f<m;f++){let v=e[f];v.requiresSiblings&&c&&(l||(l=Pe(a)),d||(d=l.substring(0,l.length-ba(a).length)));let y=v(a,l,d,c);if(typeof y=="string")return y;ff(y)&&(u||(u=[]),u.push(y))}return u?(async()=>{for(let f of u){let m=await f;if(typeof m=="string")return m}return null})():null},o=e.find(a=>!!a.allBasenames);o&&(i.allBasenames=o.allBasenames);let s=e.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(i.allPaths=s),i}function HL(n,r,e){if(r===!1)return Nn;let t=VI(n,e);if(t===Nn)return Nn;if(typeof r=="boolean")return t;if(r){let i=r.when;if(typeof i=="string"){let o=(s,a,l,c)=>{if(!c||!t(s,a))return null;let d=i.replace("$(basename)",()=>l),u=c(d);return ff(u)?u.then(f=>f?n:null):u?n:null};return o.requiresSiblings=!0,o}}return t}function wE(n,r){let e=n.filter(a=>!!a.basenames);if(e.length<2)return n;let t=e.reduce((a,l)=>{let c=l.basenames;return c?a.concat(c):a},[]),i;if(r){i=[];for(let a=0,l=t.length;a<l;a++)i.push(r)}else i=e.reduce((a,l)=>{let c=l.patterns;return c?a.concat(c):a},[]);let o=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){let u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substring(d)}let c=t.indexOf(l);return c!==-1?i[c]:null};o.basenames=t,o.patterns=i,o.allBasenames=t;let s=n.filter(a=>!a.basenames);return s.push(o),s}function HI(n,r){return Ao(n,r,(e,t)=>typeof e=="string"&&typeof t=="string"?e===t:typeof e!="string"&&typeof t!="string"?e.base===t.base&&e.pattern===t.pattern:!1)}var Hl,uE,Xm,Ym,kL,RL,DL,AL,LL,ML,OL,mE,hE,Nn,$I=I(()=>{Jt();he();zi();ni();Cr();we();X();ar();Hl="**",uE="/",Xm="[/\\\\]",Ym="[^/\\\\]",kL=/\//g;RL=/^\*\*\/\*\.[\w\.-]+$/,DL=/^\*\*\/([\w\.-]+)\/?$/,AL=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,LL=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,ML=/^\*\*((\/[\w\.-]+)+)\/?$/,OL=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,mE=new ki(1e4),hE=function(){return!1},Nn=function(){return null}});function rh(n){return typeof n.correlationId=="number"}function SE(n){return n.recursive===!0}function ih(n){return n.map(r=>({type:r.type,resource:x.revive(r.resource),cId:r.cId}))}function xE(n){let r=new qI;for(let e of n)r.processEvent(e);return r.coalesce()}function $L(n,r){return typeof r=="string"&&!r.startsWith(Hl)&&!Do(r)?{base:n,pattern:r}:r}function KI(n,r,e){let t=[];for(let i of r)t.push(IE($L(n,i),{ignoreCase:e}));return t}function PE(n,r){if(typeof r=="number")switch(n.type){case 1:return(r&4)===0;case 2:return(r&8)===0;case 0:return(r&2)===0}return!1}function EE(n){if(typeof n=="number"){let r=[];return n&4&&r.push("Added"),n&8&&r.push("Deleted"),n&2&&r.push("Updated"),r.length===0?"<all>":`[${r.join(", ")}]`}return"<none>"}var Zm,eh,th,qI,ia=I(()=>{$I();$();we();X();ce();je();Zm=class n extends T{constructor(e,t,i,o){super();this.onFileChanges=e;this.onLogMessage=t;this.verboseLogging=i;this.options=o;this.watcherDisposables=this._register(new Qt);this.requests=void 0;this.restartCounter=0}static{this.MAX_RESTARTS=5}init(){let e=new j;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){this.canRestart(e,t)?this.restartCounter<n.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,t){return!(!this.options.restartOnError||t||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()}},eh=class extends Zm{constructor(r,e,t){super(r,e,t,{type:"node.js",restartOnError:!1})}},th=class extends Zm{constructor(r,e,t){super(r,e,t,{type:"universal",restartOnError:!0})}};qI=class{constructor(){this.coalesced=new Set;this.mapPathToChange=new Map}toKey(r){return re?r.resource.fsPath:r.resource.fsPath.toLowerCase()}processEvent(r){let e=this.mapPathToChange.get(this.toKey(r)),t=!1;if(e){let i=e.type,o=r.type;e.resource.fsPath!==r.resource.fsPath&&(r.type===2||r.type===1)?t=!0:i===1&&o===2?(this.mapPathToChange.delete(this.toKey(r)),this.coalesced.delete(e)):i===2&&o===1?e.type=0:i===1&&o===0||(e.type=o)}else t=!0;t&&(this.coalesced.add(r),this.mapPathToChange.set(this.toKey(r),r))}coalesce(){let r=[],e=[];return Array.from(this.coalesced).filter(t=>t.type!==2?(r.push(t),!1):!0).sort((t,i)=>t.resource.fsPath.length-i.resource.fsPath.length).filter(t=>e.some(i=>sP(t.resource.fsPath,i,!re))?!1:(e.push(t.resource.fsPath),!0)).concat(r)}}});var jI,CE=I(()=>{ot();No();He();q();$();Os();Xt();je();ia();jI="localFilesystem"});async function oh(n,r,e,t,i,o){let s;try{await qL(n,r,e,t,i,o)}catch(a){s=a}finally{s&&i.errorTransformer&&(s=i.errorTransformer(s)),typeof s<"u"&&e.error(s),e.end()}}async function qL(n,r,e,t,i,o){GI(o);let s=await n.open(r,{create:!1});try{GI(o);let a=0,l=0,c=i&&typeof i.length=="number"?i.length:void 0,d=H.alloc(Math.min(i.bufferSize,typeof c=="number"?c:i.bufferSize)),u=i&&typeof i.position=="number"?i.position:0,f=0;do l=await n.read(s,u,d.buffer,f,d.byteLength-f),u+=l,f+=l,a+=l,typeof c=="number"&&(c-=l),f===d.byteLength&&(await e.write(t(d)),d=H.alloc(Math.min(i.bufferSize,typeof c=="number"?c:i.bufferSize)),f=0);while(l>0&&(typeof c!="number"||c>0)&&GI(o)&&KL(a,i));if(f>0){let m=f;typeof c=="number"&&(m=Math.min(f,c)),e.write(t(d.slice(0,m)))}}catch(a){throw fo(a)}finally{await n.close(s)}}function GI(n){if(n.isCancellationRequested)throw qi();return!0}function KL(n,r){if(typeof r?.limits?.size=="number"&&n>r.limits.size)throw zr(h(2249,null),"EntryTooLarge");return!0}var JI=I(()=>{ot();He();xe();je()});var sh,TE=I(()=>{Jt();he();He();q();ni();$();we();ia();te();sh=class extends T{constructor(e,t){super();this.logService=e;this.options=t;this._onDidChangeFile=this._register(new b);this.onDidChangeFile=this._onDidChangeFile.event;this._onDidWatchError=this._register(new b);this.onDidWatchError=this._onDidWatchError.event;this.universalWatchRequests=[];this.universalWatchRequestDelayer=this._register(new Tr(this.getRefreshWatchersDelay(this.universalWatchRequests.length)));this.nonRecursiveWatchRequests=[];this.nonRecursiveWatchRequestDelayer=this._register(new Tr(this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)))}watch(e,t){return t.recursive||this.options?.watcher?.forceUniversal?this.watchUniversal(e,t):this.watchNonRecursive(e,t)}getRefreshWatchersDelay(e){return e>200?500:0}watchUniversal(e,t){let i=this.toWatchRequest(e,t),o=Zg(this.universalWatchRequests,i);return this.refreshUniversalWatchers(),G(()=>{o(),this.refreshUniversalWatchers()})}toWatchRequest(e,t){let i={path:this.toWatchPath(e),excludes:t.excludes,includes:t.includes,recursive:t.recursive,filter:t.filter,correlationId:t.correlationId};if(SE(i)){let o=this.options?.watcher?.recursive?.usePolling;o===!0?i.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3:Array.isArray(o)&&o.includes(i.path)&&(i.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3)}return i}refreshUniversalWatchers(){this.universalWatchRequestDelayer.trigger(()=>this.doRefreshUniversalWatchers(),this.getRefreshWatchersDelay(this.universalWatchRequests.length)).catch(e=>nt(e))}doRefreshUniversalWatchers(){return this.universalWatcher||(this.universalWatcher=this._register(this.createUniversalWatcher(e=>this._onDidChangeFile.fire(ih(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,t){let i={path:this.toWatchPath(e),excludes:t.excludes,includes:t.includes,recursive:!1,filter:t.filter,correlationId:t.correlationId},o=Zg(this.nonRecursiveWatchRequests,i);return this.refreshNonRecursiveWatchers(),G(()=>{o(),this.refreshNonRecursiveWatchers()})}refreshNonRecursiveWatchers(){this.nonRecursiveWatchRequestDelayer.trigger(()=>this.doRefreshNonRecursiveWatchers(),this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)).catch(e=>nt(e))}doRefreshNonRecursiveWatchers(){return this.nonRecursiveWatcher||(this.nonRecursiveWatcher=this._register(this.createNonRecursiveWatcher(e=>this._onDidChangeFile.fire(ih(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 kt(e.fsPath)}toWatchPath(e){let t=this.toFilePath(e);return gv(t)}}});function _E(n){let r=n;return r&&typeof r.type=="string"&&typeof r.severity=="string"}function zL(n){let r=[],e;try{let t=JSON.parse(n.arguments),i=t[t.length-1];i&&i.__$stack&&(t.pop(),e=i.__$stack),r.push(...t)}catch{r.push("Unable to log remote console arguments",n.arguments)}return{args:r,stack:e}}function jL(n){if(!n)return n;let r=n.indexOf(`
`);return r===-1?n:n.substring(0,r)}function kE(n,r){let{args:e,stack:t}=zL(n),i=typeof e[0]=="string"&&e.length===1,o=jL(t);o&&(o=`(${o.trim()})`);let s=[];if(typeof e[0]=="string"?o&&i?s=[`%c[${r}] %c${e[0]} %c${o}`,$l("blue"),$l(""),$l("grey")]:s=[`%c[${r}] %c${e[0]}`,$l("blue"),$l(""),...e.slice(1)]:s=[`%c[${r}]%`,$l("blue"),...e],o&&!i&&s.push(o),typeof console[n.severity]!="function")throw new Error("Unknown console method");console[n.severity].apply(console,s)}function $l(n){return`color: ${n}`}var RE=I(()=>{ce()});import{fork as GL}from"child_process";var ah,DE=I(()=>{he();ot();wt();RE();He();q();$();di();ta();ku();Pn();ah=class{constructor(r,e){this.modulePath=r;this.options=e;this.activeRequests=new Set;this.channels=new Map;this._onDidProcessExit=new b;this.onDidProcessExit=this._onDidProcessExit.event;let t=e.timeout||6e4;this.disposeDelayer=new to(t),this.child=null,this._client=null}getChannel(r){let e=this;return{call(t,i,o){return e.requestPromise(r,t,i,o)},listen(t,i){return e.requestEvent(r,t,i)}}}requestPromise(r,e,t,i=Ce.None){if(!this.disposeDelayer)return Promise.reject(new Error("disposed"));if(i.isCancellationRequested)return Promise.reject(qi());this.disposeDelayer.cancel();let o=this.getCachedChannel(r),s=Ji(c=>o.call(e,t,c)),a=i.onCancellationRequested(()=>s.cancel()),l=G(()=>s.cancel());return this.activeRequests.add(l),s.finally(()=>{a.dispose(),this.activeRequests.delete(l),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}),s}requestEvent(r,e,t){if(!this.disposeDelayer)return S.None;this.disposeDelayer.cancel();let i,o=new b({onWillAddFirstListener:()=>{i=this.getCachedChannel(r).listen(e,t)(o.fire,o),this.activeRequests.add(i)},onDidRemoveLastListener:()=>{this.activeRequests.delete(i),i.dispose(),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}});return o.event}get client(){if(!this._client){let r=this.options.args||[],e=Object.create(null);e.env={...or(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(u=>!/^--inspect(-brk)?=/.test(u)).filter(u=>!u.startsWith("--vscode-"))),Mm(e.env),this.child=GL(this.modulePath,r,e);let t=new b,o=S.fromNodeEventEmitter(this.child,"message",u=>u)(u=>{if(_E(u)){kE(u,`IPC Library: ${this.options.serverName}`);return}t.fire(H.wrap(Buffer.from(u,"base64")))}),s=this.options.useQueue?Q0(this.child):this.child,a=u=>this.child?.connected&&s.send(u.buffer.toString("base64")),l=t.event,c={send:a,onMessage:l};this._client=new Us(c);let d=()=>this.disposeClient();process.once("exit",d),this.child.on("error",u=>console.warn('IPC "'+this.options.serverName+'" errored with '+u)),this.child.on("exit",(u,f)=>{process.removeListener("exit",d),o.dispose(),this.activeRequests.forEach(m=>ut(m)),this.activeRequests.clear(),u!==0&&f!=="SIGTERM"&&console.warn('IPC "'+this.options.serverName+'" crashed with exit code '+u+" and signal "+f),this.disposeDelayer?.cancel(),this.disposeClient(),this._onDidProcessExit.fire({code:u,signal:f})})}return this._client}getCachedChannel(r){let e=this.channels.get(r);return e||(e=this.client.getChannel(r),this.channels.set(r,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 lh,AE=I(()=>{ze();Pn();DE();ia();lh=class extends th{constructor(r,e,t){super(r,e,t),this.init()}createWatcher(r){let e=r.add(new ah(st.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 r.add(e.onDidProcessExit(({code:t,signal:i})=>this.onError(`terminated by itself with code ${t}, signal: ${i} (ETERM)`))),tt.toService(vx(e.getChannel("watcher")))}}});import{watchFile as JL,unwatchFile as QL}from"fs";var ch,LE=I(()=>{$();ia();q();je();ce();he();En();He();ch=class extends T{constructor(){super();this._onDidChangeFile=this._register(new b);this.onDidChangeFile=this._onDidChangeFile.event;this._onDidLogMessage=this._register(new b);this.onDidLogMessage=this._onDidLogMessage.event;this._onDidWatchFail=this._register(new b);this.onDidWatchFail=this._onDidWatchFail.event;this.correlatedWatchRequests=new Map;this.nonCorrelatedWatchRequests=new Map;this.suspendedWatchRequests=this._register(new Dt);this.suspendedWatchRequestsWithPolling=new Set;this.updateWatchersDelayer=this._register(new Tr(this.getUpdateWatchersDelay()));this.suspendedWatchRequestPollingInterval=5007;this.joinWatch=new At;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 rh(e)}computeId(e){return this.isCorrelated(e)?e.correlationId:cr(e)}async watch(e){this.joinWatch.isSettled||this.joinWatch.complete(),this.joinWatch=new At;try{this.correlatedWatchRequests.clear(),this.nonCorrelatedWatchRequests.clear();for(let t of e)this.isCorrelated(t)?this.correlatedWatchRequests.set(t.correlationId,t):this.nonCorrelatedWatchRequests.set(this.computeId(t),t);for(let[t]of this.suspendedWatchRequests)!this.nonCorrelatedWatchRequests.has(t)&&!this.correlatedWatchRequests.has(t)&&(this.suspendedWatchRequests.deleteAndDispose(t),this.suspendedWatchRequestsWithPolling.delete(t));return await this.updateWatchers(!1)}finally{this.joinWatch.complete()}}updateWatchers(e){let t=[];for(let[i,o]of[...this.nonCorrelatedWatchRequests,...this.correlatedWatchRequests])this.suspendedWatchRequests.has(i)||t.push(o);return this.updateWatchersDelayer.trigger(()=>this.doWatch(t),e?this.getUpdateWatchersDelay():0).catch(i=>nt(i))}getUpdateWatchersDelay(){return 800}isSuspended(e){let t=this.computeId(e);return this.suspendedWatchRequestsWithPolling.has(t)?"polling":this.suspendedWatchRequests.has(t)}async suspendWatchRequest(e){if(this.suspendedWatchRequests.has(e.id))return;let t=new j;this.suspendedWatchRequests.set(e.id,t),await this.joinWatch.p,!t.isDisposed&&(this.monitorSuspendedWatchRequest(e,t),this.updateWatchers(!0))}resumeWatchRequest(e){this.suspendedWatchRequests.deleteAndDispose(e.id),this.suspendedWatchRequestsWithPolling.delete(e.id),this.updateWatchers(!1)}monitorSuspendedWatchRequest(e,t){this.doMonitorWithExistingWatcher(e,t)?(this.trace(`reusing an existing recursive watcher to monitor ${e.path}`),this.suspendedWatchRequestsWithPolling.delete(e.id)):(this.doMonitorWithNodeJS(e,t),this.suspendedWatchRequestsWithPolling.add(e.id))}doMonitorWithExistingWatcher(e,t){let i=this.recursiveWatcher?.subscribe(e.path,(o,s)=>{t.isDisposed||(o?this.monitorSuspendedWatchRequest(e,t):s?.type===1&&this.onMonitoredPathAdded(e))});return i?(t.add(i),!0):!1}doMonitorWithNodeJS(e,t){let i=!1,o=(s,a)=>{if(t.isDisposed)return;let l=this.isPathNotFound(s),c=this.isPathNotFound(a),d=i;i=l,!l&&(c||d)&&this.onMonitoredPathAdded(e)};this.trace(`starting fs.watchFile() on ${e.path} (correlationId: ${e.correlationId})`);try{JL(e.path,{persistent:!1,interval:this.suspendedWatchRequestPollingInterval},o)}catch(s){this.warn(`fs.watchFile() failed with error ${s} on path ${e.path} (correlationId: ${e.correlationId})`)}t.add(G(()=>{this.trace(`stopping fs.watchFile() on ${e.path} (correlationId: ${e.correlationId})`);try{QL(e.path,o)}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 t={resource:x.file(e.path),type:1,cId:e.correlationId};this._onDidChangeFile.fire([t]),this.traceEvent(t,e),this.resumeWatchRequest(e)}isPathNotFound(e){return e.ctimeMs===0&&e.ino===0}async stop(){this.suspendedWatchRequests.clearAndDisposeAll(),this.suspendedWatchRequestsWithPolling.clear()}traceEvent(e,t){if(this.verboseLogging){let i=` >> normalized ${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`;this.traceWithCorrelation(i,t)}}traceWithCorrelation(e,t){this.verboseLogging&&this.trace(`${e}${typeof t.correlationId=="number"?` <${t.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: ${EE(e.filter)}, correlationId: ${typeof e.correlationId=="number"?e.correlationId:"<none>"})`}async setVerboseLogging(e){this.verboseLogging=e}}});import{watch as XL,promises as YL}from"fs";var dh,ME=I(()=>{he();wt();ni();$();vd();we();X();gt();ce();nr();je();ia();Yn();dh=class n extends T{constructor(e,t,i,o,s,a){super();this.request=e;this.recursiveWatcher=t;this.onDidFilesChange=i;this.onDidWatchFail=o;this.onLogMessage=s;this.verboseLogging=a;this.throttledFileChangesEmitter=this._register(new Va({maxWorkChunkSize:100,throttleDelay:200,maxBufferedWork:1e4},e=>this.onDidFilesChange(e)));this.fileChangesAggregator=this._register(new uf(e=>this.handleFileChanges(e),n.FILE_CHANGES_HANDLER_DELAY));this.cts=new $e;this.realPath=new rr(async()=>{let e=this.request.path;try{e=await Q.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=!re;this.excludes=KI(this.request.path,this.request.excludes,l),this.includes=this.request.includes?KI(this.request.path,this.request.includes,l):void 0,this.filter=rh(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 YL.stat(this.request.path);if(this.cts.token.isCancellationRequested)return;this._register(await this.doWatch(e.isDirectory()))}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 t=new j;return this.doWatchWithExistingWatcher(e,t)?(this.trace(`reusing an existing recursive watcher for ${this.request.path}`),this._isReusingRecursiveWatcher=!0):(this._isReusingRecursiveWatcher=!1,await this.doWatchWithNodeJS(e,t)),t}doWatchWithExistingWatcher(e,t){if(e)return!1;let i=x.file(this.request.path),o=this.recursiveWatcher?.subscribe(this.request.path,async(s,a)=>{t.isDisposed||(s?await WS(this.doWatch(e),t):a&&(typeof a.cId=="number"||typeof this.request.correlationId=="number")&&this.onFileChange({resource:i,type:a.type,cId:this.request.correlationId},!0))});return o?(t.add(o),!0):!1}async doWatchWithNodeJS(e,t){let i=await this.realPath.value;if(this.cts.token.isCancellationRequested)return;if(V&&eo(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 o=new $e(this.cts.token);t.add(G(()=>o.dispose(!0)));let s=new j;t.add(s);try{let a=x.file(this.request.path),l=Pe(i),c=XL(i);s.add(G(()=>{c.removeAllListeners(),c.close()})),this.trace(`Started watching: '${i}'`);let d=new Set;if(e)try{for(let f of await Q.readdir(i))d.add(f)}catch(f){this.error(f)}if(o.token.isCancellationRequested)return;let u=new Map;s.add(G(()=>{for(let[,f]of u)f.dispose();u.clear()})),c.on("error",(f,m)=>{o.token.isCancellationRequested||(this.error(`Failed to watch ${i} for changes using fs.watch() (${f}, ${m})`),this.notifyWatchFailed())}),c.on("change",(f,m)=>{if(o.token.isCancellationRequested)return;this.verboseLogging&&this.traceWithCorrelation(`[raw] ["${f}"] ${m}`);let v="";if(m&&(v=m.toString(),V&&(v=Sn(v))),!(!v||f!=="change"&&f!=="rename"))if(e)if(f==="rename"){u.get(v)?.dispose();let y=setTimeout(async()=>{if(u.delete(v),Fo(v,l,!re)&&!await Q.exists(i)){this.onWatchedPathDeleted(a);return}if(o.token.isCancellationRequested)return;let C=await this.existsChildStrictCase(N(i,v));if(o.token.isCancellationRequested)return;let w;C?d.has(v)?w=0:(w=1,d.add(v)):(d.delete(v),w=2),this.onFileChange({resource:oe(a,v),type:w,cId:this.request.correlationId})},n.FILE_DELETE_HANDLER_DELAY);u.set(v,G(()=>clearTimeout(y)))}else{let y;d.has(v)?y=0:(y=1,d.add(v)),this.onFileChange({resource:oe(a,v),type:y,cId:this.request.correlationId})}else if(f==="rename"||!Fo(v,l,!re)){let y=setTimeout(async()=>{let C=await Q.exists(i);o.token.isCancellationRequested||(C?(this.onFileChange({resource:a,type:0,cId:this.request.correlationId},!0),s.add(await this.doWatch(!1))):this.onWatchedPathDeleted(a))},n.FILE_DELETE_HANDLER_DELAY);s.clear(),s.add(G(()=>clearTimeout(y)))}else this.onFileChange({resource:a,type:0,cId:this.request.correlationId},!0)})}catch(a){if(o.token.isCancellationRequested)return;this.error(`Failed to watch ${i} for changes using fs.watch() (${a.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,t=!1){this.cts.token.isCancellationRequested||(this.verboseLogging&&this.traceWithCorrelation(`${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`),!t&&this.excludes.some(i=>i(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (excluded) ${e.resource.fsPath}`):!t&&this.includes&&this.includes.length>0&&!this.includes.some(i=>i(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (not included) ${e.resource.fsPath}`):this.fileChangesAggregator.work(e))}handleFileChanges(e){let t=xE(e),i=[];for(let s of t){if(PE(s,this.filter)){this.verboseLogging&&this.traceWithCorrelation(` >> ignored (filtered) ${s.resource.fsPath}`);continue}i.push(s)}if(i.length===0)return;if(this.verboseLogging)for(let s of i)this.traceWithCorrelation(` >> normalized ${s.type===1?"[ADDED]":s.type===2?"[DELETED]":"[CHANGED]"} ${s.resource.fsPath}`);this.throttledFileChangesEmitter.work(i)?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: ${i[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: ${i.length}, most recent change: ${i[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`)}async existsChildStrictCase(e){if(re)return Q.exists(e);try{let t=Pe(e);return(await Q.readdir(Le(e))).some(o=>o===t)}catch(t){return this.trace(t),!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 uh,OE=I(()=>{q();$I();LE();X();ME();he();$();uh=class extends ch{constructor(e){super();this.recursiveWatcher=e;this.onDidError=S.None;this._watchers=new Map;this.worker=this._register(new Qt)}get watchers(){return this._watchers.values()}async doWatch(e){e=this.removeDuplicateRequests(e);let t=[],i=new Set(Array.from(this.watchers));for(let o of e){let s=this._watchers.get(this.requestToWatcherKey(o));s&&HI(s.request.excludes,o.excludes)&&HI(s.request.includes,o.includes)?i.delete(s):t.push(o)}t.length&&this.trace(`Request to start watching: ${t.map(o=>this.requestToString(o)).join(",")}`),i.size&&this.trace(`Request to stop watching: ${Array.from(i).map(o=>this.requestToString(o.request)).join(",")}`),this.worker.clear();for(let o of i)this.stopWatching(o);this.createWatchWorker().work(t)}createWatchWorker(){return this.worker.value=new Va({maxWorkChunkSize:100,throttleDelay:100,maxBufferedWork:Number.MAX_VALUE},e=>{for(let t of e)this.startWatching(t)}),this.worker.value}requestToWatcherKey(e){return typeof e.correlationId=="number"?e.correlationId:this.pathToWatcherKey(e.path)}pathToWatcherKey(e){return re?e:e.toLowerCase()}startWatching(e){let t=new dh(e,this.recursiveWatcher,o=>this._onDidChangeFile.fire(o),()=>this._onDidWatchFail.fire(e),o=>this._onDidLogMessage.fire(o),this.verboseLogging),i={request:e,instance:t};this._watchers.set(this.requestToWatcherKey(e),i)}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 t=new Map;for(let i of e){let o=t.get(i.correlationId);o||(o=new Map,t.set(i.correlationId,o));let s=this.pathToWatcherKey(i.path);o.has(s)&&this.trace(`ignoring a request for watching who's path is already watched: ${this.requestToString(i)}`),o.set(s,i)}return Array.from(t.values()).flatMap(i=>Array.from(i.values()))}async setVerboseLogging(e){super.setVerboseLogging(e);for(let t of this.watchers)t.instance.setVerboseLogging(e)}trace(e,t){this.verboseLogging&&this._onDidLogMessage.fire({type:"trace",message:this.toMessage(e,t)})}warn(e){this._onDidLogMessage.fire({type:"warn",message:this.toMessage(e)})}toMessage(e,t){return t?`[File Watcher (node.js)] ${e} (${this.requestToString(t.request)})`:`[File Watcher (node.js)] ${e}`}}});var ph,FE=I(()=>{ia();OE();ph=class extends eh{constructor(r,e,t){super(r,e,t),this.init()}createWatcher(r){return r.add(new uh(void 0))}}});import{constants as QI,promises as na}from"fs";var ps,fh=I(()=>{he();Cr();ot();q();ni();$();we();X();gt();Os();nr();xe();je();JI();TE();AE();FE();ps=class n extends sh{constructor(){super(...arguments);this.onDidChangeCapabilities=S.None;this.resourceLocks=new mt(e=>Je.getComparisonKey(e));this.mapHandleToPos=new Map;this.mapHandleToLock=new Map;this.writeHandles=new Map}static{this.TRACE_LOG_RESOURCE_LOCKS=!1}get capabilities(){return this._capabilities||(this._capabilities=1040414,re&&(this._capabilities|=1024)),this._capabilities}async stat(e){try{let{stat:t,symbolicLink:i}=await ir.stat(this.toFilePath(e)),o;return(t.mode&128)===0&&(o=2),(t.mode&QI.S_IXUSR||t.mode&QI.S_IXGRP||t.mode&QI.S_IXOTH)&&(o=(o??0)|4),{type:this.toType(t,i),ctime:t.birthtime.getTime(),mtime:t.mtime.getTime(),size:t.size,permissions:o}}catch(t){throw this.toFileSystemProviderError(t)}}async statIgnoreError(e){try{return await this.stat(e)}catch{return}}async realpath(e){let t=this.toFilePath(e);return Q.realpath(t)}async readdir(e){try{let t=await Q.readdir(this.toFilePath(e),{withFileTypes:!0}),i=[];return await Promise.all(t.map(async o=>{try{let s;o.isSymbolicLink()?s=(await this.stat(oe(e,o.name))).type:s=this.toType(o),i.push([o.name,s])}catch(s){this.logService.trace(s)}})),i}catch(t){throw this.toFileSystemProviderError(t)}}toType(e,t){let i;return t?.dangling?i=0:e.isFile()?i=1:e.isDirectory()?i=2:i=0,t&&(i|=64),i}async createResourceLock(e){let t=this.toFilePath(e);this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${t})`);let i;for(;i=this.resourceLocks.get(e);)this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${t})`),await i.wait();let o=new bn;return this.resourceLocks.set(e,o),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${t})`),G(()=>{this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${t})`),this.resourceLocks.get(e)===o&&(this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${t})`),this.resourceLocks.delete(e)),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${t})`),o.open()})}async readFile(e,t){let i;try{t?.atomic&&(this.traceLock(`[Disk FileSystemProvider]: atomic read operation started (${this.toFilePath(e)})`),i=await this.createResourceLock(e));let o=this.toFilePath(e);return await na.readFile(o)}catch(o){throw this.toFileSystemProviderError(o)}finally{i?.dispose()}}traceLock(e){n.TRACE_LOG_RESOURCE_LOCKS&&this.logService.trace(e)}readFileStream(e,t,i){let o=Bo(s=>H.concat(s.map(a=>H.wrap(a))).buffer);return oh(this,e,o,s=>s.buffer,{...t,bufferSize:256*1024},i),o}async writeFile(e,t,i){return i?.atomic!==!1&&i?.atomic?.postfix&&await this.canWriteFileAtomic(e)?this.doWriteFileAtomic(e,oe(m1(e),`${qr(e)}${i.atomic.postfix}`),t,i):this.doWriteFile(e,t,i)}async canWriteFileAtomic(e){try{let t=this.toFilePath(e),{symbolicLink:i}=await ir.stat(t);if(i)return!1}catch{}return!0}async doWriteFileAtomic(e,t,i,o){let s=new j;try{s.add(await this.createResourceLock(e)),s.add(await this.createResourceLock(t)),await this.doWriteFile(t,i,{...o,create:!0,overwrite:!0},!0);try{await this.rename(t,e,{overwrite:!0})}catch(a){try{await this.delete(t,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw a}}finally{s.dispose()}}async doWriteFile(e,t,i,o){let s;try{let a=this.toFilePath(e);if(!i.create||!i.overwrite){if(await Q.exists(a)){if(!i.overwrite)throw zr(h(2254,null),"EntryExists")}else if(!i.create)throw zr(h(2257,null),"EntryNotFound")}s=await this.open(e,{create:!0,append:i.append,unlock:i.unlock},o),await this.write(s,0,t,0,t.byteLength)}catch(a){throw await this.toFileSystemProviderWriteError(e,a)}finally{typeof s=="number"&&await this.close(s)}}static{this.canFlush=!0}static configureFlushOnWrite(e){n.canFlush=e}async open(e,t,i){let o=this.toFilePath(e),s;Ks(t)&&!i&&(s=await this.createResourceLock(e));let a;try{if(Ks(t)&&t.unlock)try{let{stat:l}=await ir.stat(o);l.mode&128||await na.chmod(o,l.mode|128)}catch(l){l.code!=="ENOENT"&&this.logService.trace(l)}if(F&&Ks(t)&&!t.append)try{a=await Q.open(o,"r+"),await Q.ftruncate(a,0)}catch(l){if(l.code!=="ENOENT"&&this.logService.trace(l),typeof a=="number"){try{await Q.close(a)}catch(c){this.logService.trace(c)}a=void 0}}typeof a!="number"&&(a=await Q.open(o,Ks(t)?t.append?"a":"w":"r"))}catch(l){throw s?.dispose(),Ks(t)?await this.toFileSystemProviderWriteError(e,l):this.toFileSystemProviderError(l)}if(this.mapHandleToPos.set(a,0),Ks(t)&&this.writeHandles.set(a,e),s){let l=this.mapHandleToLock.get(a);this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${a} (${o})`),this.mapHandleToLock.set(a,s),l&&(this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${a} (${o})`),l.dispose())}return a}async close(e){let t=this.mapHandleToLock.get(e);try{if(this.mapHandleToPos.delete(e),this.writeHandles.delete(e)&&n.canFlush)try{await Q.fdatasync(e)}catch(i){n.configureFlushOnWrite(!1),this.logService.error(i)}return await Q.close(e)}catch(i){throw this.toFileSystemProviderError(i)}finally{t&&(this.mapHandleToLock.get(e)===t&&(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}`),t.dispose())}}async read(e,t,i,o,s){let a=this.normalizePos(e,t),l=null;try{l=(await Q.read(e,i,o,s,a)).bytesRead}catch(c){throw this.toFileSystemProviderError(c)}finally{this.updatePos(e,a,l)}return l}normalizePos(e,t){return t===this.mapHandleToPos.get(e)?null:t}updatePos(e,t,i){let o=this.mapHandleToPos.get(e);typeof o=="number"&&(typeof t=="number"||(typeof i=="number"?this.mapHandleToPos.set(e,o+i):this.mapHandleToPos.delete(e)))}async write(e,t,i,o,s){return P1(()=>this.doWrite(e,t,i,o,s),100,3)}async doWrite(e,t,i,o,s){let a=this.normalizePos(e,t),l=null;try{l=(await Q.write(e,i,o,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 na.mkdir(this.toFilePath(e))}catch(t){throw this.toFileSystemProviderError(t)}}async delete(e,t){try{let i=this.toFilePath(e);if(t.recursive){let o;t?.atomic!==!1&&t.atomic.postfix&&(o=N(Le(i),`${Pe(i)}${t.atomic.postfix}`)),await Q.rm(i,1,o)}else try{await na.unlink(i)}catch(o){if(o.code==="EPERM"||o.code==="EISDIR"){let s=!1;try{let{stat:a,symbolicLink:l}=await ir.stat(i);s=a.isDirectory()&&!l}catch{}if(s)await na.rmdir(i);else throw o}else throw o}}catch(i){throw this.toFileSystemProviderError(i)}}async rename(e,t,i){let o=this.toFilePath(e),s=this.toFilePath(t);if(o!==s)try{await this.validateMoveCopy(e,t,"move",i.overwrite),await Q.rename(o,s)}catch(a){throw(a.code==="EINVAL"||a.code==="EBUSY"||a.code==="ENAMETOOLONG")&&(a=new Error(h(2258,null,Pe(o),Pe(Le(s)),a.toString()))),this.toFileSystemProviderError(a)}}async copy(e,t,i){let o=this.toFilePath(e),s=this.toFilePath(t);if(o!==s)try{await this.validateMoveCopy(e,t,"copy",i.overwrite),await Q.copy(o,s,{preserveSymlinks:!0})}catch(a){throw(a.code==="EINVAL"||a.code==="EBUSY"||a.code==="ENAMETOOLONG")&&(a=new Error(h(2252,null,Pe(o),Pe(Le(s)),a.toString()))),this.toFileSystemProviderError(a)}}async validateMoveCopy(e,t,i,o){let s=this.toFilePath(e),a=this.toFilePath(t),l=!1;if(this.capabilities&1024||(l=Fo(s,a,!0)),l){if(i==="copy")throw zr(h(2253,null),"EntryExists");if(i==="move")return}let d=await this.statIgnoreError(e);if(!d)throw zr(h(2256,null),"EntryNotFound");let u=await this.statIgnoreError(t);if(u){if(!o)throw zr(h(2255,null),"EntryExists");(d.type&1)!==0&&(u.type&1)!==0||await this.delete(t,{recursive:!0,useTrash:!1,atomic:!1})}}async cloneFile(e,t){return this.doCloneFile(e,t,!1)}async doCloneFile(e,t,i){let o=this.toFilePath(e),s=this.toFilePath(t),a=!!(this.capabilities&1024);if(Fo(o,s,!a))return;let l=new j;try{l.add(await this.createResourceLock(e)),l.add(await this.createResourceLock(t)),i&&await na.mkdir(Le(s),{recursive:!0}),await na.copyFile(o,s)}catch(c){if(c.code==="ENOENT"&&!i)return this.doCloneFile(e,t,!0);throw this.toFileSystemProviderError(c)}finally{l.dispose()}}createUniversalWatcher(e,t,i){return new lh(o=>e(o),o=>t(o),i)}createNonRecursiveWatcher(e,t,i){return new ph(o=>e(o),o=>t(o),i)}toFileSystemProviderError(e){if(e instanceof ol)return e;let t=e,i;switch(e.code){case"ENOENT":i="EntryNotFound";break;case"EISDIR":i="EntryIsADirectory";break;case"ENOTDIR":i="EntryNotADirectory";break;case"EEXIST":i="EntryExists";break;case"EPERM":case"EACCES":i="NoPermissions";break;case"ERR_UNC_HOST_NOT_ALLOWED":t=`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,i="Unknown";break;default:i="Unknown"}return zr(t,i)}async toFileSystemProviderWriteError(e,t){let i=this.toFileSystemProviderError(t);if(e&&i.code==="NoPermissions")try{let{stat:o}=await ir.stat(this.toFilePath(e));o.mode&128||(i=zr(t,"EntryWriteLocked"))}catch(o){this.logService.trace(o)}return i}}});var mh,hh,UE=I(()=>{q();fh();$();ot();Os();wt();mh=class extends T{constructor(e,t){super();this.provider=e;this.logService=t;this.sessionToWatcher=new Map;this.watchRequests=new Map}call(e,t,i){let o=this.getUriTransformer(e);switch(t){case"stat":return this.stat(o,i[0]);case"realpath":return this.realpath(o,i[0]);case"readdir":return this.readdir(o,i[0]);case"open":return this.open(o,i[0],i[1]);case"close":return this.close(i[0]);case"read":return this.read(i[0],i[1],i[2]);case"readFile":return this.readFile(o,i[0],i[1]);case"write":return this.write(i[0],i[1],i[2],i[3],i[4]);case"writeFile":return this.writeFile(o,i[0],i[1],i[2]);case"rename":return this.rename(o,i[0],i[1],i[2]);case"copy":return this.copy(o,i[0],i[1],i[2]);case"cloneFile":return this.cloneFile(o,i[0],i[1]);case"mkdir":return this.mkdir(o,i[0]);case"delete":return this.delete(o,i[0],i[1]);case"watch":return this.watch(o,i[0],i[1],i[2],i[3]);case"unwatch":return this.unwatch(i[0],i[1])}throw new Error(`IPC Command ${t} not found`)}listen(e,t,i){let o=this.getUriTransformer(e);switch(t){case"fileChange":return this.onFileChange(o,i[0]);case"readFileStream":return this.onReadFileStream(o,i[0],i[1])}throw new Error(`Unknown event ${t}`)}stat(e,t){let i=this.transformIncoming(e,t,!0);return this.provider.stat(i)}realpath(e,t){let i=this.transformIncoming(e,t,!0);return this.provider.realpath(i)}readdir(e,t){let i=this.transformIncoming(e,t);return this.provider.readdir(i)}async readFile(e,t,i){let o=this.transformIncoming(e,t,!0),s=await this.provider.readFile(o,i);return H.wrap(s)}onReadFileStream(e,t,i){let o=this.transformIncoming(e,t,!0),s=new $e,a=new b({onDidRemoveLastListener:()=>{s.cancel()}}),l=this.provider.readFileStream(o,i,s.token);return Ka(l,{onData:c=>a.fire(H.wrap(c)),onError:c=>a.fire(c),onEnd:()=>{a.fire("end"),a.dispose(),s.dispose()}}),a.event}writeFile(e,t,i,o){let s=this.transformIncoming(e,t);return this.provider.writeFile(s,i.buffer,o)}open(e,t,i){let o=this.transformIncoming(e,t,!0);return this.provider.open(o,i)}close(e){return this.provider.close(e)}async read(e,t,i){let o=H.alloc(i),a=await this.provider.read(e,t,o.buffer,0,i);return[o,a]}write(e,t,i,o,s){return this.provider.write(e,t,i.buffer,o,s)}mkdir(e,t){let i=this.transformIncoming(e,t);return this.provider.mkdir(i)}delete(e,t,i){let o=this.transformIncoming(e,t);return this.provider.delete(o,i)}rename(e,t,i,o){let s=this.transformIncoming(e,t),a=this.transformIncoming(e,i);return this.provider.rename(s,a,o)}copy(e,t,i,o){let s=this.transformIncoming(e,t),a=this.transformIncoming(e,i);return this.provider.copy(s,a,o)}cloneFile(e,t,i){let o=this.transformIncoming(e,t),s=this.transformIncoming(e,i);return this.provider.cloneFile(o,s)}onFileChange(e,t){let i=new b({onWillAddFirstListener:()=>{this.sessionToWatcher.set(t,this.createSessionFileWatcher(e,i))},onDidRemoveLastListener:()=>{ut(this.sessionToWatcher.get(t)),this.sessionToWatcher.delete(t)}});return i.event}async watch(e,t,i,o,s){let a=this.sessionToWatcher.get(t);if(a){let l=this.transformIncoming(e,o),c=a.watch(i,l,s);this.watchRequests.set(t+i,c)}}async unwatch(e,t){let i=e+t,o=this.watchRequests.get(i);o&&(ut(o),this.watchRequests.delete(i))}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()}},hh=class extends T{constructor(e,t,i,o){super();this.uriTransformer=e;this.environmentService=o;this.watcherRequests=new Map;this.fileWatcher=this._register(new ps(i)),this.registerListeners(t)}registerListeners(e){let t=this._register(new b);this._register(t.event(i=>{e.fire(i.map(o=>({resource:this.uriTransformer.transformOutgoingURI(o.resource),type:o.type,cId:o.cId})))})),this._register(this.fileWatcher.onDidChangeFile(i=>t.fire(i))),this._register(this.fileWatcher.onDidWatchError(i=>e.fire(i)))}getRecursiveWatcherOptions(e){}getExtraExcludes(e){}watch(e,t,i){let o=this.getExtraExcludes(this.environmentService);return Array.isArray(o)&&(i.excludes=[...i.excludes,...o]),this.watcherRequests.set(e,this.fileWatcher.watch(t,i)),G(()=>{ut(this.watcherRequests.get(e)),this.watcherRequests.delete(e)})}dispose(){for(let[,e]of this.watcherRequests)e.dispose();this.watcherRequests.clear(),super.dispose()}}});var NE,BE=I(()=>{ot();nf();ce();NE=new class{transformIncoming(n){return n}transformOutgoing(n){return n}transformOutgoingURI(n){return n}transformOutgoingScheme(n){return n}}});import{shell as eM}from"electron";var gh,XI,VE=I(()=>{xe();X();ce();je();we();UE();BE();No();gh=class extends mh{constructor(e,t,i){super(e,t);this.environmentService=i}getUriTransformer(e){return NE}transformIncoming(e,t){return x.revive(t)}async delete(e,t,i){if(!i.useTrash)return super.delete(e,t,i);let o=this.transformIncoming(e,t),s=kt(o.fsPath);try{await eM.trashItem(s)}catch(a){throw zr(F?h(2250,null,Pe(s),_r(a)):h(2251,null,Pe(s),_r(a)),"Unknown")}}createSessionFileWatcher(e,t){return new XI(e,t,this.logService,this.environmentService)}},XI=class extends hh{watch(r,e,t){if(t.recursive)throw zr("Recursive file watching is not supported from main process for performance reasons.","Unavailable");return super.watch(r,e,t)}}});var ge,Ju=I(()=>{ge=class{constructor(r,e=[],t=!1){this.ctor=r,this.staticArguments=e,this.supportsDelayedInstantiation=t}}});var fs,vh=I(()=>{fs=class{constructor(...r){this._entries=new Map;for(let[e,t]of r)this.set(e,t)}set(r,e){let t=this._entries.get(r);return this._entries.set(r,e),t}has(r){return this._entries.has(r)}get(r){return this._entries.get(r)}}});import{exec as yh}from"child_process";import{totalmem as tM}from"os";function Qu(n){return new Promise((r,e)=>{let t,i=new Map,o=tM();function s(l,c,d,u,f){let m=i.get(c);if(l===n||m){let v={name:a(d),cmd:d,pid:l,ppid:c,load:u,mem:F?f:o*(f/100)};i.set(l,v),l===n&&(t=v),m&&(m.children||(m.children=[]),m.children.push(v),m.children.length>1&&(m.children=m.children.sort((y,C)=>y.pid-C.pid)))}}function a(l){let c=/--utility-sub-type=network/i,d=/--crashes-directory/i,u=/conhost\.exe.+--headless/i,f=/--type=([a-zA-Z-]+)/;if(d.exec(l))return"electron-crash-reporter";if(u.exec(l))return"conpty-agent";let m=f.exec(l);if(m&&m.length===2)return m[1]==="renderer"?"window":m[1]==="utility"?c.exec(l)?"utility-network-service":"utility-process":m[1]==="extensionHost"?"extension-host":m[1];if(l.indexOf("node ")<0&&l.indexOf("node.exe")<0){let v="";do m=rM.exec(l),m&&(v+=m+" ");while(m);if(v)return`electron-nodejs (${v.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(n,d=>{if(!d){e(new Error(`Root process ${n} not found`));return}c.getProcessCpuUsage(d,u=>{let f=new Map;u.forEach(m=>{let v=l(m.commandLine||"");f.set(m.pid,{name:a(v),cmd:v,pid:m.pid,ppid:m.ppid,load:m.cpu||0,mem:m.memory||0})}),t=f.get(n),t?(f.forEach(m=>{let v=f.get(m.ppid);v&&(v.children||(v.children=[]),v.children.push(m))}),f.forEach(m=>{m.children&&(m.children=m.children.sort((v,y)=>v.pid-y.pid))}),r(t)):e(new Error(`Root process ${n} not found`))})},c.ProcessDataFlag.CommandLine|c.ProcessDataFlag.Memory)})}else{let l=function(){let c=[t],d=[];for(;c.length;){let f=c.shift();f&&(d.push(f.pid),f.children&&(c=c.concat(f.children)))}let u=JSON.stringify(st.asFileUri("vs/base/node/cpuUsage.sh").fsPath);u+=" "+d.join(" "),yh(u,{},(f,m,v)=>{if(f||v)e(f||new Error(v.toString()));else{let y=m.toString().split(`
`);for(let C=0;C<d.length;C++){let w=i.get(d[C]);w.load=parseFloat(y[C])}if(!t){e(new Error(`Root process ${n} not found`));return}r(t)}})};yh("which ps",{},(c,d,u)=>{if(c||u)if(process.platform!=="linux")e(c||new Error(u.toString()));else{let f=JSON.stringify(st.asFileUri("vs/base/node/ps.sh").fsPath);yh(f,{},(m,v,y)=>{m||y?e(m||new Error(y.toString())):(HE(v,s),l())})}else{let f=d.toString().trim();yh(`${f} -ax -o pid=,ppid=,pcpu=,pmem=,command=`,{maxBuffer:1e3*1024,env:{LC_NUMERIC:"en_US.UTF-8"}},(v,y,C)=>{v||C&&!C.includes("screen size is bogus")?e(v||new Error(C.toString())):(HE(y,s),process.platform==="linux"?l():t?r(t):e(new Error(`Root process ${n} not found`)))})}})}})}function HE(n,r){let e=/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+\.[0-9]+)\s+([0-9]+\.[0-9]+)\s+(.+)$/,t=n.toString().split(`
`);for(let i of t){let o=e.exec(i.trim());o&&o.length===6&&r(parseInt(o[1]),parseInt(o[2]),o[5],parseFloat(o[3]),parseFloat(o[4]))}}var rM,YI=I(()=>{ze();X();rM=/[a-zA-Z-]+\.js\b/g});var ql,$E=I(()=>{YI();xe();Em();tI();te();os();ql=class{constructor(r,e,t){this.logService=r;this.diagnosticsService=e;this.diagnosticsMainService=t}async resolveProcesses(){let r=await this.diagnosticsMainService.getMainDiagnostics(),e=[];for(let i of r.windows)e.push([i.pid,`window [${i.id}] (${i.title})`]);for(let{pid:i,name:o}of sr.getAll())e.push([i,o]);let t=[];try{t.push({name:h(2379,null),rootProcess:await Qu(process.pid)}),(await this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!0})).forEach(o=>{Eu(o)?t.push({name:o.hostName,rootProcess:o}):o.processes&&t.push({name:o.hostName,rootProcess:o.processes})})}catch(i){this.logService.error(`Listing processes failed: ${i}`)}return{pidToNames:e,processes:t}}async getSystemStatus(){let[r,e]=await Promise.all([this.diagnosticsMainService.getMainDiagnostics(),this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!1,includeWorkspaceMetadata:!1})]);return this.diagnosticsService.getDiagnostics(r,e)}async getSystemInfo(){let[r,e]=await Promise.all([this.diagnosticsMainService.getMainDiagnostics(),this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!1,includeWorkspaceMetadata:!1})]);return await this.diagnosticsService.getSystemInfo(r,e)}async getPerformanceInfo(){try{let[r,e]=await Promise.all([this.diagnosticsMainService.getMainDiagnostics(),this.diagnosticsMainService.getRemoteDiagnostics({includeProcesses:!0,includeWorkspaceMetadata:!0})]);return await this.diagnosticsService.getPerformanceInfo(r,e)}catch(r){throw this.logService.warn("issueService#getPerformanceInfo ",r.message),r}}};ql=E([g(0,B),g(1,Pu),g(2,Dl)],ql)});function qE(n){let r=n.getKeyMap(),e=n.getCurrentKeyboardLayout();return{keyboardMapping:r,keyboardLayoutInfo:e}}var ZI,Kl,KE=I(()=>{X();q();$();Z();Ct();ZI=O("keyboardLayoutMainService"),Kl=class extends T{constructor(e){super();this._onDidChangeKeyboardLayout=this._register(new b);this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event;this._initPromise=null,this._keyboardLayoutData=null,e.when(3).then(()=>this._initialize())}_initialize(){return this._initPromise||(this._initPromise=this._doInitialize()),this._initPromise}async _doInitialize(){let e=await import("native-keymap");this._keyboardLayoutData=qE(e),rS||e.onDidChangeKeyboardLayout(()=>{this._keyboardLayoutData=qE(e),this._onDidChangeKeyboardLayout.fire(this._keyboardLayoutData)})}async getKeyboardLayoutData(){return await this._initialize(),this._keyboardLayoutData}};Kl=E([g(0,ye)],Kl)});var zl,ew=I(()=>{Z();zl=O("urlService")});import{app as iM}from"electron";var nM,Ih,jl,zE=I(()=>{Jt();q();X();ce();nr();et();Nl();Z();te();ew();Kt();qt();nM="launchMainService",Ih=O(nM),jl=class{constructor(r,e,t,i,o){this.logService=r;this.windowsMainService=e;this.urlService=t;this.configurationService=i;this.productService=o;this._onDidRequestShareSecrets=new b;this.onDidRequestShareSecrets=this._onDidRequestShareSecrets.event}async start(r,e){if(this.logService.trace("Received data from other instance: ",r,e),r["share-secrets-with-agents-app"]){this.logService.info("Received --share-secrets-with-agents-app from second instance"),this._onDidRequestShareSecrets.fire();return}V&&iM.focus({steal:!0});let t=this.parseOpenUrl(r);if(t.length){let i=Promise.resolve();if(this.windowsMainService.getWindowCount()===0){let o=(await this.windowsMainService.openEmptyWindow({context:4})).at(0);o&&(i=o.ready())}i.then(()=>{for(let{uri:o,originalUrl:s}of t)this.urlService.open(o,{originalUrl:s})})}else return this.startOpenWindow(r,e)}parseOpenUrl(r){return r["open-url"]&&r._urls&&r._urls.length>0?at(r._urls.map(e=>{try{return{uri:x.parse(e),originalUrl:e}}catch{return null}})):[]}async startOpenWindow(r,e){let t=an(e)?0:4,i=[],o=r.wait&&r.waitMarkerFilePath?x.file(r.waitMarkerFilePath):void 0,s=r.remote||void 0,a={context:t,cli:r,userEnv:r["preserve-env"]||t===0?e:void 0,waitMarkerFileURI:o,remoteAuthority:s,forceProfile:r.profile,forceTempProfile:r["profile-temp"]};if(r.extensionDevelopmentPath)await this.windowsMainService.openExtensionDevelopmentHostWindow(r.extensionDevelopmentPath,a);else if(r.agents&&this.productService.quality!=="stable")i=await this.windowsMainService.openAgentsWindow(a);else if(!r._.length&&!r["folder-uri"]&&!r["file-uri"]){let l=!1;if(r["new-window"]||a.forceProfile||a.forceTempProfile)l=!0;else if(r["reuse-window"])l=!1;else switch(this.configurationService.getValue("window")?.openWithoutArgumentsInNewWindow||"default"){case"on":l=!0;break;case"off":l=!1;break;default:l=!V}if(l)i=await this.windowsMainService.open({...a,forceNewWindow:!0,forceEmpty:!0});else{let c=this.windowsMainService.getLastActiveWindow();c?(this.windowsMainService.openExistingWindow(c,a),i=[c]):i=await this.windowsMainService.open({...a,forceEmpty:!0})}}else i=await this.windowsMainService.open({...a,forceNewWindow:r["new-window"],preferNewWindow:!r["reuse-window"]&&!r.wait,forceReuseWindow:r["reuse-window"],diffMode:r.diff,mergeMode:r.merge,addMode:r.add,removeMode:r.remove,noRecentEntry:!!r["skip-add-to-recently-opened"],gotoLineMode:r.goto});if(o&&i.length===1&&i[0])return Promise.race([i[0].whenClosedOrLoaded,k1(o.fsPath)]).then(()=>{},()=>{})}async getMainProcessId(){return this.logService.trace("Received request for process ID from other instance."),process.pid}};jl=E([g(0,B),g(1,qe),g(2,zl),g(3,ue),g(4,Te)],jl)});function tw(n){return n.submenu!==void 0}function rw(n){return n.id==="vscode.menubar.separator"}function iw(n){return n.uri!==void 0}function jE(n){return!tw(n)&&!rw(n)&&!iw(n)}var GE=I(()=>{});var ae,ms,Bn=I(()=>{Oe();Z();ae={Uninitialized:{type:"uninitialized"},Disabled:n=>({type:"disabled",reason:n}),Idle:(n,r,e)=>({type:"idle",updateType:n,error:r,notAvailable:e}),CheckingForUpdates:n=>({type:"checking for updates",explicit:n}),AvailableForDownload:(n,r)=>({type:"available for download",update:n,canInstall:r}),Downloading:(n,r,e,t,i,o)=>({type:"downloading",update:n,explicit:r,overwrite:e,downloadedBytes:t,totalBytes:i,startTime:o}),Downloaded:(n,r,e)=>({type:"downloaded",update:n,explicit:r,overwrite:e}),Updating:(n,r,e,t)=>({type:"updating",update:n,explicit:r,currentProgress:e,maxProgress:t}),Ready:(n,r,e)=>({type:"ready",update:n,explicit:r,overwrite:e}),Overwriting:(n,r)=>({type:"overwriting",update:n,explicit:r}),Restarting:n=>({type:"restarting",update:n})},ms=O("updateService")});import{app as oa}from"electron";var hs,wr,Xu=I(()=>{Jt();he();q();so();$();ze();X();gt();ce();nr();xe();Z();Ct();te();Rn();Fn();Lm();Rr();is();Cr();Qs();Lt();hs=O("workspacesHistoryMainService"),wr=class extends T{constructor(e,t,i,o,s,a){super();this.logService=e;this.workspacesManagementMainService=t;this.lifecycleMainService=i;this.applicationStorageMainService=o;this.dialogMainService=s;this.environmentMainService=a;this._onDidChangeRecentlyOpened=this._register(new b);this.onDidChangeRecentlyOpened=this._onDidChangeRecentlyOpened.event;this.macOSRecentDocumentsUpdater=this._register(new Tr(800));this.registerListeners()}static{this.MAX_TOTAL_RECENT_ENTRIES=500}static{this.RECENTLY_OPENED_STORAGE_KEY="history.recentlyOpenedPathsList"}registerListeners(){this.lifecycleMainService.when(4).then(()=>this.handleWindowsJumpList()),this._register(this.workspacesManagementMainService.onDidEnterWorkspace(e=>this.addRecentlyOpened([{workspace:e.workspace,remoteAuthority:e.window.remoteAuthority}])))}async addRecentlyOpened(e){let t=[],i=[];for(let s of e)if(Am(s))!this.workspacesManagementMainService.isUntitledWorkspace(s.workspace)&&!this.containsWorkspace(t,s.workspace)&&t.push(s);else if(_u(s))this.containsFolder(t,s.folderUri)||t.push(s);else{let a=this.containsFile(i,s.fileUri),l=s.fileUri.scheme===W.file&&wr.COMMON_FILES_FILTER.indexOf(qr(s.fileUri))>=0;!a&&!l&&(i.push(s),F&&s.fileUri.scheme===W.file&&!this.environmentMainService.isPortable&&!process.isEmbeddedApp&&oa.addRecentDocument(s.fileUri.fsPath))}let o=await this.mergeEntriesFromStorage({workspaces:t,files:i});t=o.workspaces,i=o.files,t.length>wr.MAX_TOTAL_RECENT_ENTRIES&&(t.length=wr.MAX_TOTAL_RECENT_ENTRIES),i.length>wr.MAX_TOTAL_RECENT_ENTRIES&&(i.length=wr.MAX_TOTAL_RECENT_ENTRIES),await this.saveRecentlyOpened({workspaces:t,files:i}),this._onDidChangeRecentlyOpened.fire(),V&&!this.environmentMainService.isPortable&&this.macOSRecentDocumentsUpdater.trigger(()=>this.updateMacOSRecentDocuments())}async removeRecentlyOpened(e){let t=a=>{let l=this.location(a);for(let c of e)if(Je.isEqual(c,l))return!1;return!0},i=await this.getRecentlyOpened(),o=i.workspaces.filter(t),s=i.files.filter(t);(o.length!==i.workspaces.length||s.length!==i.files.length)&&(await this.saveRecentlyOpened({files:s,workspaces:o}),this._onDidChangeRecentlyOpened.fire(),V&&!this.environmentMainService.isPortable&&this.macOSRecentDocumentsUpdater.trigger(()=>this.updateMacOSRecentDocuments()))}async clearRecentlyOpened(e){if(e?.confirm){let{response:t}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[h(2892,null),h(2891,null)],message:h(2894,null),detail:h(2893,null),cancelId:1});if(t!==0)return}await this.saveRecentlyOpened({workspaces:[],files:[]}),this.environmentMainService.isPortable||oa.clearRecentDocuments(),this._onDidChangeRecentlyOpened.fire()}async getRecentlyOpened(){return this.mergeEntriesFromStorage()}async mergeEntriesFromStorage(e){let t=new mt(s=>Je.getComparisonKey(s));if(e?.workspaces)for(let s of e.workspaces)t.set(this.location(s),s);let i=new mt(s=>Je.getComparisonKey(s));if(e?.files)for(let s of e.files)i.set(this.location(s),s);let o=await this.getRecentlyOpenedFromStorage();for(let s of o.workspaces){let a=t.get(this.location(s));a?a.label=a.label??s.label:t.set(this.location(s),s)}for(let s of o.files){let a=i.get(this.location(s));a?a.label=a.label??s.label:i.set(this.location(s),s)}return{workspaces:[...t.values()],files:[...i.values()]}}async getRecentlyOpenedFromStorage(){await this.applicationStorageMainService.whenReady;let e,t=this.applicationStorageMainService.get(wr.RECENTLY_OPENED_STORAGE_KEY,-2);if(typeof t=="string")try{e=JSON.parse(t)}catch(i){this.logService.error("Unexpected error parsing opened paths list",i)}return QP(e,this.logService)}async saveRecentlyOpened(e){await this.applicationStorageMainService.whenReady,this.applicationStorageMainService.store(wr.RECENTLY_OPENED_STORAGE_KEY,JSON.stringify(XP(e)),-2,1)}location(e){return _u(e)?e.folderUri:qP(e)?e.fileUri:e.workspace.configPath}containsWorkspace(e,t){return!!e.find(i=>Am(i)&&i.workspace.id===t.id)}containsFolder(e,t){return!!e.find(i=>_u(i)&&Je.isEqual(i.folderUri,t))}containsFile(e,t){return!!e.find(i=>Je.isEqual(i.fileUri,t))}static{this.MAX_MACOS_DOCK_RECENT_WORKSPACES=7}static{this.MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL=10}static{this.MAX_WINDOWS_JUMP_LIST_ENTRIES=7}static{this.COMMON_FILES_FILTER=["COMMIT_EDITMSG","MERGE_MSG","git-rebase-todo"]}async handleWindowsJumpList(){F&&(this.environmentMainService.isPortable||process.isEmbeddedApp||(await this.updateWindowsJumpList(),this._register(this.onDidChangeRecentlyOpened(()=>this.updateWindowsJumpList()))))}async updateWindowsJumpList(){if(!F)return;let e=[];if(e.push({type:"tasks",items:[{type:"task",title:h(2895,null),description:h(2896,null),program:process.execPath,args:"-n",iconPath:process.execPath,iconIndex:0}]}),(await this.getRecentlyOpened()).workspaces.length>0){let t=[];for(let s of oa.getJumpListSettings().removedItems){let a=s.args;if(a){let l=/^--(folder|file)-uri\s+"([^"]+)"$/.exec(a);l&&t.push(x.parse(l[2]))}}await this.removeRecentlyOpened(t);let i=!1,o=at((await this.getRecentlyOpened()).workspaces.slice(0,wr.MAX_WINDOWS_JUMP_LIST_ENTRIES).map(s=>{let a=Am(s)?s.workspace:s.folderUri,{title:l,description:c}=this.getWindowsJumpListLabel(a,s.label),d;return x.isUri(a)?d=`--folder-uri "${a.toString()}"`:(i=!0,d=`--file-uri "${a.configPath.toString()}"`),{type:"task",title:l.substr(0,255),description:c.substr(0,255),program:process.execPath,args:d,iconPath:"explorer.exe",iconIndex:0}}));o.length>0&&e.push({type:"custom",name:i?h(2898,null):h(2897,null),items:o})}e.push({type:"recent"});try{let t=oa.setJumpList(e);t&&t!=="ok"&&this.logService.warn(`updateWindowsJumpList#setJumpList unexpected result: ${t}`)}catch(t){this.logService.warn("updateWindowsJumpList#setJumpList",t)}}getWindowsJumpListLabel(e,t){if(t)return{title:rx(t).name,description:t};if(x.isUri(e))return{title:qr(e),description:this.renderJumpListPathDescription(e)};if(this.workspacesManagementMainService.isUntitledWorkspace(e))return{title:h(2899,null),description:""};let i=qr(e.configPath);return i.endsWith(lu)&&(i=i.substr(0,i.length-lu.length-1)),{title:h(2900,null,i),description:this.renderJumpListPathDescription(e.configPath)}}renderJumpListPathDescription(e){return e.scheme==="file"?Cd(e.fsPath):e.toString()}async updateMacOSRecentDocuments(){if(!V||process.isEmbeddedApp)return;oa.clearRecentDocuments();let e=await this.getRecentlyOpened(),t=[],i=0;for(let s=0;s<e.workspaces.length&&i<wr.MAX_MACOS_DOCK_RECENT_WORKSPACES;s++){let a=this.location(e.workspaces[s]);if(a.scheme===W.file){let l=hr(a);await Q.exists(l)&&(t.push(l),i++)}}let o=[];for(let s=0;s<e.files.length&&i<wr.MAX_MACOS_DOCK_RECENT_ENTRIES_TOTAL;s++){let a=this.location(e.files[s]);if(a.scheme===W.file){let l=hr(a);if(wr.COMMON_FILES_FILTER.includes(qr(a))||t.includes(l))continue;await Q.exists(l)&&(o.push(l),i++)}}o.reverse().forEach(s=>oa.addRecentDocument(s)),t.reverse().forEach(s=>oa.addRecentDocument(s))}};wr=E([g(0,B),g(1,pi),g(2,ye),g(3,Ir),g(4,ui),g(5,_e)],wr)});import{app as oM,BrowserWindow as wh,Menu as er,MenuItem as Qe}from"electron";function wo(){return new Qe({type:"separator"})}var bh,bo,JE=I(()=>{he();wt();so();X();ce();xe();Ll();et();Lt();Ct();te();GE();Fl();qt();xi();Zt();Bn();Jo();Kt();Xu();$();bh="menu",bo=class extends T{constructor(e,t,i,o,s,a,l,c,d,u,f,m){super();this.updateService=e;this.configurationService=t;this.windowsMainService=i;this.environmentMainService=o;this.telemetryService=s;this.workspacesHistoryMainService=a;this.stateService=l;this.lifecycleMainService=c;this.logService=d;this.nativeHostMainService=u;this.productService=f;this.auxiliaryWindowsMainService=m;this.fallbackMenuHandlers=Object.create(null);this.menuUpdater=this._register(new gr(()=>this.doUpdateMenu(),0)),this.menuGC=this._register(new gr(()=>{this.oldMenus=[]},1e4)),this.menubarMenus=Object.create(null),this.keybindings=Object.create(null),this.showNativeMenu=wy(t),(V||this.showNativeMenu)&&this.restoreCachedMenubarData(),this.addFallbackHandlers(),this.closedLastWindow=!1,this.noActiveMainWindow=!1,this.oldMenus=[],this.install(),this.registerListeners()}static{this.lastKnownMenubarStorageKey="lastKnownMenubarData"}restoreCachedMenubarData(){let e=this.stateService.getItem(bo.lastKnownMenubarStorageKey);e&&(e.menus&&(this.menubarMenus=e.menus),e.keybindings&&(this.keybindings=e.keybindings))}addFallbackHandlers(){this.fallbackMenuHandlers["workbench.action.files.newUntitledFile"]=(a,l,c)=>{this.runActionInRenderer({type:"commandId",commandId:"workbench.action.files.newUntitledFile"})||this.windowsMainService.openEmptyWindow({context:2,contextWindowId:l?.id})},this.fallbackMenuHandlers["workbench.action.newWindow"]=(a,l,c)=>this.windowsMainService.openEmptyWindow({context:2,contextWindowId:l?.id}),this.fallbackMenuHandlers["workbench.action.files.openFileFolder"]=(a,l,c)=>this.nativeHostMainService.pickFileFolderAndOpen(void 0,{forceNewWindow:this.isOptionClick(c),telemetryExtraData:{from:bh}}),this.fallbackMenuHandlers["workbench.action.files.openFolder"]=(a,l,c)=>this.nativeHostMainService.pickFolderAndOpen(void 0,{forceNewWindow:this.isOptionClick(c),telemetryExtraData:{from:bh}}),this.fallbackMenuHandlers["workbench.action.openWorkspace"]=(a,l,c)=>this.nativeHostMainService.pickWorkspaceAndOpen(void 0,{forceNewWindow:this.isOptionClick(c),telemetryExtraData:{from:bh}}),this.fallbackMenuHandlers["workbench.action.clearRecentFiles"]=()=>this.workspacesHistoryMainService.clearRecentlyOpened({confirm:!0});let e=this.productService.youTubeUrl;e&&(this.fallbackMenuHandlers["workbench.action.openYouTubeUrl"]=()=>this.openUrl(e,"openYouTubeUrl"));let t=this.productService.requestFeatureUrl;t&&(this.fallbackMenuHandlers["workbench.action.openRequestFeatureUrl"]=()=>this.openUrl(t,"openUserVoiceUrl"));let i=this.productService.reportIssueUrl;i&&(this.fallbackMenuHandlers["workbench.action.openIssueReporter"]=()=>this.openUrl(i,"openReportIssues"));let o=this.productService.licenseUrl;o&&(this.fallbackMenuHandlers["workbench.action.openLicenseUrl"]=()=>{if(vi){let a=o.indexOf("?")>0?"&":"?";this.openUrl(`${o}${a}lang=${vi}`,"openLicenseUrl")}else this.openUrl(o,"openLicenseUrl")});let s=this.productService.privacyStatementUrl;s&&o&&(this.fallbackMenuHandlers["workbench.action.openPrivacyStatementUrl"]=()=>{this.openUrl(s,"openPrivacyStatement")})}registerListeners(){this._register(this.lifecycleMainService.onWillShutdown(()=>this.willShutdown=!0)),this._register(this.windowsMainService.onDidChangeWindowsCount(e=>this.onDidChangeWindowsCount(e))),this._register(this.nativeHostMainService.onDidBlurMainWindow(()=>this.onDidChangeWindowFocus())),this._register(this.nativeHostMainService.onDidFocusMainWindow(()=>this.onDidChangeWindowFocus())),this._register(this.updateService.onStateChange(()=>this.scheduleUpdateMenu()))}get currentEnableMenuBarMnemonics(){let e=this.configurationService.getValue("window.enableMenuBarMnemonics");return typeof e!="boolean"?!0:e}get currentEnableNativeTabs(){if(!V)return!1;let e=this.configurationService.getValue("window.nativeTabs");return typeof e!="boolean"?!1:e}updateMenu(e,t){this.menubarMenus=e.menus,this.keybindings=e.keybindings,this.stateService.setItem(bo.lastKnownMenubarStorageKey,e),this.scheduleUpdateMenu()}scheduleUpdateMenu(){this.menuUpdater.schedule()}doUpdateMenu(){this.willShutdown||setTimeout(()=>{this.willShutdown||this.install()},10)}onDidChangeWindowsCount(e){V&&(e.oldCount===0&&e.newCount>0||e.oldCount>0&&e.newCount===0)&&(this.closedLastWindow=e.newCount===0,this.scheduleUpdateMenu())}onDidChangeWindowFocus(){if(!V)return;let e=wh.getFocusedWindow();this.noActiveMainWindow=!e||!!this.auxiliaryWindowsMainService.getWindowByWebContents(e.webContents),this.scheduleUpdateMenu()}install(){let e=er.getApplicationMenu();if(e&&this.oldMenus.push(e),Object.keys(this.menubarMenus).length===0){this.doSetApplicationMenu(V?new er:null);return}let t=new er,i;if(V){let s=new er;i=new Qe({label:this.productService.nameShort,submenu:s}),this.setMacApplicationMenu(s),t.append(i)}if(V&&!this.appMenuInstalled){this.appMenuInstalled=!0;let s=new er;s.append(new Qe({label:this.mnemonicLabel(h(2334,null)),click:()=>this.windowsMainService.openEmptyWindow({context:1})})),oM.dock.setMenu(s)}if(this.shouldDrawMenu("File")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2323,null)),submenu:s});this.setMenuById(s,"File"),t.append(a)}if(this.shouldDrawMenu("Edit")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2322,null)),submenu:s});this.setMenuById(s,"Edit"),t.append(a)}if(this.shouldDrawMenu("Selection")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2344,null)),submenu:s});this.setMenuById(s,"Selection"),t.append(a)}if(this.shouldDrawMenu("View")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2350,null)),submenu:s});this.setMenuById(s,"View"),t.append(a)}if(this.shouldDrawMenu("Go")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2324,null)),submenu:s});this.setMenuById(s,"Go"),t.append(a)}if(this.shouldDrawMenu("Run")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2343,null)),submenu:s});this.setMenuById(s,"Run"),t.append(a)}if(this.shouldDrawMenu("Terminal")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2349,null)),submenu:s});this.setMenuById(s,"Terminal"),t.append(a)}let o;if(this.shouldDrawMenu("Window")){let s=new er;o=new Qe({label:this.mnemonicLabel(h(2351,null)),submenu:s,role:"window"}),this.setMacWindowMenu(s)}if(o&&t.append(o),this.shouldDrawMenu("Help")){let s=new er,a=new Qe({label:this.mnemonicLabel(h(2325,null)),submenu:s,role:"help"});this.setMenuById(s,"Help"),t.append(a)}t.items&&t.items.length>0?this.doSetApplicationMenu(t):this.doSetApplicationMenu(null),this.menuGC.schedule()}doSetApplicationMenu(e){if(er.setApplicationMenu(e),e)for(let t of this.auxiliaryWindowsMainService.getWindows())t.win?.setMenu(null)}setMacApplicationMenu(e){let t=this.createMenuItem(h(2320,null,this.productService.nameLong),"workbench.action.showAboutDialog"),i=this.getUpdateMenuItems(),o;if(this.shouldDrawMenu("Preferences")){let m=new er;this.setMenuById(m,"Preferences"),o=new Qe({label:this.mnemonicLabel(h(2335,null)),submenu:m})}let s=new er,a=new Qe({label:h(2345,null),role:"services",submenu:s}),l=new Qe({label:h(2326,null,this.productService.nameLong),role:"hide",accelerator:"Command+H"}),c=new Qe({label:h(2327,null),role:"hideOthers",accelerator:"Command+Alt+H"}),d=new Qe({label:h(2346,null),role:"unhide"}),u=new Qe(this.likeAction("workbench.action.quit",{label:h(2336,null,this.productService.nameLong),click:async(m,v,y)=>{let C=this.windowsMainService.getLastActiveWindow();(this.windowsMainService.getWindowCount()===0||wh.getFocusedWindow()||C?.win?.isMinimized())&&await this.confirmBeforeQuit(y)&&this.nativeHostMainService.quit(void 0)}})),f=[t];f.push(...i),o&&f.push(wo(),o),f.push(wo(),a,wo(),l,c,d,wo(),u),f.forEach(m=>e.append(m))}async confirmBeforeQuit(e){if(this.windowsMainService.getWindowCount()===0)return!0;let t=this.configurationService.getValue("window.confirmBeforeClose");if(t==="always"||t==="keyboardOnly"&&this.isKeyboardEvent(e)){let{response:i}=await this.nativeHostMainService.showMessageBox(this.windowsMainService.getFocusedWindow()?.id,{type:"question",buttons:[V?h(2353,null):h(2319,null),h(2318,null)],message:V?h(2355,null):h(2354,null)});return i===0}return!0}shouldDrawMenu(e){if(!V&&!this.showNativeMenu)return!1;switch(e){case"File":case"Help":if(V)return this.windowsMainService.getWindowCount()===0&&this.closedLastWindow||this.windowsMainService.getWindowCount()>0&&this.noActiveMainWindow||!!this.menubarMenus&&!!this.menubarMenus[e];case"Window":if(V)return this.windowsMainService.getWindowCount()===0&&this.closedLastWindow||this.windowsMainService.getWindowCount()>0&&this.noActiveMainWindow||!!this.menubarMenus;default:return this.windowsMainService.getWindowCount()>0&&!!this.menubarMenus&&!!this.menubarMenus[e]}}setMenu(e,t){t.forEach(i=>{if(rw(i))e.append(wo());else if(tw(i)){let o=new er,s=new Qe({label:this.mnemonicLabel(i.label),submenu:o});this.setMenu(o,i.submenu.items),e.append(s)}else iw(i)?e.append(this.createOpenRecentMenuItem(i)):jE(i)&&(i.id==="workbench.action.showAboutDialog"&&this.insertCheckForUpdatesItems(e),V?this.windowsMainService.getWindowCount()===0&&this.closedLastWindow||this.windowsMainService.getWindowCount()>0&&this.noActiveMainWindow?this.fallbackMenuHandlers[i.id]?e.append(new Qe(this.likeAction(i.id,{label:this.mnemonicLabel(i.label),click:this.fallbackMenuHandlers[i.id]}))):e.append(this.createMenuItem(i.label,i.id,!1,i.checked)):e.append(this.createMenuItem(i.label,i.id,i.enabled!==!1,!!i.checked)):e.append(this.createMenuItem(i.label,i.id,i.enabled!==!1,!!i.checked)))})}setMenuById(e,t){this.menubarMenus?.[t]&&this.setMenu(e,this.menubarMenus[t].items)}insertCheckForUpdatesItems(e){let t=this.getUpdateMenuItems();t.length&&(t.forEach(i=>e.append(i)),e.append(wo()))}createOpenRecentMenuItem(e){let t=x.revive(e.uri),i=e.id,o=i==="openRecentFile"?{fileUri:t}:i==="openRecentWorkspace"?{workspaceUri:t}:{folderUri:t};return new Qe(this.likeAction(i,{label:e.label,click:async(s,a,l)=>{let c=this.isOptionClick(l);(await this.windowsMainService.open({context:2,cli:this.environmentMainService.args,urisToOpen:[o],forceNewWindow:c,gotoLineMode:!1,remoteAuthority:e.remoteAuthority})).length>0||await this.workspacesHistoryMainService.removeRecentlyOpened([t])}},!1))}isOptionClick(e){return!!(e&&(!V&&(e.ctrlKey||e.shiftKey)||V&&(e.metaKey||e.altKey)))}isKeyboardEvent(e){return!!(e.triggeredByAccelerator||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}createRoleMenuItem(e,t,i){let o={label:this.mnemonicLabel(e),role:i,enabled:!0};return new Qe(this.withKeybinding(t,o))}setMacWindowMenu(e){let t=new Qe({label:h(2340,null),role:"minimize",accelerator:"Command+M",enabled:this.windowsMainService.getWindowCount()>0}),i=new Qe({label:h(2352,null),role:"zoom",enabled:this.windowsMainService.getWindowCount()>0}),o=new Qe({label:h(2321,null),role:"front",enabled:this.windowsMainService.getWindowCount()>0}),s=this.createMenuItem(h(2338,null),"workbench.action.switchWindow"),a=[];this.currentEnableNativeTabs&&(a.push(wo()),a.push(this.createMenuItem(h(2342,null),"workbench.action.newWindowTab")),a.push(this.createRoleMenuItem(h(2348,null),"workbench.action.showPreviousWindowTab","selectPreviousTab")),a.push(this.createRoleMenuItem(h(2347,null),"workbench.action.showNextWindowTab","selectNextTab")),a.push(this.createRoleMenuItem(h(2341,null),"workbench.action.moveWindowTabToNewWindow","moveTabToNewWindow")),a.push(this.createRoleMenuItem(h(2339,null),"workbench.action.mergeAllWindowTabs","mergeAllWindows"))),[t,i,wo(),s,...a,wo(),o].forEach(l=>e.append(l))}getUpdateMenuItems(){switch(this.updateService.state.type){case"idle":return[new Qe({label:this.mnemonicLabel(h(2328,null)),click:()=>setTimeout(()=>{this.reportMenuActionTelemetry("CheckForUpdate"),this.updateService.checkForUpdates(!0)},0)})];case"checking for updates":return[new Qe({label:h(2329,null),enabled:!1})];case"available for download":return[new Qe({label:this.mnemonicLabel(h(2331,null)),click:()=>{this.updateService.downloadUpdate(!0)}})];case"downloading":case"overwriting":return[new Qe({label:h(2330,null),enabled:!1})];case"downloaded":return V?[]:[new Qe({label:this.mnemonicLabel(h(2333,null)),click:()=>{this.reportMenuActionTelemetry("InstallUpdate"),this.updateService.applyUpdate()}})];case"updating":return[new Qe({label:h(2332,null),enabled:!1})];case"ready":return[new Qe({label:this.mnemonicLabel(h(2337,null)),click:()=>{this.reportMenuActionTelemetry("RestartToUpdate"),this.updateService.quitAndInstall()}})];default:return[]}}createMenuItem(e,t,i,o){let s=this.mnemonicLabel(e),a=(u,f,m)=>{let v=u?u.userSettingsLabel:null;v&&m.triggeredByAccelerator?this.runActionInRenderer({type:"keybinding",userSettingsLabel:v}):this.runActionInRenderer({type:"commandId",commandId:t})},l=typeof i=="boolean"?i:this.windowsMainService.getWindowCount()>0,c=typeof o=="boolean"?o:!1,d={label:s,click:a,enabled:l};return c&&(d.type="checkbox",d.checked=c),V&&(t==="editor.action.clipboardCutAction"?d.role="cut":t==="editor.action.clipboardCopyAction"?d.role="copy":t==="editor.action.clipboardPasteAction"&&(d.role="paste"),t==="undo"?d.click=this.makeContextAwareClickHandler(a,{inDevTools:u=>u.undo(),inNoWindow:()=>er.sendActionToFirstResponder("undo:")}):t==="redo"?d.click=this.makeContextAwareClickHandler(a,{inDevTools:u=>u.redo(),inNoWindow:()=>er.sendActionToFirstResponder("redo:")}):t==="editor.action.selectAll"&&(d.click=this.makeContextAwareClickHandler(a,{inDevTools:u=>u.selectAll(),inNoWindow:()=>er.sendActionToFirstResponder("selectAll:")}))),new Qe(this.withKeybinding(t,d))}makeContextAwareClickHandler(e,t){return(i,o,s)=>{let a=wh.getFocusedWindow();if(!a)return t.inNoWindow();if(a.webContents.isDevToolsFocused()&&a.webContents.devToolsWebContents)return t.inDevTools(a.webContents.devToolsWebContents);if(!a.webContents.isFocused())return t.inNoWindow();e(i,o||a,s)}}runActionInRenderer(e){let t=wh.getFocusedWindow();if(t){let o=this.auxiliaryWindowsMainService.getWindowByWebContents(t.webContents);o&&(t=this.windowsMainService.getWindowById(o.parentId)?.win??null)}if(!t){let o=this.windowsMainService.getLastActiveWindow();o?.win?.isMinimized()&&(t=o.win)}let i=t?this.windowsMainService.getWindowById(t.id):void 0;if(i){if(this.logService.trace("menubar#runActionInRenderer",e),V&&!this.environmentMainService.isBuilt&&!i.isReady&&(e.type==="commandId"&&e.commandId==="workbench.action.toggleDevTools"||e.type!=="commandId"&&e.userSettingsLabel==="alt+cmd+i"))return!1;if(e.type==="commandId"){let o={id:e.commandId,from:"menu"};i.sendWhenReady("vscode:runAction",Ce.None,o)}else{let o={userSettingsLabel:e.userSettingsLabel};i.sendWhenReady("vscode:runKeybinding",Ce.None,o)}return!0}else return this.logService.trace("menubar#runActionInRenderer: no active window found",e),!1}withKeybinding(e,t){let i=typeof e=="string"?this.keybindings[e]:void 0;if(i?.label){if(i.isNative!==!1)t.accelerator=i.label,t.userSettingsLabel=i.userSettingsLabel;else if(typeof t.label=="string"){let o=t.label.indexOf("[");o>=0?t.label=`${t.label.substr(0,o)} [${i.label}]`:t.label=`${t.label} [${i.label}]`}}else t.accelerator=void 0;return t}likeAction(e,t,i=!t.accelerator){i&&(t=this.withKeybinding(e,t));let o=t.click;return t.click=(s,a,l)=>{this.reportMenuActionTelemetry(e),o?.(s,a,l)},t}openUrl(e,t){this.nativeHostMainService.openExternal(void 0,e),this.reportMenuActionTelemetry(t)}reportMenuActionTelemetry(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e,from:bh})}mnemonicLabel(e){return tx(e,!this.currentEnableMenuBarMnemonics)}};bo=E([g(0,ms),g(1,ue),g(2,qe),g(3,_e),g(4,Ke),g(5,hs),g(6,Et),g(7,ye),g(8,B),g(9,Wi),g(10,Te),g(11,nn)],bo)});var nw,Gl,QE=I(()=>{Z();Ct();te();JE();$();nw=O("menubarMainService"),Gl=class extends T{constructor(e,t,i){super();this.instantiationService=e;this.lifecycleMainService=t;this.logService=i;this.menubar=this.installMenuBarAfterWindowOpen()}async installMenuBarAfterWindowOpen(){return await this.lifecycleMainService.when(3),this._register(this.instantiationService.createInstance(bo))}async updateMenubar(e,t){this.logService.trace("menubarService#updateMenubar",e),(await this.menubar).updateMenu(t,e)}};Gl=E([g(0,Ht),g(1,ye),g(2,B)],Gl)});var Gr,ow,Sh,gs=I(()=>{q();$();Z();Gr=O("meteredConnectionService"),ow="network.meteredConnection",Sh=class extends T{constructor(e,t){super();this._onDidChangeIsConnectionMetered=this._register(new b);this.onDidChangeIsConnectionMetered=this._onDidChangeIsConnectionMetered.event;this._isBrowserConnectionMetered=t,this._meteredConnectionSetting=e.getValue(ow),this._isConnectionMetered=this._meteredConnectionSetting==="on"||this._meteredConnectionSetting!=="off"&&this._isBrowserConnectionMetered,this._register(e.onDidChangeConfiguration(i=>{if(i.affectsConfiguration(ow)){let o=e.getValue(ow);o!==this._meteredConnectionSetting&&(this._meteredConnectionSetting=o,this.onUpdated())}}))}get isConnectionMetered(){return this._isConnectionMetered}get isBrowserConnectionMetered(){return this._isBrowserConnectionMetered}setIsBrowserConnectionMetered(e){e!==this._isBrowserConnectionMetered&&(this._isBrowserConnectionMetered=e,this.onChangeBrowserConnection())}onChangeBrowserConnection(){this.onUpdated()}onUpdated(){let e=this._meteredConnectionSetting==="on"||this._meteredConnectionSetting!=="off"&&this._isBrowserConnectionMetered;e!==this._isConnectionMetered&&(this._isConnectionMetered=e,this.onChangeIsConnectionMetered())}onChangeIsConnectionMetered(){this._onDidChangeIsConnectionMetered.fire(this._isConnectionMetered)}}});var sw,aw=I(()=>{q();$();sw="meteredConnection"});var xh,XE=I(()=>{aw();xh=class{constructor(r){this.service=r}listen(r,e){if(e==="OnDidChangeIsConnectionMetered")return this.service.onDidChangeIsConnectionMetered;throw new Error(`Event not found: ${e}`)}async call(r,e,t){switch(e){case"IsConnectionMetered":return this.service.isConnectionMetered;case"SetIsBrowserConnectionMetered":this.service.setIsBrowserConnectionMetered(t);break;default:throw new Error(`Call not found: ${e}`)}}}});var Jl,YE=I(()=>{et();gs();Jl=class extends Sh{constructor(r){super(r,!1)}setTelemetryService(r){this.telemetryService=r}onChangeBrowserConnection(){let r=this.isBrowserConnectionMetered;r||super.onChangeBrowserConnection(),this.telemetryService?.publicLog2("meteredConnectionStateChange",{connectionState:this.isBrowserConnectionMetered}),r&&super.onChangeBrowserConnection()}};Jl=E([g(0,ue)],Jl)});var Ui,sa,Ql,cn=I(()=>{q();ad();$();Z();Ui=O("policy"),sa=class extends T{constructor(){super(...arguments);this.policyDefinitions={};this.policies=new Map;this._onDidChange=this._register(new b);this.onDidChange=this._onDidChange.event}async updatePolicyDefinitions(e){let t=Object.keys(this.policyDefinitions).length;return this.policyDefinitions={...e,...this.policyDefinitions},t!==Object.keys(this.policyDefinitions).length&&await this._updatePolicyDefinitions(this.policyDefinitions),In.reduce(this.policies.entries(),(i,[o,s])=>({...i,[o]:s}),{})}getPolicyValue(e){return this.policies.get(e)}serialize(){return In.reduce(Object.entries(this.policyDefinitions),(e,[t,i])=>({...e,[t]:{definition:i,value:this.policies.get(t)}}),{})}},Ql=class{constructor(){this.onDidChange=S.None;this.policyDefinitions={}}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}});async function sM(n,r,e,t,i){try{let o=await import("@vscode/spdlog");o.setFlushOn(0);let s=await o.createAsyncRotatingLogger(n,r,e,t);return i?s.clearFormatters():s.setPattern("%Y-%m-%d %H:%M:%S.%e [%l] %v"),s}catch(o){console.error(o)}return null}function ZE(n,r,e){switch(r){case 1:n.trace(e);break;case 2:n.debug(e);break;case 3:n.info(e);break;case 4:n.warn(e);break;case 5:n.error(e);break;case 0:break;default:throw new Error(`Invalid log level ${r}`)}}function eC(n,r){switch(r){case 1:n.setLevel(0);break;case 2:n.setLevel(1);break;case 3:n.setLevel(2);break;case 4:n.setLevel(3);break;case 5:n.setLevel(4);break;case 0:n.setLevel(6);break;default:throw new Error(`Invalid log level ${r}`)}}var Ph,tC=I(()=>{je();te();Ph=class extends $s{constructor(e,t,i,o,s){super();this.buffer=[];this.setLevel(s),this._loggerCreationPromise=this._createSpdLogLogger(e,t,i,o),this._register(this.onDidChangeLogLevel(a=>{this._logger&&eC(this._logger,a)}))}async _createSpdLogLogger(e,t,i,o){let s=i?6:1,a=30/s*_n.MB,l=await sM(e,t,a,s,o);if(l){this._logger=l,eC(this._logger,this.getLevel());for(let{level:c,message:d}of this.buffer)ZE(this._logger,c,d);this.buffer=[]}}log(e,t){this._logger?ZE(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}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 Eh,rC=I(()=>{Xt();te();tC();Eh=class extends ru{doCreateLogger(r,e,t){return new Ph(ke(),r.fsPath,!t?.donotRotate,!!t?.donotUseFormatters,e)}}});var dn,Ch,Xl=I(()=>{Cr();q();Z();te();rC();dn=ai,Ch=class extends Eh{constructor(){super(...arguments);this.loggerResourcesByWindow=new mt}createLogger(e,t,i){i!==void 0&&this.loggerResourcesByWindow.set(this.toResource(e),i);try{return super.createLogger(e,t)}catch(o){throw this.loggerResourcesByWindow.delete(this.toResource(e)),o}}registerLogger(e,t){t!==void 0&&this.loggerResourcesByWindow.set(e.resource,t),super.registerLogger(e)}deregisterLogger(e){this.loggerResourcesByWindow.delete(e),super.deregisterLogger(e)}getGlobalLoggers(){let e=[];for(let t of super.getRegisteredLoggers())this.loggerResourcesByWindow.has(t.resource)||e.push(t);return e}getOnDidChangeLogLevelEvent(e){return S.filter(this.onDidChangeLogLevel,t=>iu(t)||this.isInterestedLoggerResource(t[0],e))}getOnDidChangeVisibilityEvent(e){return S.filter(this.onDidChangeVisibility,([t])=>this.isInterestedLoggerResource(t,e))}getOnDidChangeLoggersEvent(e){return S.filter(S.map(this.onDidChangeLoggers,t=>({added:[...t.added].filter(o=>this.isInterestedLoggerResource(o.resource,e)),removed:[...t.removed].filter(o=>this.isInterestedLoggerResource(o.resource,e))})),t=>t.added.length>0||t.removed.length>0)}deregisterLoggers(e){for(let[t,i]of this.loggerResourcesByWindow)i===e&&this.deregisterLogger(t)}isInterestedLoggerResource(e,t){let i=this.loggerResourcesByWindow.get(e);return i===void 0||i===t}dispose(){super.dispose(),this.loggerResourcesByWindow.clear()}}});function aM(n){if(Gn===2&&/^penguin(\.|$)/i.test(n))return"chromebook"}function iC(n,r,e,t,i,o,s,a,l,c,d){let u=Object.create(null);u["common.machineId"]=o,u["common.sqmId"]=s,u["common.devDeviceId"]=a,u.sessionID=ke()+Date.now(),u.commitHash=t,u.version=i,u["common.releaseDate"]=c,u["common.platformVersion"]=(n||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),u["common.platform"]=Lp(Gn),u["common.nodePlatform"]=Fp,u["common.nodeArch"]=e,u["common.product"]=d||"desktop",l&&(u["common.msftInternal"]=l);let f=0,m=Date.now();Object.defineProperties(u,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-m,enumerable:!0},"common.sequence":{get:()=>f++,enumerable:!0}}),Mp&&(u["common.snap"]="true");let v=aM(r);return v&&(u["common.platformDetail"]=v),u}function nC(n){let r=St.USERDNSDOMAIN;if(!r)return!1;let e=r.toLowerCase();return n.some(t=>e===t)}var lw=I(()=>{X();yi();Xt()});function Th(n,r){return!r.isBuilt&&!r.disableTelemetry?!0:!(r.disableTelemetry||!n.enableTelemetry)}function Zl(n){let r=n.getValue(fl),e=n.getValue(mm);if(n.getValue(mu)===!1||e===!1)return 0;switch(r??"all"){case"all":return 3;case"error":return 2;case"crash":return 1;case"off":return 0}}function oC(n,r){let e=n.msftInternalDomains||[],t=r.getValue("telemetry.internalTesting");return nC(e)||t}function sC(n){return[n.appRoot,n.extensionsPath,n.userHome.fsPath,n.tmpDir.fsPath,n.userDataPath]}function uM(n,r){if(!n||!n.includes("/")&&!n.includes("\\"))return n;let e=n,t=[];for(let l of r)for(;;){let c=l.exec(n);if(!c)break;t.push([c.index,l.lastIndex])}let i=/(?:^|[\\\/])((node_modules|node_modules\.asar)[\\\/].*)$/,o=/^(.*?)((?:\.vscode(?:-[a-z]+)*|resources[\\\/]app)[\\\/]extensions[\\\/].*)$/i,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w\-\._@]+(\\\\|\\|\/))+[\w\-\._@]*/g,a=0;for(e="";;){let l=s.exec(n);if(!l)break;if(!t.some(([d,u])=>l.index<u&&d<s.lastIndex)){let d=o.exec(l[0]);if(d)e+=n.substring(a,l.index)+"<REDACTED: user-file-path>/"+d[2];else{let u=i.exec(l[0]);u?e+=n.substring(a,l.index)+"<REDACTED: user-file-path>/"+u[1]:e+=n.substring(a,l.index)+"<REDACTED: user-file-path>"}a=s.lastIndex}}return a<n.length&&(e+=n.substr(a)),e}function pM(n){if(!n)return n;let r=[{label:"URL",regex:/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]*/},{label:"Google API Key",regex:/AIza[A-Za-z0-9_\\\-]{35}/},{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:"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,}/}];for(let e of r)if(e.regex.test(n))return`<REDACTED: ${e.label}>`;return n}function aC(n,r){return n?WP(n,e=>{if(e instanceof Yl||Object.hasOwnProperty.call(e,"isTrustedTelemetryValue"))return e.value;if(typeof e=="string"){let t=e.replaceAll("%20"," ");t=uM(t,r);for(let i of r)t=t.replace(i,"");return t=pM(t),t}}):{}}var Yl,cw,Vn,dM,vne,So=I(()=>{di();Oe();xe();_l();lw();Zt();Yl=class{constructor(r){this.value=r;this.isTrustedTelemetryValue=!0}},cw=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(){}},Vn=new cw,dM="telemetry",vne={id:dM,name:h(2465,null)}});var _h,uw,pw,lC=I(()=>{_h={exit:"vscode:electron-main->shared-process=exit",ipcReady:"vscode:shared-process->electron-main=ipc-ready",initDone:"vscode:shared-process->electron-main=init-done"},uw={request:"vscode:createSharedProcessChannelConnection",response:"vscode:createSharedProcessChannelConnectionResult"},pw={request:"vscode:createSharedProcessRawConnection",response:"vscode:createSharedProcessRawConnectionResult"}});var ec,cC=I(()=>{Ai();he();$();Lt();Ct();te();en();cn();Xl();os();So();zd();Oe();lC();q();ec=class extends T{constructor(e,t,i,o,s,a,l,c,d){super();this.machineId=e;this.sqmId=t;this.devDeviceId=i;this.environmentMainService=o;this.userDataProfilesService=s;this.lifecycleMainService=a;this.logService=l;this.loggerMainService=c;this.policyService=d;this.firstWindowConnectionBarrier=new bn;this.utilityProcess=void 0;this.utilityProcessLogListener=void 0;this._onDidCrash=this._register(new b);this.onDidCrash=this._onDidCrash.event;this._whenReady=void 0;this._whenIpcReady=void 0;this.registerListeners()}registerListeners(){rt.on(uw.request,(e,t)=>this.onWindowConnection(e,t,uw.response)),rt.on(pw.request,(e,t)=>this.onWindowConnection(e,t,pw.response)),this._register(this.lifecycleMainService.onWillShutdown(()=>this.onWillShutdown()))}async onWindowConnection(e,t,i){this.logService.trace(`[SharedProcess] onWindowConnection for: ${i}`),this.firstWindowConnectionBarrier.isOpen()||this.firstWindowConnectionBarrier.open(),await this.whenReady();let o=await this.connect(i);if(e.sender.isDestroyed())return o.close();e.sender.postMessage(i,t,[o])}onWillShutdown(){this.logService.trace("[SharedProcess] onWillShutdown"),this.utilityProcess?.postMessage(_h.exit),this.utilityProcess=void 0}whenReady(){return this._whenReady||(this._whenReady=(async()=>{await this.whenIpcReady;let e=new At;this.utilityProcess?.once(_h.initDone,()=>e.complete()),await e.p,this.utilityProcessLogListener?.dispose(),this.logService.trace("[SharedProcess] Overall ready")})()),this._whenReady}get whenIpcReady(){return this._whenIpcReady||(this._whenIpcReady=(async()=>{await this.firstWindowConnectionBarrier.wait(),this.createUtilityProcess();let e=new At;this.utilityProcess?.once(_h.ipcReady,()=>e.complete()),await e.p,this.logService.trace("[SharedProcess] IPC ready")})()),this._whenIpcReady}createUtilityProcess(){this.utilityProcess=this._register(new sr(this.logService,Vn,this.lifecycleMainService)),this.utilityProcessLogListener=this.utilityProcess.onMessage(i=>{let o=i;typeof o.warning=="string"?this.logService.warn(o.warning):typeof o.error=="string"&&this.logService.error(o.error)});let e=Gx(this.environmentMainService.args,this.environmentMainService.isBuilt),t;e.port&&(t=["--nolazy","--experimental-network-inspection"],e.break?t.push(`--inspect-brk=${e.port}`):t.push(`--inspect=${e.port}`)),this.utilityProcess.start({type:"shared-process",name:"shared-process",entryPoint:"vs/code/electron-utility/sharedProcess/sharedProcessMain",payload:this.createSharedProcessConfiguration(),respondToAuthRequestsFromMainProcess:!0,execArgv:t}),this._register(this.utilityProcess.onCrash(()=>this._onDidCrash.fire()))}createSharedProcessConfiguration(){return{machineId:this.machineId,sqmId:this.sqmId,devDeviceId:this.devDeviceId,codeCachePath:this.environmentMainService.codeCachePath,profiles:{home:this.userDataProfilesService.profilesHome,all:this.userDataProfilesService.profiles},args:this.environmentMainService.args,logLevel:this.loggerMainService.getLogLevel(),loggers:this.loggerMainService.getGlobalLoggers(),policiesData:this.policyService.serialize()}}async connect(e){return await this.whenIpcReady,yn(this.utilityProcess).connect(e)}};ec=E([g(3,_e),g(4,Dr),g(5,ye),g(6,B),g(7,dn),g(8,Ui)],ec)});var fM,vs,kh=I(()=>{Z();fM="signService",vs=O(fM)});var Rh,dC=I(()=>{q();$();Rd();Ry();Rr();Rh=class n extends T{constructor(e,t){super();this.logService=e;this.storageMainService=t;this.onDidChangeApplicationStorageEmitter=this._register(new b);this.onDidChangeApplicationSharedStorageEmitter=this._register(new b);this.mapProfileToOnDidChangeProfileStorageEmitter=new Map;this.registerStorageChangeListeners(t.applicationStorage,this.onDidChangeApplicationStorageEmitter),this.registerStorageChangeListeners(t.applicationSharedStorage,this.onDidChangeApplicationSharedStorageEmitter)}static{this.STORAGE_CHANGE_DEBOUNCE_TIME=100}registerStorageChangeListeners(e,t){this._register(S.debounce(e.onDidChangeStorage,(i,o)=>(i?i.push(o):i=[o],i),n.STORAGE_CHANGE_DEBOUNCE_TIME)(i=>{i.length&&t.fire(this.serializeStorageChangeEvents(i,e))}))}serializeStorageChangeEvents(e,t){let i=new Map,o=new Set;return e.forEach(s=>{let a=t.get(s.key);typeof a=="string"?i.set(s.key,a):o.add(s.key)}),{changed:Array.from(i.entries()),deleted:Array.from(o.values())}}listen(e,t,i){switch(t){case"onDidChangeStorage":{let o=i.profile?Yi(i.profile):void 0;if(!o)return i.applicationShared?this.onDidChangeApplicationSharedStorageEmitter.event:this.onDidChangeApplicationStorageEmitter.event;let s=this.mapProfileToOnDidChangeProfileStorageEmitter.get(o.id);return s||(s=this._register(new b),this.registerStorageChangeListeners(this.storageMainService.profileStorage(o),s),this.mapProfileToOnDidChangeProfileStorageEmitter.set(o.id,s)),s.event}}throw new Error(`Event not found: ${t}`)}async call(e,t,i){let o=i.profile?Yi(i.profile):void 0,s=aP(i.workspace),a=i.applicationShared,l=await this.withStorageInitialized(o,s,a);switch(t){case"getItems":{let c=new Map(l.items);return Array.from(c.entries())}case"getFallbackApplicationStorageItems":return l instanceof ml?Array.from(l.applicationStorageItems.entries()):[];case"updateItems":{let c=i;if(c.insert)for(let[d,u]of c.insert)l.set(d,u);c.delete?.forEach(d=>l.delete(d));break}case"optimize":return l.optimize();case"isUsed":{let c=i.payload;return typeof c=="string"?this.storageMainService.isUsed(c):!1}default:throw new Error(`Call not found: ${t}`)}}async withStorageInitialized(e,t,i){let o;t?o=this.storageMainService.workspaceStorage(t):e?o=this.storageMainService.profileStorage(e):i?o=this.storageMainService.applicationSharedStorage:o=this.storageMainService.applicationStorage;try{await o.init()}catch(s){this.logService.error(`StorageIPC#init: Unable to init ${t?"workspace":e?"profile":i?"application-shared":"application"} storage due to ${s}`)}return o}}});var Dh,uC=I(()=>{Dh=class{constructor(r){this.channel=r}log(r,e){return this.channel.call("log",{eventName:r,data:e}).then(void 0,t=>`Failed to log telemetry: ${console.warn(t)}`),Promise.resolve(null)}flush(){return Promise.resolve()}}});function mM(){let n=h(2462,null,Fr.nameLong),r=Fr.privacyStatementUrl?h(2448,null,"https://aka.ms/vscode-telemetry",Fr.privacyStatementUrl):h(2449,null,"https://aka.ms/vscode-telemetry"),e=Pr?"":h(2454,null),t=h(2447,null),i=h(2452,null),o=h(2463,null),s=h(2461,null),a=`
|       | ${t} | ${i} | ${o} |
|:------|:-------------:|:---------------:|:----------:|
| all   |       \u2713       |        \u2713        |     \u2713      |
| error |       \u2713       |        \u2713        |     -      |
| crash |       \u2713       |        -        |     -      |
| off   |       -       |        -        |     -      |
`,l=h(2457,null);return`
${n} ${r} ${e}

&nbsp;

${s}
${a}

&nbsp;

${l}
`}var xo,hM,pC=I(()=>{$();di();X();bd();ar();xe();et();no();xd();qt();Xi();Zt();So();xo=class{constructor(r,e,t){this._configurationService=e;this._productService=t;this._experimentProperties={};this._pendingEvents=[];this._isExperimentPropertySet=!1;this._disposables=new j;this._cleanupPatterns=[];this._appenders=r.appenders,this._commonProperties=r.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.msftInternal=this._commonProperties["common.msftInternal"],this._piiPaths=r.piiPaths||[],this._telemetryLevel=3,this._sendErrorTelemetry=!!r.sendErrorTelemetry,this._meteredConnectionService=r.meteredConnectionService,this._cleanupPatterns=[/(vscode-)?file:\/\/.*?\/resources\/app\//gi];for(let i of this._piiPaths)this._cleanupPatterns.push(new RegExp(Lo(i),"gi")),i.indexOf("\\")>=0&&this._cleanupPatterns.push(new RegExp(Lo(i.replace(/\\/g,"/")),"gi"));this._updateTelemetryLevel(),this._disposables.add(this._configurationService.onDidChangeConfiguration(i=>{(i.affectsConfiguration(fl)||i.affectsConfiguration(mu)||i.affectsConfiguration(mm))&&this._updateTelemetryLevel()})),r.waitForExperimentProperties?this._flushTimeout=setTimeout(()=>this._flushPendingEvents(),xo.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}setExperimentProperty(r,e){this._experimentProperties[r]=new Yl(e),this._isExperimentPropertySet||this._flushPendingEvents()}setCommonProperty(r,e){this._commonProperties[r]=e}_flushPendingEvents(){if(!this._isExperimentPropertySet){this._isExperimentPropertySet=!0,this._flushTimeout!==void 0&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0);for(let r of this._pendingEvents)this._doLog(r.eventName,r.eventLevel,r.data);this._pendingEvents=[]}}_updateTelemetryLevel(){let r=Zl(this._configurationService),e=this._productService.enabledTelemetryLevels;if(e){this._sendErrorTelemetry=this.sendErrorTelemetry?e.error:!1;let t=e.usage?3:e.error?2:0;r=Math.min(r,t)}this._telemetryLevel=r}get sendErrorTelemetry(){return this._sendErrorTelemetry}get telemetryLevel(){return this._telemetryLevel}dispose(){this._flushPendingEvents(),this._disposables.dispose()}_log(r,e,t){if(!(this._telemetryLevel<e)&&!this._meteredConnectionService?.isConnectionMetered){if(!this._isExperimentPropertySet){this._pendingEvents.length<xo.MAX_BUFFER_SIZE&&this._pendingEvents.push({eventName:r,eventLevel:e,data:t});return}this._doLog(r,e,t)}}_doLog(r,e,t){t=km(t,this._experimentProperties),t=aC(t,this._cleanupPatterns),t=km(t,this._commonProperties),e===2&&(t={...t,isError:!0}),this._appenders.forEach(i=>i.log(r,t??{}))}publicLog(r,e){this._log(r,3,e)}publicLog2(r,e){this.publicLog(r,e)}publicLogError(r,e){this._sendErrorTelemetry&&this._log(r,2,e)}publicLogError2(r,e){this.publicLogError(r,e)}};xo=E([g(1,ue),g(2,Te)],xo);hM=Pt.as(lr.Configuration);hM.registerConfiguration({id:bP,order:1,type:"object",title:h(2464,null),properties:{[fl]:{type:"string",enum:["all","error","crash","off"],enumDescriptions:[h(2456,null),h(2458,null),h(2455,null),h(2459,null)],markdownDescription:mM(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"],policy:{name:"TelemetryLevel",category:"Telemetry",minimumVersion:"1.99",localization:{description:{key:"telemetry.telemetryLevel.policyDescription",value:h(2460,null)},enumDescriptions:[{key:"telemetry.telemetryLevel.default",value:h(2456,null)},{key:"telemetry.telemetryLevel.error",value:h(2458,null)},{key:"telemetry.telemetryLevel.crash",value:h(2455,null)},{key:"telemetry.telemetryLevel.off",value:h(2459,null)}]}}},"telemetry.feedback.enabled":{type:"boolean",default:!0,description:h(2453,null),policy:{name:"EnableFeedback",category:"Telemetry",minimumVersion:"1.99",localization:{description:{key:"telemetry.feedback.enabled",value:h(2453,null)}}}},[mu]:{type:"boolean",markdownDescription:Fr.privacyStatementUrl?h(2451,null,Fr.nameLong,Fr.privacyStatementUrl):h(2450,null,Fr.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:h(2446,null,`\`#${fl}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}})});var Ah,fC=I(()=>{q();$();Bn();Ah=class{constructor(r){this.service=r}listen(r,e){if(e==="onStateChange")return this.service.onStateChange;throw new Error(`Event not found: ${e}`)}call(r,e,t){switch(e){case"checkForUpdates":return this.service.checkForUpdates(t);case"downloadUpdate":return this.service.downloadUpdate(t);case"applyUpdate":return this.service.applyUpdate();case"quitAndInstall":return this.service.quitAndInstall();case"_getInitialState":return Promise.resolve(this.service.state);case"isLatestVersion":return this.service.isLatestVersion();case"_applySpecificUpdate":return this.service._applySpecificUpdate(t);case"setInternalOrg":return this.service.setInternalOrg(t)}throw new Error(`Call not found: ${e}`)}}});var Lh,mC=I(()=>{q();$();Lh=class extends T{constructor(e,t,i,o){super();this.localUpdateService=e;this.logService=t;this.lifecycleMainService=i;this.crossAppIPCService=o;this.mode="standalone";this._onStateChange=this._register(new b);this.onStateChange=this._onStateChange.event;this.pendingQuitAndInstall=!1;this._state=this.localUpdateService.state,this.registerLocalStateListener(),this._register(this.crossAppIPCService.onDidConnect(s=>{this.handleConnect(s)})),this.crossAppIPCService.connected&&this.handleConnect(this.crossAppIPCService.isServer),this._register(this.crossAppIPCService.onDidReceiveMessage(s=>{this.handleMessage(s)})),this._register(this.crossAppIPCService.onDidDisconnect(s=>{if(this.logService.info(`CrossAppUpdateCoordinator: disconnected (${s}), was ${this.mode}`),this.mode==="client"&&(this.localUpdateService.resume(),this.registerLocalStateListener(),this.updateState(this.localUpdateService.state)),this.mode==="server"&&this.pendingQuitAndInstall){this.logService.info("CrossAppUpdateCoordinator: client disconnected during pending quit, treating as confirmed"),this.pendingQuitAndInstall=!1,this.mode="standalone",this.localUpdateService.quitAndInstall();return}this.mode="standalone"}))}get state(){return this._state}handleConnect(e){this.logService.info(`CrossAppUpdateCoordinator: connected (isServer=${e})`),e?(this.mode="server",this.broadcastState(this.localUpdateService.state)):(this.mode="client",this.localUpdateService.suspend(),this.localStateListener?.dispose(),this.localStateListener=void 0,this.sendMessage({type:"update/requestInitialState"}))}registerLocalStateListener(){this.localStateListener=this.localUpdateService.onStateChange(e=>{this.updateState(e),this.broadcastState(e)})}handleMessage(e){switch(this.logService.trace(`CrossAppUpdateCoordinator: received ${e.type} (mode=${this.mode})`),e.type){case"update/stateChange":case"update/initialState":this.mode==="client"&&this.updateState(e.data);break;case"update/prepareForQuit":this.mode==="client"&&(this.logService.info("CrossAppUpdateCoordinator: server requested quit for update"),this.lifecycleMainService.quit().then(t=>{t?(this.logService.info("CrossAppUpdateCoordinator: client quit was vetoed"),this.sendMessage({type:"update/quitVetoed"})):this.sendMessage({type:"update/quitConfirmed"})}));break;case"update/requestInitialState":this.mode==="server"&&this.sendMessage({type:"update/initialState",data:this.localUpdateService.state});break;case"update/checkForUpdates":this.mode==="server"&&this.localUpdateService.checkForUpdates(typeof e.data=="boolean"?e.data:!0);break;case"update/downloadUpdate":this.mode==="server"&&this.localUpdateService.downloadUpdate(typeof e.data=="boolean"?e.data:!0);break;case"update/applyUpdate":this.mode==="server"&&this.localUpdateService.applyUpdate();break;case"update/quitAndInstall":this.mode==="server"&&this.doCoordinatedQuitAndInstall();break;case"update/quitConfirmed":this.mode==="server"&&(this.logService.info("CrossAppUpdateCoordinator: client confirmed quit, proceeding with quitAndInstall"),this.pendingQuitAndInstall=!1,this.localUpdateService.quitAndInstall());break;case"update/quitVetoed":this.mode==="server"&&(this.logService.info("CrossAppUpdateCoordinator: client vetoed quit, aborting quitAndInstall"),this.pendingQuitAndInstall=!1);break}}updateState(e){this._state=e,this._onStateChange.fire(e)}broadcastState(e){this.mode==="server"&&this.sendMessage({type:"update/stateChange",data:e})}sendMessage(e){this.crossAppIPCService.sendMessage(e)}async checkForUpdates(e){this.mode==="client"?this.sendMessage({type:"update/checkForUpdates",data:e}):await this.localUpdateService.checkForUpdates(e)}async downloadUpdate(e){this.mode==="client"?this.sendMessage({type:"update/downloadUpdate",data:e}):await this.localUpdateService.downloadUpdate(e)}async applyUpdate(){this.mode==="client"?this.sendMessage({type:"update/applyUpdate"}):await this.localUpdateService.applyUpdate()}doCoordinatedQuitAndInstall(){this.crossAppIPCService.connected?(this.pendingQuitAndInstall=!0,this.sendMessage({type:"update/prepareForQuit"})):this.localUpdateService.quitAndInstall()}async quitAndInstall(){this.mode==="client"?this.sendMessage({type:"update/quitAndInstall"}):this.doCoordinatedQuitAndInstall()}async isLatestVersion(){return this.localUpdateService.isLatestVersion()}async _applySpecificUpdate(e){return this.localUpdateService._applySpecificUpdate(e)}async setInternalOrg(e){return this.localUpdateService.setInternalOrg(e)}dispose(){this.localStateListener?.dispose(),super.dispose()}}});import fw from"electron";var Mh,hC=I(()=>{q();$();X();xe();Bn();Mh=class extends T{constructor(e,t){super();this.dialogMainService=t;this.macAppActive=V;V&&(this._register(S.fromNodeEventEmitter(fw.app,"did-become-active")(()=>this.macAppActive=!0)),this._register(S.fromNodeEventEmitter(fw.app,"did-resign-active")(()=>this.macAppActive=!1))),this._register(e.onStateChange(i=>{i.type==="idle"&&i.notAvailable&&!i.error&&this.show()}))}show(){let e=fw.BrowserWindow.getFocusedWindow();!e&&!(V&&this.macAppActive)||this.dialogMainService.showMessageBox({type:"info",message:h(2848,null)},e??void 0)}}});function ep(n){return`${Zu}${n}`}async function mw(n,r,e,t){let i=ep(n);t?.trace("[secrets] getting secret for key:",i);let o=r(i);if(!o){t?.trace("[secrets] no secret found for key:",i);return}t?.trace("[secrets] decrypting secret for key:",i);let s=await e(o);return t?.trace("[secrets] decrypted secret for key:",i),s}async function hw(n,r,e,t,i){i?.trace("[secrets] encrypting secret for key:",n);let o=await t(r),s=ep(n);i?.trace("[secrets] storing encrypted secret for key:",s),e(s,o),i?.trace("[secrets] stored encrypted secret for key:",s)}var Zu,tp,Koe,Oh,gC=I(()=>{he();qd();Z();Rn();q();te();$();Yn();X();Zu="secret://";tp=['{"extensionId":"vscode.github-authentication","key":"github.auth"}'],Koe=O("secretStorageService"),Oh=class extends T{constructor(e,t,i,o){super();this._useInMemoryStorage=e;this._storageService=t;this._encryptionService=i;this._logService=o;this.onDidChangeSecretEmitter=this._register(new b);this.onDidChangeSecret=this.onDidChangeSecretEmitter.event;this._sequencer=new lf;this._type="unknown";this._onDidChangeValueDisposable=this._register(new j);this._lazyStorageService=new rr(()=>this.initialize())}useSharedStorage(e){return F&&tp.includes(e)}get type(){return this._type}get resolvedStorageService(){return this._lazyStorageService.value}get(e){return this._sequencer.queue(e,async()=>{let t=await this.resolvedStorageService;try{return await mw(e,i=>this.getValueFromStorage(e,i,t),this._type==="in-memory"?i=>Promise.resolve(i):i=>this._encryptionService.decrypt(i),this._logService)}catch(i){this._logService.error(i),this.delete(e);return}})}set(e,t){return this._sequencer.queue(e,async()=>{let i=await this.resolvedStorageService;try{await hw(e,t,(o,s)=>this.setValueInStorage(e,o,s,i),this._type==="in-memory"?o=>Promise.resolve(o):o=>this._encryptionService.encrypt(o),this._logService)}catch(o){throw this._logService.error(o),o}})}delete(e){return this._sequencer.queue(e,async()=>{let t=await this.resolvedStorageService,i=ep(e);this._logService.trace("[secrets] deleting secret for key:",i);let o=this.useSharedStorage(e)?-2:-1;t.remove(i,o),this._logService.trace("[secrets] deleted secret for key:",i)})}keys(){return this._sequencer.queue("__keys__",async()=>{let e=await this.resolvedStorageService;this._logService.trace("[secrets] fetching keys of all secrets");let t=e.keys(-1,1);return this._logService.trace("[secrets] fetched keys of all secrets"),t.filter(i=>i.startsWith(Zu)).map(i=>i.slice(Zu.length))})}getValueFromStorage(e,t,i){return this.useSharedStorage(e)?(this._logService.trace(`[SecretStorageService] Fetching value for cross-app shared secret: ${t}`),i.get(t,-2)):i.get(t,-1)}setValueInStorage(e,t,i,o){if(this.useSharedStorage(e)){this._logService.trace(`[SecretStorageService] Setting value for cross-app shared secret: ${t}`),o.store(t,i,-2,1);return}o.store(t,i,-1,1)}async initialize(){let e;if(!this._useInMemoryStorage&&await this._encryptionService.isEncryptionAvailable())this._logService.trace("[SecretStorageService] Encryption is available, using persisted storage"),this._type="persisted",e=this._storageService;else{if(this._type==="in-memory")return this._storageService;this._logService.trace("[SecretStorageService] Encryption is not available, falling back to in-memory storage"),this._type="in-memory",e=this._register(new om)}return this._onDidChangeValueDisposable.clear(),this._onDidChangeValueDisposable.add(S.any(e.onDidChangeValue(-1,void 0,this._onDidChangeValueDisposable),e.onDidChangeValue(-2,void 0,this._onDidChangeValueDisposable))(t=>{this.onDidChangeValue(t.key)})),e}reinitialize(){this._lazyStorageService=new rr(()=>this.initialize())}onDidChangeValue(e){if(!e.startsWith(Zu))return;let t=e.slice(Zu.length);this._logService.trace(`[SecretStorageService] Notifying change in value for secret: ${t}`),this.onDidChangeSecretEmitter.fire(t)}};Oh=E([g(1,dP),g(2,Bx),g(3,B)],Oh)});import{execFile as gM}from"child_process";var gw,Fh,vC=I(()=>{we();$();gC();X();gw="crossAppSecretSharing.migrationDone",Fh=class extends T{constructor(e,t,i,o,s,a,l,c){super();this.encryptionMainService=t;this.stateService=i;this.logService=o;this.crossAppIPCService=c;this.hostHandshakeListeners=this._register(new j);this.isEmbeddedApp=!!process.isEmbeddedApp,this.applicationStorage=e.applicationStorage,this.initialize(s,a,l)}initialize(e,t,i){if(this.isEmbeddedApp)this.initializeAsAgentsApp();else if(e.args["share-secrets-with-agents-app"]){let o=e.args._.length>0||e.args["folder-uri"]||e.args["file-uri"];this.initializeAsHostApp(o?void 0:()=>{this.logService.info("[CrossAppSecretSharing] Host app was launched for migration only, quitting"),i.quit()})}else this._register(t.onDidRequestShareSecrets(()=>{this.initializeAsHostApp()}))}async initializeAsAgentsApp(){if(!(!V||!this.isEmbeddedApp)){if(this.isMigrationDone()){this.logService.trace("[CrossAppSecretSharing] Migration already done, skipping");return}if(await this.applicationStorage.whenInit,!this.crossAppIPCService.initialized){this.logService.info("[CrossAppSecretSharing] crossAppIPC not initialized, skipping migration");return}this.logService.info("[CrossAppSecretSharing] Migration needed, starting..."),this._register(this.crossAppIPCService.onDidConnect(e=>{this.logService.info(`[CrossAppSecretSharing] Connected (isServer=${e}), requesting secrets from host app`),this.crossAppIPCService.sendMessage({type:"secrets/request"})})),this._register(this.crossAppIPCService.onDidReceiveMessage(e=>{let t=e;t?.type==="secrets/response"&&this.handleSecretResponse(t.data??{})})),this.crossAppIPCService.connected&&(this.logService.info(`[CrossAppSecretSharing] Already connected (isServer=${this.crossAppIPCService.isServer}), requesting secrets from host app`),this.crossAppIPCService.sendMessage({type:"secrets/request"})),this.spawnHostApp(),setTimeout(()=>{this.isMigrationDone()||this.logService.warn("[CrossAppSecretSharing] Migration timed out")},3e4)}}async initializeAsHostApp(e){if(!V||this.isEmbeddedApp){e?.();return}if(this.isMigrationDone()){this.logService.trace("[CrossAppSecretSharing] Migration already done, skipping"),e?.();return}if(await this.applicationStorage.whenInit,!this.hasAnySharedSecrets()){this.logService.trace("[CrossAppSecretSharing] No shared secrets to share, skipping"),e?.();return}if(!this.crossAppIPCService.initialized){this.logService.info("[CrossAppSecretSharing] crossAppIPC not initialized"),e?.();return}this._onHostMigrationComplete=e,this.logService.info("[CrossAppSecretSharing] Host app responding to secret sharing request"),this.hostHandshakeListeners.clear(),this.hostHandshakeListeners.add(this.crossAppIPCService.onDidReceiveMessage(t=>{let i=t;i?.type==="secrets/request"?this.handleSecretRequest():i?.type==="secrets/ack"&&this.handleSecretAck()})),this.hostHandshakeListeners.add(this.crossAppIPCService.onDidDisconnect(()=>{this._onHostMigrationComplete?.(),this._onHostMigrationComplete=void 0}))}isMigrationDone(){return this.stateService.getItem(gw,!1)}hasAnySharedSecrets(){for(let e of tp)if(this.applicationStorage.get(ep(e))!==void 0)return!0;return!1}spawnHostApp(){let e=Le(Le(Le(Le(Le(Le(process.execPath))))));this.logService.info("[CrossAppSecretSharing] Spawning host app:",e),gM("open",["-a",e,"-n","-g","--args","--share-secrets-with-agents-app"],i=>{i&&this.logService.error("[CrossAppSecretSharing] Failed to spawn host app:",i.message)}).unref()}async handleSecretRequest(){this.logService.info("[CrossAppSecretSharing] Host app handling secret request");let e={};for(let t of tp)try{let i=await mw(t,o=>this.applicationStorage.get(o),o=>this.encryptionMainService.decrypt(o),this.logService);i!==void 0&&(e[t]=i)}catch(i){this.logService.error("[CrossAppSecretSharing] Failed to read secret for key:",t,i)}this.crossAppIPCService.sendMessage({type:"secrets/response",data:e}),this.logService.info("[CrossAppSecretSharing] Sent secrets response with",Object.keys(e).length,"keys")}async handleSecretResponse(e){this.logService.info("[CrossAppSecretSharing] Agents app received",Object.keys(e).length,"secrets");for(let[t,i]of Object.entries(e)){if(!tp.includes(t)){this.logService.warn("[CrossAppSecretSharing] Ignoring unexpected key:",t);continue}try{await hw(t,i,(o,s)=>this.applicationStorage.set(o,s),o=>this.encryptionMainService.encrypt(o),this.logService)}catch(o){this.logService.error("[CrossAppSecretSharing] Failed to store secret for key:",t,o)}}this.stateService.setItem(gw,!0),this.logService.info("[CrossAppSecretSharing] Migration complete"),this.crossAppIPCService.sendMessage({type:"secrets/ack"})}handleSecretAck(){this.stateService.setItem(gw,!0),this.logService.info("[CrossAppSecretSharing] Host app received ack, migration complete on both sides");let e=this._onHostMigrationComplete;this._onHostMigrationComplete=void 0,e?.()}}});import*as IC from"os";function tc(n,r,e,t,i){let o=new URL(`${n}/api/update/${r}/${e}/${t}`);return i?.background&&o.searchParams.set("bg","true"),o.searchParams.set("u",i?.internalOrg??"none"),o.toString()}function rc(n){if(V){let r=IC.release();return{"User-Agent":`Code/${n} Darwin/${r}`}}if(F){let r=Tx().match(/^(\d+\.\d+)/);if(r)return{"User-Agent":`Code/${n} Electron/${process.versions.electron} Windows NT ${r[1]}`}}}var yC,Hn,Uh=I(()=>{he();wt();q();X();el();gs();et();Lt();Ct();te();qt();ss();Rn();Fn();Zt();Bn();yC="abstractUpdateService/lastKnownVersion";Hn=class{constructor(r,e,t,i,o,s,a,l,c,d){this.lifecycleMainService=r;this.configurationService=e;this.environmentMainService=t;this.requestService=i;this.logService=o;this.productService=s;this.telemetryService=a;this.applicationStorageMainService=l;this.meteredConnectionService=c;this.supportsUpdateOverwrite=d;this._state=ae.Uninitialized;this._overwrite=!1;this._hasCheckedForOverwriteOnQuit=!1;this.overwriteUpdatesCheckInterval=new cf;this._internalOrg=void 0;this._suspended=!1;this._onStateChange=new b;this.onStateChange=this._onStateChange.event;r.when(3).finally(()=>this.initialize())}get state(){return this._state}setState(r){r.type==="updating"?this.logService.trace("update#setState",r.type):this.logService.info("update#setState",r.type),this._state=r,this._onStateChange.fire(r),r.type==="idle"&&(r.error||r.notAvailable)&&(this._state=ae.Idle(r.updateType)),this.supportsUpdateOverwrite&&(r.type==="ready"?this.overwriteUpdatesCheckInterval.cancelAndSet(()=>this.checkForOverwriteUpdates(),300*1e3):this.overwriteUpdatesCheckInterval.cancel())}async initialize(){if(!this.environmentMainService.isBuilt){this.setState(ae.Disabled(0));return}if(await this.trackVersionChange(),this.environmentMainService.disableUpdates){this.setState(ae.Disabled(1)),this.logService.info("update#ctor - updates are disabled by the environment");return}if(!this.productService.updateUrl||!this.productService.commit){this.setState(ae.Disabled(4)),this.logService.info("update#ctor - updates are disabled as there is no update URL");return}let r=this.configurationService.getValue("update.mode"),e=this.configurationService.inspect("update.mode"),t=e.policyValue!==void 0&&!this.getProductQuality(e.policyValue),i=this.getProductQuality(r);if(!i){t?(this.setState(ae.Disabled(3)),this.logService.info("update#ctor - updates are disabled by policy")):(this.setState(ae.Disabled(2)),this.logService.info("update#ctor - updates are disabled by user preference"));return}if(!this.buildUpdateFeedUrl(i,this.productService.commit)){this.setState(ae.Disabled(5)),this.logService.info("update#ctor - updates are disabled as the update URL is badly formed");return}if(this.quality=i,this.setState(ae.Idle(this.getUpdateType())),await this.postInitialize(),r==="manual"){this.logService.info("update#ctor - manual checks only; automatic updates are disabled by user preference");return}r==="start"?(this.logService.info("update#ctor - startup checks only; automatic updates are disabled by user preference"),setTimeout(()=>this.checkForUpdates(!1),30*1e3)):this.scheduleCheckForUpdates(30*1e3).then(void 0,o=>this.logService.error(o))}async trackVersionChange(){await this.applicationStorageMainService.whenReady;let r,e=this.applicationStorageMainService.get(yC,-1);if(typeof e=="string")try{r=JSON.parse(e)}catch{}let t={version:this.productService.version,commit:this.productService.commit,timestamp:Date.now()};r?.commit!==t.commit&&(this.applicationStorageMainService.store(yC,JSON.stringify(t),-1,1),r&&this.telemetryService.publicLog2("update:versionChanged",{fromVersion:r.version,fromCommit:r.commit,fromVersionTime:r.timestamp,toVersion:t.version,toCommit:t.commit,timeToUpdateMs:t.timestamp-r.timestamp,updateMode:this.configurationService.getValue("update.mode")}))}getProductQuality(r){return r==="none"?void 0:this.productService.quality}scheduleCheckForUpdates(r=3600*1e3){return lt(r).then(()=>this.checkForUpdates(!1)).then(()=>this.scheduleCheckForUpdates(3600*1e3))}async checkForUpdates(r){if(this.logService.trace("update#checkForUpdates, state = ",this.state.type),this._suspended){this.logService.trace("update#checkForUpdates - suspended, skipping");return}this.state.type==="idle"&&this.doCheckForUpdates(r)}suspend(){this._suspended=!0}resume(){this._suspended=!1}async downloadUpdate(r){if(this.logService.trace("update#downloadUpdate, state = ",this.state.type),this.state.type==="available for download"){if(!r&&this.meteredConnectionService.isConnectionMetered){this.logService.info("update#downloadUpdate - skipping download because connection is metered");return}await this.doDownloadUpdate(this.state)}}async doDownloadUpdate(r){}async applyUpdate(){this.logService.trace("update#applyUpdate, state = ",this.state.type),this.state.type==="downloaded"&&await this.doApplyUpdate()}async doApplyUpdate(){}async quitAndInstall(){if(this.logService.trace("update#quitAndInstall, state = ",this.state.type),this.state.type!=="ready")return;if(this.supportsUpdateOverwrite&&!this._hasCheckedForOverwriteOnQuit&&(this._hasCheckedForOverwriteOnQuit=!0,await this.checkForOverwriteUpdates(!0))){this.logService.info("update#quitAndInstall(): overwrite update detected, postponing quitAndInstall");return}let r=this.state;return this.setState(ae.Restarting(this.state.update)),this.logService.trace("update#quitAndInstall(): before lifecycle quit()"),this.lifecycleMainService.quit(!0).then(e=>{if(this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${e}`),e){this.logService.info("update#quitAndInstall(): quit was vetoed, restoring Ready state"),this.setState(r);return}this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),this.doQuitAndInstall()}),Promise.resolve(void 0)}async checkForOverwriteUpdates(r=!1){if(this._state.type!=="ready")return!1;let e=this._state.update.version;if(!e||e==="unknown")return!1;let t;try{let i=new $e,o=lt(2e3).then(()=>{i.cancel()});t=await Promise.race([this.isLatestVersion(e,i.token),o]),i.dispose()}catch(i){return this.logService.warn("update#checkForOverwriteUpdates(): failed to check for updates, proceeding with restart"),this.logService.warn(i),!1}if(t===!1&&this._state.type==="ready"){this.logService.info("update#readyStateCheck: newer update available, restarting update machinery");try{await this.cancelPendingUpdate()}catch(i){return this.logService.error("update#checkForOverwriteUpdates(): failed to cancel pending update, aborting overwrite"),this.logService.error(i),!1}return this._overwrite=!0,this.setState(ae.Overwriting(this._state.update,r)),this.doCheckForUpdates(r,e),!0}return!1}async isLatestVersion(r,e=Ce.None){if(!this.quality||this.configurationService.getValue("update.mode")==="none")return;let i=this.buildUpdateFeedUrl(this.quality,r??this.productService.commit,{internalOrg:this.getInternalOrg()});if(!i)return;let o=rc(this.productService.version);this.logService.trace("update#isLatestVersion() - checking update server",{url:i,headers:o});try{let a=(await this.requestService.request({url:i,headers:o,callSite:"updateService.isLatestVersion"},e)).res.statusCode;return this.logService.trace("update#isLatestVersion() - response",{statusCode:a}),a===204}catch(s){this.logService.error("update#isLatestVersion(): failed to check for updates"),this.logService.error(s);return}}async _applySpecificUpdate(r){}async setInternalOrg(r){this._internalOrg!==r&&(this.logService.info("update#setInternalOrg",r),this._internalOrg=r)}getInternalOrg(){return this._internalOrg}getUpdateType(){return 1}doQuitAndInstall(){}async postInitialize(){}async cancelPendingUpdate(){}};Hn=E([g(0,ye),g(1,ue),g(2,_e),g(3,Fi),g(4,B),g(5,Te),g(6,Ke),g(7,Ir),g(8,Gr)],Hn)});import*as $n from"electron";var un,wC=I(()=>{wt();Vo();q();En();$();et();Lt();Ct();te();qt();ss();Fn();Zt();Bn();gs();Uh();un=class extends Hn{constructor(e,t,i,o,s,a,l,c,d){super(e,t,o,s,a,l,i,c,d,!0);this.disposables=new j;e.setRelaunchHandler(this)}get onRawError(){return S.fromNodeEventEmitter($n.autoUpdater,"error",(e,t)=>t)}get onRawCheckingForUpdate(){return S.fromNodeEventEmitter($n.autoUpdater,"checking-for-update")}get onRawUpdateNotAvailable(){return S.fromNodeEventEmitter($n.autoUpdater,"update-not-available")}get onRawUpdateAvailable(){return S.fromNodeEventEmitter($n.autoUpdater,"update-available")}get onRawUpdateDownloaded(){return S.fromNodeEventEmitter($n.autoUpdater,"update-downloaded",(e,t,i,o)=>({version:t,productVersion:i,timestamp:o instanceof Date?o.getTime()||void 0:o}))}handleRelaunch(e){return e?.addArgs||e?.removeArgs||this.state.type!=="ready"?!1:(this.logService.trace("update#handleRelaunch(): running raw#quitAndInstall()"),this.doQuitAndInstall(),!0)}async initialize(){await super.initialize(),this.onRawError(this.onError,this,this.disposables),this.onRawCheckingForUpdate(this.onCheckingForUpdate,this,this.disposables),this.onRawUpdateAvailable(this.onUpdateAvailable,this,this.disposables),this.onRawUpdateDownloaded(this.onUpdateDownloaded,this,this.disposables),this.onRawUpdateNotAvailable(this.onUpdateNotAvailable,this,this.disposables)}onCheckingForUpdate(){this.logService.trace("update#onCheckingForUpdate - Electron autoUpdater is checking for updates")}onError(e){this.telemetryService.publicLog2("update:error",{messageHash:String(cr(String(e)))}),this.logService.error("UpdateService error:",e);let t=this.state.type==="checking for updates"&&this.state.explicit?e:void 0;this.setState(ae.Idle(1,t))}buildUpdateFeedUrl(e,t,i){let o=this.productService.darwinUniversalAssetId??(process.arch==="x64"?"darwin":"darwin-arm64"),s=tc(this.productService.updateUrl,o,e,t,i),a=rc(this.productService.version);try{this.logService.trace("update#buildUpdateFeedUrl - setting feed URL for Electron autoUpdater",{url:s,assetID:o,quality:e,commit:t,headers:a}),$n.autoUpdater.setFeedURL({url:s,headers:a})}catch(l){this.logService.error("Failed to set update feed URL",l);return}return s}doCheckForUpdates(e,t){if(!this.quality)return;this.setState(ae.CheckingForUpdates(e));let i=this.getInternalOrg(),o=!e&&!i,s=this.buildUpdateFeedUrl(this.quality,t??this.productService.commit,{background:o,internalOrg:i});if(!s){this.setState(ae.Idle(1));return}if(!e&&this.meteredConnectionService.isConnectionMetered){this.logService.info("update#doCheckForUpdates - checking for update without auto-download because connection is metered"),this.checkForUpdateNoDownload(s);return}this.logService.trace("update#doCheckForUpdates - using Electron autoUpdater",{url:s,explicit:e,background:o}),$n.autoUpdater.checkForUpdates()}async checkForUpdateNoDownload(e,t){let i=rc(this.productService.version);this.logService.trace("update#checkForUpdateNoDownload - checking update server",{url:e,headers:i});try{let o=await this.requestService.request({url:e,headers:i,callSite:"updateService.darwin.checkForUpdates"},Ce.None),s=o.res.statusCode;this.logService.trace("update#checkForUpdateNoDownload - response",{statusCode:s});let a=await Ol(o);if(!a||!a.url||!a.version||!a.productVersion){this.logService.trace("update#checkForUpdateNoDownload - no update available");let l=this.state.type==="checking for updates"&&this.state.explicit;this.setState(ae.Idle(1,void 0,l||void 0))}else this.logService.trace("update#checkForUpdateNoDownload - update available",{version:a.version,productVersion:a.productVersion}),this.setState(ae.AvailableForDownload(a,t))}catch(o){this.logService.error("update#checkForUpdateNoDownload - failed to check for update",o),this.setState(ae.Idle(1))}}onUpdateAvailable(){if(this.logService.trace("update#onUpdateAvailable - Electron autoUpdater reported update available"),this._suspended){this.logService.trace("update#onUpdateAvailable - suspended, ignoring");return}this.state.type!=="checking for updates"&&this.state.type!=="overwriting"||this.setState(ae.Downloading(this.state.type==="overwriting"?this.state.update:void 0,this.state.explicit,this._overwrite))}onUpdateDownloaded(e){this._suspended||this.state.type!=="downloading"||(this.setState(ae.Downloaded(e,this.state.explicit,this._overwrite)),this.logService.info(`Update downloaded: ${JSON.stringify(e)}`),this.setState(ae.Ready(e,this.state.explicit,this._overwrite)))}onUpdateNotAvailable(){if(this.logService.trace("update#onUpdateNotAvailable - Electron autoUpdater reported no update available"),this._suspended){this.logService.trace("update#onUpdateNotAvailable - suspended, ignoring");return}if(this.state.type!=="checking for updates")return;let e=this.state.explicit;this.setState(ae.Idle(1,void 0,e||void 0))}async doDownloadUpdate(e){this.buildUpdateFeedUrl(this.quality,e.update.version,{internalOrg:this.getInternalOrg()}),this.setState(ae.CheckingForUpdates(!0)),$n.autoUpdater.checkForUpdates()}doQuitAndInstall(){this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),$n.autoUpdater.quitAndInstall()}dispose(){this.disposables.dispose()}};E([se],un.prototype,"onRawError",1),E([se],un.prototype,"onRawCheckingForUpdate",1),E([se],un.prototype,"onRawUpdateNotAvailable",1),E([se],un.prototype,"onRawUpdateAvailable",1),E([se],un.prototype,"onRawUpdateDownloaded",1),un=E([g(0,ye),g(1,ue),g(2,Ke),g(3,_e),g(4,Fi),g(5,B),g(6,Te),g(7,Ir),g(8,Gr)],un)});var ic,bC=I(()=>{wt();et();Lt();Ct();te();gs();Fl();qt();ss();Fn();Zt();Bn();Uh();ic=class extends Hn{constructor(e,t,i,o,s,a,l,c,d,u){super(e,t,i,o,s,l,c,d,u,!1);this.nativeHostMainService=a}buildUpdateFeedUrl(e,t,i){return tc(this.productService.updateUrl,`linux-${process.arch}`,e,t,i)}doCheckForUpdates(e,t){if(!this.quality)return;let i=this.getInternalOrg(),o=!e&&!i,s=this.buildUpdateFeedUrl(this.quality,this.productService.commit,{background:o,internalOrg:i});this.setState(ae.CheckingForUpdates(e)),this.requestService.request({url:s,callSite:"updateService.linux.checkForUpdates"},Ce.None).then(Ol).then(a=>{!a||!a.url||!a.version||!a.productVersion?this.setState(ae.Idle(1,void 0,e||void 0)):this.setState(ae.AvailableForDownload(a))}).then(void 0,a=>{this.logService.error(a);let l=e?a.message||a:void 0;this.setState(ae.Idle(1,l))})}async doDownloadUpdate(e){this.productService.downloadUrl&&this.productService.downloadUrl.length>0?this.nativeHostMainService.openExternal(void 0,this.productService.downloadUrl):e.update.url&&this.nativeHostMainService.openExternal(void 0,e.update.url),this.setState(ae.Idle(1))}};ic=E([g(0,ye),g(1,ue),g(2,_e),g(3,Fi),g(4,B),g(5,Wi),g(6,Te),g(7,Ke),g(8,Ir),g(9,Gr)],ic)});import{spawn as yM}from"child_process";import{realpath as IM,watch as wM}from"fs";var rp,nc,SC=I(()=>{he();q();we();Lt();Ct();te();Bn();gs();rp=class{constructor(r,e,t,i){this.lifecycleMainService=r;this.logService=t;this.meteredConnectionService=i;this._state=ae.Uninitialized;this._onStateChange=new b;this.onStateChange=this._onStateChange.event;if(e.disableUpdates){this.logService.info("update#ctor - updates are disabled");return}this.setState(ae.Idle(this.getUpdateType())),this.scheduleCheckForUpdates(30*1e3).then(void 0,o=>this.logService.error(o))}get state(){return this._state}setState(r){this.logService.info("update#setState",r.type),this._state=r,this._onStateChange.fire(r),r.type==="idle"&&(r.error||r.notAvailable)&&(this._state=ae.Idle(r.updateType))}scheduleCheckForUpdates(r=3600*1e3){return lt(r).then(()=>this.checkForUpdates(!1)).then(()=>this.scheduleCheckForUpdates(3600*1e3))}async checkForUpdates(r){this.logService.trace("update#checkForUpdates, state = ",this.state.type),this.state.type==="idle"&&this.doCheckForUpdates(r)}async downloadUpdate(r){if(this.logService.trace("update#downloadUpdate, state = ",this.state.type),this.state.type==="available for download"){if(!r&&this.meteredConnectionService.isConnectionMetered){this.logService.info("update#downloadUpdate - skipping download because connection is metered");return}await this.doDownloadUpdate(this.state)}}doDownloadUpdate(r){return Promise.resolve(void 0)}async applyUpdate(){this.logService.trace("update#applyUpdate, state = ",this.state.type),this.state.type==="downloaded"&&await this.doApplyUpdate()}doApplyUpdate(){return Promise.resolve(void 0)}quitAndInstall(){if(this.logService.trace("update#quitAndInstall, state = ",this.state.type),this.state.type!=="ready")return Promise.resolve(void 0);let r=this.state;return this.setState(ae.Restarting(this.state.update)),this.logService.trace("update#quitAndInstall(): before lifecycle quit()"),this.lifecycleMainService.quit(!0).then(e=>{if(this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${e}`),e){this.logService.info("update#quitAndInstall(): quit was vetoed, restoring Ready state"),this.setState(r);return}this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),this.doQuitAndInstall()}),Promise.resolve(void 0)}getUpdateType(){return 2}doQuitAndInstall(){}async setInternalOrg(r){}async _applySpecificUpdate(r){}};rp=E([g(0,ye),g(1,_e),g(2,B),g(3,Gr)],rp);nc=class extends rp{constructor(e,t,i,o,s,a){super(i,o,s,a);this.snap=e;this.snapRevision=t;let l=wM(Le(this.snap)),c=S.fromNodeEventEmitter(l,"change",(m,v)=>v),d=S.filter(c,m=>m==="current"),f=S.debounce(d,(m,v)=>v,2e3)(()=>this.checkForUpdates(!1));S.once(i.onWillShutdown)(()=>{f.dispose(),l.close()})}doCheckForUpdates(){this.setState(ae.CheckingForUpdates(!1)),this.isUpdateAvailable().then(e=>{e?this.setState(ae.Ready({version:"something"},!1,!1)):this.setState(ae.Idle(2,void 0,void 0))},e=>{this.logService.error(e),this.setState(ae.Idle(2,e.message||e))})}doQuitAndInstall(){this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),yM("sleep 3 && "+Pe(process.argv[0]),{shell:!0,detached:!0,stdio:"ignore"})}async isUpdateAvailable(){let e=await new Promise((i,o)=>IM(`${Le(this.snap)}/current`,(s,a)=>s?o(s):i(a))),t=Pe(e);return this.snapRevision!==t}isLatestVersion(){return this.isUpdateAvailable().then(void 0,e=>{this.logService.error("update#checkForSnapUpdate(): Could not get realpath of application.")})}};nc=E([g(2,ye),g(3,_e),g(4,B),g(5,Gr)],nc)});import*as xC from"crypto";import*as PC from"fs";async function EC(n,r){if(await new Promise((i,o)=>{let s=PC.createReadStream(n),a=xC.createHash("sha256");s.pipe(a);let l=Xn((c,d)=>{s.removeAllListeners(),a.removeAllListeners(),s.destroy(),c?o(c):i(d)});s.once("error",l),s.once("end",l),a.once("error",l),a.once("data",c=>l(void 0,c.toString("hex")))})!==r)throw new Error("Hash mismatch")}var CC=I(()=>{Pa()});import{spawn as vw}from"child_process";import{app as TC}from"electron";import{existsSync as bM,unlinkSync as SM}from"fs";import{mkdir as xM,readFile as yw,unlink as PM}from"fs/promises";import{release as EM,tmpdir as CM}from"os";function aa(){return typeof Iw>"u"&&(Iw=bM(N(Le(process.execPath),"unins000.exe"))?0:1),Iw}var Iw,la,_C=I(()=>{he();ot();wt();Vo();En();we();we();Os();ce();CC();nr();ta();el();et();Lt();je();Ct();te();gs();Fl();qt();ss();Fn();Zt();Bn();Uh();la=class extends Hn{constructor(e,t,i,o,s,a,l,c,d,u,f){super(e,t,o,s,a,d,i,u,f,!0);this.fileService=l;this.nativeHostMainService=c;e.setRelaunchHandler(this)}get cachePath(){let e=N(CM(),`vscode-${this.productService.quality}-${this.productService.target}-${process.arch}`);return xM(e,{recursive:!0}).then(()=>e)}handleRelaunch(e){return e?.addArgs||e?.removeArgs||this.state.type!=="ready"||!this.availableUpdate?!1:(this.logService.trace("update#handleRelaunch(): running raw#quitAndInstall()"),this.doQuitAndInstall(),!0)}async initialize(){if(this.productService.win32VersionedUpdate){let i=await this.cachePath;TC.setPath("appUpdate",i),await this.unlink(N(i,"session-ending.flag"))}let e=await Cx(),t=EM();if(this.telemetryService.publicLog2("windowsUpdateInit",{osRelease:e,osNodeRelease:t}),this.productService.target==="user"&&await this.nativeHostMainService.isAdmin(void 0)){this.setState(ae.Disabled(6)),this.logService.info("update#ctor - updates are disabled due to running as Admin in user setup");return}await super.initialize()}async postInitialize(){if(!this.productService.win32VersionedUpdate)return;let e=TC.getPath("exe"),t=Le(e),i=N(t,"updating_version");if(await Q.exists(i))try{let o=(await yw(i,"utf8")).trim();this.logService.info(`update#doCheckForUpdates - application was updating to version ${o}`);let s=await this.getUpdatePackagePath(o);await Q.exists(s)&&(await this._applySpecificUpdate(s,o),this.logService.info(`update#doCheckForUpdates - successfully applied update to version ${o}`))}catch(o){this.logService.error(`update#doCheckForUpdates - could not read ${i}`,o)}else if(this.configurationService.getValue("update.enableWindowsBackgroundUpdates")&&this.productService.target==="user"&&this.productService.commit){let s=this.productService.commit.substring(0,10),a=N(t,s,"tools","inno_updater.exe"),l=Pe(e),c=this.productService.win32SiblingExeBasename?`${this.productService.win32SiblingExeBasename}.exe`:"";await new Promise(d=>{vw(a,["--gc",e,s,l,c],{stdio:["ignore","ignore","ignore"],windowsHide:!0,timeout:12e4}).once("exit",()=>d())})}}buildUpdateFeedUrl(e,t,i){let o=`win32-${process.arch}`;return aa()===1?o+="-archive":this.productService.target==="user"&&(o+="-user"),tc(this.productService.updateUrl,o,e,t,i)}doCheckForUpdates(e,t){if(!this.quality)return;let i=this.getInternalOrg(),o=!e&&!i,s=this.buildUpdateFeedUrl(this.quality,t??this.productService.commit,{background:o,internalOrg:i});this.state.type!=="overwriting"&&this.setState(ae.CheckingForUpdates(e));let a=rc(this.productService.version);this.requestService.request({url:s,headers:a,callSite:"updateService.win32.checkForUpdates"},Ce.None).then(Ol).then(l=>{let c=aa();if(!l||!l.url||!l.version||!l.productVersion)return this.state.type==="overwriting"?(this._overwrite=!1,this.setState(ae.Ready(this.state.update,this.state.explicit,!1))):this.setState(ae.Idle(c,void 0,e||void 0)),Promise.resolve(null);if(c===1)return this.setState(ae.AvailableForDownload(l)),Promise.resolve(null);if(!e&&this.meteredConnectionService.isConnectionMetered)return this.logService.info("update#doCheckForUpdates - update available but skipping download because connection is metered"),this.setState(ae.AvailableForDownload(l)),Promise.resolve(null);let d=Date.now();return this.setState(ae.Downloading(l,e,this._overwrite,0,void 0,d)),this.cleanup(l.version).then(()=>this.getUpdatePackagePath(l.version).then(u=>Q.exists(u).then(f=>{if(f)return Promise.resolve(u);let m=`${u}.tmp`;return this.requestService.request({url:l.url,callSite:"updateService.win32.downloadUpdate"},Ce.None).then(v=>{let y=v.res.headers["content-length"],C=typeof y=="string"?y:void 0,w=C?parseInt(C,10):void 0,_=0,D=new to(500),k=za(v.stream,{data:A=>(_+=A.byteLength,D.trigger(()=>{this.setState(ae.Downloading(l,e,this._overwrite,_,w,d))}),A)},A=>H.concat(A));return this.fileService.writeFile(x.file(m),k).finally(()=>D.dispose())}).then(l.sha256hash?()=>EC(m,l.sha256hash):()=>{}).then(()=>Q.rename(m,u,!1)).then(()=>u)})).then(u=>{this.availableUpdate={packagePath:u},this.saveUpdateMetadata(l),this.setState(ae.Downloaded(l,e,this._overwrite)),this.configurationService.getValue("update.enableWindowsBackgroundUpdates")&&this.productService.target==="user"?this.doApplyUpdate():this.setState(ae.Ready(l,e,this._overwrite))}))}).then(void 0,l=>{this.telemetryService.publicLog2("update:error",{messageHash:String(cr(String(l)))}),this.logService.error(l);let c=e?l.message||l:void 0;this.state.type==="overwriting"?(this._overwrite=!1,this.setState(ae.Ready(this.state.update,this.state.explicit,!1))):this.setState(ae.Idle(aa(),c))})}async doDownloadUpdate(e){e.update.url&&this.nativeHostMainService.openExternal(void 0,e.update.url),this.setState(ae.Idle(aa()))}async getUpdatePackagePath(e){let t=await this.cachePath;return N(t,`CodeSetup-${this.productService.quality}-${e}.exe`)}async cleanup(e=null){let t=e?a=>!new RegExp(`${this.productService.quality}-${e}\\.exe$`).test(a):()=>!0,i=await this.cachePath,s=(await Q.readdir(i)).filter(t).map(a=>this.unlink(N(i,a)));await Promise.all(s)}async doApplyUpdate(){if(this.state.type!=="downloaded"||!this.availableUpdate)return Promise.resolve(void 0);let e=this.state.update,t=this.state.explicit;this.setState(ae.Updating(e,t));let i=await this.cachePath,o=N(i,"session-ending.flag"),s=N(i,"cancel.flag");await this.unlink(s);let a=N(i,"update-progress");await this.unlink(a),this.availableUpdate.updateFilePath=N(i,`CodeSetup-${this.productService.quality}-${e.version}.flag`),this.availableUpdate.cancelFilePath=s,await Q.writeFile(this.availableUpdate.updateFilePath,"flag");let l=vw(this.availableUpdate.packagePath,["/verysilent","/log",`/update="${this.availableUpdate.updateFilePath}"`,`/progress="${a}"`,`/sessionend="${o}"`,`/cancel="${s}"`,"/nocloseapplications","/mergetasks=runcode,!desktopicon,!quicklaunchicon"],{detached:!0,stdio:["ignore","ignore","ignore"],windowsVerbatimArguments:!0,env:{...process.env,__COMPAT_LAYER:"RunAsInvoker"}});this.availableUpdate.updateProcess=l,l.once("exit",()=>{this.availableUpdate=void 0,this.setState(ae.Idle(aa()))});let d=`${process.isEmbeddedApp?this.productService.win32SetupMutexName:this.productService.win32MutexName}-ready`,u=await import("@vscode/windows-mutex");this.updateCancellationTokenSource?.dispose(!0);let f=this.updateCancellationTokenSource=new $e,m=f.token,v=async()=>{for(;this.state.type==="updating"&&!m.isCancellationRequested;){if(u.isActive(d)){this.setState(ae.Ready(e,t,this._overwrite));return}try{let C=await yw(a,"utf8");if(!m.isCancellationRequested){let[w,_]=C.split(","),D=parseInt(w,10),k=parseInt(_,10);!isNaN(D)&&!isNaN(k)&&this.state.type==="updating"&&(this.state.currentProgress!==D||this.state.maxProgress!==k)&&this.setState(ae.Updating(e,t,D,k))}}catch{}await lt(500)}},y=new df(()=>{this.logService.warn("update#doApplyUpdate: polling timed out waiting for update to be ready"),this.setState(ae.Idle(aa(),"Update did not complete within expected time"))},3600*1e3);y.schedule(),v().finally(()=>{y.dispose(),this.updateCancellationTokenSource===f&&(this.updateCancellationTokenSource=void 0),f.dispose()})}async cancelPendingUpdate(){if(!this.availableUpdate)return;this.updateCancellationTokenSource?.dispose(!0),this.updateCancellationTokenSource=void 0,this.logService.trace("update#cancelPendingUpdate: cancelling pending update");let{updateProcess:e,updateFilePath:t,cancelFilePath:i}=this.availableUpdate;if(e&&e.exitCode===null){e.removeAllListeners();let o=new Promise(l=>e.once("exit",()=>l(!0)));if(i)try{await Q.writeFile(i,"cancel")}catch(l){this.logService.warn("update#cancelPendingUpdate: failed to write cancel file",l)}let s=e.pid,a=await Promise.race([o,lt(30*1e3).then(()=>!1)]);s&&!a&&(this.logService.trace("update#cancelPendingUpdate: process did not exit gracefully, killing process tree"),await X0(s,!0))}await this.unlink(t),await this.unlink(i),this.availableUpdate=void 0}doQuitAndInstall(){if(!(this.state.type!=="ready"&&this.state.type!=="restarting"||!this.availableUpdate))if(this.logService.trace("update#quitAndInstall(): running raw#quitAndInstall()"),this.availableUpdate.updateFilePath)try{SM(this.availableUpdate.updateFilePath)}catch{}else vw(this.availableUpdate.packagePath,["/silent","/log","/mergetasks=runcode,!desktopicon,!quicklaunchicon"],{detached:!0,stdio:["ignore","ignore","ignore"],env:{...process.env,__COMPAT_LAYER:"RunAsInvoker"}})}async saveUpdateMetadata(e){try{let t=await this.cachePath,i=N(t,"update-metadata.json");await Q.writeFile(i,JSON.stringify(e))}catch(t){this.logService.error("update#saveUpdateMetadata: failed to save",t)}}async loadUpdateMetadata(){try{let e=await this.cachePath,t=N(e,"update-metadata.json");if(await Q.exists(t)){let i=await yw(t,"utf8");return JSON.parse(i)}}catch(e){this.logService.error("update#loadUpdateMetadata: failed to load",e)}}getUpdateType(){return aa()}async _applySpecificUpdate(e,t){if(this.state.type!=="idle")return;let i=this.configurationService.getValue("update.enableWindowsBackgroundUpdates"),o=await this.loadUpdateMetadata()??{version:t??"unknown",productVersion:"unknown"};this.setState(ae.Downloading(o,!0,!1)),this.availableUpdate={packagePath:e},this.setState(ae.Downloaded(o,!0,!1)),i&&this.productService.target==="user"?this.doApplyUpdate():this.setState(ae.Ready(o,!0,!1))}async unlink(e){if(e)try{await PM(e)}catch(t){let i=t;if(i&&i.code==="ENOENT")return;this.logService.warn(`update#unlink: failed to unlink ${Pe(e)}`,t)}}};E([se],la.prototype,"cachePath",1),la=E([g(0,ye),g(1,ue),g(2,Ke),g(3,_e),g(4,Fi),g(5,B),g(6,Me),g(7,Wi),g(8,Te),g(9,Ir),g(10,Gr)],la)});var Nh,Bh,kC=I(()=>{ce();Nh=class{constructor(r){this.channel=r}handleURL(r,e){return this.channel.call("handleURL",[r.toJSON(),e])}},Bh=class{constructor(r,e){this.next=r;this.logService=e}async routeCall(r,e,t,i){if(e!=="handleURL")throw new Error(`Call not found: ${e}`);if(Array.isArray(t)&&t.length>0){let o=x.revive(t[0]);if(this.logService.trace("URLHandlerRouter#routeCall() with URI argument",o.toString(!0)),o.query){let s=/\bwindowId=(\d+)/.exec(o.query);if(s){let a=s[1];this.logService.trace(`URLHandlerRouter#routeCall(): found windowId query parameter with value "${a}"`,o.toString(!0));let l=new RegExp(`window:${a}`),c=r.connections.find(d=>(this.logService.trace("URLHandlerRouter#routeCall(): testing connection",d.ctx),l.test(d.ctx)));if(c)return this.logService.trace("URLHandlerRouter#routeCall(): found a connection to route",o.toString(!0)),c;this.logService.trace("URLHandlerRouter#routeCall(): did not find a connection to route",o.toString(!0))}else this.logService.trace("URLHandlerRouter#routeCall(): did not find windowId query parameter",o.toString(!0))}}else this.logService.trace("URLHandlerRouter#routeCall() without URI argument");return this.next.routeCall(r,e,t,i)}routeEvent(r,e){throw new Error(`Event not found: ${e}`)}}});var ww,oc,RC=I(()=>{he();$();ce();qt();ww=class extends T{constructor(){super(...arguments);this.handlers=new Set}open(e,t){let i=[...this.handlers.values()];return x1(i.map(o=>()=>o.handleURL(e,t)),void 0,!1).then(o=>o||!1)}registerHandler(e){return this.handlers.add(e),G(()=>this.handlers.delete(e))}},oc=class extends ww{constructor(e){super();this.productService=e}create(e){let{authority:t,path:i,query:o,fragment:s}=e||{authority:void 0,path:void 0,query:void 0,fragment:void 0};return t&&i&&i.indexOf("/")!==0&&(i=`/${i}`),x.from({scheme:this.productService.urlProtocol,authority:t,path:i,query:o,fragment:s})}};oc=E([g(0,Te)],oc)});import{app as DC}from"electron";var Vh,AC=I(()=>{he();q();$();X();ce();Vh=class extends T{constructor(e,t,i,o,s,a){super();this.urlService=t;this.logService=a;this.uris=[];this.retryCount=0;if(e&&(a.trace("ElectronURLListener initialUrisToHandle:",e.map(d=>d.originalUrl)),this.uris=e),F&&!o.isPortable&&!process.isEmbeddedApp){let d=o.isBuilt?[]:[`"${o.appRoot}"`];d.push("--open-url","--"),DC.setAsDefaultProtocolClient(s.urlProtocol,process.execPath,d)}let l=S.map(S.fromNodeEventEmitter(DC,"open-url",(d,u)=>({event:d,url:u})),({event:d,url:u})=>(d.preventDefault(),u));this._register(l(d=>{let u=this.uriFromRawUrl(d);u&&this.urlService.open(u,{originalUrl:d})})),i.getWindows().filter(d=>d.isReady).length>0?(a.trace("ElectronURLListener: window is ready to handle URLs"),this.flush()):(a.trace("ElectronURLListener: waiting for window to be ready to handle URLs..."),this._register(S.once(i.onDidSignalReadyWindow)(()=>this.flush())))}uriFromRawUrl(e){try{return x.parse(e)}catch{return}}async flush(){if(this.retryCount++>10){this.logService.trace("ElectronURLListener#flush(): giving up after 10 retries");return}this.logService.trace("ElectronURLListener#flush(): flushing URLs");let e=[];for(let t of this.uris)await this.urlService.open(t.uri,{originalUrl:t.originalUrl})?this.logService.trace("ElectronURLListener#flush(): URL was handled",t.originalUrl):(this.logService.trace("ElectronURLListener#flush(): URL was not yet handled",t.originalUrl),e.push(t));e.length!==0&&(this.uris=e,S1(()=>this.flush(),500,this._store))}}});var bw,LC=I(()=>{Z();bw=O("webviewManagerService")});import{protocol as MC}from"electron";var ys,OC=I(()=>{ze();ce();je();ys=class{constructor(r){this._fileService=r;let e=this.handleWebviewRequest.bind(this);MC.handle(W.vscodeWebview,e)}static{this.validWebviewFilePaths=new Map([["/index.html",{mime:"text/html"}],["/fake.html",{mime:"text/html"}],["/service-worker.js",{mime:"application/javascript"}]])}dispose(){MC.unhandle(W.vscodeWebview)}async handleWebviewRequest(r){try{let e=x.parse(r.url),t=ys.validWebviewFilePaths.get(e.path);if(t){let i=`vs/workbench/contrib/webview/browser/pre${e.path}`,o=st.asFileUri(i),s=await this._fileService.readFile(o);return new Response(s.value.buffer.buffer,{headers:{"Content-Type":t.mime,...Wa.getHeadersFromQuery(r.url),"Cross-Origin-Resource-Policy":"cross-origin"}})}else return new Response(null,{status:403})}catch{}return new Response(null,{status:500})}};ys=E([g(0,Me)],ys)});import{webContents as TM}from"electron";var sc,FC=I(()=>{q();$();OC();Kt();je();sc=class extends T{constructor(e,t){super();this.windowsMainService=t;this._onFoundInFrame=this._register(new b);this.onFoundInFrame=this._onFoundInFrame.event;this._register(new ys(e))}async setIgnoreMenuShortcuts(e,t){let i;if(typeof e.windowId=="number"){let{windowId:o}=e,s=this.windowsMainService.getWindowById(o);if(!s?.win)throw new Error(`Invalid windowId: ${o}`);i=s.win.webContents}else{let{webContentsId:o}=e;if(i=TM.fromId(o),!i)throw new Error(`Invalid webContentsId: ${o}`)}i.isDestroyed()||i.setIgnoreMenuShortcuts(t)}async findInFrame(e,t,i,o){let a=this.getFrameByName(e,t);if(typeof a.findInFrame=="function"){a.findInFrame(i,{findNext:o.findNext,forward:o.forward});let l=(c,d)=>{d.finalUpdate&&(this._onFoundInFrame.fire(d),a.removeListener("found-in-frame",l))};a.on("found-in-frame",l)}}async stopFindInFrame(e,t,i){let s=this.getFrameByName(e,t);typeof s.stopFindInFrame=="function"&&s.stopFindInFrame(i.keepSelection?"keepSelection":"clearSelection")}getFrameByName(e,t){let i=this.windowsMainService.getWindowById(e.windowId);if(!i?.win)throw new Error(`Invalid windowId: ${e}`);let o=i.win.webContents.mainFrame.framesInSubtree.find(s=>s.name===t);if(!o)throw new Error(`Unknown frame: ${t}`);return o}};sc=E([g(0,Me),g(1,qe)],sc)});var ac,Hh=I(()=>{Z();ac=O("protocolMainService")});async function WC(n,r,e){let t=e&&e.get("storage.serviceMachineId",-1)||null;if(t)return t;try{let o=(await r.readFile(n.serviceMachineIdResource)).value.toString();t=yx(o)?o:null}catch{t=null}if(!t){t=ke();try{await r.writeFile(n.serviceMachineIdResource,H.fromString(t))}catch{}}return e?.store("storage.serviceMachineId",t,-1,1),t}var UC=I(()=>{ot();Xt();Rn()});async function NC(n,r,e,t,i,o,s){let a={"X-Market-Client-Id":`VSCode ${n}`,"User-Agent":`VSCode ${n} (${r.nameShort})`};if(Th(r,e)&&Zl(t)===3){let l=await WC(e,i,o);a["X-Market-User-Id"]=l,a["VSCode-SessionId"]=s.machineId||l}return a}var BC=I(()=>{UC();Zt();So()});function p(n,r){if(Fe(r)){let e=VC[r];if(e===void 0)throw new Error(`${n} references an unknown codicon: ${r}`);r=e}return VC[n]=r,{id:n}}var VC,Sw=I(()=>{Oe();VC=Object.create(null)});var HC,$C=I(()=>{Sw();HC={add:p("add",6e4),plus:p("plus",6e4),gistNew:p("gist-new",6e4),repoCreate:p("repo-create",6e4),lightbulb:p("lightbulb",60001),lightBulb:p("light-bulb",60001),repo:p("repo",60002),repoDelete:p("repo-delete",60002),gistFork:p("gist-fork",60003),repoForked:p("repo-forked",60003),gitPullRequest:p("git-pull-request",60004),gitPullRequestAbandoned:p("git-pull-request-abandoned",60004),recordKeys:p("record-keys",60005),keyboard:p("keyboard",60005),tag:p("tag",60006),gitPullRequestLabel:p("git-pull-request-label",60006),tagAdd:p("tag-add",60006),tagRemove:p("tag-remove",60006),person:p("person",60007),personFollow:p("person-follow",60007),personOutline:p("person-outline",60007),personFilled:p("person-filled",60007),sourceControl:p("source-control",60008),mirror:p("mirror",60009),mirrorPublic:p("mirror-public",60009),star:p("star",60010),starAdd:p("star-add",60010),starDelete:p("star-delete",60010),starEmpty:p("star-empty",60010),comment:p("comment",60011),commentAdd:p("comment-add",60011),alert:p("alert",60012),warning:p("warning",60012),search:p("search",60013),searchSave:p("search-save",60013),logOut:p("log-out",60014),signOut:p("sign-out",60014),logIn:p("log-in",60015),signIn:p("sign-in",60015),eye:p("eye",60016),eyeUnwatch:p("eye-unwatch",60016),eyeWatch:p("eye-watch",60016),circleFilled:p("circle-filled",60017),primitiveDot:p("primitive-dot",60017),closeDirty:p("close-dirty",60017),debugBreakpoint:p("debug-breakpoint",60017),debugBreakpointDisabled:p("debug-breakpoint-disabled",60017),debugHint:p("debug-hint",60017),terminalDecorationSuccess:p("terminal-decoration-success",60017),primitiveSquare:p("primitive-square",60018),edit:p("edit",60019),pencil:p("pencil",60019),info:p("info",60020),issueOpened:p("issue-opened",60020),gistPrivate:p("gist-private",60021),gitForkPrivate:p("git-fork-private",60021),lock:p("lock",60021),mirrorPrivate:p("mirror-private",60021),close:p("close",60022),removeClose:p("remove-close",60022),x:p("x",60022),repoSync:p("repo-sync",60023),sync:p("sync",60023),clone:p("clone",60024),desktopDownload:p("desktop-download",60024),beaker:p("beaker",60025),microscope:p("microscope",60025),vm:p("vm",60026),deviceDesktop:p("device-desktop",60026),file:p("file",60027),more:p("more",60028),ellipsis:p("ellipsis",60028),kebabHorizontal:p("kebab-horizontal",60028),mailReply:p("mail-reply",60029),reply:p("reply",60029),organization:p("organization",60030),organizationFilled:p("organization-filled",60030),organizationOutline:p("organization-outline",60030),newFile:p("new-file",60031),fileAdd:p("file-add",60031),newFolder:p("new-folder",60032),fileDirectoryCreate:p("file-directory-create",60032),trash:p("trash",60033),trashcan:p("trashcan",60033),history:p("history",60034),clock:p("clock",60034),folder:p("folder",60035),fileDirectory:p("file-directory",60035),symbolFolder:p("symbol-folder",60035),logoGithub:p("logo-github",60036),markGithub:p("mark-github",60036),github:p("github",60036),terminal:p("terminal",60037),console:p("console",60037),repl:p("repl",60037),zap:p("zap",60038),symbolEvent:p("symbol-event",60038),error:p("error",60039),stop:p("stop",60039),variable:p("variable",60040),symbolVariable:p("symbol-variable",60040),array:p("array",60042),symbolArray:p("symbol-array",60042),symbolModule:p("symbol-module",60043),symbolPackage:p("symbol-package",60043),symbolNamespace:p("symbol-namespace",60043),symbolObject:p("symbol-object",60043),symbolMethod:p("symbol-method",60044),symbolFunction:p("symbol-function",60044),symbolConstructor:p("symbol-constructor",60044),symbolBoolean:p("symbol-boolean",60047),symbolNull:p("symbol-null",60047),symbolNumeric:p("symbol-numeric",60048),symbolNumber:p("symbol-number",60048),symbolStructure:p("symbol-structure",60049),symbolStruct:p("symbol-struct",60049),symbolParameter:p("symbol-parameter",60050),symbolTypeParameter:p("symbol-type-parameter",60050),symbolKey:p("symbol-key",60051),symbolText:p("symbol-text",60051),symbolReference:p("symbol-reference",60052),goToFile:p("go-to-file",60052),symbolEnum:p("symbol-enum",60053),symbolValue:p("symbol-value",60053),symbolRuler:p("symbol-ruler",60054),symbolUnit:p("symbol-unit",60054),activateBreakpoints:p("activate-breakpoints",60055),archive:p("archive",60056),arrowBoth:p("arrow-both",60057),arrowDown:p("arrow-down",60058),arrowLeft:p("arrow-left",60059),arrowRight:p("arrow-right",60060),arrowSmallDown:p("arrow-small-down",60061),arrowSmallLeft:p("arrow-small-left",60062),arrowSmallRight:p("arrow-small-right",60063),arrowSmallUp:p("arrow-small-up",60064),arrowUp:p("arrow-up",60065),bell:p("bell",60066),bold:p("bold",60067),book:p("book",60068),bookmark:p("bookmark",60069),debugBreakpointConditionalUnverified:p("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:p("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:p("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:p("debug-breakpoint-data-unverified",60072),debugBreakpointData:p("debug-breakpoint-data",60073),debugBreakpointDataDisabled:p("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:p("debug-breakpoint-log-unverified",60074),debugBreakpointLog:p("debug-breakpoint-log",60075),debugBreakpointLogDisabled:p("debug-breakpoint-log-disabled",60075),briefcase:p("briefcase",60076),broadcast:p("broadcast",60077),browser:p("browser",60078),bug:p("bug",60079),calendar:p("calendar",60080),caseSensitive:p("case-sensitive",60081),check:p("check",60082),checklist:p("checklist",60083),chevronDown:p("chevron-down",60084),chevronLeft:p("chevron-left",60085),chevronRight:p("chevron-right",60086),chevronUp:p("chevron-up",60087),chromeClose:p("chrome-close",60088),chromeMaximize:p("chrome-maximize",60089),chromeMinimize:p("chrome-minimize",60090),chromeRestore:p("chrome-restore",60091),circleOutline:p("circle-outline",60092),circle:p("circle",60092),debugBreakpointUnverified:p("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:p("terminal-decoration-incomplete",60092),circleSlash:p("circle-slash",60093),circuitBoard:p("circuit-board",60094),clearAll:p("clear-all",60095),clippy:p("clippy",60096),closeAll:p("close-all",60097),cloudDownload:p("cloud-download",60098),cloudUpload:p("cloud-upload",60099),code:p("code",60100),collapseAll:p("collapse-all",60101),colorMode:p("color-mode",60102),commentDiscussion:p("comment-discussion",60103),creditCard:p("credit-card",60105),dash:p("dash",60108),dashboard:p("dashboard",60109),database:p("database",60110),debugContinue:p("debug-continue",60111),debugDisconnect:p("debug-disconnect",60112),debugPause:p("debug-pause",60113),debugRestart:p("debug-restart",60114),debugStart:p("debug-start",60115),debugStepInto:p("debug-step-into",60116),debugStepOut:p("debug-step-out",60117),debugStepOver:p("debug-step-over",60118),debugStop:p("debug-stop",60119),debug:p("debug",60120),deviceCameraVideo:p("device-camera-video",60121),deviceCamera:p("device-camera",60122),deviceMobile:p("device-mobile",60123),diffAdded:p("diff-added",60124),diffIgnored:p("diff-ignored",60125),diffModified:p("diff-modified",60126),diffRemoved:p("diff-removed",60127),diffRenamed:p("diff-renamed",60128),diff:p("diff",60129),diffSidebyside:p("diff-sidebyside",60129),discard:p("discard",60130),editorLayout:p("editor-layout",60131),emptyWindow:p("empty-window",60132),exclude:p("exclude",60133),extensions:p("extensions",60134),eyeClosed:p("eye-closed",60135),fileBinary:p("file-binary",60136),fileCode:p("file-code",60137),fileMedia:p("file-media",60138),filePdf:p("file-pdf",60139),fileSubmodule:p("file-submodule",60140),fileSymlinkDirectory:p("file-symlink-directory",60141),fileSymlinkFile:p("file-symlink-file",60142),fileZip:p("file-zip",60143),files:p("files",60144),filter:p("filter",60145),flame:p("flame",60146),foldDown:p("fold-down",60147),foldUp:p("fold-up",60148),fold:p("fold",60149),folderActive:p("folder-active",60150),folderOpened:p("folder-opened",60151),gear:p("gear",60152),gift:p("gift",60153),gistSecret:p("gist-secret",60154),gist:p("gist",60155),gitCommit:p("git-commit",60156),gitCompare:p("git-compare",60157),compareChanges:p("compare-changes",60157),gitMerge:p("git-merge",60158),githubAction:p("github-action",60159),githubAlt:p("github-alt",60160),globe:p("globe",60161),grabber:p("grabber",60162),graph:p("graph",60163),gripper:p("gripper",60164),heart:p("heart",60165),home:p("home",60166),horizontalRule:p("horizontal-rule",60167),hubot:p("hubot",60168),inbox:p("inbox",60169),issueReopened:p("issue-reopened",60171),issues:p("issues",60172),italic:p("italic",60173),jersey:p("jersey",60174),json:p("json",60175),bracket:p("bracket",60175),kebabVertical:p("kebab-vertical",60176),key:p("key",60177),law:p("law",60178),lightbulbAutofix:p("lightbulb-autofix",60179),linkExternal:p("link-external",60180),link:p("link",60181),listOrdered:p("list-ordered",60182),listUnordered:p("list-unordered",60183),liveShare:p("live-share",60184),loading:p("loading",60185),location:p("location",60186),mailRead:p("mail-read",60187),mail:p("mail",60188),markdown:p("markdown",60189),megaphone:p("megaphone",60190),mention:p("mention",60191),milestone:p("milestone",60192),gitPullRequestMilestone:p("git-pull-request-milestone",60192),mortarBoard:p("mortar-board",60193),move:p("move",60194),multipleWindows:p("multiple-windows",60195),mute:p("mute",60196),noNewline:p("no-newline",60197),note:p("note",60198),octoface:p("octoface",60199),openPreview:p("open-preview",60200),package:p("package",60201),paintcan:p("paintcan",60202),pin:p("pin",60203),play:p("play",60204),run:p("run",60204),plug:p("plug",60205),preserveCase:p("preserve-case",60206),preview:p("preview",60207),project:p("project",60208),pulse:p("pulse",60209),question:p("question",60210),quote:p("quote",60211),radioTower:p("radio-tower",60212),reactions:p("reactions",60213),references:p("references",60214),refresh:p("refresh",60215),regex:p("regex",60216),remoteExplorer:p("remote-explorer",60217),remote:p("remote",60218),remove:p("remove",60219),replaceAll:p("replace-all",60220),replace:p("replace",60221),repoClone:p("repo-clone",60222),repoForcePush:p("repo-force-push",60223),repoPull:p("repo-pull",60224),repoPush:p("repo-push",60225),report:p("report",60226),requestChanges:p("request-changes",60227),rocket:p("rocket",60228),rootFolderOpened:p("root-folder-opened",60229),rootFolder:p("root-folder",60230),rss:p("rss",60231),ruby:p("ruby",60232),saveAll:p("save-all",60233),saveAs:p("save-as",60234),save:p("save",60235),screenFull:p("screen-full",60236),screenNormal:p("screen-normal",60237),searchStop:p("search-stop",60238),server:p("server",60240),settingsGear:p("settings-gear",60241),settings:p("settings",60242),shield:p("shield",60243),smiley:p("smiley",60244),sortPrecedence:p("sort-precedence",60245),splitHorizontal:p("split-horizontal",60246),splitVertical:p("split-vertical",60247),squirrel:p("squirrel",60248),starFull:p("star-full",60249),starHalf:p("star-half",60250),symbolClass:p("symbol-class",60251),symbolColor:p("symbol-color",60252),symbolConstant:p("symbol-constant",60253),symbolEnumMember:p("symbol-enum-member",60254),symbolField:p("symbol-field",60255),symbolFile:p("symbol-file",60256),symbolInterface:p("symbol-interface",60257),symbolKeyword:p("symbol-keyword",60258),symbolMisc:p("symbol-misc",60259),symbolOperator:p("symbol-operator",60260),symbolProperty:p("symbol-property",60261),wrench:p("wrench",60261),wrenchSubaction:p("wrench-subaction",60261),symbolSnippet:p("symbol-snippet",60262),tasklist:p("tasklist",60263),telescope:p("telescope",60264),textSize:p("text-size",60265),threeBars:p("three-bars",60266),thumbsdown:p("thumbsdown",60267),thumbsup:p("thumbsup",60268),tools:p("tools",60269),triangleDown:p("triangle-down",60270),triangleLeft:p("triangle-left",60271),triangleRight:p("triangle-right",60272),triangleUp:p("triangle-up",60273),twitter:p("twitter",60274),unfold:p("unfold",60275),unlock:p("unlock",60276),unmute:p("unmute",60277),unverified:p("unverified",60278),verified:p("verified",60279),versions:p("versions",60280),vmActive:p("vm-active",60281),vmOutline:p("vm-outline",60282),vmRunning:p("vm-running",60283),watch:p("watch",60284),whitespace:p("whitespace",60285),wholeWord:p("whole-word",60286),window:p("window",60287),wordWrap:p("word-wrap",60288),zoomIn:p("zoom-in",60289),zoomOut:p("zoom-out",60290),listFilter:p("list-filter",60291),listFlat:p("list-flat",60292),listSelection:p("list-selection",60293),selection:p("selection",60293),listTree:p("list-tree",60294),debugBreakpointFunctionUnverified:p("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:p("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:p("debug-breakpoint-function-disabled",60296),debugStackframeActive:p("debug-stackframe-active",60297),circleSmallFilled:p("circle-small-filled",60298),debugStackframeDot:p("debug-stackframe-dot",60298),terminalDecorationMark:p("terminal-decoration-mark",60298),debugStackframe:p("debug-stackframe",60299),debugStackframeFocused:p("debug-stackframe-focused",60299),debugBreakpointUnsupported:p("debug-breakpoint-unsupported",60300),symbolString:p("symbol-string",60301),debugReverseContinue:p("debug-reverse-continue",60302),debugStepBack:p("debug-step-back",60303),debugRestartFrame:p("debug-restart-frame",60304),debugAlt:p("debug-alt",60305),callIncoming:p("call-incoming",60306),callOutgoing:p("call-outgoing",60307),menu:p("menu",60308),expandAll:p("expand-all",60309),feedback:p("feedback",60310),gitPullRequestReviewer:p("git-pull-request-reviewer",60310),groupByRefType:p("group-by-ref-type",60311),ungroupByRefType:p("ungroup-by-ref-type",60312),account:p("account",60313),gitPullRequestAssignee:p("git-pull-request-assignee",60313),bellDot:p("bell-dot",60314),debugConsole:p("debug-console",60315),library:p("library",60316),output:p("output",60317),runAll:p("run-all",60318),syncIgnored:p("sync-ignored",60319),pinned:p("pinned",60320),githubInverted:p("github-inverted",60321),serverProcess:p("server-process",60322),serverEnvironment:p("server-environment",60323),pass:p("pass",60324),issueClosed:p("issue-closed",60324),stopCircle:p("stop-circle",60325),playCircle:p("play-circle",60326),record:p("record",60327),debugAltSmall:p("debug-alt-small",60328),vmConnect:p("vm-connect",60329),cloud:p("cloud",60330),merge:p("merge",60331),export:p("export",60332),graphLeft:p("graph-left",60333),magnet:p("magnet",60334),notebook:p("notebook",60335),redo:p("redo",60336),checkAll:p("check-all",60337),pinnedDirty:p("pinned-dirty",60338),passFilled:p("pass-filled",60339),circleLargeFilled:p("circle-large-filled",60340),circleLarge:p("circle-large",60341),circleLargeOutline:p("circle-large-outline",60341),combine:p("combine",60342),gather:p("gather",60342),table:p("table",60343),variableGroup:p("variable-group",60344),typeHierarchy:p("type-hierarchy",60345),typeHierarchySub:p("type-hierarchy-sub",60346),typeHierarchySuper:p("type-hierarchy-super",60347),gitPullRequestCreate:p("git-pull-request-create",60348),runAbove:p("run-above",60349),runBelow:p("run-below",60350),notebookTemplate:p("notebook-template",60351),debugRerun:p("debug-rerun",60352),workspaceTrusted:p("workspace-trusted",60353),workspaceUntrusted:p("workspace-untrusted",60354),workspaceUnknown:p("workspace-unknown",60355),terminalCmd:p("terminal-cmd",60356),terminalDebian:p("terminal-debian",60357),terminalLinux:p("terminal-linux",60358),terminalPowershell:p("terminal-powershell",60359),terminalTmux:p("terminal-tmux",60360),terminalUbuntu:p("terminal-ubuntu",60361),terminalBash:p("terminal-bash",60362),arrowSwap:p("arrow-swap",60363),copy:p("copy",60364),personAdd:p("person-add",60365),filterFilled:p("filter-filled",60366),wand:p("wand",60367),debugLineByLine:p("debug-line-by-line",60368),inspect:p("inspect",60369),layers:p("layers",60370),layersDot:p("layers-dot",60371),layersActive:p("layers-active",60372),compass:p("compass",60373),compassDot:p("compass-dot",60374),compassActive:p("compass-active",60375),azure:p("azure",60376),issueDraft:p("issue-draft",60377),gitPullRequestClosed:p("git-pull-request-closed",60378),gitPullRequestDraft:p("git-pull-request-draft",60379),debugAll:p("debug-all",60380),debugCoverage:p("debug-coverage",60381),runErrors:p("run-errors",60382),folderLibrary:p("folder-library",60383),debugContinueSmall:p("debug-continue-small",60384),beakerStop:p("beaker-stop",60385),graphLine:p("graph-line",60386),graphScatter:p("graph-scatter",60387),pieChart:p("pie-chart",60388),bracketDot:p("bracket-dot",60389),bracketError:p("bracket-error",60390),lockSmall:p("lock-small",60391),azureDevops:p("azure-devops",60392),verifiedFilled:p("verified-filled",60393),newline:p("newline",60394),layout:p("layout",60395),layoutActivitybarLeft:p("layout-activitybar-left",60396),layoutActivitybarRight:p("layout-activitybar-right",60397),layoutPanelLeft:p("layout-panel-left",60398),layoutPanelCenter:p("layout-panel-center",60399),layoutPanelJustify:p("layout-panel-justify",60400),layoutPanelRight:p("layout-panel-right",60401),layoutPanel:p("layout-panel",60402),layoutSidebarLeft:p("layout-sidebar-left",60403),layoutSidebarRight:p("layout-sidebar-right",60404),layoutStatusbar:p("layout-statusbar",60405),layoutMenubar:p("layout-menubar",60406),layoutCentered:p("layout-centered",60407),target:p("target",60408),indent:p("indent",60409),recordSmall:p("record-small",60410),errorSmall:p("error-small",60411),terminalDecorationError:p("terminal-decoration-error",60411),arrowCircleDown:p("arrow-circle-down",60412),arrowCircleLeft:p("arrow-circle-left",60413),arrowCircleRight:p("arrow-circle-right",60414),arrowCircleUp:p("arrow-circle-up",60415),layoutSidebarRightOff:p("layout-sidebar-right-off",60416),layoutPanelOff:p("layout-panel-off",60417),layoutSidebarLeftOff:p("layout-sidebar-left-off",60418),blank:p("blank",60419),heartFilled:p("heart-filled",60420),map:p("map",60421),mapHorizontal:p("map-horizontal",60421),foldHorizontal:p("fold-horizontal",60421),mapFilled:p("map-filled",60422),mapHorizontalFilled:p("map-horizontal-filled",60422),foldHorizontalFilled:p("fold-horizontal-filled",60422),circleSmall:p("circle-small",60423),bellSlash:p("bell-slash",60424),bellSlashDot:p("bell-slash-dot",60425),commentUnresolved:p("comment-unresolved",60426),gitPullRequestGoToChanges:p("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:p("git-pull-request-new-changes",60428),searchFuzzy:p("search-fuzzy",60429),commentDraft:p("comment-draft",60430),send:p("send",60431),sparkle:p("sparkle",60432),insert:p("insert",60433),mic:p("mic",60434),thumbsdownFilled:p("thumbsdown-filled",60435),thumbsupFilled:p("thumbsup-filled",60436),coffee:p("coffee",60437),snake:p("snake",60438),game:p("game",60439),vr:p("vr",60440),chip:p("chip",60441),piano:p("piano",60442),music:p("music",60443),micFilled:p("mic-filled",60444),repoFetch:p("repo-fetch",60445),copilot:p("copilot",60446),lightbulbSparkle:p("lightbulb-sparkle",60447),robot:p("robot",60448),sparkleFilled:p("sparkle-filled",60449),diffSingle:p("diff-single",60450),diffMultiple:p("diff-multiple",60451),surroundWith:p("surround-with",60452),share:p("share",60453),gitStash:p("git-stash",60454),gitStashApply:p("git-stash-apply",60455),gitStashPop:p("git-stash-pop",60456),vscode:p("vscode",60457),vscodeInsiders:p("vscode-insiders",60458),codeOss:p("code-oss",60459),runCoverage:p("run-coverage",60460),runAllCoverage:p("run-all-coverage",60461),coverage:p("coverage",60462),githubProject:p("github-project",60463),mapVertical:p("map-vertical",60464),foldVertical:p("fold-vertical",60464),mapVerticalFilled:p("map-vertical-filled",60465),foldVerticalFilled:p("fold-vertical-filled",60465),goToSearch:p("go-to-search",60466),percentage:p("percentage",60467),sortPercentage:p("sort-percentage",60467),attach:p("attach",60468),goToEditingSession:p("go-to-editing-session",60469),editSession:p("edit-session",60470),codeReview:p("code-review",60471),copilotWarning:p("copilot-warning",60472),python:p("python",60473),copilotLarge:p("copilot-large",60474),copilotWarningLarge:p("copilot-warning-large",60475),keyboardTab:p("keyboard-tab",60476),copilotBlocked:p("copilot-blocked",60477),copilotNotConnected:p("copilot-not-connected",60478),flag:p("flag",60479),lightbulbEmpty:p("lightbulb-empty",60480),symbolMethodArrow:p("symbol-method-arrow",60481),copilotUnavailable:p("copilot-unavailable",60482),repoPinned:p("repo-pinned",60483),keyboardTabAbove:p("keyboard-tab-above",60484),keyboardTabBelow:p("keyboard-tab-below",60485),gitPullRequestDone:p("git-pull-request-done",60486),mcp:p("mcp",60487),extensionsLarge:p("extensions-large",60488),layoutPanelDock:p("layout-panel-dock",60489),layoutSidebarLeftDock:p("layout-sidebar-left-dock",60490),layoutSidebarRightDock:p("layout-sidebar-right-dock",60491),copilotInProgress:p("copilot-in-progress",60492),copilotError:p("copilot-error",60493),copilotSuccess:p("copilot-success",60494),chatSparkle:p("chat-sparkle",60495),searchSparkle:p("search-sparkle",60496),editSparkle:p("edit-sparkle",60497),copilotSnooze:p("copilot-snooze",60498),sendToRemoteAgent:p("send-to-remote-agent",60499),commentDiscussionSparkle:p("comment-discussion-sparkle",60500),chatSparkleWarning:p("chat-sparkle-warning",60501),chatSparkleError:p("chat-sparkle-error",60502),collection:p("collection",60503),newCollection:p("new-collection",60504),thinking:p("thinking",60505),build:p("build",60506),commentDiscussionQuote:p("comment-discussion-quote",60507),cursor:p("cursor",60508),eraser:p("eraser",60509),fileText:p("file-text",60510),quotes:p("quotes",60512),rename:p("rename",60513),runWithDeps:p("run-with-deps",60514),debugConnected:p("debug-connected",60515),strikethrough:p("strikethrough",60516),openInProduct:p("open-in-product",60517),indexZero:p("index-zero",60518),agent:p("agent",60519),editCode:p("edit-code",60520),repoSelected:p("repo-selected",60521),skip:p("skip",60522),mergeInto:p("merge-into",60523),gitBranchChanges:p("git-branch-changes",60524),gitBranchStagedChanges:p("git-branch-staged-changes",60525),gitBranchConflicts:p("git-branch-conflicts",60526),gitBranch:p("git-branch",60527),gitBranchCreate:p("git-branch-create",60527),gitBranchDelete:p("git-branch-delete",60527),searchLarge:p("search-large",60528),terminalGitBash:p("terminal-git-bash",60529),windowActive:p("window-active",60530),forward:p("forward",60531),download:p("download",60532),clockface:p("clockface",60533),unarchive:p("unarchive",60534),sessionInProgress:p("session-in-progress",60535),collectionSmall:p("collection-small",60536),vmSmall:p("vm-small",60537),cloudSmall:p("cloud-small",60538),addSmall:p("add-small",60539),removeSmall:p("remove-small",60540),worktreeSmall:p("worktree-small",60541),worktree:p("worktree",60542),screenCut:p("screen-cut",60543),ask:p("ask",60544),openai:p("openai",60545),claude:p("claude",60546),openInWindow:p("open-in-window",60547),newSession:p("new-session",60548),terminalSecure:p("terminal-secure",60549),chatImport:p("chat-import",60550),chatExport:p("chat-export",60551),shareWindow:p("share-window",60552)}});function xw(){return Object.values(pt)}var _M,pt,ip=I(()=>{Sw();$C();_M={dialogError:p("dialog-error","error"),dialogWarning:p("dialog-warning","warning"),dialogInfo:p("dialog-info","info"),dialogClose:p("dialog-close","close"),treeItemExpanded:p("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:p("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:p("tree-filter-on-type-off","list-selection"),treeFilterClear:p("tree-filter-clear","close"),treeItemLoading:p("tree-item-loading","loading"),menuSelection:p("menu-selection","check"),menuSubmenu:p("menu-submenu","chevron-right"),menuBarMore:p("menubar-more","more"),scrollbarButtonLeft:p("scrollbar-button-left","triangle-left"),scrollbarButtonRight:p("scrollbar-button-right","triangle-right"),scrollbarButtonUp:p("scrollbar-button-up","triangle-up"),scrollbarButtonDown:p("scrollbar-button-down","triangle-down"),toolBarMore:p("toolbar-more","more"),quickInputBack:p("quick-input-back","arrow-left"),dropDownButton:p("drop-down-button",60084),symbolCustomColor:p("symbol-customcolor",60252),exportIcon:p("export",60332),workspaceUnspecified:p("workspace-unspecified",60355),newLine:p("newline",60394),thumbsDownFilled:p("thumbsdown-filled",60435),thumbsUpFilled:p("thumbsup-filled",60436),gitFetch:p("git-fetch",60445),lightbulbSparkleAutofix:p("lightbulb-sparkle-autofix",60447),debugBreakpointPending:p("debug-breakpoint-pending",60377),chatImport:p("chat-import",60550),chatExport:p("chat-export",60551)},pt={...HC,..._M}});var qC,lc,Pw=I(()=>{ip();(r=>{function n(e){return!!e&&typeof e=="object"&&typeof e.id=="string"}r.isThemeColor=n})(qC||={});(w=>{w.iconNameSegment="[A-Za-z0-9]+",w.iconNameExpression="[A-Za-z0-9-]+",w.iconModifierExpression="~[A-Za-z]+",w.iconNameCharacter="[A-Za-z0-9~-]";let i=new RegExp(`^(${w.iconNameExpression})(${w.iconModifierExpression})?$`);function o(_){let D=i.exec(_.id);if(!D)return o(pt.error);let[,k,A]=D,de=["codicon","codicon-"+k];return A&&de.push("codicon-modifier-"+A.substring(1)),de}w.asClassNameArray=o;function s(_){return o(_).join(" ")}w.asClassName=s;function a(_){return"."+o(_).join(".")}w.asCSSSelector=a;function l(_){return!!_&&typeof _=="object"&&typeof _.id=="string"&&(typeof _.color>"u"||qC.isThemeColor(_.color))}w.isThemeIcon=l;let c=new RegExp(`^\\$\\((${w.iconNameExpression}(?:${w.iconModifierExpression})?)\\)$`);function d(_){let D=c.exec(_);if(!D)return;let[,k]=D;return{id:k}}w.fromString=d;function u(_){return{id:_}}w.fromId=u;function f(_,D){let k=_.id,A=k.lastIndexOf("~");return A!==-1&&(k=k.substring(0,A)),D&&(k=`${k}~${D}`),{id:k}}w.modify=f;function m(_){let D=_.id.lastIndexOf("~");if(D!==-1)return _.id.substring(D+1)}w.getModifier=m;function v(_,D){return _.id===D.id&&_.color?.id===D.color?.id}w.isEqual=v;function y(_){return _?.id===pt.file.id}w.isFile=y;function C(_){return _?.id===pt.folder.id}w.isFolder=C})(lc||={})});import mi,{screen as kM}from"electron";import{release as KC}from"os";var Ew,np,ca,Cw,Tw=I(()=>{he();wt();No();q();$();ze();hn();X();ce();xe();Sl();et();Qs();Lt();Nl();je();Ct();te();qt();Hh();BC();Fn();Zt();Pw();dl();Jo();Kt();Rr();is();tn();cn();xi();es();Xl();Z();ot();He();yI();Sy();Ew=class n{constructor(){this.windows=new Set}static{this.INSTANCE=new n}acquireBadge(r){return this.windows.add(r.id),mi.app.setBadgeCount(re?1:void 0),{dispose:()=>{this.windows.delete(r.id),this.windows.size===0&&mi.app.setBadgeCount(0)}}}},np=class n extends T{constructor(e,t,i,o){super();this.configurationService=e;this.stateService=t;this.environmentMainService=i;this.logService=o;this._onDidClose=this._register(new b);this.onDidClose=this._onDidClose.event;this._onDidMaximize=this._register(new b);this.onDidMaximize=this._onDidMaximize.event;this._onDidUnmaximize=this._register(new b);this.onDidUnmaximize=this._onDidUnmaximize.event;this._onDidTriggerSystemContextMenu=this._register(new b);this.onDidTriggerSystemContextMenu=this._onDidTriggerSystemContextMenu.event;this._onDidEnterFullScreen=this._register(new b);this.onDidEnterFullScreen=this._onDidEnterFullScreen.event;this._onDidLeaveFullScreen=this._register(new b);this.onDidLeaveFullScreen=this._onDidLeaveFullScreen.event;this._onDidChangeAlwaysOnTop=this._register(new b);this.onDidChangeAlwaysOnTop=this._onDidChangeAlwaysOnTop.event;this._lastFocusTime=Date.now();this._win=null;this.notifyFocusDisposable=this._register(new Qt);this.windowControlsDimmed=!1;this.transientIsNativeFullScreen=void 0;this.joinNativeFullScreenTransition=void 0}get lastFocusTime(){return this._lastFocusTime}get win(){return this._win}setWin(e,t){this._win=e,this._register(S.fromNodeEventEmitter(e,"maximize")(()=>{if(F&&this.environmentMainService.enableRDPDisplayTracking&&this._win){let[o,s]=this._win.getPosition(),[a,l]=this._win.getSize();this.maximizedWindowState={mode:0,width:a,height:l,x:o,y:s},this.logService.debug(`Saved maximized window ${this.id} display state:`,this.maximizedWindowState)}this._onDidMaximize.fire()})),this._register(S.fromNodeEventEmitter(e,"unmaximize")(()=>{F&&this.environmentMainService.enableRDPDisplayTracking&&this.maximizedWindowState&&(this.maximizedWindowState=void 0,this.logService.debug(`Cleared maximized window ${this.id} state`)),this._onDidUnmaximize.fire()})),this._register(S.fromNodeEventEmitter(e,"closed")(()=>{this._onDidClose.fire(),this.dispose()})),this._register(S.fromNodeEventEmitter(e,"focus")(()=>{this.clearNotifyFocus(),this._lastFocusTime=Date.now()})),this._register(S.fromNodeEventEmitter(this._win,"enter-full-screen")(()=>this._onDidEnterFullScreen.fire())),this._register(S.fromNodeEventEmitter(this._win,"leave-full-screen")(()=>this._onDidLeaveFullScreen.fire())),this._register(S.fromNodeEventEmitter(this._win,"always-on-top-changed",(o,s)=>s)(o=>this._onDidChangeAlwaysOnTop.fire(o)));let i=!Go(this.configurationService,t?.titleBarStyle==="hidden"?"custom":void 0);if(V&&i&&e.setSheetOffset(Gg(KC())?32:28),i&&pu(this.configurationService)){let o=this.stateService.getItem(n.windowControlHeightStateStorageKey);o?this.updateWindowControls({height:o}):this.updateWindowControls({height:fP})}(F||re)&&i&&this._register(S.fromNodeEventEmitter(e,"system-context-menu",(o,s)=>({event:o,point:s}))(o=>{let[s,a]=e.getPosition(),l=mi.screen.screenToDipPoint(o.point),c=Math.floor(l.x)-s,d=Math.floor(l.y)-a;re&&c>35&&(o.event.preventDefault(),this._onDidTriggerSystemContextMenu.fire({x:c,y:d}))})),this.environmentMainService.args["open-devtools"]===!0&&e.webContents.openDevTools(),V&&(this._register(this.onDidEnterFullScreen(()=>{this.joinNativeFullScreenTransition?.complete(!0)})),this._register(this.onDidLeaveFullScreen(()=>{this.joinNativeFullScreenTransition?.complete(!0)}))),F&&this.environmentMainService.enableRDPDisplayTracking&&this._register(S.fromNodeEventEmitter(kM,"display-added",(o,s)=>({event:o,display:s}))(o=>{this.onDisplayAdded(o.display)}))}onDisplayAdded(e){let t=this.maximizedWindowState;t&&this._win&&pl.validateWindowStateOnDisplay(t,e)&&(this.logService.debug(`Setting maximized window ${this.id} bounds to match newly added display`,t),this._win.setBounds(t))}applyState(e,t=mi.screen.getAllDisplays().length>0){let i=this.configurationService.getValue("window"),o=V&&i?.nativeTabs===!0;(V||F)&&t&&(!o||Ln().length===1)&&[e.width,e.height,e.x,e.y].every(s=>typeof s=="number")&&this._win?.setBounds({width:e.width,height:e.height,x:e.x,y:e.y}),(e.mode===0||e.mode===3)&&(this._win?.maximize(),e.mode===3&&this.setFullScreen(!0,!0),this._win?.show())}setRepresentedFilename(e){V?this.win?.setRepresentedFilename(e):this.representedFilename=e}getRepresentedFilename(){return V?this.win?.getRepresentedFilename():this.representedFilename}setDocumentEdited(e){V&&this.win?.setDocumentEdited(e),this.documentEdited=e}isDocumentEdited(){return V?!!this.win?.isDocumentEdited():!!this.documentEdited}focus(e){switch(e?.mode??0){case 0:this.doFocusWindow();break;case 1:this.showNotifyFocus();break;case 2:V&&mi.app.focus({steal:!0}),this.doFocusWindow();break}}showNotifyFocus(){let e=new j;this.notifyFocusDisposable.value=e,e.add(Ew.INSTANCE.acquireBadge(this)),F||re?(this.win?.flashFrame(!0),e.add(G(()=>this.win?.flashFrame(!1)))):V&&mi.app.dock?.bounce("informational")}clearNotifyFocus(){this.notifyFocusDisposable.clear()}doFocusWindow(){let e=this.win;e&&(e.isMinimized()&&e.restore(),e.focus(),e.webContents.focus())}static{this.windowControlHeightStateStorageKey="windowControlHeight"}updateWindowControls(e){let t=this.win;if(t){if(e.height&&this.stateService.setItem(ca.windowControlHeightStateStorageKey,e.height),!V&&pu(this.configurationService)){e.dimmed!==void 0&&(this.windowControlsDimmed=e.dimmed);let i=e.backgroundColor??this.lastWindowControlColors?.backgroundColor,o=e.foregroundColor??this.lastWindowControlColors?.foregroundColor;(e.backgroundColor!==void 0||e.foregroundColor!==void 0)&&(this.lastWindowControlColors={backgroundColor:i,foregroundColor:o});let s=this.windowControlsDimmed&&i?this.dimColor(i):i,a=this.windowControlsDimmed&&o?this.dimColor(o):o;t.setTitleBarOverlay({color:s?.trim()===""?void 0:s,symbolColor:a?.trim()===""?void 0:a,height:e.height?e.height-1:void 0})}else if(V&&e.height!==void 0){let i=Gg(KC())?14:16,o=Math.floor((e.height-i)/2);o?t.setWindowButtonPosition({x:o+1,y:o}):t.setWindowButtonPosition(null)}}}dimColor(e){let t=Yo.Format.CSS.parse(e);if(!t)return e;let i=.7,o=Math.round(t.rgba.r*i),s=Math.round(t.rgba.g*i),a=Math.round(t.rgba.b*i);return`rgb(${o}, ${s}, ${a})`}toggleFullScreen(){this.setFullScreen(!this.isFullScreen,!1)}setFullScreen(e,t){cm(this.configurationService)?this.setNativeFullScreen(e,t):this.setSimpleFullScreen(e)}get isFullScreen(){if(V&&typeof this.transientIsNativeFullScreen=="boolean")return this.transientIsNativeFullScreen;let e=this.win,t=e?.isFullScreen(),i=e?.isSimpleFullScreen();return!!(t||i)}setNativeFullScreen(e,t){let i=this.win;i?.isSimpleFullScreen()&&i?.setSimpleFullScreen(!1),this.doSetNativeFullScreen(e,t)}doSetNativeFullScreen(e,t){if(V){this.transientIsNativeFullScreen=e;let o=this.joinNativeFullScreenTransition=new At;(async()=>{let s=await Promise.race([o.p,lt(1e4).then(()=>!1)]);this.joinNativeFullScreenTransition===o&&(this.transientIsNativeFullScreen=void 0,this.joinNativeFullScreenTransition=void 0,!s&&e&&t&&this.win&&!this.win.isFullScreen()&&(this.logService.warn("window: native macOS fullscreen transition did not happen within 10s from restoring"),this._onDidLeaveFullScreen.fire()))})()}this.win?.setFullScreen(e)}setSimpleFullScreen(e){let t=this.win;t?.isFullScreen()&&this.doSetNativeFullScreen(!1,!1),t?.setSimpleFullScreen(e),t?.webContents.focus()}dispose(){super.dispose(),this._win=null}},ca=class extends np{constructor(e,t,i,o,s,a,l,c,d,u,f,m,v,y,C,w,_,D,k,A,de){super(u,A,o,t);this.loggerMainService=i;this.policyService=s;this.userDataProfilesService=a;this.fileService=l;this.applicationStorageMainService=c;this.storageMainService=d;this.themeMainService=f;this.workspacesManagementMainService=m;this.backupMainService=v;this.telemetryService=y;this.dialogMainService=C;this.lifecycleMainService=w;this.productService=_;this.windowsMainService=k;this._onWillLoad=this._register(new b);this.onWillLoad=this._onWillLoad.event;this._onDidSignalReady=this._register(new b);this.onDidSignalReady=this._onDidSignalReady.event;this._onDidDestroy=this._register(new b);this.onDidDestroy=this._onDidDestroy.event;this.whenReadyCallbacks=[];this.touchBarGroups=[];this.currentHttpProxy=void 0;this.currentNoProxy=void 0;this.customZoomLevel=void 0;this.wasLoaded=!1;this.readyState=0;this.swipeListenerDisposable=this._register(new Qt);{this.configObjectUrl=this._register(D.createIPCObjectUrl());let[K,ve]=this.restoreWindowState(e.state);this.windowState=K,this.logService.trace("window#ctor: using window state",K);let yt={preload:st.asFileUri("vs/base/parts/sandbox/electron-browser/preload.js").fsPath,additionalArguments:[`--vscode-window-config=${this.configObjectUrl.resource.toString()}`],v8CacheOptions:this.environmentMainService.useCodeCache?"bypassHeatCheck":"none"};process.isEmbeddedApp&&(yt.backgroundThrottling=!1);let Ot=de.invokeFunction(ul,this.windowState,void 0,yt);Ve("code/willCreateCodeBrowserWindow"),this._win=new mi.BrowserWindow(Ot),Ve("code/didCreateCodeBrowserWindow"),this._id=this._win.id,this.setWin(this._win,Ot),this.applyState(this.windowState,ve),this._lastFocusTime=Date.now()}let L=parseInt(this.environmentMainService.args["unresponsive-sample-interval"]||"1000"),J=parseInt(this.environmentMainService.args["unresponsive-sample-period"]||"15000");(L<=0||J<=0||L>J)&&(this.logService.warn(`Invalid unresponsive sample interval (${L}ms) or period (${J}ms), using defaults.`),L=1e3,J=15e3),this.jsCallStackMap=new Map,this.jsCallStackEffectiveSampleCount=Math.round(J/L),this.jsCallStackCollector=this._register(new to(L)),this.jsCallStackCollectorStopScheduler=this._register(new gr(()=>{this.stopCollectingJScallStacks()},J)),this.onConfigurationUpdated(),this.createTouchBar(),this.registerListeners()}get id(){return this._id}get backupPath(){return this._config?.backupPath}get openedWorkspace(){return this._config?.workspace}get profile(){if(!this.config)return;let e=this.userDataProfilesService.profiles.find(t=>t.id===this.config?.profiles.profile.id);return this.isExtensionDevelopmentHost&&e?e:this.userDataProfilesService.getProfileForWorkspace(this.config.workspace??jo(this.backupPath,this.isExtensionDevelopmentHost))??this.userDataProfilesService.defaultProfile}get remoteAuthority(){return this._config?.remoteAuthority}get config(){return this._config}get isExtensionDevelopmentHost(){return!!this._config?.extensionDevelopmentPath}get isExtensionTestHost(){return!!this._config?.extensionTestsPath}get isExtensionDevelopmentTestFromCli(){return this.isExtensionDevelopmentHost&&this.isExtensionTestHost&&!this._config?.debugId}setReady(){for(this.logService.trace(`window#load: window reported ready (id: ${this._id})`),this.readyState=2;this.whenReadyCallbacks.length;)this.whenReadyCallbacks.pop()(this);this._onDidSignalReady.fire()}ready(){return new Promise(e=>{if(this.isReady)return e(this);this.whenReadyCallbacks.push(e)})}get isReady(){return this.readyState===2}get whenClosedOrLoaded(){return new Promise(e=>{function t(){i.dispose(),o.dispose(),e()}let i=this.onDidClose(()=>t()),o=this.onWillLoad(()=>t())})}registerListeners(){this._register(S.fromNodeEventEmitter(this._win,"unresponsive")(()=>this.onWindowError(1))),this._register(S.fromNodeEventEmitter(this._win,"responsive")(()=>this.onWindowError(4))),this._register(S.fromNodeEventEmitter(this._win.webContents,"render-process-gone",(t,i)=>i)(t=>this.onWindowError(2,{...t}))),this._register(S.fromNodeEventEmitter(this._win.webContents,"did-fail-load",(t,i,o)=>({exitCode:i,reason:o}))(({exitCode:t,reason:i})=>this.onWindowError(3,{reason:i,exitCode:t}))),this._register(S.fromNodeEventEmitter(this._win.webContents,"will-prevent-unload")(t=>t.preventDefault())),this._register(S.fromNodeEventEmitter(this._win.webContents,"did-finish-load")(()=>{this.pendingLoadConfig&&(this._config=this.pendingLoadConfig,this.pendingLoadConfig=void 0)})),this._register(this.onDidMaximize(()=>{this._config&&(this._config.maximized=!0)})),this._register(this.onDidUnmaximize(()=>{this._config&&(this._config.maximized=!1)})),this._register(this.onDidEnterFullScreen(()=>{this.sendWhenReady("vscode:enterFullScreen",Ce.None)})),this._register(this.onDidLeaveFullScreen(()=>{this.sendWhenReady("vscode:leaveFullScreen",Ce.None)})),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationUpdated(t))),this._register(this.workspacesManagementMainService.onDidDeleteUntitledWorkspace(t=>this.onDidDeleteUntitledWorkspace(t)));let e=["https://*.vsassets.io/*"];if(this.productService.extensionsGallery?.serviceUrl){let t=x.parse(this.productService.extensionsGallery.serviceUrl);e.push(`${t.scheme}://${t.authority}/*`)}this._win.webContents.session.webRequest.onBeforeSendHeaders({urls:e},async(t,i)=>{let o=await this.getMarketplaceHeaders();i({cancel:!1,requestHeaders:Object.assign(t.requestHeaders,o)})})}getMarketplaceHeaders(){return this.marketplaceHeadersPromise||(this.marketplaceHeadersPromise=NC(this.productService.version,this.productService,this.environmentMainService,this.configurationService,this.fileService,this.applicationStorageMainService,this.telemetryService)),this.marketplaceHeadersPromise}async onWindowError(e,t){switch(e){case 2:this.logService.error(`CodeWindow: renderer process gone (reason: ${t?.reason||"<unknown>"}, code: ${t?.exitCode||"<unknown>"})`);break;case 1:this.logService.error("CodeWindow: detected unresponsive");break;case 4:this.logService.error("CodeWindow: recovered from unresponsive");break;case 3:this.logService.error(`CodeWindow: failed to load (reason: ${t?.reason||"<unknown>"}, code: ${t?.exitCode||"<unknown>"})`);break}switch(this.telemetryService.publicLog2("windowerror",{type:e,reason:t?.reason,code:t?.exitCode}),e){case 1:case 2:if(this.isExtensionDevelopmentTestFromCli){this.lifecycleMainService.kill(1);return}if(this.environmentMainService.args["enable-smoke-test-driver"]){await this.destroyWindow(!1,!1),this.lifecycleMainService.quit();return}if(e===1){if(this.isExtensionDevelopmentHost||this.isExtensionTestHost||this._win?.webContents?.isDevToolsOpened())return;this.jsCallStackCollector.trigger(()=>this.startCollectingJScallStacks()),this.jsCallStackCollectorStopScheduler.schedule();let{response:i,checkboxChecked:o}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[h(2877,null),h(2873,null),h(2878,null)],message:h(2871,null),detail:h(2872,null),checkboxLabel:this._config?.workspace?h(2874,null):void 0},this._win);if(i!==2){let s=i===0;this.stopCollectingJScallStacks(),await this.destroyWindow(s,o)}}else if(e===2){let i;t?i=h(2869,null,t.reason,t.exitCode??"<unknown>"):i=h(2867,null);let{response:o,checkboxChecked:s}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[this._config?.workspace?h(2877,null):h(2876,null),h(2873,null)],message:i,detail:this._config?.workspace?h(2870,null):h(2868,null),checkboxLabel:this._config?.workspace?h(2874,null):void 0},this._win),a=o===0;await this.destroyWindow(a,s)}break;case 4:this.stopCollectingJScallStacks();break}}async destroyWindow(e,t){let i=this._config?.workspace;if(t&&i)try{let o=this.storageMainService.workspaceStorage(i);await o.init(),o.delete("memento/workbench.parts.editor"),await o.close()}catch(o){this.logService.error(o)}this._onDidDestroy.fire();try{if(e&&this._config){let o,s;$t(i)?o={folderUri:i.uri}:ct(i)?o={workspaceUri:i.configPath}:s=!0,(await this.windowsMainService.open({context:5,userEnv:this._config.userEnv,cli:{...this.environmentMainService.args,_:[]},urisToOpen:o?[o]:void 0,forceEmpty:s,forceNewWindow:!0,remoteAuthority:this.remoteAuthority})).at(0)?.focus()}}finally{this._win?.destroy()}}onDidDeleteUntitledWorkspace(e){this._config?.workspace?.id===e.id&&(this._config.workspace=void 0)}onConfigurationUpdated(e){if(V&&(!e||e.affectsConfiguration("workbench.editor.swipeToNavigate"))&&(this.configurationService.getValue("workbench.editor.swipeToNavigate")?this.registerSwipeListener():this.swipeListenerDisposable.clear()),!e||e.affectsConfiguration("window.menuBarVisibility")){let t=this.getMenuBarVisibility();t!==this.currentMenuBarVisibility&&(this.currentMenuBarVisibility=t,this.setMenuBarVisibility(t))}if(!e||e.affectsConfiguration("http.proxy")||e.affectsConfiguration("http.noProxy")){let i=(this.configurationService.inspect("http.proxy").userLocalValue||"").trim()||(process.env.https_proxy||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.HTTP_PROXY||"").trim()||void 0;if(i?.indexOf("@")!==-1){let s=x.parse(i),a=s.authority.indexOf("@");a!==-1&&(i=s.with({authority:s.authority.substring(a+1)}).toString())}i?.endsWith("/")&&(i=i.substr(0,i.length-1));let o=(this.configurationService.getValue("http.noProxy")||[]).map(s=>s.trim()).join(",")||(process.env.no_proxy||process.env.NO_PROXY||"").trim()||void 0;if((i||"").indexOf("@")===-1&&(i!==this.currentHttpProxy||o!==this.currentNoProxy)){this.currentHttpProxy=i,this.currentNoProxy=o;let s=i||"",a=o?`${o},<local>`:"<local>";this.logService.trace(`Setting proxy to '${s}', bypassing '${a}'`),this._win.webContents.session.setProxy({proxyRules:s,proxyBypassRules:a,pacScript:""}),mi.app.setProxy({proxyRules:s,proxyBypassRules:a,pacScript:""})}}}registerSwipeListener(){this.swipeListenerDisposable.value=S.fromNodeEventEmitter(this._win,"swipe",(e,t)=>t)(e=>{this.isReady&&(e==="left"?this.send("vscode:runAction",{id:"workbench.action.openPreviousRecentlyUsedEditor",from:"mouse"}):e==="right"&&this.send("vscode:runAction",{id:"workbench.action.openNextRecentlyUsedEditor",from:"mouse"}))})}addTabbedWindow(e){V&&e.win&&this._win.addTabbedWindow(e.win)}load(e,t=Object.create(null)){this.logService.trace(`window#load: attempt to load window (id: ${this._id})`),this.isDocumentEdited()&&(!t.isReload||!this.backupMainService.isHotExitEnabled())&&this.setDocumentEdited(!1),t.isReload||(this.getRepresentedFilename()&&this.setRepresentedFilename(""),this._win.setTitle(this.productService.nameLong)),this.updateConfiguration(e,t),this.readyState===0?this._config=e:this.pendingLoadConfig=e,this.readyState=1;let i;process.env.VSCODE_DEV&&process.env.VSCODE_DEV_SERVER_URL?i=process.env.VSCODE_DEV_SERVER_URL:e.isSessionsWindow?i=st.asBrowserUri(`vs/sessions/electron-browser/sessions${this.environmentMainService.isBuilt?"":"-dev"}.html`).toString(!0):i=st.asBrowserUri(`vs/code/electron-browser/workbench/workbench${this.environmentMainService.isBuilt?"":"-dev"}.html`).toString(!0),this._win.loadURL(i);let o=this.wasLoaded;this.wasLoaded=!0,!this.environmentMainService.isBuilt&&!this.environmentMainService.extensionTestsLocationURI&&this._register(new gr(()=>{this._win&&!this._win.isVisible()&&!this._win.isMinimized()&&(this._win.show(),this.focus({mode:2}),this._win.webContents.openDevTools())},1e4)).schedule(),this._onWillLoad.fire({workspace:e.workspace,reason:t.isReload?3:o?2:1})}updateConfiguration(e,t){let i=(this._config??this.pendingLoadConfig)?.userEnv;if(i){let o=an(i)&&!an(e.userEnv),s=this.isExtensionDevelopmentHost;(o||s)&&(e.userEnv={...i,...e.userEnv})}process.env.CHROME_CRASHPAD_PIPE_NAME&&Object.assign(e.userEnv,{CHROME_CRASHPAD_PIPE_NAME:process.env.CHROME_CRASHPAD_PIPE_NAME}),t.disableExtensions!==void 0&&(e["disable-extensions"]=t.disableExtensions);try{e.handle=H.wrap(this._win.getNativeWindowHandle())}catch(o){this.logService.error(`Error getting native window handle: ${o}`)}e.fullscreen=this.isFullScreen,e.maximized=this._win.isMaximized(),e.partsSplash=this.themeMainService.getWindowSplash(e.workspace),e.zoomLevel=this.getZoomLevel(),e.isCustomZoomLevel=typeof this.customZoomLevel=="number",e.isCustomZoomLevel&&e.partsSplash&&(e.partsSplash.zoomLevel=e.zoomLevel),Ve("code/willOpenNewWindow"),e.perfMarks=Ep(),this.configObjectUrl.update(e)}async reload(e){let t=Object.assign({},this._config);t.workspace=await this.validateWorkspaceBeforeReload(t),delete t.filesToOpenOrCreate,delete t.filesToDiff,delete t.filesToMerge,delete t.filesToWait,this.isExtensionDevelopmentHost&&e&&(t.verbose=e.verbose,t.debugId=e.debugId,t.extensionEnvironment=e.extensionEnvironment,t["inspect-extensions"]=e["inspect-extensions"],t["inspect-brk-extensions"]=e["inspect-brk-extensions"],t["extensions-dir"]=e["extensions-dir"]),t.accessibilitySupport=mi.app.isAccessibilitySupportEnabled(),t.isInitialStartup=!1,t.policiesData=this.policyService.serialize(),t.continueOn=this.environmentMainService.continueOn,t.profiles={all:this.userDataProfilesService.profiles,profile:this.profile||this.userDataProfilesService.defaultProfile,home:this.userDataProfilesService.profilesHome},t.logLevel=this.loggerMainService.getLogLevel(),t.loggers=this.loggerMainService.getGlobalLoggers(),this.load(t,{isReload:!0,disableExtensions:e?.["disable-extensions"]})}async validateWorkspaceBeforeReload(e){if(ct(e.workspace)){let t=e.workspace.configPath;if(t.scheme===W.file&&!await this.fileService.exists(t))return}else if($t(e.workspace)){let t=e.workspace.uri;if(t.scheme===W.file&&!await this.fileService.exists(t))return}return e.workspace}serializeWindowState(){if(!this._win)return Dn();if(this.isFullScreen){let i;try{i=mi.screen.getDisplayMatching(this.getBounds())}catch{}let o=Dn();return{mode:3,display:i?i.id:void 0,width:this.windowState.width||o.width,height:this.windowState.height||o.height,x:this.windowState.x||0,y:this.windowState.y||0,zoomLevel:this.customZoomLevel}}let e=Object.create(null),t;if(!V&&this._win.isMaximized()?t=0:t=1,t===0?e.mode=0:e.mode=1,t===1||t===0){let i;t===1?i=this.getBounds():i=this._win.getNormalBounds(),e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height}return e.zoomLevel=this.customZoomLevel,e}restoreWindowState(e){Ve("code/willRestoreCodeWindowState");let t=!1;if(e){this.customZoomLevel=e.zoomLevel;try{let i=mi.screen.getAllDisplays();t=i.length>1,e=pl.validateWindowState(this.logService,e,i)}catch(i){this.logService.warn(`Unexpected error validating window state: ${i}
${i.stack}`)}}return Ve("code/didRestoreCodeWindowState"),[e||Dn(),t]}getBounds(){let[e,t]=this._win.getPosition(),[i,o]=this._win.getSize();return{x:e,y:t,width:i,height:o}}setFullScreen(e,t){super.setFullScreen(e,t),this.sendWhenReady(e?"vscode:enterFullScreen":"vscode:leaveFullScreen",Ce.None),this.currentMenuBarVisibility&&this.setMenuBarVisibility(this.currentMenuBarVisibility,!1)}getMenuBarVisibility(){let e=uP(this.configurationService);return["visible","toggle","hidden"].indexOf(e)<0&&(e="classic"),e}setMenuBarVisibility(e,t=!0){V||(e==="toggle"&&t&&this.send("vscode:showInfoMessage",h(2875,null)),e==="hidden"?setTimeout(()=>{this.doSetMenuBarVisibility(e)}):this.doSetMenuBarVisibility(e))}doSetMenuBarVisibility(e){let t=this.isFullScreen;switch(e){case"classic":this._win.setMenuBarVisibility(!t),this._win.autoHideMenuBar=t;break;case"visible":this._win.setMenuBarVisibility(!0),this._win.autoHideMenuBar=!1;break;case"toggle":this._win.setMenuBarVisibility(!1),this._win.autoHideMenuBar=!0;break;case"hidden":this._win.setMenuBarVisibility(!1),this._win.autoHideMenuBar=!1;break}}notifyZoomLevel(e){this.customZoomLevel=e}getZoomLevel(){return typeof this.customZoomLevel=="number"?this.customZoomLevel:this.configurationService.getValue("window")?.zoomLevel}close(){this._win?.close()}sendWhenReady(e,t,...i){this.isReady?this.send(e,...i):this.ready().then(()=>{t.isCancellationRequested||this.send(e,...i)})}send(e,...t){if(this._win){if(this._win.isDestroyed()||this._win.webContents.isDestroyed()){this.logService.warn(`Sending IPC message to channel '${e}' for window that is destroyed`);return}try{this._win.webContents.send(e,...t)}catch(i){this.logService.warn(`Error sending IPC message to channel '${e}' of window ${this._id}: ${_r(i)}`)}}}updateTouchBar(e){V&&this.touchBarGroups.forEach((t,i)=>{let o=e[i];t.segments=this.createTouchBarGroupSegments(o)})}createTouchBar(){if(V){for(let e=0;e<10;e++){let t=this.createTouchBarGroup();this.touchBarGroups.push(t)}this._win.setTouchBar(new mi.TouchBar({items:this.touchBarGroups}))}}createTouchBarGroup(e=[]){let t=this.createTouchBarGroupSegments(e),i=new mi.TouchBar.TouchBarSegmentedControl({segments:t,mode:"buttons",segmentStyle:"automatic",change:o=>{this.sendWhenReady("vscode:runAction",Ce.None,{id:i.segments[o].id,from:"touchbar"})}});return i}createTouchBarGroupSegments(e=[]){return e.map(i=>{let o;i.icon&&!lc.isThemeIcon(i.icon)&&i.icon?.dark?.scheme===W.file&&(o=mi.nativeImage.createFromPath(x.revive(i.icon.dark).fsPath),o.isEmpty()&&(o=void 0));let s;return typeof i.title=="string"?s=i.title:s=i.title.value,{id:i.id,label:o?void 0:s,icon:o}})}async startCollectingJScallStacks(){if(!this.jsCallStackCollector.isTriggered()){let e=await this._win?.webContents.mainFrame.collectJavaScriptCallStack();if(e){let t=this.jsCallStackMap.get(e)||0;this.jsCallStackMap.set(e,t+1)}this.jsCallStackCollector.trigger(()=>this.startCollectingJScallStacks())}}stopCollectingJScallStacks(){if(this.jsCallStackCollectorStopScheduler.cancel(),this.jsCallStackCollector.cancel(),this.jsCallStackMap.size){let e=`CodeWindow unresponsive samples:
`,t=0,i=Array.from(this.jsCallStackMap.entries()).sort((o,s)=>s[1]-o[1]);for(let[o,s]of i){if(t+=s,Math.round(s*100/this.jsCallStackEffectiveSampleCount)>20){let a=new Cw(o,this.id,this._win?.webContents.getOSProcessId());xa.onUnexpectedError(a)}e+=`<${s}> ${o}
`}e+=`Total Samples: ${t}
`,e+="For full overview of the unresponsive period, capture cpu profile via https://aka.ms/vscode-tracing-cpu-profile",this.logService.error(e)}this.jsCallStackMap.clear()}matches(e){return this._win?.webContents.id===e.id}dispose(){super.dispose(),this.loggerMainService.deregisterLoggers(this.id)}};ca=E([g(1,B),g(2,dn),g(3,_e),g(4,Ui),g(5,Ur),g(6,Me),g(7,Ir),g(8,ts),g(9,ue),g(10,An),g(11,pi),g(12,Wn),g(13,Ke),g(14,ui),g(15,ye),g(16,Te),g(17,ac),g(18,qe),g(19,Et),g(20,Ht)],ca);Cw=class extends Error{constructor(r,e,t=0){let i=Error.stackTraceLimit;Error.stackTraceLimit=0,super(`UnresponsiveSampleError: from window with ID ${e} belonging to process with pid ${t}`),Error.stackTraceLimit=i,this.name="UnresponsiveSampleError",this.stack=r}}});import cc from"electron";function RM(n){let r={openedWindows:[]},e=n||{openedWindows:[]};return e.lastActiveWindow&&(r.lastActiveWindow=_w(e.lastActiveWindow)),e.lastPluginDevelopmentHostWindow&&(r.lastPluginDevelopmentHostWindow=_w(e.lastPluginDevelopmentHostWindow)),Array.isArray(e.openedWindows)&&(r.openedWindows=e.openedWindows.map(t=>_w(t))),r}function _w(n){let r={uiState:n.uiState};return n.backupPath&&(r.backupPath=n.backupPath),n.remoteAuthority&&(r.remoteAuthority=n.remoteAuthority),n.folder&&(r.folderUri=x.parse(n.folder)),n.workspaceIdentifier&&(r.workspace={id:n.workspaceIdentifier.id,configPath:x.parse(n.workspaceIdentifier.configURIPath)}),r}function DM(n){return{lastActiveWindow:n.lastActiveWindow&&kw(n.lastActiveWindow),lastPluginDevelopmentHostWindow:n.lastPluginDevelopmentHostWindow&&kw(n.lastPluginDevelopmentHostWindow),openedWindows:n.openedWindows.map(r=>kw(r))}}function kw(n){return{workspaceIdentifier:n.workspace&&{id:n.workspace.id,configURIPath:n.workspace.configPath.toString()},folder:n.folderUri?.toString(),backupPath:n.backupPath,remoteAuthority:n.remoteAuthority,uiState:n.uiState}}var Po,zC=I(()=>{$();X();gt();ce();et();Ct();te();xi();Kt();tn();Rr();Po=class extends T{constructor(e,t,i,o,s){super();this.windowsMainService=e;this.stateService=t;this.lifecycleMainService=i;this.logService=o;this.configurationService=s;this.lastClosedState=void 0;this.shuttingDown=!1;this._state=RM(this.stateService.getItem(Po.windowsStateStorageKey)),this.registerListeners()}static{this.windowsStateStorageKey="windowsState"}get state(){return this._state}registerListeners(){cc.app.on("browser-window-blur",()=>{this.shuttingDown||this.saveWindowsState()}),this._register(this.lifecycleMainService.onBeforeCloseWindow(e=>this.onBeforeCloseWindow(e))),this._register(this.lifecycleMainService.onBeforeShutdown(()=>this.onBeforeShutdown())),this._register(this.windowsMainService.onDidChangeWindowsCount(e=>{e.newCount-e.oldCount>0&&(this.lastClosedState=void 0)})),this._register(this.windowsMainService.onDidDestroyWindow(e=>this.onBeforeCloseWindow(e)))}onBeforeShutdown(){this.shuttingDown=!0,this.saveWindowsState()}saveWindowsState(){let e=new Set,t={openedWindows:[],lastPluginDevelopmentHostWindow:this._state.lastPluginDevelopmentHostWindow,lastActiveWindow:this.lastClosedState};if(!t.lastActiveWindow){let s=this.windowsMainService.getLastActiveWindow();(!s||s.isExtensionDevelopmentHost)&&(s=this.windowsMainService.getWindows().find(a=>!a.isExtensionDevelopmentHost)),s&&(t.lastActiveWindow=this.toWindowState(s),t.lastActiveWindow.uiState.mode===3&&e.add(t.lastActiveWindow.uiState.display))}let i=this.windowsMainService.getWindows().find(s=>s.isExtensionDevelopmentHost&&!s.isExtensionTestHost);i&&(t.lastPluginDevelopmentHostWindow=this.toWindowState(i),t.lastPluginDevelopmentHostWindow.uiState.mode===3&&(e.has(t.lastPluginDevelopmentHostWindow.uiState.display)?V&&!i.win?.isSimpleFullScreen()&&(t.lastPluginDevelopmentHostWindow.uiState.mode=1):e.add(t.lastPluginDevelopmentHostWindow.uiState.display))),this.windowsMainService.getWindowCount()>1&&(t.openedWindows=this.windowsMainService.getWindows().filter(s=>!s.isExtensionDevelopmentHost).map(s=>{let a=this.toWindowState(s);return a.uiState.mode===3&&(e.has(a.uiState.display)?V&&a.windowId!==t.lastActiveWindow?.windowId&&!s.win?.isSimpleFullScreen()&&(a.uiState.mode=1):e.add(a.uiState.display)),a}));let o=DM(t);this.stateService.setItem(Po.windowsStateStorageKey,o),this.shuttingDown&&this.logService.trace("[WindowsStateHandler] onBeforeShutdown",o)}onBeforeCloseWindow(e){if(this.lifecycleMainService.quitRequested)return;let t=this.toWindowState(e);e.isExtensionDevelopmentHost&&!e.isExtensionTestHost?this._state.lastPluginDevelopmentHostWindow=t:!e.isExtensionDevelopmentHost&&e.openedWorkspace&&this._state.openedWindows.forEach(i=>{let o=ct(e.openedWorkspace)&&i.workspace?.id===e.openedWorkspace.id,s=$t(e.openedWorkspace)&&i.folderUri&&Je.isEqual(i.folderUri,e.openedWorkspace.uri);(o||s)&&(i.uiState=t.uiState)}),this.windowsMainService.getWindowCount()===1&&(this.lastClosedState=t)}toWindowState(e){return{windowId:e.id,workspace:ct(e.openedWorkspace)?e.openedWorkspace:void 0,folderUri:$t(e.openedWorkspace)?e.openedWorkspace.uri:void 0,backupPath:e.backupPath,remoteAuthority:e.remoteAuthority,uiState:e.serializeWindowState()}}getNewWindowState(e){let t=this.doGetNewWindowState(e),i=this.configurationService.getValue("window");if(t.mode===3){let o;t.hasDefaultState?o=!!(i?.newWindowDimensions&&["fullscreen","inherit","offset"].indexOf(i.newWindowDimensions)>=0):o=!!(this.lifecycleMainService.wasRestarted||i?.restoreFullscreen),o||(t.mode=1)}return t}doGetNewWindowState(e){let t=this.windowsMainService.getLastActiveWindow();if(!e.extensionTestsPath){if(e.extensionDevelopmentPath&&this.state.lastPluginDevelopmentHostWindow)return this.state.lastPluginDevelopmentHostWindow.uiState;let c=e.workspace;if(ct(c)){let u=this.state.openedWindows.filter(f=>f.workspace&&f.workspace.id===c.id).map(f=>f.uiState);if(u.length)return u[0]}if($t(c)){let u=this.state.openedWindows.filter(f=>f.folderUri&&Je.isEqual(f.folderUri,c.uri)).map(f=>f.uiState);if(u.length)return u[0]}else if(e.backupPath){let u=this.state.openedWindows.filter(f=>f.backupPath===e.backupPath).map(f=>f.uiState);if(u.length)return u[0]}let d=this.lastClosedState||this.state.lastActiveWindow;if(!t&&d)return d.uiState}let i,o=cc.screen.getAllDisplays();if(o.length===1)i=o[0];else{if(V){let c=cc.screen.getCursorScreenPoint();i=cc.screen.getDisplayNearestPoint(c)}!i&&t&&(i=cc.screen.getDisplayMatching(t.getBounds())),i||(i=cc.screen.getPrimaryDisplay()||o[0])}let s=Dn(void 0,ct(e.workspace)||$t(e.workspace));s.x=Math.round(i.bounds.x+i.bounds.width/2-s.width/2),s.y=Math.round(i.bounds.y+i.bounds.height/2-s.height/2);let a=this.configurationService.getValue("window"),l=!0;if(a?.newWindowDimensions){if(a.newWindowDimensions==="maximized")s.mode=0,l=!1;else if(a.newWindowDimensions==="fullscreen")s.mode=3,l=!1;else if((a.newWindowDimensions==="inherit"||a.newWindowDimensions==="offset")&&t){let c=t.serializeWindowState();c.mode===3?s.mode=3:s={...c,zoomLevel:void 0},l=s.mode!==3&&a.newWindowDimensions==="offset"}}return l&&(s=this.ensureNoOverlap(s)),s.hasDefaultState=!0,s}ensureNoOverlap(e){if(this.windowsMainService.getWindows().length===0)return e;e.x=typeof e.x=="number"?e.x:0,e.y=typeof e.y=="number"?e.y:0;let t=this.windowsMainService.getWindows().map(i=>i.getBounds());for(;t.some(i=>i.x===e.x||i.y===e.y);)e.x+=30,e.y+=30;return e}};Po=E([g(0,qe),g(1,Et),g(2,ye),g(3,B),g(4,ue)],Po)});import{spawn as AM}from"child_process";var $h,dc,Rw=I(()=>{we();ze();_s();si();Z();te();$h=O("ICSSDevelopmentService"),dc=class{constructor(r,e){this.envService=r;this.logService=e}get isEnabled(){return!this.envService.isBuilt}getCssModules(){return this._cssModules??=this.computeCssModules(),this._cssModules}async computeCssModules(){if(!this.isEnabled)return[];let r=await import("@vscode/ripgrep");return await new Promise(e=>{let t=ii.create(),i=[],o=st.asFileUri("").fsPath,s=AM(r.rgPath,["-g","**/*.css","--files","--no-ignore",o],{});s.stdout.on("data",a=>{i.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(i).toString("utf8"),l=a.split(`
`).filter(Boolean).map(c=>Np(o,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(t.elapsed())}ms)`)})})}};dc=E([g(0,wi),g(1,B)],dc)});import*as jC from"fs";import{app as LM,BrowserWindow as qh,shell as MM}from"electron";import{hostname as OM,release as FM,arch as WM}from"os";function op(n){return ct(n?.workspace)}function uc(n){return $t(n?.workspace)}var Dw,pc,GC=I(()=>{Ha();Jt();wt();zi();q();ni();so();$();ze();we();hn();X();yi();gt();Oe();ce();xe();Sl();et();Qs();Lt();je();Z();Ct();te();xd();Hh();_l();xi();Jo();Tw();Kt();zy();zC();Rr();bm();Xu();is();tn();dl();cn();es();Xl();Ll();Rw();Cr();ot();Dw=Object.create(null);pc=class extends T{constructor(e,t,i,o,s,a,l,c,d,u,f,m,v,y,C,w,_,D,k,A,de,L){super();this.machineId=e;this.sqmId=t;this.devDeviceId=i;this.initialUserEnv=o;this.logService=s;this.loggerService=a;this.policyService=c;this.environmentMainService=d;this.userDataProfilesMainService=u;this.lifecycleMainService=f;this.backupMainService=m;this.configurationService=v;this.workspacesHistoryMainService=y;this.workspacesManagementMainService=C;this.instantiationService=w;this.dialogMainService=_;this.fileService=D;this.protocolMainService=k;this.themeMainService=A;this.auxiliaryWindowsMainService=de;this.cssDevelopmentService=L;this._onDidOpenWindow=this._register(new b);this.onDidOpenWindow=this._onDidOpenWindow.event;this._onDidSignalReadyWindow=this._register(new b);this.onDidSignalReadyWindow=this._onDidSignalReadyWindow.event;this._onDidDestroyWindow=this._register(new b);this.onDidDestroyWindow=this._onDidDestroyWindow.event;this._onDidChangeWindowsCount=this._register(new b);this.onDidChangeWindowsCount=this._onDidChangeWindowsCount.event;this._onDidMaximizeWindow=this._register(new b);this.onDidMaximizeWindow=this._onDidMaximizeWindow.event;this._onDidUnmaximizeWindow=this._register(new b);this.onDidUnmaximizeWindow=this._onDidUnmaximizeWindow.event;this._onDidChangeFullScreen=this._register(new b);this.onDidChangeFullScreen=this._onDidChangeFullScreen.event;this._onDidTriggerSystemContextMenu=this._register(new b);this.onDidTriggerSystemContextMenu=this._onDidTriggerSystemContextMenu.event;this.windows=new Map;this.windowsStateHandler=this._register(new Po(this,l,this.lifecycleMainService,this.logService,this.configurationService)),this.registerListeners()}registerListeners(){this._register(this.workspacesManagementMainService.onDidEnterWorkspace(e=>this._onDidSignalReadyWindow.fire(e.window))),this._register(this.onDidSignalReadyWindow(e=>{if(e.config?.extensionDevelopmentPath||e.config?.extensionTestsPath){let t=new j;if(t.add(S.any(e.onDidClose,e.onDidDestroy)(()=>t.dispose())),e.config.extensionDevelopmentPath)for(let i of e.config.extensionDevelopmentPath)t.add(this.protocolMainService.addValidFileRoot(i));e.config.extensionTestsPath&&t.add(this.protocolMainService.addValidFileRoot(e.config.extensionTestsPath))}}))}openEmptyWindow(e,t){let i=this.environmentMainService.args,o=t?.remoteAuthority||void 0,s=!0,a=t?.forceReuseWindow,l=!a;return this.open({...e,cli:i,forceEmpty:s,forceNewWindow:l,forceReuseWindow:a,remoteAuthority:o,forceTempProfile:t?.forceTempProfile,forceProfile:t?.forceProfile})}openExistingWindow(e,t){e.focus(),this.handleWaitMarkerFile(t,[e]),this.handleChatRequest(t,[e])}async openAgentsWindow(e){return this.logService.trace("windowsManager#openAgentsWindow"),this.open(await this.ensureAgentsWindow(e))}async ensureAgentsWindow(e){let t=this.environmentMainService.agentSessionsWorkspace;if(!t)throw new Error("Agents workspace is not configured");if(!await this.fileService.exists(t)){let o=JSON.stringify({folders:[]},null,"	");await this.fileService.writeFile(t,H.fromString(o))}return{urisToOpen:[{workspaceUri:t}],userEnv:e.userEnv,cli:e.cli,noRecentEntry:!0,context:e.context,contextWindowId:e.contextWindowId,initialStartup:e.initialStartup,forceNewWindow:e.forceNewWindow}}async open(e){this.logService.trace("windowsManager#open");let t=process.isEmbeddedApp;t&&(e=await this.ensureAgentsWindow(e)),(e.addMode||e.removeMode)&&(e.initialStartup||!this.getLastActiveWindow())&&(e.addMode=!1,e.removeMode=!1);let i=[],o=[],s=[],a=[],l=[],c=[],d,u=!1,f=await this.getPathsToOpen(e);this.logService.trace("windowsManager#open pathsToOpen",f);for(let w of f)uc(w)?e.addMode?i.push(w):e.removeMode?o.push(w):s.push(w):op(w)?a.push(w):w.fileUri?(d||(d={filesToOpenOrCreate:[],filesToDiff:[],filesToMerge:[],remoteAuthority:w.remoteAuthority}),d.filesToOpenOrCreate.push(w)):w.backupPath?c.push({backupFolder:Pe(w.backupPath),remoteAuthority:w.remoteAuthority}):u=!0;e.diffMode&&d&&d.filesToOpenOrCreate.length>=2&&(d.filesToDiff=d.filesToOpenOrCreate.slice(0,2),d.filesToOpenOrCreate=[]),e.mergeMode&&d&&d.filesToOpenOrCreate.length===4&&(d.filesToMerge=d.filesToOpenOrCreate.slice(0,4),d.filesToOpenOrCreate=[],d.filesToDiff=[]),d&&e.waitMarkerFileURI&&(d.filesToWait={paths:at([...d.filesToDiff,d.filesToMerge[3],...d.filesToOpenOrCreate]),waitMarkerFileUri:e.waitMarkerFileURI}),e.initialStartup&&!t?(l.push(...this.workspacesManagementMainService.getUntitledWorkspaces()),a.push(...l),c.push(...this.backupMainService.getEmptyWindowBackups())):c.length=0;let{windows:m,filesOpenedInWindow:v}=await this.doOpen(e,a,s,c,u,d,i,o);if(this.logService.trace(`windowsManager#open used window count ${m.length} (workspacesToOpen: ${a.length}, foldersToOpen: ${s.length}, emptyToRestore: ${c.length}, maybeOpenEmptyWindow: ${u})`),m.length>1)if(v)v.focus();else{let w=this.windowsStateHandler.state.lastActiveWindow&&!e.forceEmpty&&!e.cli._.length&&!e.cli["file-uri"]&&!e.cli["folder-uri"]&&!e.urisToOpen?.length,_=!0,D=!0;if(w){let k=m.filter(A=>this.windowsStateHandler.state.lastActiveWindow&&A.backupPath===this.windowsStateHandler.state.lastActiveWindow.backupPath);k.length&&(k[0].focus(),_=!1,D=!1)}if(_)for(let k=m.length-1;k>=0;k--){let A=m[k];if(!(A.openedWorkspace&&l.some(de=>A.openedWorkspace&&de.workspace.id===A.openedWorkspace.id)||A.backupPath&&c.some(de=>A.backupPath&&de.backupFolder===Pe(A.backupPath)))){A.focus(),D=!1;break}}D&&m[m.length-1].focus()}let y=d&&d.filesToDiff.length>0,C=d&&d.filesToMerge.length>0;if(!m.some(w=>w.isExtensionDevelopmentHost)&&!y&&!C&&!e.noRecentEntry){let w=[];for(let _ of f)op(_)&&!_.transient?w.push({label:_.label,workspace:_.workspace,remoteAuthority:_.remoteAuthority}):uc(_)?w.push({label:_.label,folderUri:_.workspace.uri,remoteAuthority:_.remoteAuthority}):_.fileUri&&w.push({label:_.label,fileUri:_.fileUri,remoteAuthority:_.remoteAuthority});this.workspacesHistoryMainService.addRecentlyOpened(w)}return this.handleWaitMarkerFile(e,m),this.handleChatRequest(e,m),this.handleOpenChatSession(e,m),m}handleWaitMarkerFile(e,t){let i=e.waitMarkerFileURI;e.context===0&&i&&t.length===1&&t[0]&&(async()=>{await t[0].whenClosedOrLoaded;try{await this.fileService.del(i)}catch{}})()}handleChatRequest(e,t){if(e.context!==0||!e.cli.chat||t.length===0)return;let i;if(t.length===1)i=t[0];else{let o=e.cli._[0];o&&(i=vo(t,x.file(o)))}i&&(i.sendWhenReady("vscode:handleChatRequest",Ce.None,e.cli.chat),i.focus())}handleOpenChatSession(e,t){let i=e.cli["open-chat-session"];if(!i||t.length===0)return;let o=t[0];o.sendWhenReady("vscode:openChatSession",Ce.None,i),o.focus()}async doOpen(e,t,i,o,s,a,l,c){let d=[],u;function f(D,k){d.push(D),k&&(u=D,a=void 0)}let{openFolderInNewWindow:m,openFilesInNewWindow:v}=this.shouldOpenNewWindow(e);if(!e.initialStartup&&(l.length>0||c.length>0)){let D=l.at(0)?.remoteAuthority??c.at(0)?.remoteAuthority,k=this.getLastActiveWindowForAuthority(D);k&&f(this.doAddRemoveFoldersInExistingWindow(k,l.map(A=>A.workspace.uri),c.map(A=>A.workspace.uri)))}let y=i.length+t.length+o.length;if(a&&y===0){let D=a.filesToOpenOrCreate[0]||a.filesToDiff[0]||a.filesToMerge[3],k=this.getWindows().filter(de=>a&&Or(de.remoteAuthority,a.remoteAuthority)),A;D?.fileUri&&!v&&((e.context===4||e.context===0||e.context===1||e.context===6)&&(A=await NP(k,D.fileUri,async de=>de.configPath.scheme===W.file?this.workspacesManagementMainService.resolveLocalWorkspace(de.configPath):void 0)),A||(A=this.doGetLastActiveWindow(k))),A?ct(A.openedWorkspace)?t.push({workspace:A.openedWorkspace,remoteAuthority:A.remoteAuthority}):$t(A.openedWorkspace)?i.push({workspace:A.openedWorkspace,remoteAuthority:A.remoteAuthority}):f(this.doOpenFilesInExistingWindow(e,A,a),!0):f(await this.openInBrowserWindow({userEnv:e.userEnv,cli:e.cli,initialStartup:e.initialStartup,filesToOpen:a,forceNewWindow:!0,remoteAuthority:a.remoteAuthority,forceNewTabbedWindow:e.forceNewTabbedWindow,forceProfile:e.forceProfile,forceTempProfile:e.forceTempProfile}),!0)}let C=Mr(t,D=>D.workspace.id);if(C.length>0){let D=at(C.map(k=>vo(this.getWindows(),k.workspace.configPath)));if(D.length>0){let k=D[0],A=Or(a?.remoteAuthority,k.remoteAuthority)?a:void 0;f(this.doOpenFilesInExistingWindow(e,k,A),!!A),m=!0}for(let k of C){if(D.some(L=>L.openedWorkspace&&L.openedWorkspace.id===k.workspace.id))continue;let A=k.remoteAuthority,de=Or(a?.remoteAuthority,A)?a:void 0;f(await this.doOpenFolderOrWorkspace(e,k,m,de),!!de),m=!0}}let w=Mr(i,D=>Je.getComparisonKey(D.workspace.uri));if(w.length>0){let D=at(w.map(k=>vo(this.getWindows(),k.workspace.uri)));if(D.length>0){let k=D[0],A=Or(a?.remoteAuthority,k.remoteAuthority)?a:void 0;f(this.doOpenFilesInExistingWindow(e,k,A),!!A),m=!0}for(let k of w){if(D.some(L=>$t(L.openedWorkspace)&&Je.isEqual(L.openedWorkspace.uri,k.workspace.uri)))continue;let A=k.remoteAuthority,de=Or(a?.remoteAuthority,A)?a:void 0;f(await this.doOpenFolderOrWorkspace(e,k,m,de),!!de),m=!0}}let _=Mr(o,D=>D.backupFolder);if(_.length>0)for(let D of _){let k=D.remoteAuthority,A=Or(a?.remoteAuthority,k)?a:void 0;f(await this.doOpenEmpty(e,!0,k,A,D),!!A),m=!0}if(a||s&&(e.forceEmpty||d.length===0)){let D=a?a.remoteAuthority:e.remoteAuthority;f(await this.doOpenEmpty(e,m,D,a),!!a)}return{windows:Mr(d),filesOpenedInWindow:u}}doOpenFilesInExistingWindow(e,t,i){this.logService.trace("windowsManager#doOpenFilesInExistingWindow",{filesToOpen:i}),this.focusMainOrChildWindow(t);let o={filesToOpenOrCreate:i?.filesToOpenOrCreate,filesToDiff:i?.filesToDiff,filesToMerge:i?.filesToMerge,filesToWait:i?.filesToWait,termProgram:e?.userEnv?.TERM_PROGRAM};return t.sendWhenReady("vscode:openFiles",Ce.None,o),t}focusMainOrChildWindow(e){let t=e,i=qh.getFocusedWindow();if(i&&i.id!==e.id){let o=this.auxiliaryWindowsMainService.getWindowByWebContents(i.webContents);o&&o.parentId===e.id&&(t=o)}t.focus()}doAddRemoveFoldersInExistingWindow(e,t,i){this.logService.trace("windowsManager#doAddRemoveFoldersToExistingWindow",{foldersToAdd:t,foldersToRemove:i}),e.focus();let o={foldersToAdd:t,foldersToRemove:i};return e.sendWhenReady("vscode:addRemoveFolders",Ce.None,o),e}doOpenEmpty(e,t,i,o,s){this.logService.trace("windowsManager#doOpenEmpty",{restore:!!s,remoteAuthority:i,filesToOpen:o,forceNewWindow:t});let a;return!t&&typeof e.contextWindowId=="number"&&(a=this.getWindowById(e.contextWindowId)),this.openInBrowserWindow({userEnv:e.userEnv,cli:e.cli,initialStartup:e.initialStartup,remoteAuthority:i,forceNewWindow:t,forceNewTabbedWindow:e.forceNewTabbedWindow,filesToOpen:o,windowToUse:a,emptyWindowBackupInfo:s,forceProfile:e.forceProfile,forceTempProfile:e.forceTempProfile})}doOpenFolderOrWorkspace(e,t,i,o,s){return this.logService.trace("windowsManager#doOpenFolderOrWorkspace",{folderOrWorkspace:t,filesToOpen:o}),!i&&!s&&typeof e.contextWindowId=="number"&&(s=this.getWindowById(e.contextWindowId)),this.openInBrowserWindow({workspace:t.workspace,userEnv:e.userEnv,cli:e.cli,initialStartup:e.initialStartup,remoteAuthority:t.remoteAuthority,forceNewWindow:i,forceNewTabbedWindow:e.forceNewTabbedWindow,filesToOpen:o,windowToUse:s,forceProfile:e.forceProfile,forceTempProfile:e.forceTempProfile})}async getPathsToOpen(e){let t,i=!1,o=!1;if(e.urisToOpen&&e.urisToOpen.length>0?(t=await this.doExtractPathsFromAPI(e),i=!0):e.forceEmpty?t=[Dw]:e.cli._.length||e.cli["folder-uri"]||e.cli["file-uri"]?(t=await this.doExtractPathsFromCLI(e.cli),t.length===0&&t.push(Dw),i=!0):(t=await this.doGetPathsFromLastSession(),t.length===0&&t.push(Dw),o=!0),!e.addMode&&!e.removeMode&&i){let s=t.filter(a=>uc(a));if(s.length>1){let a=s[0].remoteAuthority;if(s.every(l=>Or(l.remoteAuthority,a))){let l,c=await this.doGetWorkspaceMatchingFoldersFromLastSession(a,s);c?l=c:l=await this.workspacesManagementMainService.createUntitledWorkspace(s.map(d=>({uri:d.workspace.uri}))),t.push({workspace:l,remoteAuthority:a}),t=t.filter(d=>!uc(d))}}}if(e.initialStartup&&!o&&this.configurationService.getValue("window")?.restoreWindows==="preserve"){let s=await this.doGetPathsFromLastSession();t.unshift(...s.filter(a=>op(a)||uc(a)||a.backupPath))}return t}async doExtractPathsFromAPI(e){let t={gotoLineMode:e.gotoLineMode,remoteAuthority:e.remoteAuthority},i=await Promise.all(at(e.urisToOpen||[]).map(async o=>{let s=await this.resolveOpenable(o,t);if(s)return s.label=o.label,s;let a=this.resourceFromOpenable(o);this.dialogMainService.showMessageBox({type:"info",buttons:[h(2885,null)],message:a.scheme===W.file?h(2887,null):h(2889,null),detail:a.scheme===W.file?h(2886,null,oo(a,{os:Ut,tildify:this.environmentMainService})):h(2888,null,a.toString(!0))},qh.getFocusedWindow()??void 0)}));return at(i)}async doExtractPathsFromCLI(e){let t=[],i={ignoreFileNotFound:!0,gotoLineMode:e.goto,remoteAuthority:e.remote||void 0,forceOpenWorkspaceAsFile:e.diff&&e._.length===2||e.merge&&e._.length===4},o=e["folder-uri"];if(o){let l=await Promise.all(o.map(c=>{let d=this.cliArgToUri(c);if(d)return this.resolveOpenable({folderUri:d},i)}));t.push(...at(l))}let s=e["file-uri"];if(s){let l=await Promise.all(s.map(c=>{let d=this.cliArgToUri(c);if(d)return this.resolveOpenable(kn(c)?{workspaceUri:d}:{fileUri:d},i)}));t.push(...at(l))}let a=await Promise.all(e._.map(l=>i.remoteAuthority?this.doResolveRemotePath(l,i):this.doResolveFilePath(l,i)));return t.push(...at(a)),t}cliArgToUri(e){try{let t=x.parse(e);if(!t.scheme){this.logService.error(`Invalid URI input string, scheme missing: ${e}`);return}return t.path?t:t.with({path:"/"})}catch(t){this.logService.error(`Invalid URI input string: ${e}, ${t.message}`)}}async doGetPathsFromLastSession(){let e=this.getRestoreWindowsSetting();switch(e){case"none":return[];case"one":case"all":case"preserve":case"folders":{let t=[];e!=="one"&&t.push(...this.windowsStateHandler.state.openedWindows),this.windowsStateHandler.state.lastActiveWindow&&t.push(this.windowsStateHandler.state.lastActiveWindow);let i=this.environmentMainService.agentSessionsWorkspace,o=await Promise.all(t.map(async s=>{if(s.workspace){if(i&&Na(s.workspace.configPath,i))return;let a=await this.resolveOpenable({workspaceUri:s.workspace.configPath},{remoteAuthority:s.remoteAuthority,rejectTransientWorkspaces:!0});if(op(a))return a}else if(s.folderUri){let a=await this.resolveOpenable({folderUri:s.folderUri},{remoteAuthority:s.remoteAuthority});if(uc(a))return a}else if(e!=="folders"&&s.backupPath)return{backupPath:s.backupPath,remoteAuthority:s.remoteAuthority}}));return at(o)}}}getRestoreWindowsSetting(){let e;return this.lifecycleMainService.wasRestarted?e="all":(e=this.configurationService.getValue("window")?.restoreWindows||"all",["preserve","all","folders","one","none"].includes(e)||(e="all")),e}async doGetWorkspaceMatchingFoldersFromLastSession(e,t){let i=(await this.doGetPathsFromLastSession()).filter(s=>op(s)),o=t.map(s=>s.workspace.uri);for(let{workspace:s}of i){let a=await this.workspacesManagementMainService.resolveLocalWorkspace(s.configPath);if(!a||a.remoteAuthority!==e||a.transient||a.folders.length!==t.length)continue;let l=new Ea(o,c=>Je.getComparisonKey(c));if(a.folders.every(c=>l.has(c.uri)))return a}}async resolveOpenable(e,t=Object.create(null)){let i=this.resourceFromOpenable(e);return i.scheme===W.file?(Iy(e)&&(t={...t,forceOpenWorkspaceAsFile:!0}),this.doResolveFilePath(i.fsPath,t)):this.doResolveRemoteOpenable(e,t)}doResolveRemoteOpenable(e,t){let i=this.resourceFromOpenable(e),o=yo(i)||t.remoteAuthority;if(i=g1(sf(i)),Iy(e)){if(t.gotoLineMode){let{path:s,line:a,column:l}=Oa(i.path);return{fileUri:i.with({path:s}),options:{selection:a?{startLineNumber:a,startColumn:l||1}:void 0},remoteAuthority:o}}return{fileUri:i,remoteAuthority:o}}else if(uu(e))return{workspace:ho(i),remoteAuthority:o};return{workspace:wm(i),remoteAuthority:o}}resourceFromOpenable(e){return uu(e)?e.workspaceUri:lm(e)?e.folderUri:e.fileUri}async doResolveFilePath(e,t,i){let o,s;t.gotoLineMode&&({path:e,line:o,column:s}=Oa(e)),e=rf(kt(e),Zr());try{let a=await jC.promises.stat(e);if(a.isFile()){if(!t.forceOpenWorkspaceAsFile){let l=await this.workspacesManagementMainService.resolveLocalWorkspace(x.file(e));if(l)return l.transient&&t.rejectTransientWorkspaces?void 0:{workspace:{id:l.id,configPath:l.configPath},type:1,exists:!0,remoteAuthority:l.remoteAuthority,transient:l.transient}}return{fileUri:x.file(e),type:1,exists:!0,options:{selection:o?{startLineNumber:o,startColumn:s||1}:void 0}}}else{if(a.isDirectory())return{workspace:wm(x.file(e),a),type:2,exists:!0};if(!F&&e==="/dev/null")return{fileUri:x.file(e),type:1,exists:!0}}}catch(a){if(a.code==="ERR_UNC_HOST_NOT_ALLOWED"&&!i)return this.onUNCHostNotAllowed(e,t);let l=x.file(e);if(this.workspacesHistoryMainService.removeRecentlyOpened([l]),t.ignoreFileNotFound&&a.code==="ENOENT")return{fileUri:l,type:1,exists:!1};this.logService.error(`Invalid path provided: ${e}, ${a.message}`)}}async onUNCHostNotAllowed(e,t){let i=x.file(e),{response:o,checkboxChecked:s}=await this.dialogMainService.showMessageBox({type:"warning",buttons:[h(2879,null),h(2880,null),h(2884,null)],message:h(2882,null,i.authority),detail:h(2881,null,oo(i,{os:Ut,tildify:this.environmentMainService})),checkboxLabel:h(2883,null,i.authority),cancelId:1});if(o===0){if(io(i.authority),s){let a={channel:"vscode:configureAllowedUNCHost",args:i.authority};this.sendToFocused(a.channel,a.args),this.sendToOpeningWindow(a.channel,a.args)}return this.doResolveFilePath(e,t,!0)}if(o===2)return MM.openExternal("https://aka.ms/vscode-windows-unc"),this.onUNCHostNotAllowed(e,t)}doResolveRemotePath(e,t){let i=e.charCodeAt(0),o=t.remoteAuthority,s,a;t.gotoLineMode&&({path:e,line:s,column:a}=Oa(e)),i!==47&&(tf(i)&&e.charCodeAt(e.charCodeAt(1))===58&&(e=wn(e)),e=`/${e}`);let l=x.from({scheme:W.vscodeRemote,authority:o,path:e});if(e.charCodeAt(e.length-1)!==47){if(kn(e))return t.forceOpenWorkspaceAsFile?{fileUri:l,options:{selection:s?{startLineNumber:s,startColumn:a||1}:void 0},remoteAuthority:t.remoteAuthority}:{workspace:ho(l),remoteAuthority:o};if(t.gotoLineMode||pe.basename(e).indexOf(".")!==-1)return{fileUri:l,options:{selection:s?{startLineNumber:s,startColumn:a||1}:void 0},remoteAuthority:o}}return{workspace:wm(l),remoteAuthority:o}}shouldOpenNewWindow(e){let t=this.configurationService.getValue("window"),i=t?.openFoldersInNewWindow||"default",o=t?.openFilesInNewWindow||"off",s=(e.preferNewWindow||e.forceNewWindow)&&!e.forceReuseWindow;!e.forceNewWindow&&!e.forceReuseWindow&&(i==="on"||i==="off")&&(s=i==="on");let a=!1;return e.forceNewWindow||e.forceReuseWindow?a=!!e.forceNewWindow&&!e.forceReuseWindow:(V?e.context===1&&(a=!0):e.context!==3&&e.context!==2&&!(e.userEnv&&e.userEnv.TERM_PROGRAM==="vscode")&&(a=!0),!e.cli.extensionDevelopmentPath&&(o==="on"||o==="off")&&(a=o==="on")),{openFolderInNewWindow:!!s,openFilesInNewWindow:a}}async openExtensionDevelopmentHostWindow(e,t){let i=BP(this.getWindows(),e);if(i)return this.lifecycleMainService.reload(i,t.cli),i.focus(),[i];let o=t.cli["folder-uri"]||[],s=t.cli["file-uri"]||[],a=t.cli._;if(!a.length&&!o.length&&!s.length&&!t.cli.extensionTestsPath){let d=this.windowsStateHandler.state.lastPluginDevelopmentHostWindow,u=d?.workspace??d?.folderUri;u&&(x.isUri(u)?u.scheme===W.file?a=[u.fsPath]:o=[u.toString()]:u.configPath.scheme===W.file?a=[hr(u.configPath)]:s=[u.configPath.toString()])}let l=t.remoteAuthority;for(let d of e)if(d.match(/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/)){let u=x.parse(d),f=yo(u);f&&(l?Or(f,l)||this.logService.error("more than one extension development path authority"):l=f)}a=a.filter(d=>{let u=x.file(d);return vo(this.getWindows(),u)?!1:Or(yo(u),l)}),o=o.filter(d=>{let u=this.cliArgToUri(d);return u&&vo(this.getWindows(),u)?!1:u?Or(yo(u),l):!1}),s=s.filter(d=>{let u=this.cliArgToUri(d);return u&&vo(this.getWindows(),u)?!1:u?Or(yo(u),l):!1}),t.cli._=a,t.cli["folder-uri"]=o,t.cli["file-uri"]=s;let c={context:t.context,cli:t.cli,forceNewWindow:!0,forceEmpty:!a.length&&!o.length&&!s.length,userEnv:t.userEnv,noRecentEntry:!0,waitMarkerFileURI:t.waitMarkerFileURI,remoteAuthority:l,forceProfile:t.forceProfile,forceTempProfile:t.forceTempProfile};return this.open(c)}async openInBrowserWindow(e){let t=this.configurationService.getValue("window"),i=this.getLastActiveWindow(),s=(t?.newWindowProfile?this.userDataProfilesMainService.profiles.find(c=>c.name===t.newWindowProfile):void 0)??i?.profile??this.userDataProfilesMainService.defaultProfile,a;!e.forceNewWindow&&!e.forceNewTabbedWindow&&(a=e.windowToUse||i,a&&a.focus());let l={...this.environmentMainService.args,...e.cli,machineId:this.machineId,sqmId:this.sqmId,devDeviceId:this.devDeviceId,isPortable:this.environmentMainService.isPortable,windowId:-1,mainPid:process.pid,appRoot:this.environmentMainService.appRoot,execPath:process.execPath,codeCachePath:this.environmentMainService.codeCachePath,backupPath:e.emptyWindowBackupInfo?N(this.environmentMainService.backupHome,e.emptyWindowBackupInfo.backupFolder):void 0,profiles:{home:this.userDataProfilesMainService.profilesHome,all:this.userDataProfilesMainService.profiles,profile:s},homeDir:this.environmentMainService.userHome.with({scheme:W.file}).fsPath,tmpDir:this.environmentMainService.tmpDir.with({scheme:W.file}).fsPath,userDataDir:this.environmentMainService.userDataPath,isEmbeddedApp:this.environmentMainService.isEmbeddedApp,parentAppUserDataDir:this.environmentMainService.parentAppUserRoamingDataHome?.with({scheme:W.file}).fsPath,parentAppUserHomeDir:this.environmentMainService.parentAppUserHome?.with({scheme:W.file}).fsPath,remoteAuthority:e.remoteAuthority,workspace:e.workspace,userEnv:{...this.initialUserEnv,...e.userEnv},nls:{messages:$g(),language:td()},filesToOpenOrCreate:e.filesToOpen?.filesToOpenOrCreate,filesToDiff:e.filesToOpen?.filesToDiff,filesToMerge:e.filesToOpen?.filesToMerge,filesToWait:e.filesToOpen?.filesToWait,logLevel:this.loggerService.getLogLevel(),loggers:this.loggerService.getGlobalLoggers(),logsPath:this.environmentMainService.logsHome.with({scheme:W.file}).fsPath,product:Fr,isInitialStartup:e.initialStartup,perfMarks:Ep(),os:{release:FM(),hostname:OM(),arch:WM()},autoDetectHighContrast:t?.autoDetectHighContrast??!0,autoDetectColorScheme:t?.autoDetectColorScheme??!1,accessibilitySupport:LM.accessibilitySupportEnabled,colorScheme:this.themeMainService.getColorScheme(),policiesData:this.policyService.serialize(),continueOn:this.environmentMainService.continueOn,cssModules:this.cssDevelopmentService.isEnabled?await this.cssDevelopmentService.getCssModules():void 0,isSessionsWindow:ct(e.workspace)&&Na(e.workspace.configPath,this.environmentMainService.agentSessionsWorkspace)};if(a){let c=a.config;!l.extensionDevelopmentPath&&c?.extensionDevelopmentPath&&(l.extensionDevelopmentPath=c.extensionDevelopmentPath,l.extensionDevelopmentKind=c.extensionDevelopmentKind,l["enable-proposed-api"]=c["enable-proposed-api"],l.verbose=c.verbose,l["inspect-extensions"]=c["inspect-extensions"],l["inspect-brk-extensions"]=c["inspect-brk-extensions"],l.debugId=c.debugId,l.extensionEnvironment=c.extensionEnvironment,l["extensions-dir"]=c["extensions-dir"],l["disable-extensions"]=c["disable-extensions"],l["disable-extension"]=c["disable-extension"])}else{let c=this.windowsStateHandler.getNewWindowState(l);Ve("code/willCreateCodeWindow");let d=a=this.instantiationService.createInstance(ca,{state:c,extensionDevelopmentPath:l.extensionDevelopmentPath,isExtensionTestHost:!!l.extensionTestsPath});Ve("code/didCreateCodeWindow"),e.forceNewTabbedWindow&&this.getLastActiveWindow()?.addTabbedWindow(d),this.windows.set(d.id,d),this._onDidOpenWindow.fire(d),this._onDidChangeWindowsCount.fire({oldCount:this.getWindowCount()-1,newCount:this.getWindowCount()});let u=new j;u.add(d.onDidSignalReady(()=>this._onDidSignalReadyWindow.fire(d))),u.add(S.once(d.onDidClose)(()=>this.onWindowClosed(d,u))),u.add(S.once(d.onDidDestroy)(()=>this.onWindowDestroyed(d))),u.add(d.onDidMaximize(()=>this._onDidMaximizeWindow.fire(d))),u.add(d.onDidUnmaximize(()=>this._onDidUnmaximizeWindow.fire(d))),u.add(d.onDidEnterFullScreen(()=>this._onDidChangeFullScreen.fire({window:d,fullscreen:!0}))),u.add(d.onDidLeaveFullScreen(()=>this._onDidChangeFullScreen.fire({window:d,fullscreen:!1}))),u.add(d.onDidTriggerSystemContextMenu(({x:m,y:v})=>this._onDidTriggerSystemContextMenu.fire({window:d,x:m,y:v})));let f=yn(d.win?.webContents);f.removeAllListeners("devtools-reload-page"),u.add(S.fromNodeEventEmitter(f,"devtools-reload-page")(()=>this.lifecycleMainService.reload(d))),this.lifecycleMainService.registerWindow(d)}return l.windowId=a.id,a.isReady?this.lifecycleMainService.unload(a,4).then(async c=>{c||await this.doOpenInBrowserWindow(a,l,e,s)}):await this.doOpenInBrowserWindow(a,l,e,s),a}async doOpenInBrowserWindow(e,t,i,o){t.extensionDevelopmentPath||(ct(t.workspace)?t.backupPath=this.backupMainService.registerWorkspaceBackup({workspace:t.workspace,remoteAuthority:t.remoteAuthority}):$t(t.workspace)?t.backupPath=this.backupMainService.registerFolderBackup({folderUri:t.workspace.uri,remoteAuthority:t.remoteAuthority}):t.backupPath=this.backupMainService.registerEmptyWindowBackup({backupFolder:i.emptyWindowBackupInfo?.backupFolder??Su().id,remoteAuthority:t.remoteAuthority}));let s=t.workspace??jo(t.backupPath,!1),a=this.resolveProfileForBrowserWindow(i,s,o),l=a instanceof Promise?await a:a;t.profiles.profile=l,t.extensionDevelopmentPath||await this.userDataProfilesMainService.setProfileForWorkspace(s,l),e.load(t)}resolveProfileForBrowserWindow(e,t,i){return e.forceProfile?this.userDataProfilesMainService.profiles.find(o=>o.name===e.forceProfile)??this.userDataProfilesMainService.createNamedProfile(e.forceProfile):e.forceTempProfile?this.userDataProfilesMainService.createTransientProfile():this.userDataProfilesMainService.getProfileForWorkspace(t)??i}onWindowClosed(e,t){this.windows.delete(e.id),this._onDidChangeWindowsCount.fire({oldCount:this.getWindowCount()+1,newCount:this.getWindowCount()}),t.dispose()}onWindowDestroyed(e){this.windows.delete(e.id),this._onDidDestroyWindow.fire(e)}getFocusedWindow(){let e=qh.getFocusedWindow();if(e)return this.getWindowById(e.id)}getLastActiveWindow(){return this.doGetLastActiveWindow(this.getWindows())}getLastActiveWindowForAuthority(e){return this.doGetLastActiveWindow(this.getWindows().filter(t=>Or(t.remoteAuthority,e)))}doGetLastActiveWindow(e){return um(e)}sendToFocused(e,...t){(this.getFocusedWindow()||this.getLastActiveWindow())?.sendWhenReady(e,Ce.None,...t)}sendToOpeningWindow(e,...t){this._register(S.once(this.onDidSignalReadyWindow)(i=>{i.sendWhenReady(e,Ce.None,...t)}))}sendToAll(e,t,i){for(let o of this.getWindows())i&&i.indexOf(o.id)>=0||o.sendWhenReady(e,Ce.None,t)}getWindows(){return Array.from(this.windows.values())}getWindowCount(){return this.windows.size}getWindowById(e){return this.windows.get(e)}getWindowByWebContents(e){let t=qh.fromWebContents(e);if(!t)return;let i=this.getWindowById(t.id);return i?.matches(e)?i:void 0}};pc=E([g(4,B),g(5,dn),g(6,Et),g(7,Ui),g(8,_e),g(9,Ur),g(10,ye),g(11,Wn),g(12,ue),g(13,hs),g(14,pi),g(15,Ht),g(16,ui),g(17,Me),g(18,ac),g(19,An),g(20,nn),g(21,$h)],pc)});var Kh,JC=I(()=>{he();q();$();Kh=class extends T{constructor({onDidOpenMainWindow:e,onDidFocusMainWindow:t,getActiveWindowId:i}){super();this.disposables=this._register(new j);S.latch(S.any(e,t))(this.setActiveWindow,this,this.disposables),this.firstActiveWindowIdPromise=Ji(()=>i()),(async()=>{try{let s=await this.firstActiveWindowIdPromise;this.activeWindowId=typeof this.activeWindowId=="number"?this.activeWindowId:s}catch{}finally{this.firstActiveWindowIdPromise=void 0}})()}setActiveWindow(e){this.firstActiveWindowIdPromise&&(this.firstActiveWindowIdPromise.cancel(),this.firstActiveWindowIdPromise=void 0),this.activeWindowId=e}async getActiveClientId(){return`window:${this.firstActiveWindowIdPromise?await this.firstActiveWindowIdPromise:this.activeWindowId}`}}});var fc,QC=I(()=>{Sl();Kt();Xu();is();fc=class{constructor(r,e,t,i){this.workspacesManagementMainService=r;this.windowsMainService=e;this.workspacesHistoryMainService=t;this.backupMainService=i;this.onDidChangeRecentlyOpened=this.workspacesHistoryMainService.onDidChangeRecentlyOpened}async enterWorkspace(r,e){let t=this.windowsMainService.getWindowById(r);if(t)return this.workspacesManagementMainService.enterWorkspace(t,this.windowsMainService.getWindows(),e)}createUntitledWorkspace(r,e,t){return this.workspacesManagementMainService.createUntitledWorkspace(e,t)}deleteUntitledWorkspace(r,e){return this.workspacesManagementMainService.deleteUntitledWorkspace(e)}getWorkspaceIdentifier(r,e){return this.workspacesManagementMainService.getWorkspaceIdentifier(e)}getRecentlyOpened(r){return this.workspacesHistoryMainService.getRecentlyOpened()}addRecentlyOpened(r,e){return this.workspacesHistoryMainService.addRecentlyOpened(e)}removeRecentlyOpened(r,e){return this.workspacesHistoryMainService.removeRecentlyOpened(e)}clearRecentlyOpened(r){return this.workspacesHistoryMainService.clearRecentlyOpened()}async getDirtyWorkspaces(){return this.backupMainService.getDirtyWorkspaces()}};fc=E([g(0,pi),g(1,qe),g(2,hs),g(3,Wn)],fc)});var zh,XC=I(()=>{q();$();cn();zh=class{constructor(r){this.service=r;this.disposables=new j}listen(r,e){if(e==="onDidChange")return S.map(this.service.onDidChange,t=>t.reduce((i,o)=>({...i,[o]:this.service.getPolicyValue(o)??null}),{}),this.disposables);throw new Error(`Event not found: ${e}`)}call(r,e,t){if(e==="updatePolicyDefinitions")return this.service.updatePolicyDefinitions(t);throw new Error(`Call not found: ${e}`)}dispose(){this.disposables.dispose()}}});function eT(n){return n.map(r=>{let[e,t]=r.split("@");return{proposalName:e,version:t?parseInt(t):void 0}})}function tT(n){return n.map(r=>r.split("@")[0])}var YC,ZC,Gh,Eo,jh,Ape,sp=I(()=>{ar();Z();_l();YC="extensions.user.cache",ZC="extensions.builtin.cache",Gh="undefined_publisher",Eo=class{constructor(r){this.value=r,this._lower=r.toLowerCase()}static equals(r,e){if(typeof r>"u"||r===null)return typeof e>"u"||e===null;if(typeof e>"u"||e===null)return!1;if(typeof r=="string"||typeof e=="string"){let t=typeof r=="string"?r:r.value,i=typeof e=="string"?e:e.value;return $r(t,i)}return r._lower===e._lower}static toKey(r){return typeof r=="string"?r.toLowerCase():r._lower}},jh=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(r){this._map.delete(Eo.toKey(r))}get(r){return this._map.get(Eo.toKey(r))}has(r){return this._map.has(Eo.toKey(r))}set(r,e){this._map.set(Eo.toKey(r),e)}values(){return this._map.values()}forEach(r){this._map.forEach(r)}[Symbol.iterator](){return this._map[Symbol.iterator]()}};Ape=O("IBuiltinExtensionsScannerService")});function iT(n,r){switch(n){case 3:return r==="x64"?"win32-x64":r==="arm64"?"win32-arm64":"unknown";case 2:return r==="x64"?"linux-x64":r==="arm64"?"linux-arm64":r==="arm"?"linux-armhf":"unknown";case"alpine":return r==="x64"?"alpine-x64":r==="arm64"?"alpine-arm64":"unknown";case 1:return r==="x64"?"darwin-x64":r==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}function nT(n){let r=n;return!!r&&typeof r=="object"&&typeof r.id=="string"&&(!r.uuid||typeof r.uuid=="string")}var UM,Jpe,Qpe,Xpe,Ype,Zpe,efe,tfe,rfe,NM,Aw=I(()=>{X();bd();xe();no();sp();je();Z();Xi();UM="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",Jpe=new RegExp(UM);Qpe=O("extensionGalleryService"),Xpe=O("extensionManagementService"),Ype=O("IGlobalExtensionEnablementService"),Zpe=O("IExtensionTipsService"),efe=O("IAllowedExtensionsService"),tfe=qg(2121,"Extensions"),rfe=qg(2138,"Preferences"),NM="extensions.allowed";Pt.as(lr.Configuration).registerConfiguration({id:"extensions",order:30,title:h(2137,null),type:"object",properties:{[NM]:{type:"object",markdownDescription:h(2127,null),default:"*",defaultSnippets:[{body:{},description:h(2132,null)},{body:{"*":!0},description:h(2128,null)}],scope:1,policy:{name:"AllowedExtensions",category:"Extensions",minimumVersion:"1.96",localization:{description:{key:"extensions.allowed.policy",value:h(2133,null)}}},additionalProperties:!1,patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{anyOf:[{type:["boolean","string"],enum:[!0,!1,"stable"],description:h(2125,null),enumDescriptions:[h(2131,null),h(2129,null),h(2130,null)]},{type:"array",items:{type:"string"},description:h(2126,null)}]},"([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:["boolean","string"],enum:[!0,!1,"stable"],description:h(2120,null),enumDescriptions:[h(2136,null),h(2134,null),h(2135,null)]},"\\*":{type:"boolean",enum:[!0,!1],description:h(2122,null),enumDescriptions:[h(2124,null),h(2123,null)]}}}}})});function da(n,r){return n.uuid&&r.uuid?n.uuid===r.uuid:n.id===r.id?!0:pd(n.id,r.id)===0}function oT(n,r){return`${n}.${r}`}function BM(n){return n.toLowerCase()}function sT(n,r){return BM(oT(n??Gh,r))}async function VM(n,r){if(!re)return!1;let e;try{e=(await n.readFile(x.file("/etc/os-release"))).value.toString()}catch{try{e=(await n.readFile(x.file("/usr/lib/os-release"))).value.toString()}catch(i){r.debug("Error while getting the os-release file.",mr(i))}}return!!e&&(e.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function aT(n,r){let e=await VM(n,r),t=iT(e?"alpine":Gn,aS);return r.debug("ComputeTargetPlatform:",t),t}var yfe,Lw=I(()=>{ar();Aw();sp();X();ce();He();yi();So();Oe();yfe=new Eo("pprice.better-merge")});function lT(n){let r=n;return Ge(r)&&nT(r.identifier)&&(HM(r.location)||Fe(r.location)&&!!r.location)&&(Hr(r.relativeLocation)||Fe(r.relativeLocation))&&!!r.version&&Fe(r.version)}function HM(n){if(!n)return!1;let r=n;return typeof r?.path=="string"&&typeof r?.scheme=="string"}var ua,Is,mc,ap=I(()=>{he();ot();$();q();Cr();ce();Aw();Lw();je();Z();te();en();Zi();Oe();He();ua=class extends Error{constructor(e,t){super(e);this.code=t}},Is=O("IExtensionsProfileScannerService"),mc=class extends T{constructor(e,t,i,o,s){super();this.extensionsLocation=e;this.fileService=t;this.userDataProfilesService=i;this.uriIdentityService=o;this.logService=s;this._onAddExtensions=this._register(new b);this.onAddExtensions=this._onAddExtensions.event;this._onDidAddExtensions=this._register(new b);this.onDidAddExtensions=this._onDidAddExtensions.event;this._onRemoveExtensions=this._register(new b);this.onRemoveExtensions=this._onRemoveExtensions.event;this._onDidRemoveExtensions=this._register(new b);this.onDidRemoveExtensions=this._onDidRemoveExtensions.event;this.resourcesAccessQueueMap=new mt}scanProfileExtensions(e,t){return this.withProfileExtensions(e,void 0,t)}async addExtensionsToProfile(e,t,i){let o=[],s=[];try{return await this.withProfileExtensions(t,a=>{let l=[];if(i)l.push(...a);else for(let c of a)e.some(([d])=>da(d.identifier,c.identifier)&&d.manifest.version!==c.version)?o.push(c):l.push(c);for(let[c,d]of e){let u=l.findIndex(m=>da(m.identifier,c.identifier)&&m.version===c.manifest.version),f={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:d};u===-1?(s.push(f),l.push(f)):l.splice(u,1,f)}return s.length&&this._onAddExtensions.fire({extensions:s,profileLocation:t}),o.length&&this._onRemoveExtensions.fire({extensions:o,profileLocation:t}),l}),s.length&&this._onDidAddExtensions.fire({extensions:s,profileLocation:t}),o.length&&this._onDidRemoveExtensions.fire({extensions:o,profileLocation:t}),s}catch(a){throw s.length&&this._onDidAddExtensions.fire({extensions:s,error:a,profileLocation:t}),o.length&&this._onDidRemoveExtensions.fire({extensions:o,error:a,profileLocation:t}),a}}async updateMetadata(e,t){let i=[];return await this.withProfileExtensions(t,o=>{let s=[];for(let a of o){let l=e.find(([c])=>da({id:c.identifier.id},{id:a.identifier.id})&&c.manifest.version===a.version);l&&(a.metadata={...a.metadata,...l[1]},i.push(a)),s.push(a)}return s}),i}async removeExtensionsFromProfile(e,t){let i=[];try{await this.withProfileExtensions(t,o=>{let s=[];for(let a of o)e.some(l=>da(a.identifier,l))?i.push(a):s.push(a);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),s}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:t})}catch(o){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:o,profileLocation:t}),o}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let o=[],s;try{let a=await this.fileService.readFile(e);s=JSON.parse(a.value.toString().trim()||"[]")}catch(a){if(jr(a)!==1)throw a;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(s=await this.migrateFromOldDefaultProfileExtensionsLocation()),!s&&i?.bailOutWhenFileNotFound)throw new ua(mr(a),"ERROR_PROFILE_NOT_FOUND")}if(s){Array.isArray(s)||this.throwInvalidConentError(e);let a=!1;for(let l of s){lT(l)||this.throwInvalidConentError(e);let c;if(Fe(l.relativeLocation)&&l.relativeLocation)c=this.resolveExtensionLocation(l.relativeLocation);else if(Fe(l.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${l.location}`);continue}else{c=x.revive(l.location);let u=this.toRelativePath(c);u&&(a=!0,l.relativeLocation=u)}Hr(l.metadata?.hasPreReleaseVersion)&&l.metadata?.preRelease&&(a=!0,l.metadata.hasPreReleaseVersion=!0);let d=l.metadata?.id??l.identifier.uuid;o.push({identifier:d?{id:l.identifier.id,uuid:d}:{id:l.identifier.id},location:c,version:l.version,metadata:l.metadata})}a&&await this.fileService.writeFile(e,H.fromString(JSON.stringify(s)))}if(t){o=t(o);let a=o.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,H.fromString(JSON.stringify(a)))}return o})}throwInvalidConentError(e){throw new ua(`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"),t=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions"),i;try{i=(await this.fileService.readFile(e)).value.toString()}catch(s){if(jr(s)===1)return;throw s}this.logService.info("Migrating extensions from old default profile location",e.toString());let o;try{let s=JSON.parse(i);Array.isArray(s)&&s.every(a=>lT(a))?o=s:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",s)}catch(s){this.logService.error(s)}if(o)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,H.fromString(JSON.stringify(o)),{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(jr(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){jr(s)!==1&&this.logService.error(s)}try{await this.fileService.del(t)}catch(s){jr(s)!==1&&this.logService.error(s)}return o})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new Di,this.resourcesAccessQueueMap.set(e,t)),t}};mc=E([g(1,Me),g(2,Dr),g(3,Rt),g(4,B)],mc)});function Jh(n){switch(n){case 1:return h(123,null);case 2:return h(122,null);case 3:return h(124,null);case 4:return h(125,null);case 5:return h(119,null);case 6:return h(120,null);case 7:return h(117,null);case 8:return h(118,null);case 9:return h(121,null);default:return""}}var cT=I(()=>{xe();rn()});var Qh,Ne,Kfe,zfe,dT,jfe,Gfe,Jfe,Qfe,Xfe,Yfe,Zfe,uT,eme,tme,rme,pT,ime,nme,ome,sme,ame,lme,cme,dme,ume,pme,fme,mme,hme,gme,vme,yme,Ime,wme,bme,Sme,xme,Pme,Mw=I(()=>{Qh={},Ne={exports:Qh};(function(n,r){if(typeof Qh=="object"&&typeof Ne=="object")Ne.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var e=r();for(var t in e)(typeof Qh=="object"?Qh:n)[t]=e[t]}})(typeof self<"u"?self:void 0,(function(){return(function(n){var r={};function e(t){if(r[t])return r[t].exports;var i=r[t]={i:t,l:!1,exports:{}};return n[t].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=n,e.c=r,e.d=function(t,i,o){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:o})},e.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i||4&i&&typeof t=="object"&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&i&&typeof t!="string")for(var s in t)e.d(o,s,function(a){return t[a]}.bind(null,s));return o},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s=0)})([function(n,r,e){(function(t){var i;r=n.exports=Ye,i=typeof t=="object"&&t.env&&t.env.NODE_DEBUG&&/\bsemver\b/i.test(t.env.NODE_DEBUG)?function(){var P=Array.prototype.slice.call(arguments,0);P.unshift("SEMVER"),console.log.apply(console,P)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var o=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=r.re=[],l=r.src=[],c=0,d=c++;l[d]="0|[1-9]\\d*";var u=c++;l[u]="[0-9]+";var f=c++;l[f]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var m=c++;l[m]="("+l[d]+")\\.("+l[d]+")\\.("+l[d]+")";var v=c++;l[v]="("+l[u]+")\\.("+l[u]+")\\.("+l[u]+")";var y=c++;l[y]="(?:"+l[d]+"|"+l[f]+")";var C=c++;l[C]="(?:"+l[u]+"|"+l[f]+")";var w=c++;l[w]="(?:-("+l[y]+"(?:\\."+l[y]+")*))";var _=c++;l[_]="(?:-?("+l[C]+"(?:\\."+l[C]+")*))";var D=c++;l[D]="[0-9A-Za-z-]+";var k=c++;l[k]="(?:\\+("+l[D]+"(?:\\."+l[D]+")*))";var A=c++,de="v?"+l[m]+l[w]+"?"+l[k]+"?";l[A]="^"+de+"$";var L="[v=\\s]*"+l[v]+l[_]+"?"+l[k]+"?",J=c++;l[J]="^"+L+"$";var K=c++;l[K]="((?:<|>)?=?)";var ve=c++;l[ve]=l[u]+"|x|X|\\*";var yt=c++;l[yt]=l[d]+"|x|X|\\*";var Ot=c++;l[Ot]="[v=\\s]*("+l[yt]+")(?:\\.("+l[yt]+")(?:\\.("+l[yt]+")(?:"+l[w]+")?"+l[k]+"?)?)?";var pn=c++;l[pn]="[v=\\s]*("+l[ve]+")(?:\\.("+l[ve]+")(?:\\.("+l[ve]+")(?:"+l[_]+")?"+l[k]+"?)?)?";var gi=c++;l[gi]="^"+l[K]+"\\s*"+l[Ot]+"$";var ie=c++;l[ie]="^"+l[K]+"\\s*"+l[pn]+"$";var z=c++;l[z]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var Y=c++;l[Y]="(?:~>?)";var ee=c++;l[ee]="(\\s*)"+l[Y]+"\\s+",a[ee]=new RegExp(l[ee],"g");var ne=c++;l[ne]="^"+l[Y]+l[Ot]+"$";var fe=c++;l[fe]="^"+l[Y]+l[pn]+"$";var Ie=c++;l[Ie]="(?:\\^)";var bt=c++;l[bt]="(\\s*)"+l[Ie]+"\\s+",a[bt]=new RegExp(l[bt],"g");var Xe=c++;l[Xe]="^"+l[Ie]+l[Ot]+"$";var Ft=c++;l[Ft]="^"+l[Ie]+l[pn]+"$";var Re=c++;l[Re]="^"+l[K]+"\\s*("+L+")$|^$";var tr=c++;l[tr]="^"+l[K]+"\\s*("+de+")$|^$";var Br=c++;l[Br]="(\\s*)"+l[K]+"\\s*("+L+"|"+l[Ot]+")",a[Br]=new RegExp(l[Br],"g");var fn=c++;l[fn]="^\\s*("+l[Ot]+")\\s+-\\s+("+l[Ot]+")\\s*$";var jc=c++;l[jc]="^\\s*("+l[pn]+")\\s+-\\s+("+l[pn]+")\\s*$";var Gc=c++;l[Gc]="(<|>)?=?\\s*\\*";for(var ko=0;ko<35;ko++)i(ko,l[ko]),a[ko]||(a[ko]=new RegExp(l[ko]));function me(P,M){if(P instanceof Ye)return P;if(typeof P!="string"||P.length>o||!(M?a[J]:a[A]).test(P))return null;try{return new Ye(P,M)}catch{return null}}function Ye(P,M){if(P instanceof Ye){if(P.loose===M)return P;P=P.version}else if(typeof P!="string")throw new TypeError("Invalid Version: "+P);if(P.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof Ye))return new Ye(P,M);i("SemVer",P,M),this.loose=M;var U=P.trim().match(M?a[J]:a[A]);if(!U)throw new TypeError("Invalid Version: "+P);if(this.raw=P,this.major=+U[1],this.minor=+U[2],this.patch=+U[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");U[4]?this.prerelease=U[4].split(".").map((function(le){if(/^[0-9]+$/.test(le)){var Se=+le;if(Se>=0&&Se<s)return Se}return le})):this.prerelease=[],this.build=U[5]?U[5].split("."):[],this.format()}r.parse=me,r.valid=function(P,M){var U=me(P,M);return U?U.version:null},r.clean=function(P,M){var U=me(P.trim().replace(/^[=v]+/,""),M);return U?U.version:null},r.SemVer=Ye,Ye.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},Ye.prototype.toString=function(){return this.version},Ye.prototype.compare=function(P){return i("SemVer.compare",this.version,this.loose,P),P instanceof Ye||(P=new Ye(P,this.loose)),this.compareMain(P)||this.comparePre(P)},Ye.prototype.compareMain=function(P){return P instanceof Ye||(P=new Ye(P,this.loose)),ya(this.major,P.major)||ya(this.minor,P.minor)||ya(this.patch,P.patch)},Ye.prototype.comparePre=function(P){if(P instanceof Ye||(P=new Ye(P,this.loose)),this.prerelease.length&&!P.prerelease.length)return-1;if(!this.prerelease.length&&P.prerelease.length)return 1;if(!this.prerelease.length&&!P.prerelease.length)return 0;var M=0;do{var U=this.prerelease[M],le=P.prerelease[M];if(i("prerelease compare",M,U,le),U===void 0&&le===void 0)return 0;if(le===void 0)return 1;if(U===void 0)return-1;if(U!==le)return ya(U,le)}while(++M)},Ye.prototype.inc=function(P,M){switch(P){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",M);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",M);break;case"prepatch":this.prerelease.length=0,this.inc("patch",M),this.inc("pre",M);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",M),this.inc("pre",M);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 U=this.prerelease.length;--U>=0;)typeof this.prerelease[U]=="number"&&(this.prerelease[U]++,U=-2);U===-1&&this.prerelease.push(0)}M&&(this.prerelease[0]===M?isNaN(this.prerelease[1])&&(this.prerelease=[M,0]):this.prerelease=[M,0]);break;default:throw new Error("invalid increment argument: "+P)}return this.format(),this.raw=this.version,this},r.inc=function(P,M,U,le){typeof U=="string"&&(le=U,U=void 0);try{return new Ye(P,U).inc(M,le).version}catch{return null}},r.diff=function(P,M){if(Rg(P,M))return null;var U=me(P),le=me(M);if(U.prerelease.length||le.prerelease.length){for(var Se in U)if((Se==="major"||Se==="minor"||Se==="patch")&&U[Se]!==le[Se])return"pre"+Se;return"prerelease"}for(var Se in U)if((Se==="major"||Se==="minor"||Se==="patch")&&U[Se]!==le[Se])return Se},r.compareIdentifiers=ya;var Rb=/^[0-9]+$/;function ya(P,M){var U=Rb.test(P),le=Rb.test(M);return U&&le&&(P=+P,M=+M),U&&!le?-1:le&&!U?1:P<M?-1:P>M?1:0}function Kn(P,M,U){return new Ye(P,U).compare(new Ye(M,U))}function bp(P,M,U){return Kn(P,M,U)>0}function Sp(P,M,U){return Kn(P,M,U)<0}function Rg(P,M,U){return Kn(P,M,U)===0}function Db(P,M,U){return Kn(P,M,U)!==0}function Dg(P,M,U){return Kn(P,M,U)>=0}function Ag(P,M,U){return Kn(P,M,U)<=0}function xp(P,M,U,le){var Se;switch(M){case"===":typeof P=="object"&&(P=P.version),typeof U=="object"&&(U=U.version),Se=P===U;break;case"!==":typeof P=="object"&&(P=P.version),typeof U=="object"&&(U=U.version),Se=P!==U;break;case"":case"=":case"==":Se=Rg(P,U,le);break;case"!=":Se=Db(P,U,le);break;case">":Se=bp(P,U,le);break;case">=":Se=Dg(P,U,le);break;case"<":Se=Sp(P,U,le);break;case"<=":Se=Ag(P,U,le);break;default:throw new TypeError("Invalid operator: "+M)}return Se}function Ti(P,M){if(P instanceof Ti){if(P.loose===M)return P;P=P.value}if(!(this instanceof Ti))return new Ti(P,M);i("comparator",P,M),this.loose=M,this.parse(P),this.semver===Jc?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}r.rcompareIdentifiers=function(P,M){return ya(M,P)},r.major=function(P,M){return new Ye(P,M).major},r.minor=function(P,M){return new Ye(P,M).minor},r.patch=function(P,M){return new Ye(P,M).patch},r.compare=Kn,r.compareLoose=function(P,M){return Kn(P,M,!0)},r.rcompare=function(P,M,U){return Kn(M,P,U)},r.sort=function(P,M){return P.sort((function(U,le){return r.compare(U,le,M)}))},r.rsort=function(P,M){return P.sort((function(U,le){return r.rcompare(U,le,M)}))},r.gt=bp,r.lt=Sp,r.eq=Rg,r.neq=Db,r.gte=Dg,r.lte=Ag,r.cmp=xp,r.Comparator=Ti;var Jc={};function Wt(P,M){if(P instanceof Wt)return P.loose===M?P:new Wt(P.raw,M);if(P instanceof Ti)return new Wt(P.value,M);if(!(this instanceof Wt))return new Wt(P,M);if(this.loose=M,this.raw=P,this.set=P.split(/\s*\|\|\s*/).map((function(U){return this.parseRange(U.trim())}),this).filter((function(U){return U.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+P);this.format()}function Vr(P){return!P||P.toLowerCase()==="x"||P==="*"}function jk(P,M,U,le,Se,pr,Ze,Qr,jt,Ar,mn,Gt,br){return((M=Vr(U)?"":Vr(le)?">="+U+".0.0":Vr(Se)?">="+U+"."+le+".0":">="+M)+" "+(Qr=Vr(jt)?"":Vr(Ar)?"<"+(+jt+1)+".0.0":Vr(mn)?"<"+jt+"."+(+Ar+1)+".0":Gt?"<="+jt+"."+Ar+"."+mn+"-"+Gt:"<="+Qr)).trim()}function Gk(P,M){for(var U=0;U<P.length;U++)if(!P[U].test(M))return!1;if(M.prerelease.length){for(U=0;U<P.length;U++)if(i(P[U].semver),P[U].semver!==Jc&&P[U].semver.prerelease.length>0){var le=P[U].semver;if(le.major===M.major&&le.minor===M.minor&&le.patch===M.patch)return!0}return!1}return!0}function Pp(P,M,U){try{M=new Wt(M,U)}catch{return!1}return M.test(P)}function Lg(P,M,U,le){var Se,pr,Ze,Qr,jt;switch(P=new Ye(P,le),M=new Wt(M,le),U){case">":Se=bp,pr=Ag,Ze=Sp,Qr=">",jt=">=";break;case"<":Se=Sp,pr=Dg,Ze=bp,Qr="<",jt="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Pp(P,M,le))return!1;for(var Ar=0;Ar<M.set.length;++Ar){var mn=M.set[Ar],Gt=null,br=null;if(mn.forEach((function(Xr){Xr.semver===Jc&&(Xr=new Ti(">=0.0.0")),Gt=Gt||Xr,br=br||Xr,Se(Xr.semver,Gt.semver,le)?Gt=Xr:Ze(Xr.semver,br.semver,le)&&(br=Xr)})),Gt.operator===Qr||Gt.operator===jt||(!br.operator||br.operator===Qr)&&pr(P,br.semver)||br.operator===jt&&Ze(P,br.semver))return!1}return!0}Ti.prototype.parse=function(P){var M=this.loose?a[Re]:a[tr],U=P.match(M);if(!U)throw new TypeError("Invalid comparator: "+P);this.operator=U[1],this.operator==="="&&(this.operator=""),U[2]?this.semver=new Ye(U[2],this.loose):this.semver=Jc},Ti.prototype.toString=function(){return this.value},Ti.prototype.test=function(P){return i("Comparator.test",P,this.loose),this.semver===Jc||(typeof P=="string"&&(P=new Ye(P,this.loose)),xp(P,this.operator,this.semver,this.loose))},Ti.prototype.intersects=function(P,M){if(!(P instanceof Ti))throw new TypeError("a Comparator is required");var U;if(this.operator==="")return U=new Wt(P.value,M),Pp(this.value,U,M);if(P.operator==="")return U=new Wt(this.value,M),Pp(P.semver,U,M);var le=!(this.operator!==">="&&this.operator!==">"||P.operator!==">="&&P.operator!==">"),Se=!(this.operator!=="<="&&this.operator!=="<"||P.operator!=="<="&&P.operator!=="<"),pr=this.semver.version===P.semver.version,Ze=!(this.operator!==">="&&this.operator!=="<="||P.operator!==">="&&P.operator!=="<="),Qr=xp(this.semver,"<",P.semver,M)&&(this.operator===">="||this.operator===">")&&(P.operator==="<="||P.operator==="<"),jt=xp(this.semver,">",P.semver,M)&&(this.operator==="<="||this.operator==="<")&&(P.operator===">="||P.operator===">");return le||Se||pr&&Ze||Qr||jt},r.Range=Wt,Wt.prototype.format=function(){return this.range=this.set.map((function(P){return P.join(" ").trim()})).join("||").trim(),this.range},Wt.prototype.toString=function(){return this.range},Wt.prototype.parseRange=function(P){var M=this.loose;P=P.trim(),i("range",P,M);var U=M?a[jc]:a[fn];P=P.replace(U,jk),i("hyphen replace",P),P=P.replace(a[Br],"$1$2$3"),i("comparator trim",P,a[Br]),P=(P=(P=P.replace(a[ee],"$1~")).replace(a[bt],"$1^")).split(/\s+/).join(" ");var le=M?a[Re]:a[tr],Se=P.split(" ").map((function(pr){return(function(Ze,Qr){return i("comp",Ze),Ze=(function(jt,Ar){return jt.trim().split(/\s+/).map((function(mn){return(function(Gt,br){i("caret",Gt,br);var Xr=br?a[Ft]:a[Xe];return Gt.replace(Xr,(function(Hi,Ee,Be,ft,_t){var Sr;return i("caret",Gt,Hi,Ee,Be,ft,_t),Vr(Ee)?Sr="":Vr(Be)?Sr=">="+Ee+".0.0 <"+(+Ee+1)+".0.0":Vr(ft)?Sr=Ee==="0"?">="+Ee+"."+Be+".0 <"+Ee+"."+(+Be+1)+".0":">="+Ee+"."+Be+".0 <"+(+Ee+1)+".0.0":_t?(i("replaceCaret pr",_t),_t.charAt(0)!=="-"&&(_t="-"+_t),Sr=Ee==="0"?Be==="0"?">="+Ee+"."+Be+"."+ft+_t+" <"+Ee+"."+Be+"."+(+ft+1):">="+Ee+"."+Be+"."+ft+_t+" <"+Ee+"."+(+Be+1)+".0":">="+Ee+"."+Be+"."+ft+_t+" <"+(+Ee+1)+".0.0"):(i("no pr"),Sr=Ee==="0"?Be==="0"?">="+Ee+"."+Be+"."+ft+" <"+Ee+"."+Be+"."+(+ft+1):">="+Ee+"."+Be+"."+ft+" <"+Ee+"."+(+Be+1)+".0":">="+Ee+"."+Be+"."+ft+" <"+(+Ee+1)+".0.0"),i("caret return",Sr),Sr}))})(mn,Ar)})).join(" ")})(Ze,Qr),i("caret",Ze),Ze=(function(jt,Ar){return jt.trim().split(/\s+/).map((function(mn){return(function(Gt,br){var Xr=br?a[fe]:a[ne];return Gt.replace(Xr,(function(Hi,Ee,Be,ft,_t){var Sr;return i("tilde",Gt,Hi,Ee,Be,ft,_t),Vr(Ee)?Sr="":Vr(Be)?Sr=">="+Ee+".0.0 <"+(+Ee+1)+".0.0":Vr(ft)?Sr=">="+Ee+"."+Be+".0 <"+Ee+"."+(+Be+1)+".0":_t?(i("replaceTilde pr",_t),_t.charAt(0)!=="-"&&(_t="-"+_t),Sr=">="+Ee+"."+Be+"."+ft+_t+" <"+Ee+"."+(+Be+1)+".0"):Sr=">="+Ee+"."+Be+"."+ft+" <"+Ee+"."+(+Be+1)+".0",i("tilde return",Sr),Sr}))})(mn,Ar)})).join(" ")})(Ze,Qr),i("tildes",Ze),Ze=(function(jt,Ar){return i("replaceXRanges",jt,Ar),jt.split(/\s+/).map((function(mn){return(function(Gt,br){Gt=Gt.trim();var Xr=br?a[ie]:a[gi];return Gt.replace(Xr,(function(Hi,Ee,Be,ft,_t,Sr){i("xRange",Gt,Hi,Ee,Be,ft,_t,Sr);var Ab=Vr(Be),Qc=Ab||Vr(ft),Xc=Qc||Vr(_t);return Ee==="="&&Xc&&(Ee=""),Ab?Hi=Ee===">"||Ee==="<"?"<0.0.0":"*":Ee&&Xc?(Qc&&(ft=0),Xc&&(_t=0),Ee===">"?(Ee=">=",Qc?(Be=+Be+1,ft=0,_t=0):Xc&&(ft=+ft+1,_t=0)):Ee==="<="&&(Ee="<",Qc?Be=+Be+1:ft=+ft+1),Hi=Ee+Be+"."+ft+"."+_t):Qc?Hi=">="+Be+".0.0 <"+(+Be+1)+".0.0":Xc&&(Hi=">="+Be+"."+ft+".0 <"+Be+"."+(+ft+1)+".0"),i("xRange return",Hi),Hi}))})(mn,Ar)})).join(" ")})(Ze,Qr),i("xrange",Ze),Ze=(function(jt,Ar){return i("replaceStars",jt,Ar),jt.trim().replace(a[Gc],"")})(Ze,Qr),i("stars",Ze),Ze})(pr,M)})).join(" ").split(/\s+/);return this.loose&&(Se=Se.filter((function(pr){return!!pr.match(le)}))),Se=Se.map((function(pr){return new Ti(pr,M)}))},Wt.prototype.intersects=function(P,M){if(!(P instanceof Wt))throw new TypeError("a Range is required");return this.set.some((function(U){return U.every((function(le){return P.set.some((function(Se){return Se.every((function(pr){return le.intersects(pr,M)}))}))}))}))},r.toComparators=function(P,M){return new Wt(P,M).set.map((function(U){return U.map((function(le){return le.value})).join(" ").trim().split(" ")}))},Wt.prototype.test=function(P){if(!P)return!1;typeof P=="string"&&(P=new Ye(P,this.loose));for(var M=0;M<this.set.length;M++)if(Gk(this.set[M],P))return!0;return!1},r.satisfies=Pp,r.maxSatisfying=function(P,M,U){var le=null,Se=null;try{var pr=new Wt(M,U)}catch{return null}return P.forEach((function(Ze){pr.test(Ze)&&(le&&Se.compare(Ze)!==-1||(Se=new Ye(le=Ze,U)))})),le},r.minSatisfying=function(P,M,U){var le=null,Se=null;try{var pr=new Wt(M,U)}catch{return null}return P.forEach((function(Ze){pr.test(Ze)&&(le&&Se.compare(Ze)!==1||(Se=new Ye(le=Ze,U)))})),le},r.validRange=function(P,M){try{return new Wt(P,M).range||"*"}catch{return null}},r.ltr=function(P,M,U){return Lg(P,M,"<",U)},r.gtr=function(P,M,U){return Lg(P,M,">",U)},r.outside=Lg,r.prerelease=function(P,M){var U=me(P,M);return U&&U.prerelease.length?U.prerelease:null},r.intersects=function(P,M,U){return P=new Wt(P,U),M=new Wt(M,U),P.intersects(M)},r.coerce=function(P){if(P instanceof Ye)return P;if(typeof P!="string")return null;var M=P.match(a[z]);return M==null?null:me((M[1]||"0")+"."+(M[2]||"0")+"."+(M[3]||"0"))}}).call(this,e(1))},function(n,r){var e,t,i=n.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(C){if(e===setTimeout)return setTimeout(C,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(C,0);try{return e(C,0)}catch{try{return e.call(null,C,0)}catch{return e.call(this,C,0)}}}(function(){try{e=typeof setTimeout=="function"?setTimeout:o}catch{e=o}try{t=typeof clearTimeout=="function"?clearTimeout:s}catch{t=s}})();var l,c=[],d=!1,u=-1;function f(){d&&l&&(d=!1,l.length?c=l.concat(c):u=-1,c.length&&m())}function m(){if(!d){var C=a(f);d=!0;for(var w=c.length;w;){for(l=c,c=[];++u<w;)l&&l[u].run();u=-1,w=c.length}l=null,d=!1,(function(_){if(t===clearTimeout)return clearTimeout(_);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(_);try{t(_)}catch{try{return t.call(null,_)}catch{return t.call(this,_)}}})(C)}}function v(C,w){this.fun=C,this.array=w}function y(){}i.nextTick=function(C){var w=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)w[_-1]=arguments[_];c.push(new v(C,w)),c.length!==1||d||a(m)},v.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(C){return[]},i.binding=function(C){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(C){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}])}));Kfe=Ne.exports.SEMVER_SPEC_VERSION,zfe=Ne.exports.parse,dT=Ne.exports.valid,jfe=Ne.exports.coerce,Gfe=Ne.exports.clean,Jfe=Ne.exports.inc,Qfe=Ne.exports.major,Xfe=Ne.exports.minor,Yfe=Ne.exports.patch,Zfe=Ne.exports.prerelease,uT=Ne.exports.gt,eme=Ne.exports.gte,tme=Ne.exports.lt,rme=Ne.exports.lte,pT=Ne.exports.eq,ime=Ne.exports.neq,nme=Ne.exports.cmp,ome=Ne.exports.compare,sme=Ne.exports.rcompare,ame=Ne.exports.compareIdentifiers,lme=Ne.exports.rcompareIdentifiers,cme=Ne.exports.compareBuild,dme=Ne.exports.sort,ume=Ne.exports.rsort,pme=Ne.exports.diff,fme=Ne.exports.validRange,mme=Ne.exports.satisfies,hme=Ne.exports.maxSatisfying,gme=Ne.exports.minSatisfying,vme=Ne.exports.minVersion,yme=Ne.exports.gtr,Ime=Ne.exports.ltr,wme=Ne.exports.outside,bme=Ne.exports.intersects,Sme=Ne.exports.SemVer,xme=Ne.exports.Comparator,Pme=Ne.exports.Range});var $M,mT,hT=I(()=>{$M={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},agentSessionsWorkspace:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentSessionsWorkspace.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",version:2},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"},authenticationChallenges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authenticationChallenges.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"},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",version:4},chatHooks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatHooks.d.ts",version:6},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",version:3},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:15},chatPromptFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts",version:2},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts",version:5},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",version:3},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"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.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",version:4},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"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.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",version:2},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"},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"},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",version:1},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",version:1},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.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",version:1},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"},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"},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"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.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"}},mT=Object.freeze($M)});function KM(n){return n=n.trim(),n==="*"||gT.test(n)}function Fw(n){if(!KM(n))return null;if(n=n.trim(),n==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let r=n.match(gT);return r?{hasCaret:r[1]==="^",hasGreaterEquals:r[1]===">=",majorBase:r[2]==="x"?0:parseInt(r[2],10),majorMustEqual:r[2]!=="x",minorBase:r[4]==="x"?0:parseInt(r[4],10),minorMustEqual:r[4]!=="x",patchBase:r[6]==="x"?0:parseInt(r[6],10),patchMustEqual:r[6]!=="x",preRelease:r[8]||null}:null}function Ww(n){if(!n)return null;let r=n.majorBase,e=n.majorMustEqual,t=n.minorBase,i=n.minorMustEqual,o=n.patchBase,s=n.patchMustEqual;n.hasCaret&&(r===0||(i=!1),s=!1);let a=0;if(n.preRelease){let l=qM.exec(n.preRelease);if(l){let[,c,d,u,f,m]=l;a=Date.UTC(Number(c),Number(d)-1,Number(u),Number(f)||0,Number(m)||0)}}return{majorBase:r,majorMustEqual:e,minorBase:t,minorMustEqual:i,patchBase:o,patchMustEqual:s,isMinimum:n.hasGreaterEquals,notBefore:a}}function zM(n,r,e){let t;typeof n=="string"?t=Ww(Fw(n)):t=n;let i;r instanceof Date?i=r.getTime():typeof r=="string"&&(i=new Date(r).getTime());let o;if(typeof e=="string"?o=Ww(Fw(e)):o=e,!t||!o)return!1;let s=t.majorBase,a=t.minorBase,l=t.patchBase,c=o.majorBase,d=o.minorBase,u=o.patchBase,f=o.notBefore,m=o.majorMustEqual,v=o.minorMustEqual,y=o.patchMustEqual;return o.isMinimum?s>c?!0:s<c?!1:a>d?!0:a<d||i&&i<f?!1:l>=u:(s===1&&c===0&&(!m||!v||!y)&&(c=1,d=0,u=0,m=!0,v=!1,y=!1),s<c?!1:s>c?!m:a<d?!1:a>d?!v:l<u?!1:l>u?!y:!(i&&i<f))}function vT(n,r,e,t,i,o){let s=[];if(typeof t.publisher<"u"&&typeof t.publisher!="string")return s.push([Ue.Error,h(2202,null)]),s;if(typeof t.name!="string")return s.push([Ue.Error,h(2201,null,"name")]),s;if(typeof t.version!="string")return s.push([Ue.Error,h(2203,null,"version")]),s;if(!t.engines)return s.push([Ue.Error,h(2194,null,"engines")]),s;if(typeof t.engines.vscode!="string")return s.push([Ue.Error,h(2195,null,"engines.vscode")]),s;if(typeof t.extensionDependencies<"u"&&!Ow(t.extensionDependencies))return s.push([Ue.Error,h(2197,null,"extensionDependencies")]),s;if(typeof t.extensionAffinity<"u"&&!Ow(t.extensionAffinity))return s.push([Ue.Error,h(2196,null,"extensionAffinity")]),s;if(typeof t.activationEvents<"u"){if(!Ow(t.activationEvents))return s.push([Ue.Error,h(2190,null,"activationEvents")]),s;if(typeof t.main>"u"&&typeof t.browser>"u")return s.push([Ue.Error,h(2191,null,"activationEvents","main","browser")]),s}if(typeof t.extensionKind<"u"&&typeof t.main>"u"&&s.push([Ue.Warning,h(2198,null,"extensionKind")]),typeof t.main<"u"){if(typeof t.main!="string")return s.push([Ue.Error,h(2199,null,"main")]),s;{let c=oe(e,t.main);Pv(c,e)||s.push([Ue.Warning,h(2200,null,c.path,e.path)])}}if(typeof t.browser<"u"){if(typeof t.browser!="string")return s.push([Ue.Error,h(2192,null,"browser")]),s;{let c=oe(e,t.browser);Pv(c,e)||s.push([Ue.Warning,h(2193,null,c.path,e.path)])}}if(!dT(t.version))return s.push([Ue.Error,h(2204,null)]),s;let a=[];if(!jM(n,r,t,i,a))for(let c of a)s.push([Ue.Error,c]);if(o&&t.enabledApiProposals?.length){let c=[];if(!GM([...t.enabledApiProposals],c))for(let d of c)s.push([Ue.Error,d])}return s}function jM(n,r,e,t,i){return t||typeof e.main>"u"&&typeof e.browser>"u"?!0:JM(n,r,e.engines.vscode,i)}function GM(n,r){if(n.length===0)return!0;let e=Array.isArray(r)?r:void 0,t=(Array.isArray(r)?void 0:r)??mT,i=[],o=eT(n);for(let{proposalName:s,version:a}of o){if(!a)continue;t[s]?.version!==a&&i.push(s)}return i.length?(e&&(i.length===1?e.push(h(2188,null,i[0])):e.push(h(2189,null,i.slice(0,i.length-1).map(s=>`'${s}'`).join(", "),i[i.length-1]))),!1):!0}function JM(n,r,e,t=[]){let i=Ww(Fw(e));if(!i)return t.push(h(2208,null,e)),!1;if(i.majorBase===0){if(!i.majorMustEqual||!i.minorMustEqual)return t.push(h(2206,null,e)),!1}else if(!i.majorMustEqual)return t.push(h(2207,null,e)),!1;return zM(n,r,i)?!0:(t.push(h(2205,null,n,e)),!1)}function Ow(n){if(!Array.isArray(n))return!1;for(let r=0,e=n.length;r<e;r++)if(typeof n[r]!="string")return!1;return!0}var gT,qM,yT=I(()=>{gt();Cu();xe();Mw();sp();hT();gT=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,qM=/^-(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?$/});function IT(n,r,e,t){try{QM(n,r,e,t)}catch(i){n.error(i?.message??i)}return r}function QM(n,r,e,t){let i=(o,s,a)=>{let l=o[s];if(Fe(l)){let c=l,d=c.length;if(d>1&&c[0]==="%"&&c[d-1]==="%"){let u=c.substr(1,d-2),f=e[u];f===void 0&&t&&(f=t[u]);let m=typeof f=="string"?f:f?.message,v=t?.[u],y=typeof v=="string"?v:v?.message;if(!m){y||n.warn(`[${r.name}]: ${h(2171,null,u)}`);return}if(a&&(s==="title"||s==="category")&&y&&y!==m){let C={value:m,original:y};o[s]=C}else o[s]=m}}else if(Ge(l))for(let c in l)l.hasOwnProperty(c)&&(c==="commands"?i(l,c,!0):i(l,c,a));else if(Array.isArray(l))for(let c=0;c<l.length;c++)i(l,c,a)};for(let o in r)r.hasOwnProperty(o)&&i(r,o)}var wT=I(()=>{Oe();xe()});function ST(n,r){let e=new Set;for(let t of n.builtInExtensionsEnabledWithAutoUpdates){let i=t.toLowerCase();r.skipBuiltinExtensions?.some(o=>o.toLowerCase()===i)||e.add(i)}return e}var bT,xT,lp,pa,hc,gc,Xh,Uw=I(()=>{Jt();he();di();ot();He();rn();cT();$();ze();we();X();gt();Mw();Cu();ce();xe();si();Lw();sp();yT();je();Z();te();qt();q();Rd();ap();en();Zi();wT();(r=>{function n(e,t){if(e===t)return!0;let i=Object.keys(e),o=new Set;for(let s of Object.keys(t))o.add(s);if(i.length!==o.size)return!1;for(let s of i){if(e[s]!==t[s])return!1;o.delete(s)}return o.size===0}r.equals=n})(bT||={});xT=O("IExtensionsScannerService"),lp=class extends T{constructor(e,t,i,o,s,a,l,c,d,u,f,m){super();this.systemExtensionsLocation=e;this.userExtensionsLocation=t;this.extensionsControlLocation=i;this.userDataProfilesService=s;this.extensionsProfileScannerService=a;this.fileService=l;this.logService=c;this.environmentService=d;this.productService=u;this.uriIdentityService=f;this.instantiationService=m;this._onDidChangeCache=this._register(new b);this.onDidChangeCache=this._onDidChangeCache.event;this.initializeDefaultProfileExtensionsPromise=void 0;this.systemExtensionsCachedScanner=this._register(this.instantiationService.createInstance(gc,o)),this.userExtensionsCachedScanner=this._register(this.instantiationService.createInstance(gc,o)),this.extensionsScanner=this._register(this.instantiationService.createInstance(hc)),this._register(this.systemExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(0))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(1)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=aT(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t){let[i,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]);return this.dedupExtensions(i,o,[],await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){let t=[];t.push(this.scanDefaultSystemExtensions(e.language)),t.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));let[i,o]=await Promise.all(t),s=[...i,...o];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 t=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,i=await this.createExtensionScannerInput(e.profileLocation,!0,1,e.language,!0,t,e.productVersion??this.getProductVersion()),o=e.useCache&&!i.devMode?this.userExtensionsCachedScanner:this.extensionsScanner,s;try{s=await o.scanExtensions(i)}catch(a){if(a instanceof ua&&a.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions(),s=await o.scanExtensions(i);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 t=await this.createExtensionScannerInput(this.userExtensionsLocation,!1,1,void 0,!0,void 0,this.getProductVersion()),i=await this.extensionsScanner.scanExtensions(t);return this.applyScanOptions(i,1,{includeAllVersions:e.includeAllVersions,includeInvalid:e.includeInvalid})}async scanExtensionsUnderDevelopment(e,t){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){let i=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(o=>o.scheme===W.file).map(async o=>{let s=await this.createExtensionScannerInput(o,!1,1,t.language,!1,void 0,this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(s)).map(l=>(l.type=e.find(c=>da(c.identifier,l.identifier))?.type??l.type,this.extensionsScanner.validate(l,s)))}))).flat();return this.applyScanOptions(i,"development",{includeInvalid:t.includeInvalid,pickLatest:!0})}return[]}async scanExistingExtension(e,t,i){let o=await this.createExtensionScannerInput(e,!1,t,i.language,!0,void 0,this.getProductVersion()),s=await this.extensionsScanner.scanExtension(o);return!s||!i.includeInvalid&&!s.isValid?null:s}async scanOneOrMultipleExtensions(e,t,i){let o=await this.createExtensionScannerInput(e,!1,t,i.language,!0,void 0,this.getProductVersion()),s=await this.extensionsScanner.scanOneOrMultipleExtensions(o);return this.applyScanOptions(s,t,{includeInvalid:i.includeInvalid,pickLatest:!0})}async scanMultipleExtensions(e,t,i){let o=[];return await Promise.all(e.map(async s=>{let a=await this.scanOneOrMultipleExtensions(s,t,i);o.push(...a)})),this.applyScanOptions(o,t,{includeInvalid:i.includeInvalid,pickLatest:!0})}async updateManifestMetadata(e,t){let i=oe(e,"package.json"),o=(await this.fileService.readFile(i)).value.toString(),s=JSON.parse(o);s.__metadata={...s.__metadata,...t},await this.fileService.writeFile(oe(e,"package.json"),H.fromString(JSON.stringify(s,null,"	")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof ua&&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(t=>[t,t.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,H.fromString(JSON.stringify([])))}catch(t){jr(t)!==1&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),mr(t))}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,t,i={}){return i.includeAllVersions||(e=this.dedupExtensions(t===0?e:void 0,t===1?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),!!i.pickLatest)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,s)=>{let a=Pe(o.location.fsPath),l=Pe(s.location.fsPath);return a<l?-1:a>l?1:0})}dedupExtensions(e,t,i,o,s){let a=(d,u,f)=>{if(!f&&!(d.isBuiltin||u.isBuiltin)){if(d.metadata?.isApplicationScoped&&!u.metadata?.isApplicationScoped)return!1;if(!d.metadata?.isApplicationScoped&&u.metadata?.isApplicationScoped)return!0}if(d.isValid&&!u.isValid)return!1;if(d.isValid===u.isValid){if(s&&uT(d.manifest.version,u.manifest.version))return this.logService.debug(`Skipping extension ${u.location.path} with lower version ${u.manifest.version} in favour of ${d.location.path} with version ${d.manifest.version}`),!1;if(pT(d.manifest.version,u.manifest.version)){if(d.type===0)return this.logService.debug(`Skipping extension ${u.location.path} in favour of system extension ${d.location.path} with same version`),!1;if(d.targetPlatform===o)return this.logService.debug(`Skipping extension ${u.location.path} from different target platform ${u.targetPlatform}`),!1}}return f?this.logService.warn(`Overwriting user extension ${d.location.path} with ${u.location.path}.`):this.logService.debug(`Overwriting user extension ${d.location.path} with ${u.location.path}.`),!0},l=new jh;e?.forEach(d=>{let u=l.get(d.identifier.id);(!u||a(u,d,!1))&&l.set(d.identifier.id,d)});let c=ST(this.productService,this.environmentService);return t?.forEach(d=>{let u=l.get(d.identifier.id);if(!u&&e&&d.type===0){this.logService.debug(`Skipping obsolete system extension ${d.location.path}.`);return}if(c.has(d.identifier.id.toLowerCase())&&!d.forceAutoUpdate){this.logService.info(`Skipping user installed builtin extension ${d.identifier.id} with version ${d.manifest.version} because it is not allowed to in the current product quality ${this.productService.quality}`);return}(!u||a(u,d,!1))&&l.set(d.identifier.id,d)}),i?.forEach(d=>{let u=l.get(d.identifier.id);(!u||a(u,d,!0))&&l.set(d.identifier.id,d),l.set(d.identifier.id,d)}),[...l.values()]}async scanDefaultSystemExtensions(e){this.logService.trace("Started scanning system extensions");let t=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,0,e,!0,void 0,this.getProductVersion()),o=await(t.devMode?this.extensionsScanner:this.systemExtensionsCachedScanner).scanExtensions(t);return this.logService.trace("Scanned system extensions:",o.length),o}async scanDevSystemExtensions(e,t){let i=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!i?.length)return[];this.logService.trace("Started scanning dev system extensions");let o=t?await this.getBuiltInExtensionControl():{},s=[],a=x.file(kt(N(st.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(let c of i){let d=o[c.name]||"marketplace";switch(d){case"disabled":break;case"marketplace":s.push(oe(a,c.name));break;default:s.push(x.file(d));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),at(l)}async getBuiltInExtensionControl(){try{let e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,t,i,o,s,a,l){let c=await this.getTranslations(o??vi),d=await this.getMtime(e),u=t&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,f=u?await this.getMtime(u):void 0;return new pa(e,d,u,f,t,a,i,s,l.version,l.date,this.productService.commit,!this.environmentService.isBuilt,o,c)}async getMtime(e){try{let t=await this.fileService.stat(e);if(typeof t.mtime=="number")return t.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};lp=E([g(4,Dr),g(5,Is),g(6,Me),g(7,B),g(8,wi),g(9,Te),g(10,Rt),g(11,Ht)],lp);pa=class{constructor(r,e,t,i,o,s,a,l,c,d,u,f,m,v){this.location=r;this.mtime=e;this.applicationExtensionslocation=t;this.applicationExtensionslocationMtime=i;this.profile=o;this.profileScanOptions=s;this.type=a;this.validate=l;this.productVersion=c;this.productDate=d;this.productCommit=u;this.devMode=f;this.language=m;this.translations=v}static createNlsConfiguration(r){return{language:r.language,pseudo:r.language==="pseudo",devMode:r.devMode,translations:r.translations}}static equals(r,e){return Na(r.location,e.location)&&r.mtime===e.mtime&&Na(r.applicationExtensionslocation,e.applicationExtensionslocation)&&r.applicationExtensionslocationMtime===e.applicationExtensionslocationMtime&&r.profile===e.profile&&ci(r.profileScanOptions,e.profileScanOptions)&&r.type===e.type&&r.validate===e.validate&&r.productVersion===e.productVersion&&r.productDate===e.productDate&&r.productCommit===e.productCommit&&r.devMode===e.devMode&&r.language===e.language&&bT.equals(r.translations,e.translations)}},hc=class extends T{constructor(e,t,i,o,s,a){super();this.extensionsProfileScannerService=e;this.uriIdentityService=t;this.fileService=i;this.environmentService=s;this.logService=a;this.extensionsEnabledWithApiProposalVersion=o.extensionsEnabledWithApiProposalVersion?.map(l=>l.toLowerCase())??[],this.productQuality=o.quality,this.productBuiltInExtensionsEnabledWithAutoUpdates=ST(o,s)}async scanExtensions(e){return e.profile?this.scanExtensionsFromProfile(e):this.scanExtensionsFromLocation(e)}async scanExtensionsFromLocation(e){let t=await this.fileService.resolve(e.location);if(!t.children?.length)return[];let i=await Promise.all(t.children.map(async o=>{if(!o.isDirectory||e.type===1&&qr(o.resource).indexOf(".")===0)return null;let s=new pa(o.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 at(i).sort((o,s)=>o.location.path<s.location.path?-1:1)}async scanExtensionsFromProfile(e){let t=await this.scanExtensionsFromProfileResource(e.location,()=>!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(o=>!o.metadata?.isApplicationScoped);let i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,o=>!!o.metadata?.isBuiltin||!!o.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){let o=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!o.length)return[];let s=await Promise.all(o.map(async a=>{if(t(a)){let l=new pa(a.location,i.mtime,i.applicationExtensionslocation,i.applicationExtensionslocationMtime,i.profile,i.profileScanOptions,i.type,i.validate,i.productVersion,i.productDate,i.productCommit,i.devMode,i.language,i.translations);return this.scanExtension(l,a)}return null}));return at(s)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(oe(e.location,"package.json"))){let t=await this.scanExtension(e);return t?[t]:[]}else return await this.scanExtensions(e)}catch(t){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,mr(t)),[]}}async scanExtension(e,t){let i=[],o=!0,s;try{s=await this.scanExtensionManifest(e.location)}catch(m){if(t){i.push([Ue.Error,mr(m)]),o=!1;let[v,y]=t.identifier.id.split(".");s={name:y,publisher:v,version:t.version,engines:{vscode:""}}}else return e.type!==0&&this.logService.error(m),null}s.publisher||(s.publisher=Gh);let a;t?a={...t.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=sT(s.publisher,s.name),c=a?.id?{id:l,uuid:a.id}:{id:l},d=a?.isSystem?0:e.type,u=d===0||!!a?.isBuiltin;try{s=await this.translateManifest(e.location,s,pa.createNlsConfiguration(e))}catch(m){this.logService.warn("Failed to translate manifest",mr(m))}let f={type:d,identifier:c,manifest:s,location:e.location,isBuiltin:u,targetPlatform:a?.targetPlatform??"undefined",publisherDisplayName:a?.publisherDisplayName,metadata:a,isValid:o,validations:i,preRelease:!!a?.preRelease,forceAutoUpdate:this.productBuiltInExtensionsEnabledWithAutoUpdates.has(l.toLowerCase())&&this.productQuality==="stable"};return e.validate&&(f=this.validate(f,e)),s.enabledApiProposals&&(!this.environmentService.isBuilt||this.extensionsEnabledWithApiProposalVersion.includes(l.toLowerCase()))&&(s.originalEnabledApiProposals=s.enabledApiProposals,s.enabledApiProposals=tT([...s.enabledApiProposals])),f}validate(e,t){let i=e.isValid,o=this.environmentService.isBuilt&&this.extensionsEnabledWithApiProposalVersion.includes(e.identifier.id.toLowerCase()),s=vT(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin,o);for(let[a,l]of s)a===Ue.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,l)));return e.isValid=i,e.validations=[...e.validations,...s],e}async scanExtensionManifest(e){let t=oe(e,"package.json"),i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(s){throw jr(s)!==1&&this.logService.error(this.formatMessage(e,h(2172,null,t.path,s.message))),s}let o;try{o=JSON.parse(i)}catch(s){let a=[];Oi(i,a);for(let l of a)this.logService.error(this.formatMessage(e,h(2174,null,t.path,l.offset,l.length,Jh(l.error))));throw s}if(rs(o)!=="object"){let s=this.formatMessage(e,h(2175,null,t.path));throw this.logService.error(s),new Error(s)}return o}async translateManifest(e,t,i){let o=await this.getLocalizedMessages(e,t,i);if(o)try{let s=[],a=await this.resolveOriginalMessageBundle(o.default,s);if(s.length>0)return s.forEach(c=>{this.logService.error(this.formatMessage(e,h(2176,null,o.default?.path,Jh(c.error))))}),t;if(rs(o)!=="object")return this.logService.error(this.formatMessage(e,h(2173,null,o.default?.path))),t;let l=o.values||Object.create(null);return IT(this.logService,t,l,a)}catch{}return t}async getLocalizedMessages(e,t,i){let o=oe(e,"package.nls.json"),s=(d,u)=>{u.forEach(f=>{this.logService.error(this.formatMessage(e,h(2176,null,d?.path,Jh(f.error))))})},a=d=>{this.logService.error(this.formatMessage(e,h(2173,null,d?.path)))},l=`${t.publisher}.${t.name}`,c=i.translations[l];if(c)try{let d=x.file(c),u=(await this.fileService.readFile(d)).value.toString(),f=[],m=Oi(u,f);return f.length>0?(s(d,f),{values:void 0,default:o}):rs(m)!=="object"?(a(d),{values:void 0,default:o}):{values:m.contents?m.contents.package:void 0,default:o}}catch{return{values:void 0,default:o}}else{if(!await this.fileService.exists(o))return;let u;try{u=await this.findMessageBundles(e,i)}catch{return}if(!u.localized)return{values:void 0,default:u.original};try{let f=(await this.fileService.readFile(u.localized)).value.toString(),m=[],v=Oi(f,m);return m.length>0?(s(u.localized,m),{values:void 0,default:u.original}):rs(v)!=="object"?(a(u.localized),{values:void 0,default:u.original}):{values:v,default:u.original}}catch{return{values:void 0,default:u.original}}}}async resolveOriginalMessageBundle(e,t){if(e)try{let i=(await this.fileService.readFile(e)).value.toString();return Oi(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,o)=>{let s=a=>{let l=oe(e,`package.nls.${a}.json`);this.fileService.exists(l).then(c=>{c&&i({localized:l,original:oe(e,"package.nls.json")});let d=a.lastIndexOf("-");d===-1?i({localized:oe(e,"package.nls.json"),original:null}):(a=a.substring(0,d),s(a))})};if(t.devMode||t.pseudo||!t.language)return i({localized:oe(e,"package.nls.json"),original:null});s(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};hc=E([g(0,Is),g(1,Rt),g(2,Me),g(3,Te),g(4,wi),g(5,B)],hc);gc=class extends hc{constructor(e,t,i,o,s,a,l,c){super(i,o,s,a,l,c);this.currentProfile=e;this.userDataProfilesService=t;this.cacheValidatorThrottler=this._register(new Tr(3e3));this._onDidChangeCache=this._register(new b);this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){let t=this.getCacheFile(e),i=await this.readExtensionCache(t);if(this.input=e,i&&i.input&&pa.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===0?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(s=>(s.location=x.revive(s.location),s));let o=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:o}),o}async readExtensionCache(e){try{let t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Yi(i.input)}}catch(t){jr(t)!==1&&this.logService.debug("Error while reading the extension cache file:",e.path,mr(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,H.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,mr(i))}}async validateCache(){if(!this.input)return;let e=this.getCacheFile(this.input),t=await this.readExtensionCache(e);if(!t)return;let i=t.result,o=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!ci(o,i))try{this.logService.info("Invalidating Cache",i,o),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(s){this.logService.error(s)}}getCacheFile(e){let t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===0?ZC:YC)}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(t=>this.uriIdentityService.extUri.isEqual(e.location,t.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};gc=E([g(1,Dr),g(2,Is),g(3,Rt),g(4,Me),g(5,Te),g(6,wi),g(7,B)],gc);Xh=class extends lp{constructor(r,e,t,i,o,s,a,l,c,d,u,f){super(r,e,oe(t,".vscode-oss-dev","extensions","control.json"),i,o,s,a,l,c,d,u,f),this.translationsPromise=(async()=>{if(zg)try{let m=await this.fileService.readFile(x.file(zg));return JSON.parse(m.value.toString())}catch{}return Object.create(null)})()}getTranslations(r){return this.translationsPromise}}});var vc,PT=I(()=>{ce();si();ap();Uw();je();Z();te();qt();Zi();en();vc=class extends Xh{constructor(r,e,t,i,o,s,a,l){super(x.file(o.builtinExtensionsPath),x.file(o.extensionsPath),o.userHome,r.defaultProfile,r,e,t,i,o,s,a,l)}};vc=E([g(0,Dr),g(1,Is),g(2,Me),g(3,B),g(4,vr),g(5,Te),g(6,Rt),g(7,Ht)],vc)});var yc,ET=I(()=>{$();Ct();tn();es();Rr();he();Kt();yc=class extends T{constructor(e,t,i){super();this.userDataProfilesService=t;this.windowsMainService=i;this._register(e.onWillLoadWindow(o=>{o.reason===2&&this.unsetProfileForWorkspace(o.window)})),this._register(e.onBeforeCloseWindow(o=>this.unsetProfileForWorkspace(o))),this._register(new gr(()=>this.cleanUpEmptyWindowAssociations(),30*1e3)).schedule()}async unsetProfileForWorkspace(e){let t=this.getWorkspace(e),i=this.userDataProfilesService.getProfileForWorkspace(t);i?.isTransient&&(this.userDataProfilesService.unsetWorkspace(t,i.isTransient),i.isTransient&&await this.userDataProfilesService.cleanUpTransientProfiles())}getWorkspace(e){return e.openedWorkspace??jo(e.backupPath,e.isExtensionDevelopmentHost)}cleanUpEmptyWindowAssociations(){let e=this.userDataProfilesService.getAssociatedEmptyWindows();if(e.length===0)return;let t=this.windowsMainService.getWindows().map(i=>this.getWorkspace(i));for(let i of e)t.some(o=>o.id===i.id)||this.userDataProfilesService.unsetWorkspace(i,!1)}};yc=E([g(0,ye),g(1,Ur),g(2,qe)],yc)});var Yh,CT=I(()=>{q();$();Rn();Yh=class extends T{constructor(e,t,i){super();this.storageMainService=e;this.userDataProfilesService=t;this.logService=i;let o=this._register(new Qt);this._onDidChange=this._register(new b({onWillAddFirstListener:()=>o.value=this.registerStorageChangeListeners(),onDidRemoveLastListener:()=>o.value=void 0}))}registerStorageChangeListeners(){this.logService.debug("ProfileStorageChangesListenerChannel#registerStorageChangeListeners");let e=new j;return e.add(S.debounce(this.storageMainService.applicationStorage.onDidChangeStorage,(t,i)=>(t?t.push(i.key):t=[i.key],t),100)(t=>this.onDidChangeApplicationStorage(t))),e.add(S.debounce(this.storageMainService.onDidChangeProfileStorage,(t,i)=>{t||(t=new Map);let o=t.get(i.profile.id);return o||t.set(i.profile.id,o={profile:i.profile,keys:[],storage:i.storage}),o.keys.push(i.key),t},100)(t=>this.onDidChangeProfileStorage(t))),e}onDidChangeApplicationStorage(e){let t=e.includes(mo)?[this.userDataProfilesService.defaultProfile]:[],i=[];if(e=e.filter(o=>o!==mo),e.length){let o=sm(this.storageMainService.applicationStorage.storage);i.push({profile:this.userDataProfilesService.defaultProfile,changes:e.map(s=>({key:s,scope:0,target:o[s]}))})}this.triggerEvents(t,i)}onDidChangeProfileStorage(e){let t=[],i=new Map;for(let[o,s]of e.entries()){s.keys.includes(mo)&&t.push(s.profile);let a=s.keys.filter(l=>l!==mo);if(a.length){let l=sm(s.storage.storage);i.set(o,{profile:s.profile,changes:a.map(c=>({key:c,scope:0,target:l[c]}))})}}this.triggerEvents(t,[...i.values()])}triggerEvents(e,t){(e.length||t.length)&&this._onDidChange.fire({valueChanges:t,targetChanges:e})}listen(e,t,i){if(t==="onDidChange")return this._onDidChange.event;throw new Error(`[ProfileStorageChangesListenerChannel] Event not found: ${t}`)}async call(e,t){throw new Error(`Call not found: ${t}`)}}});async function TT(n,r){let e=n.getItem(pm);return(typeof e!="string"||V&&e==="6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead")&&(e=await g0(r.error.bind(r))),e}async function _T(n,r){let e=n.getItem(fm);return typeof e!="string"&&(e=await v0(r.error.bind(r))),e}async function Nw(n,r){let e=n.getItem(fu);return typeof e!="string"&&(e=await Vm(r.error.bind(r))),e}var kT=I(()=>{X();Ou();Zt()});async function RT(n,r){r.trace("Resolving machine identifier...");let e=await TT(n,r);return n.setItem(pm,e),r.trace(`Resolved machine identifier: ${e}`),e}async function DT(n,r){r.trace("Resolving SQM identifier...");let e=await _T(n,r);return n.setItem(fm,e),r.trace(`Resolved SQM identifier: ${e}`),e}async function AT(n,r){r.trace("Resolving devDevice identifier...");let e=await Nw(n,r);return n.setItem(fu,e),r.trace(`Resolved devDevice identifier: ${e}`),e}async function LT(n,r){let e=await Vm(r.error.bind(r)),t=await Nw(n,r);e!==t&&n.setItem(fu,e)}var MT=I(()=>{Ou();Zt();kT()});var Ic,OT=I(()=>{te();en();Zi();ap();je();si();ce();Ic=class extends mc{constructor(r,e,t,i,o){super(x.file(r.extensionsPath),e,t,i,o)}};Ic=E([g(0,vr),g(1,Me),g(2,Dr),g(3,Rt),g(4,B)],Ic)});var Zh,FT=I(()=>{Cr();ce();te();Zh=class{constructor(r){this.loggerService=r;this.loggers=new mt}listen(r,e,t){switch(e){case"onDidChangeLoggers":return t?this.loggerService.getOnDidChangeLoggersEvent(t):this.loggerService.onDidChangeLoggers;case"onDidChangeLogLevel":return t?this.loggerService.getOnDidChangeLogLevelEvent(t):this.loggerService.onDidChangeLogLevel;case"onDidChangeVisibility":return t?this.loggerService.getOnDidChangeVisibilityEvent(t):this.loggerService.onDidChangeVisibility}throw new Error(`Event not found: ${e}`)}async call(r,e,t){switch(e){case"createLogger":this.createLogger(x.revive(t[0]),t[1],t[2]);return;case"log":return this.log(x.revive(t[0]),t[1]);case"consoleLog":return this.consoleLog(t[0],t[1]);case"setLogLevel":return iu(t[0])?this.loggerService.setLogLevel(t[0]):this.loggerService.setLogLevel(x.revive(t[0]),t[1]);case"setVisibility":return this.loggerService.setVisibility(x.revive(t[0]),t[1]);case"registerLogger":return this.loggerService.registerLogger({...t[0],resource:x.revive(t[0].resource)},t[1]);case"deregisterLogger":return this.loggerService.deregisterLogger(x.revive(t[0]))}throw new Error(`Call not found: ${e}`)}createLogger(r,e,t){this.loggers.set(r,this.loggerService.createLogger(r,e,t))}consoleLog(r,e){let t=console.log;switch(r){case 5:t=console.error;break;case 4:t=console.warn;break;case 3:t=console.info;break}t.call(console,...e)}log(r,e){let t=this.loggers.get(r);if(!t)throw new Error("Create the logger before logging");for(let[i,o]of e)ou(t,i,o)}}});var Bw,wc,cp,WT=I(()=>{$();Z();te();Kt();os();Zt();En();q();he();Ct();Bw=O("utilityProcessWorker"),wc=class extends T{constructor(e,t,i,o){super();this.logService=e;this.windowsMainService=t;this.telemetryService=i;this.lifecycleMainService=o;this.workers=new Map}async createWorker(e){let t=`window: ${e.reply.windowId}, moduleId: ${e.process.moduleId}`;this.logService.trace(`[UtilityProcessWorker]: createWorker(${t})`);let i=this.hash(e);this.workers.has(i)&&(this.logService.warn(`[UtilityProcessWorker]: createWorker() found an existing worker that will be terminated (${t})`),this.disposeWorker(e));let o=new cp(this.logService,this.windowsMainService,this.telemetryService,this.lifecycleMainService,e);if(!o.spawn())return{reason:{code:1,signal:"EINVALID"}};this.workers.set(i,o);let s=new At;return S.once(o.onDidTerminate)(a=>{a.code===0?this.logService.trace(`[UtilityProcessWorker]: terminated normally with code ${a.code}, signal: ${a.signal}`):this.logService.error(`[UtilityProcessWorker]: terminated unexpectedly with code ${a.code}, signal: ${a.signal}`),this.workers.delete(i),s.complete({reason:a})}),s.p}hash(e){return cr({moduleId:e.process.moduleId,windowId:e.reply.windowId})}async disposeWorker(e){let t=this.hash(e),i=this.workers.get(t);i&&(this.logService.trace(`[UtilityProcessWorker]: disposeWorker(window: ${e.reply.windowId}, moduleId: ${e.process.moduleId})`),i.kill(),i.dispose(),this.workers.delete(t))}};wc=E([g(0,B),g(1,qe),g(2,Ke),g(3,ye)],wc);cp=class extends T{constructor(e,t,i,o,s){super();this.windowsMainService=t;this.configuration=s;this._onDidTerminate=this._register(new b);this.onDidTerminate=this._onDidTerminate.event;this.utilityProcess=this._register(new ns(e,t,i,o)),this.registerListeners()}registerListeners(){this._register(this.utilityProcess.onExit(e=>this._onDidTerminate.fire({code:e.code,signal:e.signal}))),this._register(this.utilityProcess.onCrash(e=>this._onDidTerminate.fire({code:e.code,signal:"ECRASH"})))}spawn(){let t=this.windowsMainService.getWindowById(this.configuration.reply.windowId)?.win?.webContents.getOSProcessId();return this.utilityProcess.start({type:this.configuration.process.type,name:this.configuration.process.name,entryPoint:this.configuration.process.moduleId,parentLifecycleBound:t,windowLifecycleBound:!0,correlationId:`${this.configuration.reply.windowId}`,responseWindowId:this.configuration.reply.windowId,responseChannel:this.configuration.reply.channel,responseNonce:this.configuration.reply.nonce})}kill(){this.utilityProcess.kill()}};cp=E([g(0,B),g(1,qe),g(2,Ke),g(3,ye)],cp)});var UT,NT=I(()=>{UT="utilityProcessWorker"});var Lge,XM,Vw,Hw,Mge,bc=I(()=>{Z();Xi();Lge=O("ptyService"),XM={Backend:"workbench.contributions.terminal.processBackend"},Vw=class{constructor(){this._backends=new Map}get backends(){return this._backends}registerTerminalBackend(r){let e=this._sanitizeRemoteAuthority(r.remoteAuthority);if(this._backends.has(e))throw new Error(`A terminal backend with remote authority '${e}' was already registered.`);this._backends.set(e,r)}getTerminalBackend(r){return this._backends.get(this._sanitizeRemoteAuthority(r))}_sanitizeRemoteAuthority(r){return r?.toLowerCase()??""}};Pt.add(XM.Backend,new Vw);Hw=O("localPtyService"),Mge=O("terminalLogService")});var Sc,BT=I(()=>{Lt();zd();Ct();te();So();bc();os();Uf();Ai();$();q();di();Oe();et();ze();Sc=class extends T{constructor(e,t,i,o,s){super();this._reconnectConstants=e;this._configurationService=t;this._environmentMainService=i;this._lifecycleMainService=o;this._logService=s;this.utilityProcess=void 0;this._onRequestConnection=this._register(new b);this.onRequestConnection=this._onRequestConnection.event;this._onWillShutdown=this._register(new b);this.onWillShutdown=this._onWillShutdown.event;this._register(this._lifecycleMainService.onWillShutdown(()=>this._onWillShutdown.fire())),rt.on("vscode:createPtyHostMessageChannel",(a,l)=>this._onWindowConnection(a,l)),this._register(G(()=>{rt.removeHandler("vscode:createPtyHostMessageChannel")}))}start(){this.utilityProcess=new sr(this._logService,Vn,this._lifecycleMainService);let e=zx(this._environmentMainService.args,this._environmentMainService.isBuilt),t=e.port?["--nolazy",`--inspect${e.break?"-brk":""}=${e.port}`]:void 0;this.utilityProcess.start({type:"ptyHost",name:"pty-host",entryPoint:"vs/platform/terminal/node/ptyHostMain",execArgv:t,args:["--logsPath",this._environmentMainService.logsHome.with({scheme:W.file}).fsPath],env:this._createPtyHostConfiguration()});let i=this.utilityProcess.connect(),o=new Ko(i,"ptyHost"),s=new j;return s.add(o),s.add(G(()=>{this.utilityProcess?.kill(),this.utilityProcess?.dispose(),this.utilityProcess=void 0})),{client:o,store:s,onDidProcessExit:this.utilityProcess.onExit}}_createPtyHostConfiguration(){this._environmentMainService.unsetSnapExportedVariables();let e={...or(process.env),VSCODE_ESM_ENTRYPOINT:"vs/platform/terminal/node/ptyHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true",VSCODE_RECONNECT_GRACE_TIME:String(this._reconnectConstants.graceTime),VSCODE_RECONNECT_SHORT_GRACE_TIME:String(this._reconnectConstants.shortGraceTime),VSCODE_RECONNECT_SCROLLBACK:String(this._reconnectConstants.scrollback)},t=this._configurationService.getValue("terminal.integrated.developer.ptyHost.latency");t&&Ki(t)&&(e.VSCODE_LATENCY=String(t));let i=this._configurationService.getValue("terminal.integrated.developer.ptyHost.startupDelay");return i&&Ki(i)&&(e.VSCODE_STARTUP_DELAY=String(i)),this._environmentMainService.restoreSnapExportedVariables(),e}_onWindowConnection(e,t){this._onRequestConnection.fire();let i=this.utilityProcess.connect();if(e.sender.isDestroyed()){i.close();return}e.sender.postMessage("vscode:createPtyHostMessageChannelResult",t,[i])}};Sc=E([g(1,ue),g(2,_e),g(3,ye),g(4,B)],Sc)});var xc,$w=I(()=>{ce();q();te();$();xc=class extends T{constructor(r,e){super(),e.call("setLogLevel",[r.getLogLevel()]),this._register(r.onDidChangeLogLevel(t=>e.call("setLogLevel",[t]))),e.call("getRegisteredLoggers").then(t=>{for(let i of t)r.registerLogger({...i,resource:x.revive(i.resource)})}),this._register(e.listen("onDidChangeVisibility")(([t,i])=>r.setVisibility(x.revive(t),i))),this._register(e.listen("onDidChangeLoggers")(({added:t,removed:i})=>{for(let o of t)r.registerLogger({...o,resource:x.revive(o.resource)});for(let o of i)r.deregisterLogger(o.resource)}))}}});var Pc,VT=I(()=>{he();wt();q();$();te();Pc=class extends T{constructor(e,t){super();this._logService=t;this._lastRequestId=0;this._pendingRequests=new Map;this._pendingRequestDisposables=new Map;this._onCreateRequest=this._register(new b);this.onCreateRequest=this._onCreateRequest.event;this._timeout=e===void 0?15e3:e,this._register(G(()=>{for(let i of this._pendingRequestDisposables.values())ut(i)}))}createRequest(e){return new Promise((t,i)=>{let o=++this._lastRequestId;this._pendingRequests.set(o,t),this._onCreateRequest.fire({requestId:o,...e});let s=new $e;lt(this._timeout,s.token).then(()=>i(`Request ${o} timed out (${this._timeout}ms)`)),this._pendingRequestDisposables.set(o,[G(()=>s.cancel())])})}acceptReply(e,t){let i=this._pendingRequests.get(e);i?(this._pendingRequests.delete(e),ut(this._pendingRequestDisposables.get(e)||[]),this._pendingRequestDisposables.delete(e),i(t)):this._logService.warn(`RequestStore#acceptReply was called without receiving a matching request ${e}`)}};Pc=E([g(1,B)],Pc)});function HT(n,r){let e=[{name:null,description:h(2497,null)}];return e.push(...n.map(t=>({name:t.profileName,description:YM(t)}))),r&&e.push(...r.map(t=>({name:t.title,description:ZM(t)}))),{values:e.map(t=>t.name),markdownDescriptions:e.map(t=>t.description)}}function YM(n){let r=`$(${lc.isThemeIcon(n.icon)?n.icon.id:n.icon?n.icon:pt.terminal.id}) ${n.profileName}
- path: ${n.path}`;return n.args&&(Fe(n.args)?r+=`
- args: "${n.args}"`:r+=`
- args: [${n.args.length===0?"":`'${n.args.join("','")}'`}]`),n.overrideName!==void 0&&(r+=`
- overrideName: ${n.overrideName}`),n.color&&(r+=`
- color: ${n.color}`),n.env&&(r+=`
- env: ${JSON.stringify(n.env)}`),r}function ZM(n){return`$(${lc.isThemeIcon(n.icon)?n.icon.id:n.icon?n.icon:pt.terminal.id}) ${n.title}
- extensionIdentifier: ${n.extensionIdentifier}`}var $T=I(()=>{ip();ce();xe();Pw();Oe()});function zw(n){let r=n===2?"linux":n===1?"osx":"windows";return h(2476,null,Lp(n),'```json\n"terminal.integrated.profile.'+r+'": {\n  "bash": null\n}\n```',"[","](https://code.visualstudio.com/docs/terminal/profiles)")}function qT(){Pt.as(lr.Configuration).registerConfiguration(rO),iO()}function iO(n,r){let e=Pt.as(lr.Configuration),t;n&&(t=HT(n?.profiles,r));let i=jw;jw={id:"terminal",order:100,title:h(2480,null),type:"object",properties:{"terminal.integrated.defaultProfile.linux":{restricted:!0,markdownDescription:h(2471,null),type:["string","null"],default:null,enum:n?.os===3?t?.values:void 0,markdownEnumDescriptions:n?.os===3?t?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.osx":{restricted:!0,markdownDescription:h(2472,null),type:["string","null"],default:null,enum:n?.os===2?t?.values:void 0,markdownEnumDescriptions:n?.os===2?t?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.windows":{restricted:!0,markdownDescription:h(2473,null),type:["string","null"],default:null,enum:n?.os===1?t?.values:void 0,markdownEnumDescriptions:n?.os===1?t?.markdownDescriptions:void 0}}},e.updateConfigurations({add:[jw],remove:i?[i]:[]})}var eO,tO,Ec,qw,Kw,rO,jw,KT=I(()=>{ip();X();xe();no();Xi();bc();$T();eO={type:["string","null"],enum:["terminal.ansiBlack","terminal.ansiRed","terminal.ansiGreen","terminal.ansiYellow","terminal.ansiBlue","terminal.ansiMagenta","terminal.ansiCyan","terminal.ansiWhite"],default:null},tO={type:"string",enum:Array.from(xw(),n=>n.id),markdownEnumDescriptions:Array.from(xw(),n=>`$(${n.id})`)},Ec={args:{description:h(2481,null),type:"array",items:{type:"string"}},icon:{description:h(2484,null),...tO},color:{description:h(2482,null),...eO},env:{markdownDescription:h(2483,null),type:"object",additionalProperties:{type:["string","null"]},default:{}}},qw={type:"object",required:["path"],properties:{path:{description:h(2492,null),type:["string","array"],items:{type:"string"}},overrideName:{description:h(2491,null),type:"boolean"},...Ec}},Kw={type:"object",required:["path"],properties:{path:{description:h(2479,null),type:["string"],items:{type:"string"}},...Ec}};rO={id:"terminal",order:100,title:h(2480,null),type:"object",properties:{"terminal.integrated.automationProfile.linux":{restricted:!0,markdownDescription:h(2467,null),type:["object","null"],default:null,anyOf:[{type:"null"},Kw],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.osx":{restricted:!0,markdownDescription:h(2468,null),type:["object","null"],default:null,anyOf:[{type:"null"},Kw],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.windows":{restricted:!0,markdownDescription:h(2469,null,"`terminal.integrated.automationShell.windows`"),type:["object","null"],default:null,anyOf:[{type:"null"},Kw],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.profiles.windows":{restricted:!0,markdownDescription:zw(3),type:"object",default:{PowerShell:{source:"PowerShell",icon:pt.terminalPowershell.id},"Command Prompt":{path:["${env:windir}\\Sysnative\\cmd.exe","${env:windir}\\System32\\cmd.exe"],args:[],icon:pt.terminalCmd.id},"Git Bash":{source:"Git Bash",icon:pt.terminalGitBash.id}},additionalProperties:{anyOf:[{type:"object",required:["source"],properties:{source:{description:h(2496,null),enum:["PowerShell","Git Bash"]},...Ec}},{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:h(2494,null),type:"string"},id:{description:h(2493,null),type:"string"},title:{description:h(2495,null),type:"string"},...Ec}},{type:"null"},qw]}},"terminal.integrated.profiles.osx":{restricted:!0,markdownDescription:zw(1),type:"object",default:{bash:{path:"bash",args:["-l"],icon:pt.terminalBash.id},zsh:{path:"zsh",args:["-l"]},fish:{path:"fish",args:["-l"]},tmux:{path:"tmux",icon:pt.terminalTmux.id},pwsh:{path:"pwsh",icon:pt.terminalPowershell.id}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:h(2489,null),type:"string"},id:{description:h(2488,null),type:"string"},title:{description:h(2490,null),type:"string"},...Ec}},{type:"null"},qw]}},"terminal.integrated.profiles.linux":{restricted:!0,markdownDescription:zw(2),type:"object",default:{bash:{path:"bash",icon:pt.terminalBash.id},zsh:{path:"zsh"},fish:{path:"fish"},tmux:{path:"tmux",icon:pt.terminalTmux.id},pwsh:{path:"pwsh",icon:pt.terminalPowershell.id}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:h(2486,null),type:"string"},id:{description:h(2485,null),type:"string"},title:{description:h(2487,null),type:"string"},...Ec}},{type:"null"},qw]}},"terminal.integrated.useWslProfiles":{description:h(2478,null),type:"boolean",default:!0},"terminal.integrated.inheritEnv":{scope:1,description:h(2474,null),type:"boolean",default:!0},"terminal.integrated.persistentSessionScrollback":{scope:1,markdownDescription:h(2475,null),type:"number",default:100},"terminal.integrated.showLinkHover":{scope:1,description:h(2477,null),type:"boolean",default:!0},"terminal.integrated.ignoreProcessNames":{markdownDescription:h(2470,null,"`#terminal.integrated.confirmOnKill#`"),type:"array",items:{type:"string",uniqueItems:!0},default:["starship","oh-my-posh","bash","zsh"]}}}});import*as GT from"fs";import*as JT from"child_process";function QT(n,r,e,t,i=process.env,o,s,a,l){return o=o||{existsFile:ir.existsFile,readFile:GT.promises.readFile},F?nO(e,o,i,s,t.getValue("terminal.integrated.useWslProfiles")!==!1,n&&Ge(n)?{...n}:t.getValue("terminal.integrated.profiles.windows"),Fe(r)?r:t.getValue("terminal.integrated.defaultProfile.windows"),l,a):uO(o,s,e,n&&Ge(n)?{...n}:t.getValue(re?"terminal.integrated.profiles.linux":"terminal.integrated.profiles.osx"),Fe(r)?r:t.getValue(re?"terminal.integrated.defaultProfile.linux":"terminal.integrated.defaultProfile.osx"),l,a,i)}async function nO(n,r,e,t,i,o,s,a,l){let c=process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),d=`${process.env.windir}\\${c?"Sysnative":"System32"}`,u=await Mf()>=19041;await sO(a);let f=new Map;if(n){f.set("PowerShell",{source:"PowerShell",icon:pt.terminalPowershell,isAutoDetected:!0}),f.set("Windows PowerShell",{path:`${d}\\WindowsPowerShell\\v1.0\\powershell.exe`,icon:pt.terminalPowershell,isAutoDetected:!0}),f.set("Git Bash",{source:"Git Bash",icon:pt.terminalGitBash,isAutoDetected:!0}),f.set("Command Prompt",{path:`${d}\\cmd.exe`,icon:pt.terminalCmd,isAutoDetected:!0}),f.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}),f.set("bash (MSYS2)",{path:[{path:`${process.env.HOMEDRIVE}\\msys64\\usr\\bin\\bash.exe`,isUnsafe:!0}],args:["--login","-i"],env:{CHERE_INVOKING:"1"},icon:pt.terminalBash,isAutoDetected:!0});let v=`${process.env.CMDER_ROOT||`${process.env.HOMEDRIVE}\\cmder`}\\vendor\\bin\\vscode_init.cmd`;f.set("Cmder",{path:`${d}\\cmd.exe`,args:["/K",v],requiresPath:process.env.CMDER_ROOT?v:{path:v,isUnsafe:!0},isAutoDetected:!0})}YT(o,f);let m=await XT(f.entries(),s,r,e,t,l);if(n&&i&&u)try{let v=await cO(`${d}\\wsl.exe`,s);for(let y of v)(!o||!Object.prototype.hasOwnProperty.call(o,y.profileName))&&m.push(y)}catch{zT&&(t?.trace("WSL is not installed, so could not detect WSL profiles"),zT=!1)}return m}async function XT(n,r,e,t=process.env,i,o){let s=[];for(let[a,l]of n)s.push(oO(a,l,r,e,t,i,o));return(await Promise.all(s)).filter(a=>!!a)}async function oO(n,r,e,t,i=process.env,o,s){if(r===null)return;let a,l,c;if(Ri(r,{source:!0})){let m=dp?.get(r.source);if(!m)return;a=m.paths,l=r.args||m.args,r.icon?c=jT(r.icon):m.icon&&(c=m.icon)}else a=Array.isArray(r.path)?r.path:[r.path],l=F||Array.isArray(r.args)?r.args:void 0,c=jT(r.icon);let d;if(s){let m=a.map(y=>Fe(y)?y:y.path),v=await s(m);d=new Array(a.length);for(let y=0;y<a.length;y++)Fe(a[y])?d[y]=v[y]:d[y]={path:v[y],isUnsafe:!0}}else d=a.slice();let u;if(r.requiresPath){let m;if(Fe(r.requiresPath)?m=r.requiresPath:(m=r.requiresPath.path,r.requiresPath.isUnsafe&&(u=m)),!await t.existsFile(m))return}let f=await tg(n,e,d,t,i,l,r.env,r.overrideName,r.isAutoDetected,u);if(!f){o?.debug("Terminal profile not validated",n,a);return}return f.isAutoDetected=r.isAutoDetected,f.icon=c,f.color=r.color,f}function jT(n){return Fe(n)?{id:n}:n}async function sO(n){if(dp&&!n)return;let[r,e]=await Promise.all([aO(),n||lO()]);dp=new Map,dp.set("Git Bash",{profileName:"Git Bash",paths:r,args:["--login","-i"]}),dp.set("PowerShell",{profileName:"PowerShell",paths:e,icon:pt.terminalPowershell})}async function aO(){let n=new Set,r=await ea("git.exe");if(r){let i=Le(r);n.add(Er(i,"../.."))}function e(i,o){o&&i.add(o)}e(n,process.env.ProgramW6432),e(n,process.env.ProgramFiles),e(n,process.env["ProgramFiles(X86)"]),e(n,`${process.env.LocalAppData}\\Program`);let t=[];for(let i of n)t.push(`${i}\\Git\\bin\\bash.exe`,`${i}\\Git\\usr\\bin\\bash.exe`,`${i}\\usr\\bin\\bash.exe`);return t.push(`${process.env.UserProfile}\\scoop\\apps\\git\\current\\bin\\bash.exe`),t.push(`${process.env.UserProfile}\\scoop\\apps\\git-with-openssh\\current\\bin\\bash.exe`),t}async function lO(){let n=[];for await(let r of kI())n.push(r.exePath);return n}async function cO(n,r){let e=[],t=await new Promise((o,s)=>{JT.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");o(l)})});if(!t)return[];let i=t.split(/\r?\n/).filter(o=>o.trim().length>0);for(let o of i){if(o===""||o.startsWith("docker-desktop"))continue;let s=`${o} (WSL)`,a={profileName:s,path:n,args:["-d",`${o}`],isDefault:s===r,icon:dO(o),isAutoDetected:!1};e.push(a)}return e}function dO(n){return n.includes("Ubuntu")?pt.terminalUbuntu:n.includes("Debian")?pt.terminalDebian:pt.terminalLinux}async function uO(n,r,e,t,i,o,s,a){let l=new Map;if(e&&await n.existsFile("/etc/shells")){let c=(await n.readFile("/etc/shells")).toString(),d=(o||c.split(`
`)).map(f=>{let m=f.indexOf("#");return m===-1?f:f.substring(0,m)}).filter(f=>f.trim().length>0),u=new Map;for(let f of d){let m=Pe(f),v=u.get(m)||0;v++,v>1&&(m=`${m} (${v})`),u.set(m,v),l.set(m,{path:f,isAutoDetected:!0})}}return YT(t,l),await XT(l.entries(),i,n,a,r,s)}function YT(n,r){if(n)for(let[e,t]of Object.entries(n))t===null||!Ge(t)||!Ri(t,{path:!0})&&!Ri(t,{source:!0})?r.delete(e):(t.icon=t.icon||r.get(e)?.icon,r.set(e,t))}async function tg(n,r,e,t,i,o,s,a,l,c){if(e.length===0)return Promise.resolve(void 0);let d=e.shift();if(d==="")return tg(n,r,e,t,i,o,s,a,l);let u=!Fe(d)&&d.isUnsafe,f=Fe(d)?d:d.path,m={profileName:n,path:f,args:o,env:s,overrideName:a,isAutoDetected:l,isDefault:n===r,isUnsafePath:u,requiresUnsafePath:c};if(Pe(f)===f){let y=i.PATH?i.PATH.split(Bp):void 0,C=await ea(f,void 0,y,void 0,t.existsFile);return C?(m.path=C,m.isFromPath=!0,m):tg(n,r,e,t,i,o)}return await t.existsFile(kt(f))?m:tg(n,r,e,t,i,o,s,a,l)}var dp,zT,ZT=I(()=>{ip();we();X();ta();Oe();nr();RI();bc();el();zT=!0});var Cc,e_=I(()=>{q();$();X();Pn();et();te();$w();qu();VT();bc();KT();ZT();MI();_s();Cc=class extends T{constructor(e,t,i,o){super();this._ptyHostStarter=e;this._configurationService=t;this._logService=i;this._loggerService=o;this._wasQuitRequested=!1;this._restartCount=0;this._isResponsive=!0;this._onPtyHostExit=this._register(new b);this.onPtyHostExit=this._onPtyHostExit.event;this._onPtyHostStart=this._register(new b);this.onPtyHostStart=this._onPtyHostStart.event;this._onPtyHostUnresponsive=this._register(new b);this.onPtyHostUnresponsive=this._onPtyHostUnresponsive.event;this._onPtyHostResponsive=this._register(new b);this.onPtyHostResponsive=this._onPtyHostResponsive.event;this._onPtyHostRequestResolveVariables=this._register(new b);this.onPtyHostRequestResolveVariables=this._onPtyHostRequestResolveVariables.event;this._onProcessData=this._register(new b);this.onProcessData=this._onProcessData.event;this._onProcessReady=this._register(new b);this.onProcessReady=this._onProcessReady.event;this._onProcessReplay=this._register(new b);this.onProcessReplay=this._onProcessReplay.event;this._onProcessOrphanQuestion=this._register(new b);this.onProcessOrphanQuestion=this._onProcessOrphanQuestion.event;this._onDidRequestDetach=this._register(new b);this.onDidRequestDetach=this._onDidRequestDetach.event;this._onDidChangeProperty=this._register(new b);this.onDidChangeProperty=this._onDidChangeProperty.event;this._onProcessExit=this._register(new b);this.onProcessExit=this._onProcessExit.event;qT(),this._register(this._ptyHostStarter),this._register(G(()=>this._disposePtyHost())),this._resolveVariablesRequestStore=this._register(new Pc(void 0,this._logService)),this._register(this._resolveVariablesRequestStore.onCreateRequest(this._onPtyHostRequestResolveVariables.fire,this._onPtyHostRequestResolveVariables)),this._ptyHostStarter.onRequestConnection&&this._register(S.once(this._ptyHostStarter.onRequestConnection)(()=>this._ensurePtyHost())),this._ptyHostStarter.onWillShutdown&&this._register(this._ptyHostStarter.onWillShutdown(()=>this._wasQuitRequested=!0))}get _connection(){return this._ensurePtyHost(),this.__connection}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(F)return process.env;try{return await cs(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(),t=e.client;this._logService.getLevel()===1&&this._logService.trace("PtyHostService#_startPtyHost",new Error().stack?.replace(/^Error/,"")),tt.toService(t.getChannel("heartbeat")).onBeat(()=>this._handleHeartbeat()),this._handleHeartbeat(!0),this._register(e.onDidProcessExit(s=>{this._onPtyHostExit.fire(s.code),!this._wasQuitRequested&&!this._store.isDisposed&&(this._restartCount<=5?(this._logService.error(`ptyHost terminated unexpectedly with code ${s.code}`),this._restartCount++,this.restartPtyHost()):this._logService.error(`ptyHost terminated unexpectedly with code ${s.code}, giving up`))}));let o=tt.toService(t.getChannel("ptyHost"));return this._register(o.onProcessData(s=>this._onProcessData.fire(s))),this._register(o.onProcessReady(s=>this._onProcessReady.fire(s))),this._register(o.onProcessExit(s=>this._onProcessExit.fire(s))),this._register(o.onDidChangeProperty(s=>this._onDidChangeProperty.fire(s))),this._register(o.onProcessReplay(s=>this._onProcessReplay.fire(s))),this._register(o.onProcessOrphanQuestion(s=>this._onProcessOrphanQuestion.fire(s))),this._register(o.onDidRequestDetach(s=>this._onDidRequestDetach.fire(s))),this._register(new xc(this._loggerService,t.getChannel("logger"))),this.__connection=e,this.__proxy=o,this._onPtyHostStart.fire(),this._register(this._configurationService.onDidChangeConfiguration(async s=>{s.affectsConfiguration("terminal.integrated.ignoreProcessNames")&&await this._refreshIgnoreProcessNames()})),this._refreshIgnoreProcessNames(),[e,o]}async createProcess(e,t,i,o,s,a,l,c,d,u,f){let m=setTimeout(()=>this._handleUnresponsiveCreateProcess(),5e3),v=await this._proxy.createProcess(e,t,i,o,s,a,l,c,d,u,f);return clearTimeout(m),v}updateTitle(e,t,i){return this._proxy.updateTitle(e,t,i)}updateIcon(e,t,i,o){return this._proxy.updateIcon(e,t,i,o)}attachToProcess(e){return this._proxy.attachToProcess(e)}detachFromProcess(e,t){return this._proxy.detachFromProcess(e,t)}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,t){return this._proxy.shutdown(e,t)}input(e,t){return this._proxy.input(e,t)}sendSignal(e,t){return this._proxy.sendSignal(e,t)}processBinary(e,t){return this._proxy.processBinary(e,t)}resize(e,t,i,o,s){return this._proxy.resize(e,t,i,o,s)}clearBuffer(e){return this._proxy.clearBuffer(e)}acknowledgeDataEvent(e,t){return this._proxy.acknowledgeDataEvent(e,t)}setUnicodeVersion(e,t){return this._proxy.setUnicodeVersion(e,t)}setNextCommandId(e,t,i){return this._proxy.setNextCommandId(e,t,i)}getInitialCwd(e){return this._proxy.getInitialCwd(e)}getCwd(e){return this._proxy.getCwd(e)}async getLatency(){let e=new ii,t=await this._proxy.getLatency();return e.stop(),[{label:"ptyhostservice<->ptyhost",latency:e.elapsed()},...t]}orphanQuestionReply(e){return this._proxy.orphanQuestionReply(e)}installAutoReply(e,t){return this._proxy.installAutoReply(e,t)}uninstallAllAutoReplies(){return this._proxy.uninstallAllAutoReplies()}getDefaultSystemShell(e){return this._optionalProxy?.getDefaultSystemShell(e)??Gm(e??Ut,process.env)}async getProfiles(e,t,i,o=!1){let s=await this._resolveShellEnv();return QT(t,i,o,this._configurationService,s,void 0,this._logService,this._resolveVariables.bind(this,e))}async getEnvironment(){return this.__proxy?this._proxy.getEnvironment():{...process.env}}getWslPath(e,t){return this._proxy.getWslPath(e,t)}getRevivedPtyNewId(e,t){return this._proxy.getRevivedPtyNewId(e,t)}setTerminalLayoutInfo(e){return this._proxy.setTerminalLayoutInfo(e)}async getTerminalLayoutInfo(e){return this._optionalProxy?.getTerminalLayoutInfo(e)}async requestDetachInstance(e,t){return this._proxy.requestDetachInstance(e,t)}async acceptDetachInstanceReply(e,t){return this._proxy.acceptDetachInstanceReply(e,t)}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,t,i){return this._proxy.reviveTerminalProcesses(e,t,i)}async refreshProperty(e,t){return this._proxy.refreshProperty(e,t)}async updateProperty(e,t,i){return this._proxy.updateProperty(e,t,i)}async restartPtyHost(){this._disposePtyHost(),this._isResponsive=!0,this._startPtyHost()}_disposePtyHost(){this._proxy.shutdownAll(),this._connection.store.dispose()}_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,t){return this._resolveVariablesRequestStore.createRequest({workspaceId:e,originalText:t})}async acceptPtyHostResolvedVariables(e,t){this._resolveVariablesRequestStore.acceptReply(e,t)}};Cc=E([g(1,ue),g(2,B),g(3,ai)],Cc)});var t_,r_,Gw,fO,Vye,Hye,rg=I(()=>{ce();Z();t_="chat.agentHost.enabled",r_="chat.agentHost.claudeAgent.enabled",Gw="VSCODE_AGENT_HOST_ENABLE_CLAUDE";(t=>{function n(i,o){return x.from({scheme:i,path:`/${o}`})}t.uri=n;function r(i){return(typeof i=="string"?x.parse(i):i).path.substring(1)}t.id=r;function e(i){return(typeof i=="string"?x.parse(i):i).scheme||void 0}t.provider=e})(fO||={});Vye=O("agentService"),Hye=O("agentHostService")});var ws,i_=I(()=>{$();he();q();Ai();Uf();et();Lt();zd();Ct();te();ze();qu();So();os();rg();di();ws=class extends T{constructor(e,t,i,o){super();this._configurationService=e;this._environmentMainService=t;this._lifecycleMainService=i;this._logService=o;this.utilityProcess=void 0;this.utilityProcessStarted=void 0;this._onRequestConnection=this._register(new b);this.onRequestConnection=this._onRequestConnection.event;this._onWillShutdown=this._register(new b);this.onWillShutdown=this._onWillShutdown.event;this._register(this._lifecycleMainService.onWillShutdown(()=>this._onWillShutdown.fire()));let s=(a,l)=>this._onWindowConnection(a,l);rt.on("vscode:createAgentHostMessageChannel",s),this._register(G(()=>{rt.removeListener("vscode:createAgentHostMessageChannel",s)}))}async start(){this.utilityProcess=new sr(this._logService,Vn,this._lifecycleMainService),this.utilityProcessStarted=new At;let e=jx(this._environmentMainService.args,this._environmentMainService.isBuilt),t=e.port?["--nolazy",`--inspect${e.break?"-brk":""}=${e.port}`]:void 0,i=await this._resolveShellEnv(),o=this._configurationService.getValue(r_)||process.env[Gw]==="1";this.utilityProcess.start({type:"agentHost",name:"agent-host",entryPoint:"vs/platform/agentHost/node/agentHostMain",execArgv:t,args:["--logsPath",this._environmentMainService.logsHome.with({scheme:W.file}).fsPath,"--user-data-dir",this._environmentMainService.userDataPath],env:{...or(process.env),...i,VSCODE_ESM_ENTRYPOINT:"vs/platform/agentHost/node/agentHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true",...o?{[Gw]:"1"}:{}}}),this.utilityProcessStarted.complete();let s=this.utilityProcess.connect(),a=new Ko(s,"agentHost"),l=new j;return l.add(a),l.add(this.utilityProcess.onStderr(c=>{this._isExpectedStderr(c)||this._logService.error(`[AgentHost:stderr] ${c}`)})),l.add(G(()=>{this.utilityProcess?.kill(),this.utilityProcess?.dispose(),this.utilityProcess=void 0,this.utilityProcessStarted=void 0})),{client:a,store:l,onDidProcessExit:this.utilityProcess.onExit}}async _resolveShellEnv(){try{return await cs(this._configurationService,this._logService,this._environmentMainService.args,process.env)}catch(e){return this._logService.error("AgentHostStarter was unable to resolve shell environment",e),{}}}async _onWindowConnection(e,t){if(this._onRequestConnection.fire(),await this.utilityProcessStarted?.p,!this.utilityProcess){this._logService.error("AgentHostStarter: cannot create window connection, agent host process is not running");return}let i=this.utilityProcess.connect();if(e.sender.isDestroyed()){i.close();return}e.sender.postMessage("vscode:createAgentHostMessageChannelResult",t,[i])}static{this._expectedStderrPatterns=["Most NODE_OPTIONs are not supported in packaged apps","Debugger listening on ws://","For help, see: https://nodejs.org/en/docs/inspector","ExperimentalWarning: SQLite is an experimental feature"]}_isExpectedStderr(e){return ws._expectedStderrPatterns.some(t=>e.includes(t))}};ws=E([g(0,ue),g(1,_e),g(2,ye),g(3,B)],ws)});var Tc,n_=I(()=>{q();$();te();$w();rg();Tc=class extends T{constructor(e,t,i){super();this._starter=e;this._logService=t;this._loggerService=i;this._started=!1;this._wasQuitRequested=!1;this._restartCount=0;this._register(this._starter),this._starter.onRequestConnection&&this._register(S.once(this._starter.onRequestConnection)(()=>this._ensureStarted())),this._starter.onWillShutdown&&this._register(this._starter.onWillShutdown(()=>this._wasQuitRequested=!0))}_ensureStarted(){this._started||this._start()}async _start(){this._started=!0;try{let e=await this._starter.start();if(this._store.isDisposed){e.store.dispose();return}this._logService.info("AgentHostProcessManager: agent host started"),this._register(new xc(this._loggerService,e.client.getChannel("agentHostLogger"))),this._register(e.onDidProcessExit(t=>{!this._wasQuitRequested&&!this._store.isDisposed&&(this._restartCount<=5?(this._logService.error(`AgentHostProcessManager: agent host terminated unexpectedly with code ${t.code}`),this._restartCount++,this._started=!1,e.store.dispose(),this._start()):this._logService.error(`AgentHostProcessManager: agent host terminated with code ${t.code}, giving up after 5 restarts`))})),this._register(G(()=>e.store.dispose()))}catch(e){this._started=!1,this._logService.error("AgentHostProcessManager: failed to start agent host",e)}}};Tc=E([g(1,B),g(2,ai)],Tc)});var Jw,o_,ig,s_=I(()=>{Jw="request",o_="remoteResourceHandler",ig=class{async routeCall(r,e,t){if(e!==Jw)throw new Error(`Call not found: ${e}`);let i=Array.isArray(t)?t[0]:void 0;if(i?.authority){let o=r.connections.find(s=>s.ctx===i.authority);if(o)return o}throw new Error("Caller not found")}routeEvent(r,e){throw new Error(`Event not found: ${e}`)}}});import{BrowserWindow as mO}from"electron";var _c,a_=I(()=>{X();et();Lt();Ct();te();xi();Jo();tn();Tw();_c=class extends np{constructor(e,t,i,o,s,a){super(o,s,t,i);this.webContents=e;this.lifecycleMainService=a;this.parentId=-1;this.stateApplied=!1;this.id=this.webContents.id,this.tryClaimWindow()}get win(){return super.win||this.tryClaimWindow(),super.win}tryClaimWindow(e){this._store.isDisposed||this.webContents.isDestroyed()||(this.doTryClaimWindow(e),e&&!this.stateApplied&&(this.stateApplied=!0,this.applyState({x:e.x,y:e.y,width:e.width,height:e.height,mode:e.show===!1?0:1})))}doTryClaimWindow(e){if(this._win)return;let t=mO.fromWebContents(this.webContents);t&&(this.logService.trace("[aux window] Claimed browser window instance"),this.setWin(t,e),t.setMenu(null),(F||re)&&Go(this.configurationService,e?.titleBarStyle==="hidden"?"custom":void 0)&&t.setAutoHideMenuBar(!0),this.lifecycleMainService.registerAuxWindow(this))}matches(e){return this.webContents.id===e.id}};_c=E([g(1,_e),g(2,B),g(3,ue),g(4,Et),g(5,ye)],_c)});import{BrowserWindow as hO,app as gO}from"electron";var kc,l_=I(()=>{q();$();ze();Ai();a_();Z();te();tn();Kt();kc=class extends T{constructor(e,t){super();this.instantiationService=e;this.logService=t;this._onDidMaximizeWindow=this._register(new b);this.onDidMaximizeWindow=this._onDidMaximizeWindow.event;this._onDidUnmaximizeWindow=this._register(new b);this.onDidUnmaximizeWindow=this._onDidUnmaximizeWindow.event;this._onDidChangeFullScreen=this._register(new b);this.onDidChangeFullScreen=this._onDidChangeFullScreen.event;this._onDidChangeAlwaysOnTop=this._register(new b);this.onDidChangeAlwaysOnTop=this._onDidChangeAlwaysOnTop.event;this._onDidTriggerSystemContextMenu=this._register(new b);this.onDidTriggerSystemContextMenu=this._onDidTriggerSystemContextMenu.event;this.windows=new Map;this.registerListeners()}registerListeners(){gO.on("browser-window-created",(e,t)=>{let i=this.getWindowByWebContents(t.webContents);if(i)this.logService.trace('[aux window] app.on("browser-window-created"): Trying to claim auxiliary window'),i.tryClaimWindow();else{let o=new j;o.add(S.fromNodeEventEmitter(t.webContents,"did-create-window",(s,a)=>({browserWindow:s,details:a}))(({browserWindow:s,details:a})=>{let l=this.getWindowByWebContents(s.webContents);l&&(this.logService.trace('[aux window] window.on("did-create-window"): Trying to claim auxiliary window'),l.tryClaimWindow(a.options))})),o.add(S.fromNodeEventEmitter(t,"closed")(()=>o.dispose()))}}),rt.handle("vscode:registerAuxiliaryWindow",async(e,t)=>{let i=this.getWindowByWebContents(e.sender);return i&&(this.logService.trace("[aux window] vscode:registerAuxiliaryWindow: Registering auxiliary window to main window"),i.parentId=t),e.sender.id})}createWindow(e){let{state:t,overrides:i}=this.computeWindowStateAndOverrides(e);return this.instantiationService.invokeFunction(ul,t,i,{preload:st.asFileUri("vs/base/parts/sandbox/electron-browser/preload-aux.js").fsPath})}computeWindowStateAndOverrides(e){let t={},i={},o=e.features.split(",");for(let a of o){let[l,c]=a.split("=");switch(l){case"width":t.width=parseInt(c,10);break;case"height":t.height=parseInt(c,10);break;case"left":t.x=parseInt(c,10);break;case"top":t.y=parseInt(c,10);break;case"window-maximized":t.mode=0;break;case"window-fullscreen":t.mode=3;break;case"window-disable-fullscreen":i.disableFullscreen=!0;break;case"window-native-titlebar":i.forceNativeTitlebar=!0;break;case"window-always-on-top":i.alwaysOnTop=!0;break}}let s=pl.validateWindowState(this.logService,t)??vP();return this.logService.trace("[aux window] using window state",s),{state:s,overrides:i}}registerWindow(e){let t=new j,i=this.instantiationService.createInstance(_c,e);this.windows.set(i.id,i),t.add(G(()=>this.windows.delete(i.id))),t.add(i.onDidMaximize(()=>this._onDidMaximizeWindow.fire(i))),t.add(i.onDidUnmaximize(()=>this._onDidUnmaximizeWindow.fire(i))),t.add(i.onDidEnterFullScreen(()=>this._onDidChangeFullScreen.fire({window:i,fullscreen:!0}))),t.add(i.onDidLeaveFullScreen(()=>this._onDidChangeFullScreen.fire({window:i,fullscreen:!1}))),t.add(i.onDidChangeAlwaysOnTop(o=>this._onDidChangeAlwaysOnTop.fire({window:i,alwaysOnTop:o}))),t.add(i.onDidTriggerSystemContextMenu(({x:o,y:s})=>this._onDidTriggerSystemContextMenu.fire({window:i,x:o,y:s}))),S.once(i.onDidClose)(()=>t.dispose())}getWindowByWebContents(e){let t=this.windows.get(e.id);return t?.matches(e)?t:void 0}getFocusedWindow(){let e=hO.getFocusedWindow();if(e)return this.getWindowByWebContents(e.webContents)}getLastActiveWindow(){return um(Array.from(this.windows.values()))}getWindows(){return Array.from(this.windows.values())}};kc=E([g(0,Ht),g(1,B)],kc)});var Qw,c_,d_=I(()=>{Z();Qw=O("INativeMcpDiscoveryHelperService"),c_="NativeMcpDiscoveryHelper"});import{homedir as vO}from"os";var ng,u_=I(()=>{X();ce();ng=class{constructor(){}load(){return Promise.resolve({platform:Gn,homedir:x.file(vO()),winAppData:this.uriFromEnvVariable("APPDATA"),xdgHome:this.uriFromEnvVariable("XDG_CONFIG_HOME")})}uriFromEnvVariable(r){let e=process.env[r];if(e)return x.file(e)}}});var up,p_,f_,Xw=I(()=>{Z();up=O("IMcpGatewayService"),p_="mcpGateway",f_="mcpGatewayToolBroker"});function yO(n){return"method"in n&&"id"in n&&(typeof n.id=="string"||typeof n.id=="number")}function Yw(n){return Ri(n,{id:!0,result:!0})||Ri(n,{id:!0,error:!0})}function Zw(n){return Ri(n,{method:!0})&&!Ri(n,{id:!0})}function IO(n){return typeof n=="object"&&n!==null&&"then"in n&&typeof n.then=="function"}var Ni,Rc,eb=I(()=>{he();wt();He();$();Oe();Ni=class extends Error{constructor(e,t,i){super(t);this.code=e;this.data=i}},Rc=class n extends T{constructor(e,t){super();this._send=e;this._handlers=t;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,t=Ce.None,i){if(this._store.isDisposed)return Promise.reject(new xt);let o=this._nextRequestId++,s=new At,a=new $e;this._pendingRequests.set(o,{promise:s,cts:a});let l=t.onCancellationRequested(()=>{s.isSettled||(this._pendingRequests.delete(o),a.cancel(),i?.(o),s.cancel()),l.dispose()});return this._send({jsonrpc:"2.0",id:o,...e}),s.p.finally(()=>{l.dispose(),this._pendingRequests.delete(o),a.dispose(!0)})}async handleMessage(e){if(Array.isArray(e)){let i=[];for(let o of e){let s=await this._handleMessage(o);s&&i.push(s)}return i}let t=await this._handleMessage(e);return t?[t]:[]}cancelPendingRequest(e){let t=this._pendingRequests.get(e);t&&(this._pendingRequests.delete(e),t.cts.cancel(),t.promise.cancel(),t.cts.dispose(!0))}cancelAllRequests(){for(let[e,t]of this._pendingRequests)this._pendingRequests.delete(e),t.cts.cancel(),t.promise.cancel(),t.cts.dispose(!0)}async _handleMessage(e){if(Yw(e)){Ri(e,{result:!0})?this._handleResult(e):this._handleError(e);return}if(yO(e))return this._handleRequest(e);Zw(e)&&this._handlers.handleNotification?.(e)}_handleResult(e){let t=this._pendingRequests.get(e.id);t&&(this._pendingRequests.delete(e.id),t.promise.complete(e.result),t.cts.dispose(!0))}_handleError(e){if(e.id===void 0)return;let t=this._pendingRequests.get(e.id);t&&(this._pendingRequests.delete(e.id),t.promise.error(new Ni(e.error.code,e.error.message,e.error.data)),t.cts.dispose(!0))}async _handleRequest(e){if(!this._handlers.handleRequest){let i={jsonrpc:"2.0",id:e.id,error:{code:n.MethodNotFound,message:`Method not found: ${e.method}`}};return this._send(i),i}let t=new $e;this._register(G(()=>t.dispose(!0)));try{let i=this._handlers.handleRequest(e,t.token),o=IO(i)?await i:i,s={jsonrpc:"2.0",id:e.id,result:o};return this._send(s),s}catch(i){let o;return i instanceof Ni?o={jsonrpc:"2.0",id:e.id,error:{code:i.code,message:i.message,data:i.data}}:o={jsonrpc:"2.0",id:e.id,error:{code:n.InternalError,message:i instanceof Error?i.message:"Internal error"}},this._send(o),o}finally{t.dispose(!0)}}dispose(){this.cancelAllRequests(),super.dispose()}static createParseError(e,t){return{jsonrpc:"2.0",error:{code:n.ParseError,message:e,data:t}}}}});function m_(n){let r=Array.isArray(n)?n[0]:n;return!r||!Ri(r,{method:!0})?!1:r.method==="initialize"}var wO,bO,SO,xO,pp,og,h_=I(()=>{eb();$();Oe();wO="2025-11-25",bO=["2025-11-25","2025-06-18","2025-03-26","2024-11-05","2024-10-07"],SO=-32600,xO=-32601,pp=-32602,og=class extends T{constructor(e,t,i,o){super();this.id=e;this._logService=t;this._onDidDispose=i;this._serverInvoker=o;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._rpc=this._register(new Rc(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,t){t.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),t.write(`: connected

`),this._sseClients.add(t),this._logService.info(`[McpGateway][session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),t.on("close",()=>{this._sseClients.delete(t),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(Yw(e)){this._logService.debug(`[McpGateway][session ${this.id}] --> response: ${JSON.stringify(e)}`);return}if(Zw(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 t=JSON.stringify(e),i=String(++this._lastEventId);this._logService.debug(`[McpGateway][session ${this.id}] Broadcasting SSE event id=${i} to ${this._sseClients.size}`);let o=t.split(/\r?\n/g),s=[`id: ${i}`,"event: message",...o.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 Ni(SO,"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 Ni(xO,`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 t=typeof e.params=="object"&&e.params?e.params:void 0,i=typeof t?.protocolVersion=="string"?t.protocolVersion:void 0,o=t?.clientInfo,s=i&&bO.includes(i)?i:wO;return this._logService.info(`[McpGateway] Initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${i??"(none)"}, negotiated=${s}`),i&&i!==s&&this._logService.warn(`[McpGateway] Client requested unsupported protocol version '${i}', 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 t=typeof e.params=="object"&&e.params?e.params:void 0;if(!t||typeof t.name!="string")throw new Ni(pp,"Missing tool call params");if(t.arguments&&typeof t.arguments!="object")throw new Ni(pp,"Invalid tool call arguments");let i=t.arguments&&typeof t.arguments=="object"?t.arguments:{};this._logService.debug(`[McpGateway][session ${this.id}] Calling tool '${t.name}' with args: ${JSON.stringify(i)}`);try{let o=await this._serverInvoker.callTool(t.name,i);return this._logService.debug(`[McpGateway][session ${this.id}] Tool '${t.name}' completed (isError=${o.isError??!1}, content blocks=${o.content.length})`),o}catch(o){throw this._logService.error(`[McpGateway][session ${this.id}] Tool '${t.name}' invocation failed`,o),new Ni(pp,String(o))}}async _handleListTools(){let e=await this._serverInvoker.listTools();return this._logService.debug(`[McpGateway][session ${this.id}] Listed ${e.length} tool(s): [${e.map(t=>t.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 t=typeof e.params=="object"&&e.params?e.params:void 0;if(!t||typeof t.uri!="string")throw new Ni(pp,"Missing resource URI");this._logService.debug(`[McpGateway][session ${this.id}] Reading resource '${t.uri}'`);try{let i=await this._serverInvoker.readResource(t.uri);return this._logService.debug(`[McpGateway][session ${this.id}] Resource read returned ${i.contents.length} content(s)`),i}catch(i){throw this._logService.error(`[McpGateway][session ${this.id}] Resource read failed for '${t.uri}'`,i),new Ni(pp,String(i))}}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 Dc,tb,g_=I(()=>{he();q();eb();$();ce();Xt();te();h_();Dc=class extends T{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,t){if(await this._ensureServer(),this._port===void 0)throw new Error("[McpGatewayService] Server failed to start, port is undefined");if(!t)throw new Error("[McpGatewayService] Tool invoker is required to create gateway");let i=ke(),o=new Set,s=new Map;this._gatewayRoutes.set(i,o),this._gatewayServerRoutes.set(i,s);let a=new j;this._gatewayDisposables.set(i,a);try{let l=t.listServers(),c=[];for(let u of l){let f=this._createRouteForServer(i,u.id,u.label,t,o,s);c.push(f)}e?(this._gatewayToClient.set(i,e),this._logger.info(`[McpGatewayService] Created gateway ${i} with ${c.length} server(s) for client ${e}`)):this._logger.warn(`[McpGatewayService] Created gateway ${i} with ${c.length} server(s) without client tracking`);let d=a.add(new b);return a.add(t.onDidChangeServers(u=>{this._refreshGatewayServers(i,u,t,o,s,d)})),{servers:c,onDidChangeServers:d.event,gatewayId:i}}catch(l){throw this._cleanupGateway(i),l}}_refreshGatewayServers(e,t,i,o,s,a){if(!this._gatewayRoutes.has(e))return;let l=new Set(t.map(u=>u.id)),c=new Set(s.keys());for(let u of c)if(!l.has(u)){let f=s.get(u);f&&(this._disposeRoute(f),o.delete(f),s.delete(u))}for(let u of t){if(!c.has(u.id)){this._createRouteForServer(e,u.id,u.label,i,o,s);continue}let f=s.get(u.id),m=f?this._routes.get(f):void 0;m&&m.label!==u.label&&(m.label=u.label)}let d=this._getGatewayServers(e);this._logger.info(`[McpGatewayService] Gateway ${e} servers changed: ${d.length} server(s)`),a.fire(d)}_cleanupGateway(e){let t=this._gatewayRoutes.get(e);if(t)for(let i of t)this._disposeRoute(i);this._gatewayRoutes.delete(e),this._gatewayServerRoutes.delete(e),this._gatewayToClient.delete(e),this._gatewayDisposables.get(e)?.dispose(),this._gatewayDisposables.delete(e)}_createRouteForServer(e,t,i,o,s,a){let l=ke(),c={onDidChangeTools:o.onDidChangeTools,onDidChangeResources:o.onDidChangeResources,listTools:()=>o.listToolsForServer(t),callTool:(f,m)=>o.callToolForServer(t,f,m),listResources:()=>o.listResourcesForServer(t),readResource:f=>o.readResourceForServer(t,f),listResourceTemplates:()=>o.listResourceTemplatesForServer(t)},d=new tb(l,this._logger,c,i);this._routes.set(l,d),s.add(l),a.set(t,l);let u=x.parse(`http://127.0.0.1:${this._port}/gateway/${l}`);return this._logger.info(`[McpGatewayService] Created route ${l} for server '${i}' (${t}) at ${u}`),{label:i,address:u}}_getGatewayServers(e){let t=this._gatewayServerRoutes.get(e);if(!t)return[];let i=[];for(let[o,s]of t){let a=this._routes.get(s);a&&i.push({label:a.label,address:x.parse(`http://127.0.0.1:${this._port}/gateway/${s}`)})}return i}_disposeRoute(e){let t=this._routes.get(e);t&&(t.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 t=[];for(let[i,o]of this._gatewayToClient)o===e&&t.push(i);if(t.length>0){this._logger.info(`[McpGatewayService] Disposing ${t.length} gateway(s) for disconnected client ${e}`);for(let i of t)this._cleanupGateway(i);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"),t=new At;this._server=e((o,s)=>{this._handleRequest(o,s)});let i=setTimeout(()=>{t.error(new Error("[McpGatewayService] Timeout waiting for server to start"))},5e3);return this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this._port=parseInt(o);else if(o instanceof Object)this._port=o.port;else{clearTimeout(i),t.error(new Error("[McpGatewayService] Unable to determine port"));return}clearTimeout(i),this._logger.info(`[McpGatewayService] Server started on port ${this._port}`),t.complete()}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){this._logger.warn("[McpGatewayService] Port in use, retrying with random port..."),this._server.listen(0,"127.0.0.1");return}clearTimeout(i),this._logger.error(`[McpGatewayService] Server error: ${o}`),t.error(o)}),this._server.listen(0,"127.0.0.1"),t.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,t){let i=new URL(e.url,`http://${e.headers.host}`),o=i.pathname.split("/").filter(Boolean);if(this._logger.debug(`[McpGatewayService] ${e.method} ${i.pathname} (active routes: ${this._routes.size})`),o.length>=2&&o[0]==="gateway"){let s=o[1],a=this._routes.get(s);if(a){a.handleRequest(e,t);return}}this._logger.warn(`[McpGatewayService] ${e.method} ${i.pathname}: route not found`),t.writeHead(404,{"Content-Type":"application/json"}),t.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()}};Dc=E([g(0,ai)],Dc);tb=class n extends T{constructor(e,t,i,o=""){super();this.routeId=e;this._logger=t;this._serverInvoker=i;this.label=o;this._sessions=new Map}static{this.SessionHeaderName="mcp-session-id"}handleRequest(e,t){if(this._logger.debug(`[McpGateway][route ${this.routeId}] ${e.method} request (sessions: ${this._sessions.size})`),e.method==="POST"){this._handlePost(e,t);return}if(e.method==="GET"){this._handleGet(e,t);return}if(e.method==="DELETE"){this._handleDelete(e,t);return}this._respondHttpError(t,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,t){let i=this._getSessionId(e);if(!i){this._respondHttpError(t,400,"Missing Mcp-Session-Id header");return}let o=this._sessions.get(i);if(!o){this._respondHttpError(t,404,"Session not found");return}this._logger.info(`[McpGateway][route ${this.routeId}] Deleting session ${i}`),o.dispose(),this._sessions.delete(i),t.writeHead(204),t.end()}_handleGet(e,t){let i=this._getSessionId(e);if(!i){this._respondHttpError(t,400,"Missing Mcp-Session-Id header");return}let o=this._sessions.get(i);if(!o){this._respondHttpError(t,404,"Session not found");return}this._logger.info(`[McpGateway][route ${this.routeId}] SSE connection requested for session ${i}`),o.attachSseClient(e,t)}async _handlePost(e,t){let i=await this._readRequestBody(e);if(i===void 0){this._respondHttpError(t,413,"Payload too large");return}this._logger.debug(`[McpGateway][route ${this.routeId}] Handling POST`);let o;try{o=JSON.parse(i)}catch(l){this._logger.warn(`[McpGateway][route ${this.routeId}] JSON parse error: ${l instanceof Error?l.message:String(l)}`),t.writeHead(400,{"Content-Type":"application/json"}),t.end(JSON.stringify(Rc.createParseError("Parse error",l instanceof Error?l.message:String(l))));return}let s=this._getSessionId(e),a=this._resolveSessionForPost(s,o,t);if(a)try{let l=await a.handleIncoming(o),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)`),t.writeHead(202,c),t.end();return}let d=JSON.stringify(Array.isArray(o)?l:l[0]);this._logger.debug(`[McpGateway][route ${this.routeId}] POST response: 200, body: ${d}`),t.writeHead(200,c),t.end(d)}catch(l){this._logger.error("[McpGatewayService] Failed handling gateway request",l),this._respondHttpError(t,500,"Internal server error")}}_resolveSessionForPost(e,t,i){if(e){let a=this._sessions.get(e);if(!a){this._logger.warn(`[McpGateway][route ${this.routeId}] Session not found: ${e}`),this._respondHttpError(i,404,"Session not found");return}return a}if(!m_(t)){this._respondHttpError(i,400,"Missing Mcp-Session-Id header");return}let o=ke();this._logger.info(`[McpGateway][route ${this.routeId}] Creating new session ${o}`);let s=new og(o,this._logger,()=>{this._sessions.delete(o)},this._serverInvoker);return this._sessions.set(o,s),s}_respondHttpError(e,t,i){this._logger.debug(`[McpGateway][route ${this.routeId}] HTTP error response: ${t} ${i}`),e.writeHead(t,{"Content-Type":"application/json"}),e.end(JSON.stringify({jsonrpc:"2.0",error:{code:t,message:i}}))}_getSessionId(e){let t=e.headers[n.SessionHeaderName];return Array.isArray(t)?t[0]:t}async _readRequestBody(e){let t=[],i=0,o=1024*1024;for await(let s of e){let a=Buffer.isBuffer(s)?s:Buffer.from(s);if(i+=a.byteLength,i>o)return;t.push(a)}return Buffer.concat(t).toString("utf8")}}});function PO(n,r){return n.getChannel(f_,e=>e.ctx===r)}var Ac,v_=I(()=>{q();$();te();Xw();Ac=class extends T{constructor(e,t,i){super();this._ipcServer=e;this.mcpGatewayService=t;this._loggerService=i;this._onDidChangeGatewayServers=this._register(new b);this._gatewayDisposables=this._register(new Dt);this._clientGateways=new Map;this._register(e.onDidRemoveConnection(o=>{this._loggerService.getLogger("mcpGateway")?.info(`[McpGateway][Channel] Client disconnected: ${o.ctx}, cleaning up gateways`),t.disposeGatewaysForClient(o.ctx);let s=this._clientGateways.get(o.ctx);if(s){for(let a of s)this._gatewayDisposables.deleteAndDispose(a);this._clientGateways.delete(o.ctx)}}))}listen(e,t){if(t==="onDidChangeGatewayServers")return this._onDidChangeGatewayServers.event;throw new Error(`Invalid listen: ${t}`)}async call(e,t,i){let o=this._loggerService.getLogger("mcpGateway");switch(o?.debug(`[McpGateway][Channel] IPC call: ${t} from client ${e}`),t){case"createGateway":{let{chatSessionResource:s}=i??{},a=PO(this._ipcServer,e),l=await a.call("listServers"),c=a.listen("onDidChangeServers"),d=await this.mcpGatewayService.createGateway(e,{onDidChangeServers:S.map(c,m=>(l=m,m)),onDidChangeTools:a.listen("onDidChangeTools"),onDidChangeResources:a.listen("onDidChangeResources"),listServers:()=>l,listToolsForServer:m=>a.call("listToolsForServer",{serverId:m}),callToolForServer:(m,v,y)=>a.call("callToolForServer",{serverId:m,name:v,args:y,chatSessionResource:s}),listResourcesForServer:m=>a.call("listResourcesForServer",{serverId:m}),readResourceForServer:(m,v)=>a.call("readResourceForServer",{serverId:m,uri:v}),listResourceTemplatesForServer:m=>a.call("listResourceTemplatesForServer",{serverId:m})}),u=new j;u.add(d.onDidChangeServers(m=>{this._onDidChangeGatewayServers.fire({gatewayId:d.gatewayId,servers:m})})),this._gatewayDisposables.set(d.gatewayId,u);let f=this._clientGateways.get(e);return f||(f=new Set,this._clientGateways.set(e,f)),f.add(d.gatewayId),o?.info(`[McpGateway][Channel] Gateway created: ${d.gatewayId} with ${d.servers.length} server(s) for client ${e}`),{gatewayId:d.gatewayId,servers:d.servers}}case"disposeGateway":{let s=i;o?.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: ${t}`)}};Ac=E([g(1,up),g(2,ai)],Ac)});var rb,Nwe,y_=I(()=>{Z();rb=O("IWebContentExtractorService"),Nwe=O("ISharedWebContentExtractorService")});var I_=I(()=>{});var ag,sg,ib=I(()=>{X();Z();ag=O("terminalSandboxService"),sg=class{async isEnabled(){return!1}async isSandboxAllowNetworkEnabled(){return!1}async getOS(){return Ut}async checkForSandboxingPrereqs(){return{enabled:!1,sandboxConfigPath:void 0,failedCheck:void 0}}async wrapCommand(r){return{command:r,isSandboxWrapped:!1}}async getSandboxConfigPath(){}getTempDir(){}setNeedsForceUpdateConfigFile(){}getResolvedNetworkDomains(){return{allowedDomains:[],deniedDomains:[]}}async getMissingSandboxDependencies(){return[]}async installMissingSandboxDependencies(){return{exitCode:void 0}}}});function b_(n,r=!1){if(!n)return;let e=n.trim().toLowerCase().replace(/^[^@]+@/,"").replace(/:\d+$/,"").replace(/\.+$/,"");if(!e||e.includes("/")||e==="."||e==="..")return;if(e==="*")return"*";if(!/^\*?\.?[a-z0-9.;,)!?:-]+$/.test(e))return;let t=e.replace(/[),;:!?]+$/,"");if(!t)return;let i=t.startsWith("*.")?t.slice(2):t;if(!/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?))*$/.test(i))return;let o=t.startsWith("*."),s=o?t.slice(2):t;if(s&&/^[a-z0-9.-]+$/.test(s)){if(!r){let a=s.slice(s.lastIndexOf(".")+1);if(EO.has(a)||!CO.has(a))return}return o?`*.${s}`:s}}function TO(n){let r=n.trim();if(r==="*"||!r.includes("://"))return r;try{return x.parse(r).authority}catch{return r}}function w_(n,r){let e=b_(TO(r),r.includes("://"));if(!e)return!1;if(e==="*")return!0;if(e.startsWith("*.")){let t=e.slice(2);return n===t||n.endsWith(`.${t}`)}return n===e}function nb(n){return b_(n.authority,!0)}function S_(n,r,e){return r.length===0&&e.length===0||e.some(t=>w_(n,t))?!1:r.length===0?!0:r.some(t=>w_(n,t))}var EO,CO,x_=I(()=>{ce();EO=new Set(["7z","bz2","cjs","class","cpp","cs","css","csv","dll","exe","gif","gz","ico","jar","env","java","jpeg","jpg","js","json","jsx","lock","log","md","mjs","pdf","php","png","py","rar","rs","so","sql","svg","tar","tgz","toml","ts","tsx","txt","wasm","webp","xml","yaml","yml","zip"]),CO=new Set(["ai","cloud","com","dev","io","me","net","org","tech"])});var P_=I(()=>{});var lg,_O,Lc,ob=I(()=>{q();$();Cr();xe();et();Z();I_();ib();x_();P_();lg=O("agentNetworkFilterService"),_O="fetchWebTool",Lc=class extends T{constructor(e,t){super();this.configurationService=e;this.terminalSandboxService=t;this.networkFilterEnabled=!1;this.terminalSandboxEnabled=!1;this.allowedPatterns=[];this.deniedPatterns=[];this.domainCache=new ki(100);this.onDidChangeEmitter=this._register(new b);this.onDidChange=this.onDidChangeEmitter.event;this.readConfiguration(),this.updateTerminalSandboxEnabled(),this._register(this.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration("chat.agent.networkFilter")||i.affectsConfiguration("chat.agent.allowedNetworkDomains")||i.affectsConfiguration("chat.agent.deniedNetworkDomains")?(this.readConfiguration(),this.onDidChangeEmitter.fire()):(i.affectsConfiguration("chat.agent.sandbox.enabled")||i.affectsConfiguration("chat.agent.sandbox"))&&this.updateTerminalSandboxEnabled()}))}readConfiguration(){let e=this.configurationService.getValue("chat.agent.networkFilter")??!1;this.networkFilterEnabled=e,this.allowedPatterns=this.configurationService.getValue("chat.agent.allowedNetworkDomains")??[],this.deniedPatterns=this.configurationService.getValue("chat.agent.deniedNetworkDomains")??[],this.domainCache.clear()}async updateTerminalSandboxEnabled(){let[e,t]=await Promise.all([this.terminalSandboxService.isEnabled(),this.terminalSandboxService.isSandboxAllowNetworkEnabled()]),i=e&&!t;this.terminalSandboxEnabled!==i&&(this.terminalSandboxEnabled=i,this.readConfiguration(),this.onDidChangeEmitter.fire())}isUriAllowed(e,t){if(!this.shouldFilter(t)||e.scheme==="file"||!e.authority)return!0;let i=nb(e);if(!i)return!0;let o=this.domainCache.get(i);return o===void 0&&(o=S_(i,this.allowedPatterns,this.deniedPatterns),this.domainCache.set(i,o)),o}shouldFilter(e){return this.networkFilterEnabled||this.terminalSandboxEnabled&&e===_O}formatError(e){let t=nb(e);return h(2375,null,t??e.authority,"chat.agent.allowedNetworkDomains","chat.agent.deniedNetworkDomains")}};Lc=E([g(0,ue),g(1,ag)],Lc)});function sb(n){let r=typeof n=="string"?x.parse(n):n;return r.with({path:r.path.replace(/\/+$/,""),query:null,fragment:null})}function E_(n,r){let e=sb(n),t;if(/^[^./:]*:\/\//.test(r))t=sb(r);else{if(e.scheme!=="http"&&e.scheme!=="https")return!1;t=sb(`${e.scheme}://${r}`)}return ab(e.scheme,t.scheme)&&ab(e.authority,t.authority,!0)&&(t.path==="/"||ab(e.path,t.path))}function ab(n,r,e=!1){let t=Array.from({length:n.length+1}).map(()=>Array.from({length:r.length+1}).map(()=>{}));return Co(t,e,n,r,0,0)}function Co(n,r,e,t,i,o){if(n[i]?.[o]!==void 0)return n[i][o];let s=[];if(i===e.length)return o===t.length?!0:r&&t[o]+t[o+1]===":*"?o+2===t.length:!1;if(o===t.length)return e.slice(i)[0]==="/";if(e[i]===t[o]&&s.push(Co(n,r,e,t,i+1,o+1)),t[o]+t[o+1]==="*."&&(["/",":"].includes(e[i])||s.push(Co(n,r,e,t,i+1,o)),(i===0||e[i-1]===".")&&s.push(Co(n,r,e,t,i,o+2))),t[o]==="*"&&(i+1===e.length?s.push(Co(n,r,e,t,i+1,o+1)):s.push(Co(n,r,e,t,i+1,o)),s.push(Co(n,r,e,t,i,o+1))),r&&t[o]+t[o+1]===":*")if(e[i]===":"){let a=i+1;do a++;while(/[0-9]/.test(e[a]));s.push(Co(n,r,e,t,a,o+2))}else s.push(Co(n,r,e,t,i,o+2));return n[i][o]=s.some(a=>a===!0)}var C_=I(()=>{ce()});function __(n,r){if(n=x.parse(T_(n)),r=r.map(T_),AO(n.authority))return!0;for(let e=0;e<r.length;e++)if(r[e]==="*"||E_(n,r[e]))return!0;return!1}function T_(n){let r=["github.com"];try{let e=typeof n=="string"?x.parse(n,!0):n;return r.includes(e.authority)?e.with({path:e.path.toLowerCase()}).toString(!0):e.toString(!0)}catch{return n.toString()}}function AO(n){return kO.test(n)||RO.test(n)||DO.test(n)}var kO,RO,DO,k_=I(()=>{ce();C_();kO=/^(.+\.)?localhost(:\d+)?$/i,RO=/^127.0.0.1(:\d+)?$/,DO=/^\[::1\](:\d+)?$/});var cg,R_=I(()=>{Cr();gt();cg=class n{constructor(){this._cache=new ki(n.MAX_CACHE_SIZE)}static{this.MAX_CACHE_SIZE=1e3}static{this.SUCCESS_CACHE_DURATION=1e3*60*60*24}static{this.ERROR_CACHE_DURATION=1e3*60*5}add(r,e,t){let i;switch(t.status){case"ok":case"redirect":i=Date.now()+n.SUCCESS_CACHE_DURATION;break;default:i=Date.now()+n.ERROR_CACHE_DURATION;break}let o=n.getKey(r,e);this._cache.set(o,{result:t,options:e,expiration:i})}tryGet(r,e){let t=n.getKey(r,e),i=this._cache.get(t);if(i!==void 0){if(i.expiration<Date.now()){this._cache.delete(t);return}return i.result}}clear(){this._cache.clear()}static getKey(r,e){return`${!!e?.followRedirects}${Ua.getComparisonKey(r)}`}}});function LO(n){if(n.length===0)return[];let r=new Map;for(let o of n)r.set(o.nodeId,o);function e(o){let s=r.get(o);if(!s||!s.childIds)return[];let a=[];for(let l of s.childIds){let c=r.get(l);c&&(c.ignored?a.push(...e(l)):a.push(l))}return a}let t=new Map;for(let o of n)o.ignored||t.set(o.nodeId,{node:o,children:[],parent:null});for(let o of n){if(o.ignored)continue;let s=t.get(o.nodeId);if(o.childIds)for(let a of o.childIds){let l=r.get(a);if(l)if(l.ignored){let c=e(a);for(let d of c){let u=t.get(d);u&&(u.parent=s,s.children.push(u))}}else{let c=t.get(a);c&&(c.parent=s,s.children.push(c))}}}let i=[];for(let o of t.values())o.parent||i.push(o);return i}function A_(n,r){let e=LO(r);if(e.length===0)return"";let t=[],i=[];for(let s of e){let a=MO(n,s),l=HO(s);a.trim().length>0&&t.push(a),i.push(...l)}return t.join(`

`)+(i.length>0?`

## Additional Links
`+i.join(`
`):"")}function MO(n,r){let e=[];return To(n,r,e,0,!0),e.join("")}function To(n,r,e,t,i){switch(_o(r.node)){case"navigation":return;case"heading":UO(n,r,e,t);return;case"paragraph":WO(n,r,e,t,i);return;case"list":e.push(`
`);for(let s of r.children)To(n,s,e,t+1,!0);e.push(`
`);return;case"ListMarker":e.push(qn(r.node,i));return;case"listitem":{let s=[];for(let l of r.children)To(n,l,s,t+1,!0);let a=cb(r.node)>1?" ".repeat(cb(r.node)):"";e.push(`${a}${s.join("").trim()}
`);return}case"link":if(!L_(r)){let s=qn(r.node,i),a=db(r.node);FO(n,r.node)?e.push(s):e.push(`[${s}](${a})`)}return;case"StaticText":{let s=qn(r.node,i);s&&e.push(s);break}case"image":{let s=qn(r.node,i)||"Image",a=OO(r.node);a?e.push(`![${s}](${a})

`):e.push(`[Image: ${s}]

`);break}case"DescriptionList":NO(n,r,e,t);return;case"blockquote":e.push("> "+qn(r.node,i).replace(/\n/g,`
> `)+`

`);break;case"generic":e.push(" ");break;case"code":{VO(n,r,e,t);return}case"pre":e.push("```\n"+qn(r.node,!1)+"\n```\n\n");break;case"table":BO(r,e);return}for(let s of r.children)To(n,s,e,t+1,i)}function _o(n){return n.role?.value||""}function qn(n,r){let e=n.name?.value||n.value?.value||"";if(!r||e.length<=lb)return e;let t=e.split(""),i=-1;for(let o=1;o<t.length;o++)t[o]===" "&&(i=o),o%lb===0&&i!==-1&&(t[i]=`
`,i=o);return t.join("")}function cb(n){let r=n.properties?.find(e=>e.name==="level");return r?Math.min(Number(r.value.value)||1,6):1}function db(n){return n.properties?.find(e=>e.name==="url")?.value.value||"#"}function OO(n){return n.properties?.find(e=>e.name==="url")?.value.value||null}function L_(n){let r=n;for(;r;){let e=_o(r.node);if(["navigation","menu","menubar"].includes(e))return!0;r=r.parent}return!1}function FO(n,r){let e=db(r);try{let t=x.parse(e);return t.scheme===n.scheme&&t.authority===n.authority&&t.path===n.path}catch{return!1}}function WO(n,r,e,t,i){e.push(`
`);for(let o of r.children)To(n,o,e,t+1,i);e.push(`

`)}function UO(n,r,e,t){e.push(`
`);let i=cb(r.node);e.push(`${"#".repeat(i)} `);for(let o of r.children)_o(o.node)==="StaticText"?e.push(qn(o.node,!1)):To(n,o,e,t+1,!1);e.push(`

`)}function NO(n,r,e,t){e.push(`
`);for(let i of r.children)if(_o(i.node)==="term"){e.push("- **");for(let o of i.children)To(n,o,e,t+1,!0);e.push("** ")}else if(_o(i.node)==="definition"){for(let o of i.children)To(n,o,e,t+1,!0);e.push(`
`)}e.push(`
`)}function D_(n){return n==="cell"||n==="gridcell"||n==="columnheader"||n==="rowheader"}function BO(n,r){r.push(`
`);let e=n.children.filter(t=>_o(t.node).includes("row"));if(e.length>0){let t=e[0].children.filter(o=>D_(_o(o.node))),i=t.map(o=>qn(o.node,!1)||" ");r.push("| "+i.join(" | ")+` |
`),r.push("| "+t.map(()=>"---").join(" | ")+` |
`);for(let o=1;o<e.length;o++){let a=e[o].children.filter(l=>D_(_o(l.node))).map(l=>qn(l.node,!1)||" ");r.push("| "+a.join(" | ")+` |
`)}}r.push(`
`)}function VO(n,r,e,t){let i=[];for(let s of r.children)To(n,s,i,t+1,!1);if(i.some(s=>s.includes(`
`)))e.push("\n```\n"),e.push(i.join("")),e.push("\n```\n");else{e.push("`");let s=0;for(let a of i)s+=a.length,s>lb&&(e.push(`
`),s=0),e.push(a),e.push("`")}}function HO(n){let r=[];return M_(n,r),r}function M_(n,r){if(_o(n.node)==="link"&&L_(n)){let t=qn(n.node,!0),i=db(n.node),o=n.node.description?.value||"";r.push(`- [${t}](${i})${o?" - "+o:""}`)}for(let t of n.children)M_(t,r)}var lb,O_=I(()=>{ce();lb=80});var dg,F_=I(()=>{he();wt();Pa();$();ce();Xt();O_();dg=class n extends T{constructor(e,t,i,o,s,a){super();this._logger=t;this._uri=i;this._options=o;this._isTrustedDomain=s;this._agentNetworkFilterService=a;this._requests=new Set;this._queue=this._register(new Di);this._timeout=this._register(new Ls);this._idleDebounceTimer=this._register(new Ls);this._onResult=e=>{};this._didFinishLoad=!1;this._window=e({width:800,height:600,show:!1,webPreferences:{partition:ke(),javascript:!0,offscreen:!0,sandbox:!0,webgl:!1}}),this._register(G(()=>this._window.destroy())),this._debugger=this._window.webContents.debugger,this._debugger.attach("1.1"),this._debugger.on("message",this.onDebugMessage.bind(this)),this._window.webContents.once("did-start-loading",this.onStartLoading.bind(this)).once("did-finish-load",this.onFinishLoad.bind(this)).once("did-fail-load",this.onFailLoad.bind(this)).on("will-navigate",this.onRedirect.bind(this)).on("will-redirect",this.onRedirect.bind(this)).on("select-client-certificate",l=>l.preventDefault()),this._window.webContents.session.webRequest.onBeforeSendHeaders(this.onBeforeSendHeaders.bind(this)),this._window.webContents.session.webRequest.onHeadersReceived(this.onHeadersReceived.bind(this)),this._window.webContents.session.on("will-download",this.onDownload.bind(this))}static{this.TIMEOUT=3e4}static{this.POST_LOAD_TIMEOUT=5e3}static{this.FRAME_TIMEOUT=500}static{this.EXTRACT_CONTENT_TIMEOUT=2e3}static{this.IDLE_DEBOUNCE_TIME=500}static{this.MIN_CONTENT_LENGTH=100}trace(e){this._logger.trace(`[WebPageLoader] [${this._uri}] ${e}`)}async load(){return await new Promise(e=>{this._onResult=Xn(t=>{switch(t.status){case"ok":this.trace(`Loaded web page content, status: ${t.status}, title: '${t.title}', length: ${t.result.length}`);break;case"redirect":this.trace(`Loaded web page content, status: ${t.status}, toURI: ${t.toURI}`);break;case"error":this.trace(`Loaded web page content, status: ${t.status}, code: ${t.statusCode}, error: '${t.error}', title: '${t.title}', length: ${t.result?.length??0}`);break}let i=t.status!=="redirect"?t.result:void 0;i!==void 0&&this.trace(i.length<200?`Extracted content: '${i}'`:`Extracted content preview: '${i.substring(0,200)}...'`),e(t),this.dispose()}),this.trace("Loading web page content"),this._window.loadURL(this._uri.toString(!0)),this.setTimeout(n.TIMEOUT)})}setTimeout(e){this._store.isDisposed||(this.trace(`Setting page load timeout to ${e} ms`),this._timeout.cancelAndSet(()=>{this.trace("Page load timeout reached"),this._queue.queue(()=>this.extractContent())},e))}onBeforeSendHeaders(e,t){let i={...e.requestHeaders};i.DNT="1",i["Sec-GPC"]="1",t({requestHeaders:i})}onHeadersReceived(e,t){let i=e.responseHeaders;if(i){let o=!1,s,a;for(let l of Object.keys(i)){let c=l.toLowerCase();c==="content-disposition"&&i[l]?.some(d=>d.toLowerCase().includes("attachment"))&&(o=!0,s=l),c==="content-type"&&(a=i[l]?.[0]?.toLowerCase())}if(o&&s){this.isTextMimeType(a)?(this.trace(`Replacing Content-Disposition: attachment with inline for ${e.url} (content-type: ${a})`),i[s]=["inline"],t({responseHeaders:i,cancel:!1})):(this.trace(`Blocked binary download (Content-Disposition: attachment, content-type: ${a}) for ${e.url}`),t({cancel:!0}));return}}t({cancel:!1})}static{this.TEXT_MIME_TYPE_RE=/^(?:text\/|application\/(?:json|xml|xhtml\+xml|rss\+xml|atom\+xml|svg\+xml|javascript|ecmascript|x-yaml|yaml|toml|.*\+(?:xml|json))$)/}isTextMimeType(e){let t=e?.split(";")[0].trim();return!!t&&n.TEXT_MIME_TYPE_RE.test(t)}onDownload(e,t){let i=t.getFilename();this.trace(`Blocked download: ${i}`),t.cancel(),this._queue.queue(()=>this.extractContent({status:"error",error:`Download not allowed: ${i}`}))}onStartLoading(){this._store.isDisposed||(this.trace("Received 'did-start-loading' event"),this._debugger.sendCommand("Network.enable").catch(()=>{}))}onFinishLoad(){this._store.isDisposed||(this.trace("Received 'did-finish-load' event"),this._didFinishLoad=!0,this.scheduleIdleCheck(),this.setTimeout(n.POST_LOAD_TIMEOUT))}onFailLoad(e,t,i){this._store.isDisposed||(this.trace(`Received 'did-fail-load' event, code: ${t}, error: '${i}'`),t===-3?(this.trace("Ignoring ERR_ABORTED (-3) as it may be caused by CSP or other measures"),this._queue.queue(()=>this.extractContent())):t===-27?(this.trace("Ignoring ERR_BLOCKED_BY_CLIENT (-27) as it may be caused by ad-blockers or similar extensions"),this._queue.queue(()=>this.extractContent())):this._queue.queue(()=>this.extractContent({status:"error",statusCode:t,error:i})))}onRedirect(e,t){if(this._store.isDisposed)return;this.trace(`Received 'will-navigate' or 'will-redirect' event, url: ${t}`);let i=x.parse(t);if(!this._agentNetworkFilterService.isUriAllowed(i)){this.trace(`Blocking navigation to ${t} (blocked by domain filter policy)`),e.preventDefault(),this._onResult({status:"error",error:this._agentNetworkFilterService.formatError(i)});return}if(!this._options?.followRedirects){if(this.normalizeAuthority(i.authority)===this.normalizeAuthority(this._uri.authority)||this._isTrustedDomain(i))return;if(this._didFinishLoad){this.trace(`Blocking post-load navigation to ${t} (likely ad/tracker script)`),e.preventDefault();return}e.preventDefault(),this._onResult({status:"redirect",toURI:i})}}normalizeAuthority(e){return e.toLowerCase().replace(/^www\./,"")}onDebugMessage(e,t,i){if(this._store.isDisposed)return;let{requestId:o,type:s,response:a}=i;switch(t){case"Network.requestWillBeSent":o!==void 0&&(this._requests.add(o),this._idleDebounceTimer.cancel());break;case"Network.loadingFinished":case"Network.loadingFailed":o!==void 0&&(this._requests.delete(o),this._requests.size===0&&this._didFinishLoad&&this.scheduleIdleCheck());break;case"Network.responseReceived":if(s==="Document"){let l=a?.status??0;if(l>=400){let c=a?.statusText||`HTTP error ${l}`;this._queue.queue(()=>this.extractContent({status:"error",statusCode:l,error:c}))}}break}}scheduleIdleCheck(){this._store.isDisposed||this._idleDebounceTimer.cancelAndSet(async()=>{this._store.isDisposed||(await this.nextFrame(),this._requests.size===0?this._queue.queue(()=>this.extractContent()):this.trace("New network requests detected, deferring content extraction"))},n.IDLE_DEBOUNCE_TIME)}async nextFrame(){this._store.isDisposed||await Tv(new Promise(e=>{try{this.trace("Waiting for a frame to be rendered"),this._window.webContents.beginFrameSubscription(!1,()=>{try{this.trace("A frame has been rendered"),this._window.webContents.endFrameSubscription()}catch{}e()})}catch{e()}}),n.FRAME_TIMEOUT)}async extractContent(e){if(!this._store.isDisposed)try{let t=this._window.webContents.getTitle(),i="",o=new $e;try{await Tv((async()=>{if(o.token.isCancellationRequested||(i=await this.extractAccessibilityTreeContent(o.token)??""),!o.token.isCancellationRequested&&i.length<n.MIN_CONTENT_LENGTH){this.trace("Accessibility tree extraction yielded insufficient content, trying main DOM element extraction");let s=await this.extractMainDomElementContent()??"";i=s.length>i.length?s:i}})(),n.EXTRACT_CONTENT_TIMEOUT)}finally{o.cancel(),o.dispose()}i.length===0?this._onResult({status:"error",error:"Failed to extract meaningful content from the web page"}):e!==void 0?this._onResult({...e,result:i,title:t}):this._onResult({status:"ok",result:i,title:t})}catch(t){e!==void 0?this._onResult(e):this._onResult({status:"error",error:t instanceof Error?t.message:String(t)})}}async extractAccessibilityTreeContent(e){this.trace("Extracting content using Accessibility domain");try{if(await this._debugger.sendCommand("Page.enable"),e.isCancellationRequested)return;let{frameTree:t}=await this._debugger.sendCommand("Page.getFrameTree");if(e.isCancellationRequested)return;let i=[t];for(let s=0;s<i.length;s++)i.push(...i[s].childFrames??[]);let o=[];for(let{frame:s}of i)try{let{nodes:a}=await this._debugger.sendCommand("Accessibility.getFullAXTree",{frameId:s.id});if(o.push(...a),e.isCancellationRequested)return}catch{}return A_(this._uri,o)}catch(t){this.trace(`Accessibility tree extraction failed: ${t instanceof Error?t.message:String(t)}`);return}}async extractMainDomElementContent(){try{return this.trace("Extracting content from main DOM element"),await this._window.webContents.executeJavaScript(`
				(() => {
					const selectors = ['main','article','[role="main"]','.main-content','#main-content','.article-body','.post-content','.entry-content','.content','body'];
					for (const selector of selectors) {
						const content = document.querySelector(selector)?.textContent?.replace(/[ \\t]+/g, ' ').replace(/\\s{2,}/gm, '\\n').trim();
						if (content && content.length > ${n.MIN_CONTENT_LENGTH}) {
							return content;
						}
					}
					return undefined;
				})();
			`)}catch(e){this.trace(`DOM extraction failed: ${e instanceof Error?e.message:String(e)}`);return}}}});import{BrowserWindow as $O}from"electron";var Mc,W_=I(()=>{he();$();te();ob();k_();R_();F_();Mc=class extends T{constructor(e,t){super();this._logger=e;this._agentNetworkFilterService=t;this._limiter=new hd(3);this._webContentsCache=new cg;this._register(this._agentNetworkFilterService.onDidChange(()=>this._webContentsCache.clear()))}extract(e,t){return e.length===0?(this._logger.info("No URIs provided for extraction"),Promise.resolve([])):(this._logger.info(`Extracting content from ${e.length} URIs`),Promise.all(e.map(i=>this._limiter.queue(()=>this.doExtract(i,t)))))}async doExtract(e,t){let i=this._webContentsCache.tryGet(e,t);if(i!==void 0)return this._logger.info(`Found cached content for ${e.toString()}`),i;let o=new dg(s=>new $O(s),this._logger,e,t,s=>__(s,t?.trustedDomains||[]),this._agentNetworkFilterService);try{let s=await o.load();return this._webContentsCache.add(e,t,s),s}finally{o.dispose()}}};Mc=E([g(0,B),g(1,lg)],Mc)});function qO(n){if(!n||typeof n!="object")return{callstack:void 0,msg:Rm(n)};let r=Array.isArray(n.stack)?n.stack.join(`
`):n.stack,e=n.message?n.message:Rm(n);return{callstack:r,msg:e}}var U_,fp,N_=I(()=>{Jt();He();q();$();di();je();(r=>{function n(e,t){return e.callstack<t.callstack?-1:e.callstack>t.callstack?1:0}r.compare=n})(U_||={});fp=class n{constructor(r,e=n.ERROR_FLUSH_TIMEOUT){this._flushHandle=void 0;this._buffer=[];this._disposables=new j;this._telemetryService=r,this._flushDelay=e;let t=xa.addListener(i=>this._onErrorEvent(i));this._disposables.add(G(t)),this.installErrorListeners()}static{this.ERROR_FLUSH_TIMEOUT=5*1e3}dispose(){clearTimeout(this._flushHandle),this._flushBuffer(),this._disposables.dispose()}installErrorListeners(){}_onErrorEvent(r){if(!r||r.code||(r.detail&&r.detail.stack&&(r=r.detail),ri.isErrorNoTelemetry(r)||r instanceof Yt||Hp.is(r)||typeof r?.message=="string"&&r.message.includes("Unable to read file")))return;let{callstack:e,msg:t}=qO(r);if(!e)return;let i={msg:t,callstack:e};La.is(r)&&(i.kind=r.kind,i.listenerCount=r.listenerCount),this._enqueue(i)}_enqueue(r){let e=wS(this._buffer,r,U_.compare);e<0?(r.count=1,this._buffer.splice(~e,0,r)):(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 r of this._buffer)this._telemetryService.publicLogError2("UnhandledError",r);this._buffer.length=0}}});var fa,B_=I(()=>{He();N_();Zt();fa=class extends fp{constructor(e,t){super(t);this.logService=e}installErrorListeners(){$p(e=>this.onUnexpectedError(e)),process.on("uncaughtException",e=>{mS(e)||nt(e)}),process.on("unhandledRejection",e=>nt(e))}onUnexpectedError(e){this.logService.error(`[uncaught exception in main]: ${e}`),e.stack&&this.logService.error(e.stack)}};fa=E([g(1,Ke)],fa)});import{app as Ei,powerMonitor as Oc,protocol as V_,session as Fc,systemPreferences as H_}from"electron";import{execFile as KO}from"child_process";import{hostname as zO,release as jO}from"os";var bs,$_=I(()=>{Ha();Ai();el();ot();No();q();Vg();so();$();ze();we();X();Oe();ce();Xt();Lx();Pn();Fx();Uf();Oy();xe();Sl();RP();et();LP();Em();tI();Qs();qd();t0();Au();n0();CI();$0();Lt();Nl();qu();WI();iE();nE();lE();cE();dE();CE();je();VE();fh();Ju();Z();vh();$E();KE();zE();Ct();te();QE();Fl();gs();aw();XE();YE();qt();_l();cC();kh();xi();dC();Fn();lw();Zt();uC();pC();So();Bn();fC();mC();hC();vC();wC();bC();SC();_C();ew();kC();RC();AC();LC();FC();Jo();Kt();GC();JC();Rr();Lm();Xu();QC();is();cn();XC();es();ap();Uw();PT();ET();CT();he();wt();MT();OT();FT();Xl();WT();NT();bc();BT();e_();i_();n_();rg();s_();Yn();Ll();l_();vd();Rw();d_();u_();Xw();g_();v_();y_();W_();ob();ib();My();B_();bs=class extends T{constructor(e,t,i,o,s,a,l,c,d,u,f,m){super();this.mainProcessNodeIpcServer=e;this.userEnv=t;this.mainInstantiationService=i;this.logService=o;this.loggerService=s;this.environmentMainService=a;this.lifecycleMainService=l;this.configurationService=c;this.stateService=d;this.fileService=u;this.productService=f;this.userDataProfilesMainService=m;this.configureSession(),this.registerListeners()}static{this.SECURITY_PROTOCOL_HANDLING_CONFIRMATION_SETTING_KEY={[W.file]:"security.promptForLocalFileProtocolHandling",[W.vscodeRemote]:"security.promptForRemoteFileProtocolHandling"}}configureSession(){let e=m=>m?.startsWith(`${W.vscodeFileResource}://${Fa}`),t=m=>m?.startsWith(`${W.vscodeWebview}://`),i=new Set(["pointerLock","notifications"]),o=new Set([...i,"clipboard-read","clipboard-sanitized-write","deprecated-sync-clipboard-read"]),s=new Set([...i,"media","local-fonts","deprecated-sync-clipboard-read"]);Fc.defaultSession.setPermissionRequestHandler((m,v,y,C)=>t(C.requestingUrl)?y(o.has(v)):e(C.requestingUrl)?y(s.has(v)):y(!1)),Fc.defaultSession.setPermissionCheckHandler((m,v,y,C)=>t(C.requestingUrl)?o.has(v):e(C.requestingUrl)?s.has(v):!1);let a=new Set([W.file,W.vscodeFileResource,W.vscodeRemoteResource,W.vscodeManagedRemoteResource,"devtools"]),l=m=>{for(let v=m;v;v=v.parent)if(v.url.startsWith(`${W.vscodeWebview}://`))return!0;return!1},c=m=>m.resourceType==="xhr"||l(m.frame),d=m=>{let v=m.frame;if(!v||!this.windowsMainService)return!1;let y=Ln();for(let C of y)if(v.processId===C.webContents.mainFrame.processId)return!0;return!1},u=(m,v)=>{if(m.path!=="/index.html")return!0;let y=v.frame;if(!y||!this.windowsMainService)return!1;for(let C of this.windowsMainService.getWindows())if(C.win&&y.processId===C.win.webContents.mainFrame.processId)return!0;return!1};Fc.defaultSession.webRequest.onBeforeRequest((m,v)=>{let y=x.parse(m.url);return y.scheme===W.vscodeWebview&&!u(y,m)?(this.logService.error("Blocked vscode-webview request",m.url),v({cancel:!0})):y.scheme===W.vscodeFileResource&&!d(m)?(this.logService.error("Blocked vscode-file request",m.url),v({cancel:!0})):y.path.endsWith(".svg")&&!a.has(y.scheme)?v({cancel:!c(m)}):v({cancel:!1})}),Fc.defaultSession.webRequest.onHeadersReceived((m,v)=>{let y=m.responseHeaders,C=y["content-type"]||y["Content-Type"];if(C&&Array.isArray(C)){let w=x.parse(m.url);if(w.path.endsWith(".svg")&&a.has(w.scheme))return y["Content-Type"]=["image/svg+xml"],v({cancel:!1,responseHeaders:y});if(!w.path.endsWith(W.vscodeRemoteResource)&&C.some(_=>_.toLowerCase().includes("image/svg")))return v({cancel:!c(m)})}return v({cancel:!1})}),Fc.defaultSession.webRequest.onHeadersReceived((m,v)=>{if(m.url.startsWith("https://vscode.download.prss.microsoft.com/")){let y=m.responseHeaders??Object.create(null);if(y["Access-Control-Allow-Origin"]===void 0)return y["Access-Control-Allow-Origin"]=["*"],v({cancel:!1,responseHeaders:y})}return v({cancel:!1})});let f=Fc.defaultSession;typeof f.setCodeCachePath=="function"&&this.environmentMainService.codeCachePath&&f.setCodeCachePath(N(this.environmentMainService.codeCachePath,"chrome")),F&&(this.configurationService.getValue("security.restrictUNCAccess")===!1?F1():io(this.configurationService.getValue("security.allowedUNCHosts")))}registerListeners(){S.once(this.lifecycleMainService.onWillShutdown)(()=>this.dispose()),Dx(),Ei.on("accessibility-support-changed",(i,o)=>{this.windowsMainService?.sendToAll("vscode:accessibilitySupportChanged",o)}),Ei.on("activate",async(i,o)=>{this.logService.trace("app#activate"),o||await this.windowsMainService?.openEmptyWindow({context:1})}),Ei.on("web-contents-created",(i,o)=>{o?.opener?.url.startsWith(`${W.vscodeFileResource}://${Fa}/`)&&(this.logService.trace('[aux window]  app.on("web-contents-created"): Registering auxiliary window'),this.auxiliaryWindowsMainService?.registerWindow(o)),o.on("will-navigate",s=>{Ys.isBrowserViewWebContents(o)||(this.logService.error("webContents#will-navigate: Prevented webcontent navigation"),s.preventDefault())}),o.setWindowOpenHandler(s=>s.url==="about:blank"?(this.logService.trace("[aux window] webContents#setWindowOpenHandler: Allowing auxiliary window to open on about:blank"),{action:"allow",overrideBrowserWindowOptions:this.auxiliaryWindowsMainService?.createWindow(s)}):(this.logService.trace(`webContents#setWindowOpenHandler: Prevented opening window with URL ${s.url}}`),this.nativeHostMainService?.openExternal(void 0,s.url),{action:"deny"}))});let e=[],t;Ei.on("open-file",(i,o)=>{o=Sn(o),this.logService.trace("app#open-file: ",o),i.preventDefault(),e.push(kn(o)?{workspaceUri:x.file(o)}:{fileUri:x.file(o)}),t!==void 0&&(clearTimeout(t),t=void 0),t=setTimeout(async()=>{await this.windowsMainService?.open({context:1,cli:this.environmentMainService.args,urisToOpen:e,gotoLineMode:!1,preferNewWindow:!0}),e=[],t=void 0},100)}),Ei.on("new-window-for-tab",async()=>{await this.windowsMainService?.openEmptyWindow({context:4})}),rt.handle("vscode:fetchShellEnv",i=>{let o=this.windowsMainService?.getWindowByWebContents(i.sender),s,a;return o?.config?(s=o.config,a={...process.env,...o.config.userEnv}):(s=this.environmentMainService.args,a=process.env),this.resolveShellEnvironment(s,a,!1)}),rt.on("vscode:toggleDevTools",i=>i.sender.toggleDevTools()),rt.on("vscode:openDevTools",i=>i.sender.openDevTools()),rt.on("vscode:reloadWindow",i=>i.sender.reload()),rt.handle("vscode:notifyZoomLevel",async(i,o)=>{let s=this.windowsMainService?.getWindowByWebContents(i.sender);s&&s.notifyZoomLevel(o)})}async startup(){this.logService.debug("Starting VS Code"),this.logService.debug(`from: ${this.environmentMainService.appRoot}`),this.logService.debug("args:",this.environmentMainService.args);let e=this.productService.win32AppUserModelId;F&&e&&Ei.setAppUserModelId(e);try{V&&this.configurationService.getValue("window.nativeTabs")===!0&&!H_.getUserDefault("NSUseImprovedLayoutPass","boolean")&&H_.setUserDefault("NSUseImprovedLayoutPass","boolean",!0)}catch(f){this.logService.error(f)}let t=new Ff;S.once(this.lifecycleMainService.onWillShutdown)(f=>{f.reason===2&&t.dispose()});let[i,o,s]=await Promise.all([RT(this.stateService,this.logService),DT(this.stateService,this.logService),AT(this.stateService,this.logService)]),{sharedProcessReady:a,sharedProcessClient:l}=this.setupSharedProcess(i,o,s),c=await this.initServices(i,o,s,a);c.invokeFunction(f=>this._register(new fa(f.get(B),f.get(Ke)))),c.invokeFunction(f=>{f.get(Gr).setTelemetryService(f.get(Ke))}),c.invokeFunction(f=>f.get(bu)),this._register(c.createInstance(yc)),c.invokeFunction(f=>this.initChannels(f,t,l));let d=await c.invokeFunction(f=>this.setupProtocolUrlHandlers(f,t));this.setupManagedRemoteResourceUrlHandler(t),this.lifecycleMainService.phase=2,await c.invokeFunction(f=>this.openFirstWindow(f,d)),this.lifecycleMainService.phase=3,this.afterWindowOpen(c),this._register(new gr(()=>{this._register(gd(()=>{this.lifecycleMainService.phase=4,this.eventuallyAfterWindowOpen()},2500))},2500)).schedule()}async setupProtocolUrlHandlers(e,t){let i=this.windowsMainService=e.get(qe),o=e.get(zl),s=this.nativeHostMainService=e.get(Wi),a=e.get(ui),l=this;o.registerHandler({async handleURL(v,y){return l.handleProtocolUrl(i,a,o,v,y)}});let c=this._register(new Kh({onDidOpenMainWindow:s.onDidOpenMainWindow,onDidFocusMainWindow:s.onDidFocusMainWindow,getActiveWindowId:()=>s.getActiveWindowId(-1)})),d=new Rf(v=>c.getActiveClientId().then(y=>v===y)),u=new Bh(d,this.logService),f=t.getChannel("urlHandler",u);o.registerHandler(new Nh(f));let m=await this.resolveInitialProtocolUrls(i,a);return this._register(new Vh(m?.urls,o,i,this.environmentMainService,this.productService,this.logService)),m}setupManagedRemoteResourceUrlHandler(e){let t=()=>({statusCode:404,data:"Not found"}),i=new rr(()=>e.getChannel(o_,new ig));V_.registerBufferProtocol(W.vscodeManagedRemoteResource,(o,s)=>{let a=x.parse(o.url);if(!a.authority.startsWith("window:"))return s(t());i.value.call(Jw,[a]).then(l=>s({...l,data:Buffer.from(l.body,"base64")}),l=>{this.logService.warn("error dispatching remote resource call",l),s({statusCode:500,data:String(l)})})})}async resolveInitialProtocolUrls(e,t){let i=this.environmentMainService.args["open-url"]?this.environmentMainService.args._urls||[]:[];i.length>0&&this.logService.trace("app#resolveInitialProtocolUrls() protocol urls from command line:",i);let o=global.getOpenUrls?.()||[];if(o.length>0&&this.logService.trace("app#resolveInitialProtocolUrls() protocol urls from macOS 'open-url' event:",o),i.length+o.length===0)return;let s=[...i,...o].map(c=>{try{return{uri:x.parse(c),originalUrl:c}}catch{this.logService.trace("app#resolveInitialProtocolUrls() protocol url failed to parse:",c);return}}),a=[],l=[];for(let c of s){if(!c)continue;let d=this.getWindowOpenableFromProtocolUrl(c.uri);if(d){if(process.isEmbeddedApp){this.logService.trace("app#resolveInitialProtocolUrls() agents app skipping window openable:",c.uri.toString(!0));continue}if(await this.shouldBlockOpenable(d,e,t)){this.logService.trace("app#resolveInitialProtocolUrls() protocol url was blocked:",c.uri.toString(!0));continue}else this.logService.trace("app#resolveInitialProtocolUrls() protocol url will be handled as window to open:",c.uri.toString(!0),d),a.push(d)}else this.logService.trace("app#resolveInitialProtocolUrls() protocol url will be passed to active window for handling:",c.uri.toString(!0)),l.push(c)}return{urls:l,openables:a}}async shouldBlockOpenable(e,t,i){let o,s;if(uu(e)?(o=e.workspaceUri,s=h(159,null,o.scheme===W.file?oo(o,{os:Ut,tildify:this.environmentMainService}):o.toString(!0),this.productService.nameShort)):lm(e)?(o=e.folderUri,s=h(158,null,o.scheme===W.file?oo(o,{os:Ut,tildify:this.environmentMainService}):o.toString(!0),this.productService.nameShort)):(o=e.fileUri,s=h(157,null,o.scheme===W.file?oo(o,{os:Ut,tildify:this.environmentMainService}):o.toString(!0),this.productService.nameShort)),o.scheme!==W.file&&o.scheme!==W.vscodeRemote||this.configurationService.getValue(bs.SECURITY_PROTOCOL_HANDLING_CONFIRMATION_SETTING_KEY[o.scheme])===!1)return!1;let{response:l,checkboxChecked:c}=await i.showMessageBox({type:"warning",buttons:[h(162,null),h(155,null)],message:s,detail:h(156,null),checkboxLabel:o.scheme===W.file?h(160,null):h(161,null),cancelId:1});if(l!==0)return!0;if(c){let d={channel:"vscode:disablePromptForProtocolHandling",args:o.scheme===W.file?"local":"remote"};t.sendToFocused(d.channel,d.args),t.sendToOpeningWindow(d.channel,d.args)}return!1}getWindowOpenableFromProtocolUrl(e){if(e.path){if(e.authority===W.file){let t=x.file(e.fsPath);return kn(t)?{workspaceUri:t}:{fileUri:t}}else if(e.authority===W.vscodeRemote){let t=e.path.indexOf(pe.sep,1),i,o;t!==-1?(i=e.path.substring(1,t),o=e.path.substring(t)):(i=e.path.substring(1),o="/");let s=e.query,a=new URLSearchParams(e.query);a.get("windowId")==="_blank"&&(a.delete("windowId"),s=a.toString());let l=x.from({scheme:W.vscodeRemote,authority:i,path:o,query:s,fragment:e.fragment});return kn(o)?{workspaceUri:l}:/:[\d]+$/.test(o)?{fileUri:l}:{folderUri:l}}}}async handleProtocolUrl(e,t,i,o,s){if(this.logService.trace("app#handleProtocolUrl():",o.toString(!0),s),process.isEmbeddedApp){if(this.logService.trace("app#handleProtocolUrl() agents app handling protocol URL:",o.toString(!0)),this.getWindowOpenableFromProtocolUrl(o))return this.logService.trace("app#handleProtocolUrl() agents app skipping window openable:",o.toString(!0)),!0;let v=(await e.openAgentsWindow({context:6,cli:this.environmentMainService.args})).at(0);return v?.focus(),await v?.ready(),!1}o.scheme===this.productService.urlProtocol&&o.path==="workspace"&&(o=o.with({authority:W.file,path:x.parse(o.query).path,query:""}));let a=!1,l=new URLSearchParams(o.query);l.get("windowId")==="_blank"?(this.logService.trace("app#handleProtocolUrl() found 'windowId=_blank' as parameter, setting shouldOpenInNewWindow=true:",o.toString(!0)),l.delete("windowId"),o=o.with({query:l.toString()}),a=!0):V&&e.getWindowCount()===0&&(this.logService.trace("app#handleProtocolUrl() running on macOS with no window open, setting shouldOpenInNewWindow=true:",o.toString(!0)),a=!0);let c=l.get("continueOn");c!==null&&(this.logService.trace("app#handleProtocolUrl() found 'continueOn' as parameter:",o.toString(!0)),l.delete("continueOn"),o=o.with({query:l.toString()}),this.environmentMainService.continueOn=c??void 0);let d=l.get("session");d!==null&&(this.logService.trace("app#handleProtocolUrl() found 'session' as parameter:",o.toString(!0)),l.delete("session"),o=o.with({query:l.toString()}));let u=this.getWindowOpenableFromProtocolUrl(o);if(u){if(await this.shouldBlockOpenable(u,e,t))return this.logService.trace("app#handleProtocolUrl() protocol url was blocked:",o.toString(!0)),!0;{this.logService.trace("app#handleProtocolUrl() opening protocol url as window:",u,o.toString(!0));let f=(await e.open({context:6,cli:{...this.environmentMainService.args},urisToOpen:[u],forceNewWindow:a,gotoLineMode:!0})).at(0);return f?.focus(),f&&d&&f.sendWhenReady("vscode:openChatSession",Ce.None,d),!0}}return a?(this.logService.trace("app#handleProtocolUrl() opening empty window and passing in protocol url:",o.toString(!0)),await(await e.open({context:6,cli:{...this.environmentMainService.args},forceNewWindow:!0,forceEmpty:!0,gotoLineMode:!0,remoteAuthority:yo(o)})).at(0)?.ready(),i.open(o,s)):(this.logService.trace("app#handleProtocolUrl(): not handled",o.toString(!0),s),!1)}setupSharedProcess(e,t,i){let o=this._register(this.mainInstantiationService.createInstance(ec,e,t,i));this._register(o.onDidCrash(()=>this.windowsMainService?.sendToFocused("vscode:reportSharedProcessCrash")));let s=(async()=>{this.logService.trace("Main->SharedProcess#connect");let l=await o.connect();return this.logService.trace("Main->SharedProcess#connect: connection established"),new Ko(l,"main")})();return{sharedProcessReady:(async()=>(await o.whenReady(),s))(),sharedProcessClient:s}}async initServices(e,t,i,o){let s=new fs;switch(process.platform){case"win32":s.set(ms,new ge(la));break;case"linux":Mp?s.set(ms,new ge(nc,[process.env.SNAP,process.env.SNAP_REVISION])):s.set(ms,new ge(ic));break;case"darwin":s.set(ms,new ge(un));break}s.set(qe,new ge(pc,[e,t,i,this.userEnv],!1)),s.set(nn,new ge(kc,void 0,!1));let a=new Cl(this.logService,this.productService);s.set(ui,a),s.set(Ih,new ge(jl,void 0,!1)),s.set(Dl,new ge(Rl,void 0,!1)),s.set(Pu,tt.toService(Md(o.then(m=>m.getChannel("diagnostics"))))),s.set(tl,new ge(Al)),s.set(yu,new ge(yl)),s.set(Nu,new ge(Ys,void 0,!1)),s.set(TI,new ge(Ul,void 0,!1)),s.set(ZI,new ge(Kl)),s.set(Wi,new ge(Xs,void 0,!1));let l=new Jl(this.configurationService);s.set(Gr,l),s.set(ag,new ge(sg)),s.set(lg,new ge(Lc,void 0,!0)),s.set(rb,new ge(Mc,void 0,!1)),s.set(bw,new ge(sc)),s.set(nw,new ge(Gl)),s.set(FI,new ge(ds)),s.set(ts,new ge(Il)),s.set(Ir,new ge(wl));let c=new Sc({graceTime:6e4,shortGraceTime:6e3,scrollback:this.configurationService.getValue("terminal.integrated.persistentSessionScrollback")??100},this.configurationService,this.environmentMainService,this.lifecycleMainService,this.logService),d=new Cc(c,this.configurationService,this.logService,this.loggerService);if(s.set(Hw,d),this.configurationService.getValue(t_)){let m=new ws(this.configurationService,this.environmentMainService,this.lifecycleMainService,this.logService);this._register(new Tc(m,this.logService,this.loggerService))}F?s.set(Ku,new ge(ju)):V?s.set(Ku,new ge(Jm)):re&&s.set(Ku,new ge(Gu)),s.set(NI,new ge(Qm));let u=new go(this.environmentMainService,this.configurationService,this.logService,this.stateService);s.set(Wn,u);let f=new kl(this.environmentMainService,this.logService,this.userDataProfilesMainService,u,a);if(s.set(pi,f),s.set(Yy,new ge(fc,void 0,!1)),s.set(hs,new ge(wr,void 0,!1)),s.set(zl,new ge(oc,void 0,!1)),Th(this.productService,this.environmentMainService)){let m=oC(this.productService,this.configurationService),v=Md(o.then(D=>D.getChannel("telemetryAppender"))),y=new Dh(v),C=iC(jO(),zO(),process.arch,this.productService.commit,this.productService.version,e,t,i,m,this.productService.date,this.productService.telemetryAppName),w=sC(this.environmentMainService),_={appenders:[y],commonProperties:C,piiPaths:w,sendErrorTelemetry:!0};s.set(Ke,new ge(xo,[_],!1))}else s.set(Ke,Vn);return s.set(Is,new ge(Ic,void 0,!0)),s.set(xT,new ge(vc,void 0,!0)),s.set(Bw,new ge(wc,void 0,!0)),s.set(bu,new ge(bl)),s.set(Qw,new ge(ng)),s.set(up,new ge(Dc)),s.set($h,new ge(dc,void 0,!0)),await vt.settled([u.initialize(),f.initialize()]),this.mainInstantiationService.createChild(s)}initChannels(e,t,i){let o=this._register(new j),s=tt.fromService(e.get(Ih),o,{disableMarshalling:!0});this.mainProcessNodeIpcServer.registerChannel("launch",s);let a=tt.fromService(e.get(Dl),o,{disableMarshalling:!0});this.mainProcessNodeIpcServer.registerChannel("diagnostics",a);let l=o.add(new zh(e.get(Ui)));t.registerChannel("policy",l),i.then(Re=>Re.registerChannel("policy",l));let c=this.fileService.getProvider(W.file);MS(c instanceof ps);let d=o.add(new gh(c,this.logService,this.environmentMainService));t.registerChannel(jI,d),i.then(Re=>Re.registerChannel(jI,d));let u=tt.fromService(e.get(Ur),o);t.registerChannel("userDataProfiles",u),i.then(Re=>Re.registerChannel("userDataProfiles",u));let f=e.get(yu);(V||F)&&f.initialize();let m=e.get(ms),v=m,y=this.productService.quality==="insider"||this.productService.quality==="exploration";(V||F)&&y&&(v=this._register(new Lh(m,this.logService,this.lifecycleMainService,f)));let C=new Ah(v);t.registerChannel("update",C),this._register(new Mh(v,e.get(ui))),V&&this._register(new Fh(e.get(ts),e.get(tl),e.get(Et),this.logService,this.environmentMainService,e.get(Ih),this.lifecycleMainService,f));let w=new xh(e.get(Gr));t.registerChannel(sw,w),i.then(Re=>Re.registerChannel(sw,w));let _=tt.fromService(new ql(this.logService,e.get(Pu),e.get(Dl)),o);t.registerChannel("process",_);let D=tt.fromService(e.get(tl),o);t.registerChannel("encryption",D);let k=tt.fromService(e.get(Nu),o);t.registerChannel(rI,k),i.then(Re=>Re.registerChannel(rI,k));let A=tt.fromService(e.get(TI),o);t.registerChannel(iI,A),i.then(Re=>Re.registerChannel(iI,A));let de=tt.fromService(e.get(vs),o);t.registerChannel("sign",de);let L=tt.fromService(e.get(ZI),o);t.registerChannel("keyboardLayout",L),this.nativeHostMainService=e.get(Wi);let J=tt.fromService(this.nativeHostMainService,o);t.registerChannel("nativeHost",J),i.then(Re=>Re.registerChannel("nativeHost",J));let K=tt.fromService(e.get(rb),o);t.registerChannel("webContentExtractor",K);let ve=tt.fromService(e.get(Yy),o);t.registerChannel("workspaces",ve);let yt=tt.fromService(e.get(nw),o);t.registerChannel("menubar",yt);let Ot=tt.fromService(e.get(zl),o);t.registerChannel("url",Ot);let pn=tt.fromService(e.get(bw),o);t.registerChannel("webview",pn);let gi=o.add(new Rh(this.logService,e.get(ts)));t.registerChannel("storage",gi),i.then(Re=>Re.registerChannel("storage",gi));let ie=o.add(new Yh(e.get(ts),e.get(Ur),this.logService));i.then(Re=>Re.registerChannel("profileStorageListener",ie));let z=tt.fromService(e.get(Hw),o);t.registerChannel("localPty",z);let Y=tt.fromService(e.get(Ku),o);t.registerChannel("externalTerminal",Y);let ee=tt.fromService(e.get(NI),o);t.registerChannel("sandboxHelper",ee);let ne=tt.fromService(e.get(Qw),o);t.registerChannel(c_,ne);let fe=this._register(new Ac(t,e.get(up),e.get(dn)));t.registerChannel(p_,fe);let Ie=new Zh(e.get(dn));t.registerChannel("logger",Ie),i.then(Re=>Re.registerChannel("logger",Ie));let bt=new Pm(e.get(qe));t.registerChannel("extensionhostdebugservice",bt);let Xe=tt.fromService(e.get(FI),o);t.registerChannel(tE,Xe);let Ft=tt.fromService(e.get(Bw),o);t.registerChannel(UT,Ft)}async openFirstWindow(e,t){let i=this.windowsMainService=e.get(qe);this.auxiliaryWindowsMainService=e.get(nn);let o=an(process.env)?0:4,s=this.environmentMainService.args;if(s["share-secrets-with-agents-app"]&&!(s._.length>0||s["folder-uri"]||s["file-uri"]))return[];if(process.isEmbeddedApp||s.agents&&this.productService.quality!=="stable")return i.openAgentsWindow({context:o,cli:s,initialStartup:!0});if(t){if(t.openables.length>0)return i.open({context:o,cli:s,urisToOpen:t.openables,gotoLineMode:!0,initialStartup:!0});if(t.urls.length>0)for(let C of t.urls){let w=new URLSearchParams(C.uri.query);if(w.get("windowId")==="_blank")return w.delete("windowId"),C.originalUrl=C.uri.toString(!0),C.uri=C.uri.with({query:w.toString()}),i.open({context:o,cli:s,forceNewWindow:!0,forceEmpty:!0,gotoLineMode:!0,initialStartup:!0})}}let a=global.macOpenFiles??[],l=s._.length,c=!!s["folder-uri"],d=!!s["file-uri"],u=s["skip-add-to-recently-opened"]===!0,f=s.wait&&s.waitMarkerFilePath?x.file(s.waitMarkerFilePath):void 0,m=s.remote||void 0,v=s.profile,y=s["profile-temp"];if(!l&&!c&&!d){if(s["new-window"]||v||y)return i.open({context:o,cli:s,forceNewWindow:!0,forceEmpty:!0,noRecentEntry:u,waitMarkerFileURI:f,initialStartup:!0,remoteAuthority:m,forceProfile:v,forceTempProfile:y});if(a.length)return i.open({context:1,cli:s,urisToOpen:a.map(C=>(C=Sn(C),kn(C)?{workspaceUri:x.file(C)}:{fileUri:x.file(C)})),noRecentEntry:u,waitMarkerFileURI:f,initialStartup:!0})}return i.open({context:o,cli:s,forceNewWindow:s["new-window"],diffMode:s.diff,mergeMode:s.merge,noRecentEntry:u,waitMarkerFileURI:f,gotoLineMode:s.goto,initialStartup:!0,remoteAuthority:m,forceProfile:v,forceTempProfile:y})}afterWindowOpen(e){F&&Lf(),this.installMutex(),V_.registerHttpProtocol(W.vscodeRemoteResource,(t,i)=>{i({url:t.url.replace(/^vscode-remote-resource:/,"http:"),method:t.method})}),this.resolveShellEnvironment(this.environmentMainService.args,process.env,!0),this.updateCrashReporterEnablement(),V&&Ei.runningUnderARM64Translation&&this.windowsMainService?.sendToFocused("vscode:showTranslatedBuildWarning"),e.invokeFunction(t=>{let i=t.get(Ke),o=()=>({idleState:Oc.getSystemIdleState(60),idleTime:Oc.getSystemIdleTime(),thermalState:Oc.getCurrentThermalState(),onBattery:Oc.isOnBatteryPower()});this._register(S.fromNodeEventEmitter(Oc,"suspend")(()=>{i.publicLog2("power.suspend",o())})),this._register(S.fromNodeEventEmitter(Oc,"resume")(()=>{i.publicLog2("power.resume",o())}))}),V&&e.invokeFunction(t=>{let i=t.get(Ke);if(Ei.getGPUFeatureStatus().skia_graphite==="enabled"){let a=S.fromNodeEventEmitter(Ei,"gpu-info-update"),l=this._register(new Qt);this._register(S.fromNodeEventEmitter(Ei,"child-process-gone",(c,d)=>({event:c,details:d}))(({details:c})=>{c.type==="GPU"&&c.reason==="crashed"&&(l.value=S.once(a)(()=>{let d=Ei.getGPUFeatureStatus();if(d.rasterization!=="enabled"){let f=[],m=Ei;typeof m.getGPULogMessages=="function"&&(f=m.getGPULogMessages().slice(-10).map(v=>v.message)),i.publicLog2("gpu.crash.fallback",{gpuFeatureStatus:JSON.stringify(d),gpuLogMessages:JSON.stringify(f)})}}))}))}});{let t=Ei;e.invokeFunction(i=>{let o=i.get(Ke);this._register(S.fromNodeEventEmitter(t,"network-process-launched",(s,a)=>a)(s=>{this.logService.info(`[network process] launched with pid ${s.pid}`),o.publicLog2("networkProcess.launched",{})})),this._register(S.fromNodeEventEmitter(t,"network-process-gone",(s,a)=>a)(s=>{this.logService.info(`[network process] gone - pid: ${s.pid}, exitCode: ${s.exitCode}, crashed: ${s.crashed}, crashedPreIPC: ${s.crashedPreIPC}`),o.publicLog2("networkProcess.gone",{exitCode:s.exitCode,crashed:s.crashed,crashedPreIPC:s.crashedPreIPC})}))})}}async installMutex(){let e=this.productService.win32MutexName;if(F&&e)try{let t=await import("@vscode/windows-mutex"),i=new t.Mutex(e);S.once(this.lifecycleMainService.onWillShutdown)(()=>i.release())}catch(t){this.logService.error(t)}}async resolveShellEnvironment(e,t,i){try{return await cs(this.configurationService,this.logService,e,t)}catch(o){let s=_r(o);i?this.windowsMainService?.sendToFocused("vscode:showResolveShellEnvError",s):this.logService.error(s)}return{}}async updateCrashReporterEnablement(){try{let t=(await this.fileService.readFile(this.environmentMainService.argvResource)).value.toString(),i=Tp(t),s=Zl(this.configurationService)>=1;if(i["enable-crash-reporter"]===void 0){let a=["","	// Allows to disable crash reporting.","	// Should restart the app if the value is changed.",`	"enable-crash-reporter": ${s},`,"","	// Unique id used for correlating crash reports sent from this instance.","	// Do not edit this value.",`	"crash-reporter-id": "${ke()}"`,"}"],l=t.substring(0,t.length-2).concat(`,
`,a.join(`
`));await this.fileService.writeFile(this.environmentMainService.argvResource,H.fromString(l))}else{let a=t.replace(/"enable-crash-reporter": .*,/,`"enable-crash-reporter": ${s},`);a!==t&&await this.fileService.writeFile(this.environmentMainService.argvResource,H.fromString(a))}}catch(e){this.logService.error(e),this.windowsMainService?.sendToFocused("vscode:showArgvParseWarning")}}eventuallyAfterWindowOpen(){LT(this.stateService,this.logService),this.registerEmbeddedAppWithLaunchServices()}registerEmbeddedAppWithLaunchServices(){if(!V||process.isEmbeddedApp||!this.productService.embedded?.nameShort||this.productService.quality==="stable")return;let e="launchServices.registeredEmbeddedApp",t=this.productService.version;if(this.stateService.getItem(e)===t){this.logService.trace("Embedded app already registered with Launch Services for this version, skipping.");return}let i=N(this.environmentMainService.appRoot,"..","..","Applications",`${this.productService.embedded.nameLong}.app`),o="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";this.logService.trace("Registering embedded app with Launch Services:",i),KO(o,["-f",i],{timeout:3e4},a=>{a?this.logService.error("Failed to register embedded app with Launch Services:",a.message):this.stateService.setItem(e,t)}).unref()}};bs=E([g(2,Ht),g(3,B),g(4,ai),g(5,_e),g(6,ye),g(7,ue),g(8,Et),g(9,Me),g(10,Te),g(11,Ur)],bs)});function mp(n){return Object.isFrozen(n)?n:OP(n)}function Ss(n,r){let{added:e,removed:t,updated:i}=q_(r?.rawConfiguration,n?.rawConfiguration),o=[],s=n?.getAllOverrideIdentifiers()||[],a=r?.getAllOverrideIdentifiers()||[];if(r){let l=a.filter(c=>!s.includes(c));for(let c of l)o.push([c,r.getKeysForOverrideIdentifier(c)])}if(n){let l=s.filter(c=>!a.includes(c));for(let c of l)o.push([c,n.getKeysForOverrideIdentifier(c)])}if(r&&n){for(let l of s)if(a.includes(l)){let c=q_({contents:n.getOverrideValue(void 0,l)||{},keys:n.getKeysForOverrideIdentifier(l)},{contents:r.getOverrideValue(void 0,l)||{},keys:r.getKeysForOverrideIdentifier(l)});o.push([l,[...c.added,...c.removed,...c.updated]])}}return{added:e,removed:t,updated:i,overrides:o}}function q_(n,r){let e=n?r?n.keys.filter(o=>r.keys.indexOf(o)===-1):[...n.keys]:[],t=r?n?r.keys.filter(o=>n.keys.indexOf(o)===-1):[...r.keys]:[],i=[];if(n&&r){for(let o of r.keys)if(n.keys.indexOf(o)!==-1){let s=Sd(r.contents,o),a=Sd(n.contents,o);ci(s,a)||i.push(o)}}return{added:e,removed:t,updated:i}}var Tt,ug,pg,ub,Wc,fg,pb=I(()=>{Jt();q();rn();$();Cr();di();Oe();ce();et();no();je();Xi();Tt=class n{constructor(r,e,t,i,o){this._contents=r;this._keys=e;this._overrides=t;this._raw=i;this.logService=o;this.overrideConfigurations=new Map}static createEmptyModel(r){return new n({},[],[],void 0,r)}get rawConfiguration(){if(!this._rawConfiguration)if(this._raw){let r=(Array.isArray(this._raw)?this._raw:[this._raw]).map(e=>{if(e instanceof n)return e;let t=new ug("",this.logService);return t.parseRaw(e),t.configurationModel});this._rawConfiguration=r.reduce((e,t)=>t===e?t:e.merge(t),r[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(r=>r instanceof n)))return this._raw}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(r){return r?Sd(this.contents,r):this.contents}inspect(r,e){let t=this;return{get value(){return mp(t.rawConfiguration.getValue(r))},get override(){return e?mp(t.rawConfiguration.getOverrideValue(r,e)):void 0},get merged(){return mp(e?t.rawConfiguration.override(e).getValue(r):t.rawConfiguration.getValue(r))},get overrides(){let i=[];for(let{contents:o,identifiers:s,keys:a}of t.rawConfiguration.overrides){let l=new n(o,a,[],void 0,t.logService).getValue(r);l!==void 0&&i.push({identifiers:s,value:l})}return i.length?mp(i):void 0}}}getOverrideValue(r,e){let t=this.getContentsForOverrideIdentifer(e);return t?r?Sd(t,r):t:void 0}getKeysForOverrideIdentifier(r){let e=[];for(let t of this.overrides)t.identifiers.includes(r)&&e.push(...t.keys);return Mr(e)}getAllOverrideIdentifiers(){let r=[];for(let e of this.overrides)r.push(...e.identifiers);return Mr(r)}override(r){let e=this.overrideConfigurations.get(r);return e||(e=this.createOverrideConfigurationModel(r),this.overrideConfigurations.set(r,e)),e}merge(...r){let e=or(this.contents),t=or(this.overrides),i=[...this.keys],o=this._raw?Array.isArray(this._raw)?[...this._raw]:[this._raw]:[this];for(let s of r)if(o.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]=t.filter(c=>Ao(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=Mr(l.keys)):t.push(or(a))}for(let a of s.keys)i.indexOf(a)===-1&&i.push(a)}return new n(e,i,t,!o.length||o.every(s=>s instanceof n)?void 0:o,this.logService)}createOverrideConfigurationModel(r){let e=this.getContentsForOverrideIdentifer(r);if(!e||typeof e!="object"||!Object.keys(e).length)return this;let t={};for(let i of Mr([...Object.keys(this.contents),...Object.keys(e)])){let o=this.contents[i],s=e[i];s&&(typeof o=="object"&&typeof s=="object"?(o=or(o),this.mergeContents(o,s)):o=s),t[i]=o}return new n(t,this.keys,this.overrides,void 0,this.logService)}mergeContents(r,e){for(let t of Object.keys(e)){if(t in r&&Ge(r[t])&&Ge(e[t])){this.mergeContents(r[t],e[t]);continue}r[t]=or(e[t])}}getContentsForOverrideIdentifer(r){let e=null,t=null,i=o=>{o&&(t?this.mergeContents(t,o):t=or(o))};for(let o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===r?e=o.contents:o.identifiers.includes(r)&&i(o.contents);return i(e),t}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(r,e){this.updateValue(r,e,!0)}setValue(r,e){this.updateValue(r,e,!1)}removeValue(r){let e=this.keys.indexOf(r);e!==-1&&(this.keys.splice(e,1),B1(this.contents,r),xn.test(r)&&this.overrides.splice(this.overrides.findIndex(t=>Ao(t.identifiers,qa(r))),1))}updateValue(r,e,t){if(Rv(this.contents,r,e,i=>this.logService.error(i)),t=t||this.keys.indexOf(r)===-1,t&&this.keys.push(r),xn.test(r)){let i=this.contents[r],o=qa(r),s={identifiers:o,keys:Object.keys(i),contents:vf(i,l=>this.logService.error(l))},a=this.overrides.findIndex(l=>Ao(l.identifiers,o));a!==-1?this.overrides[a]=s:this.overrides.push(s)}}},ug=class{constructor(r,e){this._name=r;this.logService=e;this._raw=null;this._configurationModel=null;this._restrictedConfigurations=[];this._parseErrors=[]}get configurationModel(){return this._configurationModel||Tt.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(r,e){if(!Vt(r)){let t=this.doParseContent(r);this.parseRaw(t,e)}}reparse(r){this._raw&&this.parseRaw(this._raw,r)}parseRaw(r,e){this._raw=r;let{contents:t,keys:i,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(r,e);this._configurationModel=new Tt(t,i,o,a?[r]:void 0,this.logService),this._restrictedConfigurations=s||[]}doParseContent(r){let e={},t=null,i=[],o=[],s=[];function a(c){Array.isArray(i)?i.push(c):t!==null&&(i[t]=c)}let l={onObjectBegin:()=>{let c={};a(c),o.push(i),i=c,t=null},onObjectProperty:c=>{t=c},onObjectEnd:()=>{i=o.pop()},onArrayBegin:()=>{let c=[];a(c),o.push(i),i=c,t=null},onArrayEnd:()=>{i=o.pop()},onLiteralValue:a,onError:(c,d,u)=>{s.push({error:c,offset:d,length:u})}};if(r)try{El(r,l),e=i[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return e}doParseRaw(r,e){let t=Pt.as(lr.Configuration),i=t.getConfigurationProperties(),o=t.getExcludedConfigurationProperties(),s=this.filter(r,i,o,!0,e);r=s.raw;let a=vf(r,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`)),l=Object.keys(r),c=this.toOverrides(r,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`));return{contents:a,keys:l,overrides:c,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(r,e,t,i,o){let s=!1;if(!o?.scopes&&!o?.skipRestricted&&!o?.skipUnregistered&&!o?.exclude?.length)return{raw:r,restricted:[],hasExcludedProperties:s};let a={},l=[];for(let c in r)if(xn.test(c)&&i){let d=this.filter(r[c],e,t,!1,o);a[c]=d.raw,s=s||d.hasExcludedProperties,l.push(...d.restricted)}else{let d=e[c];d?.restricted&&l.push(c),this.shouldInclude(c,d,t,o)?a[c]=r[c]:s=!0}return{raw:a,restricted:l,hasExcludedProperties:s}}shouldInclude(r,e,t,i){if(i.exclude?.includes(r))return!1;if(i.include?.includes(r))return!0;if(i.skipRestricted&&e?.restricted||i.skipUnregistered&&!e)return!1;let o=e??t[r],s=o?typeof o.scope<"u"?o.scope:4:void 0;return s===void 0||i.scopes===void 0?!0:i.scopes.includes(s)}toOverrides(r,e){let t=[];for(let i of Object.keys(r))if(xn.test(i)){let o={},s=r[i];for(let a in s)o[a]=s[a];t.push({identifiers:qa(i),keys:Object.keys(o),contents:vf(o,e)})}return t}},pg=class extends T{constructor(e,t,i,o,s){super();this.userSettingsResource=e;this.parseOptions=t;this.fileService=o;this.logService=s;this._onDidChange=this._register(new b);this.onDidChange=this._onDidChange.event;this.parser=new ug(this.userSettingsResource.toString(),s),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(S.any(S.filter(this.fileService.onDidFilesChange,a=>a.contains(this.userSettingsResource)),S.filter(this.fileService.onDidRunOperation,a=>(a.isOperation(0)||a.isOperation(3)||a.isOperation(1)||a.isOperation(4))&&i.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 Tt.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}},ub=class{constructor(r,e,t,i,o,s,a,l,c,d,u,f,m){this.key=r;this.overrides=e;this._value=t;this.overrideIdentifiers=i;this.defaultConfiguration=o;this.policyConfiguration=s;this.applicationConfiguration=a;this.userConfiguration=l;this.localUserConfiguration=c;this.remoteUserConfiguration=d;this.workspaceConfiguration=u;this.folderConfigurationModel=f;this.memoryConfigurationModel=m}get value(){return mp(this._value)}toInspectValue(r){return r?.value!==void 0||r?.override!==void 0||r?.overrides!==void 0?r: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)}},Wc=class n{constructor(r,e,t,i,o,s,a,l,c,d){this._defaultConfiguration=r;this._policyConfiguration=e;this._applicationConfiguration=t;this._localUserConfiguration=i;this._remoteUserConfiguration=o;this._workspaceConfiguration=s;this._folderConfigurations=a;this._memoryConfiguration=l;this._memoryConfigurationByResource=c;this.logService=d;this._workspaceConsolidatedConfiguration=null;this._foldersConsolidatedConfigurations=new mt;this._userConfiguration=null}getValue(r,e,t){return this.getConsolidatedConfigurationModel(r,e,t).getValue(r)}updateValue(r,e,t={}){let i;t.resource?(i=this._memoryConfigurationByResource.get(t.resource),i||(i=Tt.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(t.resource,i))):i=this._memoryConfiguration,e===void 0?i.removeValue(r):i.setValue(r,e),t.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(r,e,t){let i=this.getConsolidatedConfigurationModel(r,e,t),o=this.getFolderConfigurationModelForResource(e.resource,t),s=e.resource?this._memoryConfigurationByResource.get(e.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(let l of i.overrides)for(let c of l.identifiers)i.getOverrideValue(r,c)!==void 0&&a.add(c);return new ub(r,e,i.getValue(r),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,t?this._workspaceConfiguration:void 0,o||void 0,s)}keys(r){let e=this.getFolderConfigurationModelForResource(void 0,r);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(r){this._defaultConfiguration=r,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(r){this._policyConfiguration=r}updateApplicationConfiguration(r){this._applicationConfiguration=r,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(r){this._localUserConfiguration=r,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(r){this._remoteUserConfiguration=r,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(r){this._workspaceConfiguration=r,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(r,e){this._folderConfigurations.set(r,e),this._foldersConsolidatedConfigurations.delete(r)}deleteFolderConfiguration(r){this.folderConfigurations.delete(r),this._foldersConsolidatedConfigurations.delete(r)}compareAndUpdateDefaultConfiguration(r,e){let t=[];if(!e){let{added:i,updated:o,removed:s}=Ss(this._defaultConfiguration,r);e=[...i,...o,...s]}for(let i of e)for(let o of qa(i)){let s=this._defaultConfiguration.getKeysForOverrideIdentifier(o),a=r.getKeysForOverrideIdentifier(o),l=[...a.filter(c=>s.indexOf(c)===-1),...s.filter(c=>a.indexOf(c)===-1),...s.filter(c=>!ci(this._defaultConfiguration.override(o).getValue(c),r.override(o).getValue(c)))];t.push([o,l])}return this.updateDefaultConfiguration(r),{keys:e,overrides:t}}compareAndUpdatePolicyConfiguration(r){let{added:e,updated:t,removed:i}=Ss(this._policyConfiguration,r),o=[...e,...t,...i];return o.length&&this.updatePolicyConfiguration(r),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(r){let{added:e,updated:t,removed:i,overrides:o}=Ss(this.applicationConfiguration,r),s=[...e,...t,...i];return s.length&&this.updateApplicationConfiguration(r),{keys:s,overrides:o}}compareAndUpdateLocalUserConfiguration(r){let{added:e,updated:t,removed:i,overrides:o}=Ss(this.localUserConfiguration,r),s=[...e,...t,...i];return s.length&&this.updateLocalUserConfiguration(r),{keys:s,overrides:o}}compareAndUpdateRemoteUserConfiguration(r){let{added:e,updated:t,removed:i,overrides:o}=Ss(this.remoteUserConfiguration,r),s=[...e,...t,...i];return s.length&&this.updateRemoteUserConfiguration(r),{keys:s,overrides:o}}compareAndUpdateWorkspaceConfiguration(r){let{added:e,updated:t,removed:i,overrides:o}=Ss(this.workspaceConfiguration,r),s=[...e,...t,...i];return s.length&&this.updateWorkspaceConfiguration(r),{keys:s,overrides:o}}compareAndUpdateFolderConfiguration(r,e){let t=this.folderConfigurations.get(r),{added:i,updated:o,removed:s,overrides:a}=Ss(t,e),l=[...i,...o,...s];return(l.length||!t)&&this.updateFolderConfiguration(r,e),{keys:l,overrides:a}}compareAndDeleteFolderConfiguration(r){let e=this.folderConfigurations.get(r);if(!e)throw new Error("Unknown folder");this.deleteFolderConfiguration(r);let{added:t,updated:i,removed:o,overrides:s}=Ss(e,void 0);return{keys:[...t,...i,...o],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 r=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Tt(r.contents,r.keys,r.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(r,e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);if(e.overrideIdentifier&&(i=i.override(e.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(r)!==void 0){i=i.merge();for(let o of this._policyConfiguration.keys)i.setValue(o,this._policyConfiguration.getValue(o))}return i}getConsolidatedConfigurationModelForResource({resource:r},e){let t=this.getWorkspaceConsolidatedConfiguration();if(e&&r){let i=e.getFolder(r);i&&(t=this.getFolderConsolidatedConfiguration(i.uri)||t);let o=this._memoryConfigurationByResource.get(r);o&&(t=t.merge(o))}return t}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(r){let e=this._foldersConsolidatedConfigurations.get(r);if(!e){let t=this.getWorkspaceConsolidatedConfiguration(),i=this._folderConfigurations.get(r);i?(e=t.merge(i),this._foldersConsolidatedConfigurations.set(r,e)):e=t}return e}getFolderConfigurationModelForResource(r,e){if(e&&r){let t=e.getFolder(r);if(t)return this._folderConfigurations.get(t.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((r,e)=>{let{contents:t,overrides:i,keys:o}=this._folderConfigurations.get(e);return r.push([e,{contents:t,overrides:i,keys:o}]),r},[])}}allKeys(){let r=new Set;return this._defaultConfiguration.keys.forEach(e=>r.add(e)),this.userConfiguration.keys.forEach(e=>r.add(e)),this._workspaceConfiguration.keys.forEach(e=>r.add(e)),this._folderConfigurations.forEach(e=>e.keys.forEach(t=>r.add(t))),[...r.values()]}allOverrideIdentifiers(){let r=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(e=>r.add(e)),this.userConfiguration.getAllOverrideIdentifiers().forEach(e=>r.add(e)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(e=>r.add(e)),this._folderConfigurations.forEach(e=>e.getAllOverrideIdentifiers().forEach(t=>r.add(t))),[...r.values()]}getAllKeysForOverrideIdentifier(r){let e=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(r).forEach(t=>e.add(t)),this.userConfiguration.getKeysForOverrideIdentifier(r).forEach(t=>e.add(t)),this._workspaceConfiguration.getKeysForOverrideIdentifier(r).forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getKeysForOverrideIdentifier(r).forEach(i=>e.add(i))),[...e.values()]}static parse(r,e){let t=this.parseConfigurationModel(r.defaults,e),i=this.parseConfigurationModel(r.policy,e),o=this.parseConfigurationModel(r.application,e),s=this.parseConfigurationModel(r.userLocal,e),a=this.parseConfigurationModel(r.userRemote,e),l=this.parseConfigurationModel(r.workspace,e),c=r.folders.reduce((d,u)=>(d.set(x.revive(u[0]),this.parseConfigurationModel(u[1],e)),d),new mt);return new n(t,i,o,s,a,l,c,Tt.createEmptyModel(e),new mt,e)}static parseConfigurationModel(r,e){return new Tt(r.contents,r.keys,r.overrides,r.raw,e)}},fg=class{constructor(r,e,t,i,o){this.change=r;this.previous=e;this.currentConfiguraiton=t;this.currentWorkspace=i;this.logService=o;this._marker=`
`;this._markerCode1=this._marker.charCodeAt(0);this._markerCode2=46;this.affectedKeys=new Set;this._previousConfiguration=void 0;for(let s of r.keys)this.affectedKeys.add(s);for(let[,s]of r.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=Wc.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(r,e){let t=this._marker+r,i=this._affectsConfigStr.indexOf(t);if(i<0)return!1;let o=i+t.length;if(o>=this._affectsConfigStr.length)return!1;let s=this._affectsConfigStr.charCodeAt(o);if(s!==this._markerCode1&&s!==this._markerCode2)return!1;if(e){let a=this.previousConfiguration?this.previousConfiguration.getValue(r,e,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(r,e,this.currentWorkspace);return!ci(a,l)}return!0}}});var mg,hg,Uc,K_=I(()=>{Jt();q();$();di();Oe();pb();no();te();cn();Xi();He();rn();mg=class extends T{constructor(e){super();this.logService=e;this._onDidChangeConfiguration=this._register(new b);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this._configurationModel=Tt.createEmptyModel(e)}get configurationModel(){return this._configurationModel}async initialize(){return this.resetConfigurationModel(),this._register(Pt.as(lr.Configuration).onDidUpdateConfiguration(({properties:e,defaultsOverrides:t})=>this.onDidUpdateConfiguration(Array.from(e),t))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(e,t){this.updateConfigurationModel(e,Pt.as(lr.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Tt.createEmptyModel(this.logService);let e=Pt.as(lr.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){let i=this.getConfigurationDefaultOverrides();for(let o of e){let s=i[o],a=t[o];s!==void 0?this._configurationModel.setValue(o,s):a?this._configurationModel.setValue(o,or(a.default)):this._configurationModel.removeValue(o)}}},hg=class{constructor(){this.onDidChangeConfiguration=S.None;this.configurationModel=Tt.createEmptyModel(new jf)}async initialize(){return this.configurationModel}},Uc=class extends T{constructor(e,t,i){super();this.defaultConfiguration=e;this.policyService=t;this.logService=i;this._onDidChangeConfiguration=this._register(new b);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this._configurationModel=Tt.createEmptyModel(this.logService),this.configurationRegistry=Pt.as(lr.Configuration)}get configurationModel(){return this._configurationModel}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!1),this.update(await this.updatePolicyDefinitions(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}async updatePolicyDefinitions(e){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",e);let t={},i=[],o=this.configurationRegistry.getConfigurationProperties(),s=this.configurationRegistry.getExcludedConfigurationProperties();for(let a of e){let l=o[a]??s[a];if(!l){i.push(a);continue}if(l.policy){if(l.type!=="string"&&l.type!=="number"&&l.type!=="array"&&l.type!=="object"&&l.type!=="boolean"){this.logService.warn(`Policy ${l.policy.name} has unsupported type ${l.type}`);continue}let{value:c,restrictedValue:d}=l.policy;i.push(a),t[l.policy.name]={type:l.type==="number"?"number":l.type==="boolean"?"boolean":"string",value:c,restrictedValue:d}}}return Jp(t)||await this.policyService.updatePolicyDefinitions(t),i}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);let t=this.configurationRegistry.getPolicyConfigurations(),i=at(e.map(o=>t.get(o)));this.update(i,!0)}update(e,t){this.logService.trace("PolicyConfiguration#update",e);let i=this.configurationRegistry.getConfigurationProperties(),o=this.configurationRegistry.getExcludedConfigurationProperties(),s=[],a=this._configurationModel.isEmpty();for(let l of e){let c=i[l]??o[l],d=c?.policy?.name;if(d){let u=this.policyService.getPolicyValue(d);if(Fe(u)&&c.type!=="string")try{u=this.parse(u)}catch(f){this.logService.error(`Error parsing policy value ${d}:`,mr(f));continue}(a?u!==void 0:!ci(this._configurationModel.getValue(l),u))&&s.push([l,u])}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=Tt.createEmptyModel(this.logService);for(let c of l.keys)this._configurationModel.setValue(c,l.getValue(c));for(let[c,d]of s)d===void 0?this._configurationModel.removeValue(c):this._configurationModel.setValue(c,d);t&&this._onDidChangeConfiguration.fire(this._configurationModel)}}parse(e){let t={},i=null,o=[],s=[],a=[];function l(d){if(Array.isArray(o))o.push(d);else if(i!==null){if(o[i]!==void 0)throw new Error(`Duplicate property found: ${i}`);o[i]=d}}if(e&&(El(e,{onObjectBegin:()=>{let d={};l(d),s.push(o),o=d,i=null},onObjectProperty:d=>{i=d},onObjectEnd:()=>{o=s.pop()},onArrayBegin:()=>{let d=[];l(d),s.push(o),o=d,i=null},onArrayEnd:()=>{o=s.pop()},onLiteralValue:l,onError:(d,u,f)=>{a.push({error:d,offset:u,length:f})}}),t=o[0]||t),a.length>0)throw new Error(a.map(d=>mr(d.error)).join(`
`));return t}};Uc=E([g(1,Ui),g(2,B)],Uc)});var gg,fb,z_=I(()=>{Jt();he();ot();q();rn();Xy();$();Cr();di();X();gt();et();pb();no();K_();je();cn();gg=class extends T{constructor(e,t,i,o){super();this.settingsResource=e;this.logService=o;this._onDidChangeConfiguration=this._register(new b);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this.defaultConfiguration=this._register(new mg(o)),this.policyConfiguration=i instanceof Ql?new hg:this._register(new Uc(this.defaultConfiguration,i,o)),this.userConfiguration=this._register(new pg(this.settingsResource,{},Je,t,o)),this.configuration=new Wc(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,Tt.createEmptyModel(o),Tt.createEmptyModel(o),Tt.createEmptyModel(o),Tt.createEmptyModel(o),new mt,Tt.createEmptyModel(o),new mt,o),this.configurationEditing=new fb(e,t,this),this.reloadConfigurationScheduler=this._register(new gr(()=>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,t,i]=await Promise.all([this.defaultConfiguration.initialize(),this.policyConfiguration.initialize(),this.userConfiguration.loadConfiguration()]);this.configuration=new Wc(e,t,Tt.createEmptyModel(this.logService),i,Tt.createEmptyModel(this.logService),Tt.createEmptyModel(this.logService),new mt,Tt.createEmptyModel(this.logService),new mt,this.logService)}getConfigurationData(){return this.configuration.toData()}getValue(e,t){let i=typeof e=="string"?e:void 0,o=gf(e)?e:gf(t)?t:{};return this.configuration.getValue(i,o,void 0)}async updateValue(e,t,i,o,s){let a=N1(i)?i:gf(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,l=a?o:i;if(l!==void 0&&l!==3&&l!==2)throw new Error(`Unable to write ${e} to target ${l}.`);a?.overrideIdentifiers&&(a.overrideIdentifiers=Mr(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(ci(t,c.defaultValue)&&(t=void 0),a?.overrideIdentifiers?.length&&a.overrideIdentifiers.length>1){let u=a.overrideIdentifiers.sort(),f=this.configuration.localUserConfiguration.overrides.find(m=>Ao([...m.identifiers].sort(),u));f&&(a.overrideIdentifiers=f.identifiers)}let d=a?.overrideIdentifiers?.length?[J1(a.overrideIdentifiers),e]:[e];await this.configurationEditing.write(d,t),await this.reloadConfiguration()}inspect(e,t={}){return this.configuration.inspect(e,t,void 0)}keys(){return this.configuration.keys(void 0)}async reloadConfiguration(){let e=await this.userConfiguration.loadConfiguration();this.onDidChangeUserConfiguration(e)}onDidChangeUserConfiguration(e){let t=this.configuration.toData(),i=this.configuration.compareAndUpdateLocalUserConfiguration(e);this.trigger(i,t,2)}onDidDefaultConfigurationChange(e,t){let i=this.configuration.toData(),o=this.configuration.compareAndUpdateDefaultConfiguration(e,t);this.trigger(o,i,7)}onDidPolicyConfigurationChange(e){let t=this.configuration.toData(),i=this.configuration.compareAndUpdatePolicyConfiguration(e);this.trigger(i,t,7)}trigger(e,t,i){let o=new fg(e,{data:t},this.configuration,void 0,this.logService);o.source=i,this._onDidChangeConfiguration.fire(o)}},fb=class{constructor(r,e,t){this.settingsResource=r;this.fileService=e;this.configurationService=t;this.queue=new Di}write(r,e){return this.queue.queue(()=>this.doWriteConfiguration(r,e))}async doWriteConfiguration(r,e){let t;try{t=(await this.fileService.readFile(this.settingsResource)).value.toString()}catch(s){if(s.fileOperationResult===1)t="{}";else throw s}let i=[];if(Oi(t,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.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 o=this.getEdits(t,r,e);t=Qy(t,o),await this.fileService.writeFile(this.settingsResource,H.fromString(t))}getEdits(r,e,t){let{tabSize:i,insertSpaces:o,eol:s}=this.formattingOptions;if(!e.length){let a=JSON.stringify(t,null,o?" ".repeat(i):"	");return[{content:a,length:a.length,offset:0}]}return Jy(r,e,t,{tabSize:i,insertSpaces:o,eol:s})}get formattingOptions(){if(!this._formattingOptions){let r=Ut===3||Ut===2?`
`:`\r
`,e=this.configurationService.getValue("files.eol",{overrideIdentifier:"jsonc"});e&&typeof e=="string"&&e!=="auto"&&(r=e),this._formattingOptions={eol:r,insertSpaces:!!this.configurationService.getValue("editor.insertSpaces",{overrideIdentifier:"jsonc"}),tabSize:this.configurationService.getValue("editor.tabSize",{overrideIdentifier:"jsonc"})}}return this._formattingOptions}}});import*as G_ from"fs";import*as zt from"os";async function mb(n,r){let e=`${n}::${r.join(":")}`,t=j_.get(e);if(t)return t;let i=[{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}],o=new Map,s=new Map,a=2e4;function l(d,u,f,m){let v=u.substring(d.length+1);return vt.withAsyncBody(async y=>{let C;m.readdirCount++;try{C=await Q.readdir(u,{withFileTypes:!0})}catch{y();return}if(m.count>=a){m.count+=C.length,m.maxReached=!0,y();return}let w=C.length;if(w===0){y();return}let _=C;m.count+C.length>a&&(m.maxReached=!0,w=a-m.count,_=C.slice(0,w)),m.count+=C.length;for(let D of _)if(D.isDirectory()){if(f.includes(D.name)||await l(d,N(u,D.name),f,m),--w===0){y();return}}else{let k=D.name.lastIndexOf(".");if(k>=0){let A=D.name.substring(k+1);A&&o.set(A,(o.get(A)??0)+1)}for(let A of i)A.relativePathPattern?.test(v)!==!1&&A.filePattern.test(D.name)&&s.set(A.tag,(s.get(A.tag)??0)+1);if(--w===0){y();return}}})}let c=vt.withAsyncBody(async d=>{let u={count:0,maxReached:!1,readdirCount:0},f=new ii(!0);await l(n,n,r,u);let m=await QO(n);d({configFiles:hb(s),fileTypes:hb(o),fileCount:u.count,maxFilesReached:u.maxReached,launchConfigFiles:m,totalScanTime:f.elapsed(),totalReaddirCount:u.readdirCount})});return j_.set(e,c),c}function hb(n){return Array.from(n.entries(),([r,e])=>({name:r,count:e})).sort((r,e)=>e.count-r.count)}function JO(){let n={os:`${zt.type()} ${zt.arch()} ${zt.release()}`,memory:`${(zt.totalmem()/_n.GB).toFixed(2)}GB (${(zt.freemem()/_n.GB).toFixed(2)}GB free)`,vmHint:`${Math.round(Mu.value()*100)}%`},r=zt.cpus();return r&&r.length>0&&(n.cpus=`${r[0].model} (${r.length} x ${r[0].speed})`),n}async function QO(n){try{let r=new Map,e=N(n,".vscode","launch.json"),t=await G_.promises.readFile(e),i=[],o=Oi(t.toString(),i);if(i.length)return console.log(`Unable to parse ${e}`),[];if(rs(o)==="object"&&o.configurations)for(let s of o.configurations){let a=s.type;a&&(r.has(a)?r.set(a,r.get(a)+1):r.set(a,1))}return hb(r)}catch{return[]}}var j_,Nc,J_=I(()=>{he();rn();ze();we();X();_s();ce();Ou();nr();YI();Em();je();qt();Zt();j_=new Map;Nc=class{constructor(r,e){this.telemetryService=r;this.productService=e}formatMachineInfo(r){let e=[];return e.push(`OS Version:       ${r.os}`),e.push(`CPUs:             ${r.cpus}`),e.push(`Memory (System):  ${r.memory}`),e.push(`VM:               ${r.vmHint}`),e.join(`
`)}formatEnvironment(r){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:       ${zt.type()} ${zt.arch()} ${zt.release()}`);let t=zt.cpus();return t&&t.length>0&&e.push(`CPUs:             ${t[0].model} (${t.length} x ${t[0].speed})`),e.push(`Memory (System):  ${(zt.totalmem()/_n.GB).toFixed(2)}GB (${(zt.freemem()/_n.GB).toFixed(2)}GB free)`),F||e.push(`Load (avg):       ${zt.loadavg().map(i=>Math.round(i)).join(", ")}`),e.push(`VM:               ${Math.round(Mu.value()*100)}%`),e.push(`Screen Reader:    ${r.screenReader?"yes":"no"}`),e.push(`Process Argv:     ${r.mainArguments.join(" ")}`),e.push(`GPU Status:       ${this.expandGPUFeatures(r.gpuFeatureStatus)}`),r.gpuLogMessages&&r.gpuLogMessages.length>0&&(e.push("GPU Log Messages:"),r.gpuLogMessages.forEach(i=>{e.push(`${i.header}: ${i.message}`)})),e.join(`
`)}async getPerformanceInfo(r,e){return Promise.all([Qu(r.mainPID),this.formatWorkspaceMetadata(r)]).then(async t=>{let[i,o]=t,s=this.formatProcessList(r,i);return e.forEach(a=>{if(Eu(a))s+=`
${a.errorMessage}`,o+=`
${a.errorMessage}`;else if(s+=`

Remote: ${a.hostName}`,a.processes&&(s+=`
${this.formatProcessList(r,a.processes)}`),a.workspaceMetadata){o+=`
|  Remote: ${a.hostName}`;for(let l of Object.keys(a.workspaceMetadata)){let c=a.workspaceMetadata[l],d=`${c.fileCount} files`;c.maxFilesReached&&(d=`more than ${d}`),o+=`|    Folder (${l}): ${d}`,o+=this.formatWorkspaceStats(c)}}}),{processInfo:s,workspaceInfo:o}})}async getSystemInfo(r,e){let{memory:t,vmHint:i,os:o,cpus:s}=JO(),a={os:o,memory:t,cpus:s,vmHint:i,processArgs:`${r.mainArguments.join(" ")}`,gpuStatus:r.gpuFeatureStatus,screenReader:`${r.screenReader?"yes":"no"}`,remoteData:e};return F||(a.load=`${zt.loadavg().map(l=>Math.round(l)).join(", ")}`),re&&(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(r,e){let t=[];return Qu(r.mainPID).then(async i=>(t.push(""),t.push(this.formatEnvironment(r)),t.push(""),t.push(this.formatProcessList(r,i)),r.windows.some(o=>o.folderURIs&&o.folderURIs.length>0&&!o.remoteAuthority)&&(t.push(""),t.push("Workspace Stats: "),t.push(await this.formatWorkspaceMetadata(r))),e.forEach(o=>{if(Eu(o))t.push(`
${o.errorMessage}`);else if(t.push(`

`),t.push(`Remote:           ${o.hostName}`),t.push(this.formatMachineInfo(o.machineInfo)),o.processes&&t.push(this.formatProcessList(r,o.processes)),o.workspaceMetadata)for(let s of Object.keys(o.workspaceMetadata)){let a=o.workspaceMetadata[s],l=`${a.fileCount} files`;a.maxFilesReached&&(l=`more than ${l}`),t.push(`Folder (${s}): ${l}`),t.push(this.formatWorkspaceStats(a))}}),t.push(""),t.push(""),t.join(`
`)))}formatWorkspaceStats(r){let e=[],i=0,o=(c,d)=>{let u=` ${c}(${d})`;i+u.length>60?(e.push(s),s="|                 ",i=s.length):i+=u.length,s+=u},s="|      File types:",a=10,l=r.fileTypes.length>a?a:r.fileTypes.length;for(let c=0;c<l;c++){let d=r.fileTypes[c];o(d.name,d.count)}if(e.push(s),r.configFiles.length>=0&&(s="|      Conf files:",i=0,r.configFiles.forEach(c=>{o(c.name,c.count)}),e.push(s)),r.launchConfigFiles.length>0){let c="|      Launch Configs:";r.launchConfigFiles.forEach(d=>{let u=d.count>1?` ${d.name}(${d.count})`:` ${d.name}`;c+=u}),e.push(c)}return e.join(`
`)}expandGPUFeatures(r){let e=Math.max(...Object.keys(r).map(t=>t.length));return Object.keys(r).map(t=>`${t}:  ${" ".repeat(e-t.length)}  ${r[t]}`).join(`
                  `)}formatWorkspaceMetadata(r){let e=[],t=[];return r.windows.forEach(i=>{i.folderURIs.length===0||i.remoteAuthority||(e.push(`|  Window (${i.title})`),i.folderURIs.forEach(o=>{let s=x.revive(o);if(s.scheme===W.file){let a=s.fsPath;t.push(mb(a,["node_modules",".git"]).then(l=>{let c=`${l.fileCount} files`;l.maxFilesReached&&(c=`more than ${c}`),e.push(`|    Folder (${Pe(a)}): ${c}`),e.push(this.formatWorkspaceStats(l))}).catch(l=>{e.push(`|      Error: Unable to collect workspace stats for folder ${a} (${l.toString()})`)}))}else e.push(`|    Folder (${s.toString()}): Workspace stats not available.`)}))}),Promise.all(t).then(i=>e.join(`
`)).catch(i=>`Unable to collect workspace stats: ${i}`)}formatProcessList(r,e){let t=new Map;r.windows.forEach(o=>t.set(o.pid,`window [${o.id}] (${o.title})`)),r.pidToNames.forEach(({pid:o,name:s})=>t.set(o,s));let i=[];return i.push("CPU %	Mem MB	   PID	Process"),e&&this.formatProcessItem(r.mainPID,t,i,e,0),i.join(`
`)}formatProcessItem(r,e,t,i,o){let s=o===0,a;s?a=i.pid===r?this.productService.applicationName:"remote-server":e.has(i.pid)?a=e.get(i.pid):a=`${"  ".repeat(o)} ${i.name}`;let l=process.platform==="win32"?i.mem:zt.totalmem()*(i.mem/100);t.push(`${i.load.toFixed(0).padStart(5," ")}	${(l/_n.MB).toFixed(0).padStart(6," ")}	${i.pid.toFixed(0).padStart(6," ")}	${a}`),Array.isArray(i.children)&&i.children.forEach(c=>this.formatProcessItem(r,e,t,c,o+1))}async getWorkspaceFileExtensions(r){let e=new Set;for(let{uri:t}of r.folders){let i=x.revive(t);if(i.scheme!==W.file)continue;let o=i.fsPath;try{(await mb(o,["node_modules",".git"])).fileTypes.forEach(a=>e.add(a.name))}catch{}}return{extensions:[...e]}}async reportWorkspaceStats(r){for(let{uri:e}of r.folders){let t=x.revive(e);if(t.scheme!==W.file)continue;let i=t.fsPath;try{let o=await mb(i,["node_modules",".git"]);this.telemetryService.publicLog2("workspace.stats",{"workspace.id":r.telemetryId,rendererSessionId:r.rendererSessionId}),o.fileTypes.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.file",{rendererSessionId:r.rendererSessionId,type:s.name,count:s.count})}),o.launchConfigFiles.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.launchConfigFile",{rendererSessionId:r.rendererSessionId,type:s.name,count:s.count})}),o.configFiles.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.configFiles",{rendererSessionId:r.rendererSessionId,type:s.name,count:s.count})}),this.telemetryService.publicLog2("workspace.stats.metadata",{duration:o.totalScanTime,reachedLimit:o.maxFilesReached,fileCount:o.fileCount,readdirCount:o.totalReaddirCount})}catch{}}}};Nc=E([g(0,Ke),g(1,Te)],Nc)});import{writeFileSync as XO}from"fs";import{tmpdir as YO}from"os";function Q_(n){let r=Ds(YO());try{return XO(r,""),n&&console.log(`Marker file for --wait created: ${r}`),r}catch(e){n&&console.error(`Failed to create marker file for --wait: ${e}`);return}}var X_=I(()=>{ni()});var xs,Y_=I(()=>{Jt();he();ot();wt();q();En();ad();$();qs();ze();hn();gt();Os();xe();je();JI();te();He();xs=class extends T{constructor(e){super();this.logService=e;this.BUFFER_SIZE=256*1024;this._onDidChangeFileSystemProviderRegistrations=this._register(new b);this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event;this._onWillActivateFileSystemProvider=this._register(new b);this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event;this._onDidChangeFileSystemProviderCapabilities=this._register(new b);this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event;this.provider=new Map;this._onDidRunOperation=this._register(new b);this.onDidRunOperation=this._onDidRunOperation.event;this.internalOnDidFilesChange=this._register(new b);this._onDidUncorrelatedFilesChange=this._register(new b);this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event;this._onDidWatchError=this._register(new b);this.onDidWatchError=this._onDidWatchError.event;this.activeWatchers=new Map;this.writeQueue=this._register(new Ba)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);Ve(`code/registerFilesystem/${e}`);let i=new j;return this.provider.set(e,t),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:t}),i.add(t.onDidChangeFile(o=>{let s=new Qf(o,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(s),s.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(s)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(o=>this._onDidWatchError.fire(new Error(o)))),i.add(t.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:t,scheme:e}))),G(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:t}),this.provider.delete(e),ut(i)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){let t=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(i){t.push(i)}}),!this.provider.has(e)&&await vt.settled(t)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,t){let i=this.provider.get(e.scheme);return!!(i&&i.capabilities&t)}listCapabilities(){return In.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!h1(e))throw new Yt(h(2238,null,this.resourceForError(e)),8);await this.activateProvider(e.scheme);let t=this.provider.get(e.scheme);if(!t){let i=new ri;throw i.message=h(2240,null,e.toString()),i}return t}async withReadProvider(e){let t=await this.withProvider(e);if(po(t)||Si(t)||Yf(t))return t;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 t=await this.withProvider(e);if(po(t)||Si(t))return t;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,t){try{return await this.doResolveFile(e,t)}catch(i){throw au(i)==="EntryNotFound"?new Yt(h(2235,null,this.resourceForError(e)),1):fo(i)}}async doResolveFile(e,t){let i=await this.withProvider(e),o=this.isPathCaseSensitive(i),s=t?.resolveTo,a=t?.resolveSingleChildDescendants,l=t?.resolveMetadata,c=await i.stat(e),d;return this.toFileStat(i,e,c,void 0,!!l,(u,f)=>(d||(d=Kr.forUris(()=>!o),d.set(e,!0),s&&d.fill(!0,s)),d.get(u.resource)||d.findSuperstr(u.resource.with({query:null,fragment:null}))?!0:u.isDirectory&&a?f===1:!1))}async toFileStat(e,t,i,o,s,a){let{providerExtUri:l}=this.getExtUri(e),c={resource:t,name:l.basename(t),isFile:(i.type&1)!==0,isDirectory:(i.type&2)!==0,isSymbolicLink:(i.type&64)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&1)||!!(e.capabilities&2048),locked:!!((i.permissions??0)&2),executable:!!((i.permissions??0)&4),etag:hy({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&a(c,o)){try{let d=await e.readdir(t),u=await vt.settled(d.map(async([f,m])=>{try{let v=l.joinPath(t,f),y=s?await e.stat(v):{type:m};return await this.toFileStat(e,v,y,d.length,s,a)}catch(v){return this.logService.trace(v),null}}));c.children=at(u)}catch(d){this.logService.trace(d),c.children=[]}return c}return c}async resolveAll(e){return vt.settled(e.map(async t=>{try{return{stat:await this.doResolveFile(t.resource,t.options),success:!0}}catch(i){return this.logService.trace(i),{stat:void 0,success:!1}}}))}async stat(e){let t=await this.withProvider(e),i=await t.stat(e);return this.toFileStat(t,e,i,void 0,!0,()=>!1)}async realpath(e){let t=await this.withProvider(e);if(nP(t)){let i=await t.realpath(e);return e.with({path:i})}}async exists(e){let t=await this.withProvider(e);try{return!!await t.stat(e)}catch{return!1}}async canCreateFile(e,t){try{await this.doValidateCreateFile(e,t)}catch(i){return i}return!0}async doValidateCreateFile(e,t){if(!t?.overwrite&&await this.exists(e))throw new Yt(h(2231,null,this.resourceForError(e)),3,t)}async createFile(e,t=H.fromString(""),i){await this.doValidateCreateFile(e,i);let o=await this.writeFile(e,t);return this._onDidRunOperation.fire(new uo(e,0,o)),o}async writeFile(e,t,i){let o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:s}=this.getExtUri(o),a=i;if(my(o)&&!a?.atomic){let l=o.enforceAtomicWriteFile?.(e);l&&(a={...i,atomic:l})}try{let{stat:l,buffer:c}=await this.validateWriteFile(o,e,t,a);l||await this.mkdirp(o,s.dirname(e)),c||(c=await this.peekBufferForWriting(o,t)),!po(o)||Si(o)&&c instanceof H||Si(o)&&my(o)&&a?.atomic?await this.doWriteUnbuffered(o,e,a,c):await this.doWriteBuffered(o,e,a,c instanceof H?cx(c):c),this._onDidRunOperation.fire(new uo(e,4))}catch(l){throw new Yt(h(2230,null,this.resourceForError(e),fo(l).toString()),jr(l),a)}return this.resolve(e,{resolveMetadata:!0})}async peekBufferForWriting(e,t){let i;if(Si(e)&&!(t instanceof H))if(_d(t)){let o=await ox(t,3);o.ended?i=H.concat(o.buffer):i=o}else i=nx(t,o=>H.concat(o),3);else i=t;return i}async validateWriteFile(e,t,i,o){let s=!!o?.unlock;if(s&&!(e.capabilities&8192))throw new Error(h(2248,null,this.resourceForError(t)));if(o?.append&&!iP(e))throw new Yt(h(2227,null,this.resourceForError(t)),6);if(!!o?.atomic){if(!(e.capabilities&32768))throw new Error(h(2246,null,this.resourceForError(t)));if(!(e.capabilities&2))throw new Error(h(2247,null,this.resourceForError(t)));if(s)throw new Error(h(2245,null,this.resourceForError(t)))}let l;try{l=await e.stat(t)}catch{return Object.create(null)}if((l.type&2)!==0)throw new Yt(h(2233,null,this.resourceForError(t)),0,o);this.throwIfFileIsReadonly(t,l);let c;if(typeof o?.mtime=="number"&&typeof o.etag=="string"&&o.etag!==tm&&typeof l.mtime=="number"&&typeof l.size=="number"&&o.mtime<l.mtime&&o.etag!==hy({mtime:o.mtime,size:l.size})){if(c=await this.peekBufferForWriting(e,i),c instanceof H&&c.byteLength===l.size)try{let{value:d}=await this.readFile(t,{limits:{size:l.size}});if(c.equals(d))return{stat:l,buffer:c}}catch{}throw new Yt(h(2234,null),3,o)}return{stat:l,buffer:c}}async readFile(e,t,i){let o=await this.withReadProvider(e);return t?.atomic?this.doReadFileAtomic(o,e,t,i):this.doReadFile(o,e,t,i)}async doReadFileAtomic(e,t,i,o){return new Promise((s,a)=>{this.writeQueue.queueFor(t,async()=>{try{let l=await this.doReadFile(e,t,i,o);s(l)}catch(l){a(l)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,o){let s=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},o);return{...s,value:await Fs(s.value)}}async readFileStream(e,t,i){let o=await this.withReadProvider(e);return this.doReadFileStream(o,e,t,i)}async doReadFileStream(e,t,i,o){let s=new $e(o),a=i;Zf(e)&&e.enforceAtomicReadFile?.(t)&&(a={...i,atomic:!0});let l=this.validateReadFile(t,a).then(d=>d,d=>{throw s.dispose(!0),d}),c;try{return typeof a?.etag=="string"&&a.etag!==tm&&await l,a?.atomic&&Zf(e)||!(po(e)||Yf(e))||Si(e)&&a?.preferUnbuffered?c=this.readFileUnbuffered(e,t,a):Yf(e)?c=this.readFileStreamed(e,t,s.token,a):c=this.readFileBuffered(e,t,s.token,a),c.on("end",()=>s.dispose()),c.on("error",()=>s.dispose()),{...await l,value:c}}catch(d){throw c&&await _f(c),this.restoreReadError(d,t,a)}}restoreReadError(e,t,i){let o=h(2228,null,this.resourceForError(t),fo(e).toString());return e instanceof al?new al(o,e.stat,i):e instanceof sl?new sl(o,e.fileOperationResult,e.size,e.options):new Yt(o,jr(e),i)}readFileStreamed(e,t,i,o=Object.create(null)){let s=e.readFileStream(t,o,i);return za(s,{data:a=>a instanceof H?a:H.wrap(a),error:a=>this.restoreReadError(a,t,o)},a=>H.concat(a))}readFileBuffered(e,t,i,o=Object.create(null)){let s=px();return oh(e,t,s,a=>a,{...o,bufferSize:this.BUFFER_SIZE,errorTransformer:a=>this.restoreReadError(a,t,o)},i),s}readFileUnbuffered(e,t,i){let o=Bo(s=>H.concat(s));return(async()=>{try{let s;i?.atomic&&Zf(e)?s=await e.readFile(t,{atomic:!0}):s=await e.readFile(t),typeof i?.position=="number"&&(s=s.slice(i.position)),typeof i?.length=="number"&&(s=s.slice(0,i.length)),this.validateReadFileLimits(t,s.byteLength,i),o.end(H.wrap(s))}catch(s){o.error(s),o.end()}})(),o}async validateReadFile(e,t){let i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Yt(h(2232,null,this.resourceForError(e)),0,t);if(typeof t?.etag=="string"&&t.etag!==tm&&t.etag===i.etag)throw new al(h(2236,null),i,t);return this.validateReadFileLimits(e,i.size,t),i}validateReadFileLimits(e,t,i){if(typeof i?.limits?.size=="number"&&t>i.limits.size)throw new sl(h(2237,null,this.resourceForError(e)),7,t,i)}async canMove(e,t,i){return this.doCanMoveCopy(e,t,"move",i)}async canCopy(e,t,i){return this.doCanMoveCopy(e,t,"copy",i)}async doCanMoveCopy(e,t,i,o){if(e.toString()!==t.toString())try{let s=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),a=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(s,e,a,t,i,o)}catch(s){return s}return!0}async move(e,t,i){let o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),a=await this.doMoveCopy(o,e,s,t,"move",!!i),l=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uo(e,a==="move"?2:3,l)),l}async copy(e,t,i){let o=await this.withReadProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),a=await this.doMoveCopy(o,e,s,t,"copy",!!i),l=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uo(e,a==="copy"?3:2,l)),l}async doMoveCopy(e,t,i,o,s,a){if(t.toString()===o.toString())return s;let{exists:l,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,o,s,a);if(l&&!c&&a&&await this.del(o,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(o)),s==="copy"){if(e===i&&su(e))await e.copy(t,o,{overwrite:a});else{let d=await this.resolve(t);d.isDirectory?await this.doCopyFolder(e,d,i,o):await this.doCopyFile(e,t,i,o)}return s}else return e===i?(await e.rename(t,o,{overwrite:a}),s):(await this.doMoveCopy(e,t,i,o,"copy",a),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,o){if(po(e)&&po(i))return this.doPipeBuffered(e,t,i,o);if(po(e)&&Si(i))return this.doPipeBufferedToUnbuffered(e,t,i,o);if(Si(e)&&po(i))return this.doPipeUnbufferedToBuffered(e,t,i,o);if(Si(e)&&Si(i))return this.doPipeUnbuffered(e,t,i,o)}async doCopyFolder(e,t,i,o){await i.mkdir(o),Array.isArray(t.children)&&await vt.settled(t.children.map(async s=>{let a=this.getExtUri(i).providerExtUri.joinPath(o,s.name);return s.isDirectory?this.doCopyFolder(e,await this.resolve(s.resource),i,a):this.doCopyFile(e,s.resource,i,a)}))}async doValidateMoveCopy(e,t,i,o,s,a){let l=!1;if(e===i){let{providerExtUri:d,isPathCaseSensitive:u}=this.getExtUri(e);if(u||(l=d.isEqual(t,o)),l&&s==="copy")throw new Error(h(2241,null,this.resourceForError(t),this.resourceForError(o)));if(!l&&d.isEqualOrParent(o,t))throw new Error(h(2242,null,this.resourceForError(t),this.resourceForError(o)))}let c=await this.exists(o);if(c&&!l){if(!a)throw new Yt(h(2243,null,this.resourceForError(t),this.resourceForError(o)),4);if(e===i){let{providerExtUri:d}=this.getExtUri(e);if(d.isEqualOrParent(t,o))throw new Error(h(2244,null,this.resourceForError(t),this.resourceForError(o)))}}return{exists:c,isSameResourceWithDifferentPathCase:l}}getExtUri(e){let t=this.isPathCaseSensitive(e);return{providerExtUri:t?We:Ua,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&1024)}async createFolder(e){let t=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(t,e);let i=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uo(e,0,i)),i}async mkdirp(e,t){let i=[],{providerExtUri:o}=this.getExtUri(e);for(;!o.isEqual(t,o.dirname(t));)try{if(((await e.stat(t)).type&2)===0)throw new Error(h(2239,null,this.resourceForError(t)));break}catch(s){if(au(s)!=="EntryNotFound")throw s;i.push(o.basename(t)),t=o.dirname(t)}for(let s=i.length-1;s>=0;s--){t=o.joinPath(t,i[s]);try{await e.mkdir(t)}catch(a){if(au(a)!=="EntryExists")throw a}}}async canDelete(e,t){try{await this.doValidateDelete(e,t)}catch(i){return i}return!0}async doValidateDelete(e,t){let i=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),o=!!t?.useTrash;if(o&&!(i.capabilities&4096))throw new Error(h(2226,null,this.resourceForError(e)));let s=t?.atomic;if(s&&!(i.capabilities&65536))throw new Error(h(2222,null,this.resourceForError(e)));if(o&&s)throw new Error(h(2225,null,this.resourceForError(e)));let a;try{a=await i.stat(e)}catch{}if(a)this.throwIfFileIsReadonly(e,a);else throw new Yt(h(2224,null,this.resourceForError(e)),1);if(!!!t?.recursive){let c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(h(2223,null,this.resourceForError(e)))}return i}async del(e,t){let i=await this.doValidateDelete(e,t),o=t;if(oP(i)&&!o?.atomic){let c=i.enforceAtomicDelete?.(e);c&&(o={...t,atomic:c})}let s=!!o?.useTrash,a=!!o?.recursive,l=o?.atomic??!1;await i.delete(e,{recursive:a,useTrash:s,atomic:l}),this._onDidRunOperation.fire(new uo(e,1))}async cloneFile(e,t){let i=await this.withProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===o&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===o&&Xf(i)?i.cloneFile(e,t):(await this.mkdirp(o,this.getExtUri(o).providerExtUri.dirname(t)),i===o&&su(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,o,t),this.getExtUri(i).providerExtUri))}static{this.WATCHER_CORRELATION_IDS=0}createWatcher(e,t){return this.watch(e,{...t,correlationId:xs.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){let i=new j,o=!1,s=()=>{o=!0};i.add(G(()=>s())),(async()=>{try{let l=await this.doWatch(e,t);o?ut(l):s=()=>ut(l)}catch(l){this.logService.error(l)}})();let a=t.correlationId;if(typeof a=="number"){let l=i.add(new b);return i.add(this.internalOnDidFilesChange.event(d=>{d.correlates(a)&&l.fire(d)})),{onDidChange:l.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){let i=await this.withProvider(e),o=cr([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]),s=this.activeWatchers.get(o);return s||(s={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(o,s)),s.count+=1,G(()=>{s&&(s.count--,s.count===0&&(ut(s.disposable),this.activeWatchers.delete(o)))})}dispose(){super.dispose();for(let[,e]of this.activeWatchers)ut(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,o){return this.writeQueue.queueFor(t,async()=>{let s=await e.open(t,{create:!0,unlock:i?.unlock??!1,append:i?.append??!1});try{_d(o)||Tf(o)?await this.doWriteStreamBufferedQueued(e,s,o):await this.doWriteReadableBufferedQueued(e,s,o)}catch(a){throw fo(a)}finally{await e.close(s)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let o=0,s;if(Tf(i)){if(i.buffer.length>0){let a=H.concat(i.buffer);await this.doWriteBuffer(e,t,a,a.byteLength,o,0),o+=a.byteLength}if(i.ended)return;s=i.stream}else s=i;return new Promise((a,l)=>{Ka(s,{onData:async c=>{s.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,o,0)}catch(d){return l(d)}o+=c.byteLength,setTimeout(()=>s.resume())},onError:c=>l(c),onEnd:()=>a()})})}async doWriteReadableBufferedQueued(e,t,i){let o=0,s;for(;(s=i.read())!==null;)await this.doWriteBuffer(e,t,s,s.byteLength,o,0),o+=s.byteLength}async doWriteBuffer(e,t,i,o,s,a){let l=0;for(;l<o;){let c=await e.write(t,s+l,i.buffer,a+l,o-l);l+=c}}async doWriteUnbuffered(e,t,i,o){return this.writeQueue.queueFor(t,()=>this.doWriteUnbufferedQueued(e,t,i,o),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,o){let s;o instanceof H?s=o:_d(o)?s=await Fs(o):Tf(o)?s=await dx(o):s=lx(o),await e.writeFile(t,s.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1,append:i?.append??!1})}async doPipeBuffered(e,t,i,o){return this.writeQueue.queueFor(o,()=>this.doPipeBufferedQueued(e,t,i,o),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,o){let s,a;try{s=await e.open(t,{create:!1}),a=await i.open(o,{create:!0,unlock:!1});let l=H.alloc(this.BUFFER_SIZE),c=0,d=0,u=0;do u=await e.read(s,c,l.buffer,d,l.byteLength-d),await this.doWriteBuffer(i,a,l,u,c,d),c+=u,d+=u,d===l.byteLength&&(d=0);while(u>0)}catch(l){throw fo(l)}finally{await vt.settled([typeof s=="number"?e.close(s):Promise.resolve(),typeof a=="number"?i.close(a):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,o){return this.writeQueue.queueFor(o,()=>this.doPipeUnbufferedQueued(e,t,i,o),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,o){return i.writeFile(o,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,o){return this.writeQueue.queueFor(o,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,o),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,o){let s=await i.open(o,{create:!0,unlock:!1});try{let a=await e.readFile(t);await this.doWriteBuffer(i,s,H.wrap(a),a.byteLength,0,0)}catch(a){throw fo(a)}finally{await i.close(s)}}async doPipeBufferedToUnbuffered(e,t,i,o){let s=await Fs(this.readFileBuffered(e,t,Ce.None));await this.doWriteUnbuffered(i,o,void 0,s)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&2048)throw new Yt(h(2229,null,this.resourceForError(t)),6);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&1)throw new Yt(h(2229,null,this.resourceForError(e)),6)}resourceForError(e){return e.scheme===W.file?e.fsPath:e.toString(!0)}};xs=E([g(0,B)],xs)});var gb,hp,Z_=I(()=>{gb=class{constructor(r,e){this.key=r;this.data=e;this.incoming=new Map;this.outgoing=new Map}},hp=class{constructor(r){this._hashFn=r;this._nodes=new Map}roots(){let r=[];for(let e of this._nodes.values())e.outgoing.size===0&&r.push(e);return r}insertEdge(r,e){let t=this.lookupOrInsertNode(r),i=this.lookupOrInsertNode(e);t.outgoing.set(i.key,i),i.incoming.set(t.key,t)}removeNode(r){let e=this._hashFn(r);this._nodes.delete(e);for(let t of this._nodes.values())t.outgoing.delete(e),t.incoming.delete(e)}lookupOrInsertNode(r){let e=this._hashFn(r),t=this._nodes.get(e);return t||(t=new gb(e,r),this._nodes.set(e,t)),t}lookup(r){return this._nodes.get(this._hashFn(r))}isEmpty(){return this._nodes.size===0}toString(){let r=[];for(let[e,t]of this._nodes)r.push(`${e}
	(-> incoming)[${[...t.incoming.keys()].join(", ")}]
	(outgoing ->)[${[...t.outgoing.keys()].join(",")}]
`);return r.join(`
`)}findCycleSlow(){for(let[r,e]of this._nodes){let t=new Set([r]),i=this._findCycle(e,t);if(i)return i}}_findCycle(r,e){for(let[t,i]of r.outgoing){if(e.has(t))return[...e,t].join(" -> ");e.add(t);let o=this._findCycle(i,e);if(o)return o;e.delete(t)}}}});var ZO,vg,yg,gp,ek=I(()=>{he();He();$();Ju();Z_();Z();vh();ov();ZO=!1,vg=class extends Error{constructor(r){super("cyclic dependency between services"),this.message=r.findCycleSlow()??`UNABLE to detect cycle, dumping graph: 
${r.toString()}`}},yg=class n{constructor(r=new fs,e=!1,t,i=ZO){this._services=r;this._strict=e;this._parent=t;this._enableTracing=i;this._isDisposed=!1;this._servicesToMaybeDispose=new Set;this._children=new Set;this._activeInstantiations=new Set;this._services.set(Ht,this),this._globalGraph=i?t?._globalGraph??new hp(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,ut(this._children),this._children.clear();for(let r of this._servicesToMaybeDispose)Qp(r)&&r.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(r,e){this._throwIfDisposed();let t=this,i=new class extends n{dispose(){t._children.delete(i),super.dispose()}}(r,this._strict,this,this._enableTracing);return this._children.add(i),e?.add(i),i}invokeFunction(r,...e){this._throwIfDisposed();let t=gp.traceInvocation(this._enableTracing,r),i=!1;try{return r({get:s=>{if(i)throw qp("service accessor is only valid during the invocation of its target method");let a=this._getOrCreateServiceInstance(s,t);return a||this._throwIfStrict(`[invokeFunction] unknown service '${s}'`,!1),a}},...e)}finally{i=!0,t.stop()}}createInstance(r,...e){this._throwIfDisposed();let t,i;return r instanceof ge?(t=gp.traceCreation(this._enableTracing,r.ctor),i=this._createInstance(r.ctor,r.staticArguments.concat(e),t)):(t=gp.traceCreation(this._enableTracing,r),i=this._createInstance(r,e,t)),t.stop(),i}_createInstance(r,e=[],t){let i=Qi.getServiceDependencies(r).sort((a,l)=>a.index-l.index),o=[];for(let a of i){let l=this._getOrCreateServiceInstance(a.id,t);l||this._throwIfStrict(`[createInstance] ${r.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}let s=i.length>0?i[0].index:e.length;if(e.length!==s){console.trace(`[createInstance] First service dependency of ${r.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(r,e.concat(o))}_setCreatedServiceInstance(r,e){if(this._services.get(r)instanceof ge)this._services.set(r,e);else if(this._parent)this._parent._setCreatedServiceInstance(r,e);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(r){let e=this._services.get(r);return!e&&this._parent?this._parent._getServiceInstanceOrDescriptor(r):e}_getOrCreateServiceInstance(r,e){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(r));let t=this._getServiceInstanceOrDescriptor(r);return t instanceof ge?this._safeCreateAndCacheServiceInstance(r,t,e.branch(r,!0)):(e.branch(r,!1),t)}_safeCreateAndCacheServiceInstance(r,e,t){if(this._activeInstantiations.has(r))throw new Error(`illegal state - RECURSIVELY instantiating service '${r}'`);this._activeInstantiations.add(r);try{return this._createAndCacheServiceInstance(r,e,t)}finally{this._activeInstantiations.delete(r)}}_createAndCacheServiceInstance(r,e,t){let i=new hp(l=>l.id.toString()),o=0,s=[{id:r,desc:e,_trace:t}],a=new Set;for(;s.length;){let l=s.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),i.lookupOrInsertNode(l),o++>1e3)throw new vg(i);for(let c of Qi.getServiceDependencies(l.desc.ctor)){let d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${r} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),d instanceof ge){let u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};i.insertEdge(l,u),s.push(u)}}}}for(;;){let l=i.roots();if(l.length===0){if(!i.isEmpty())throw new vg(i);break}for(let{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof ge){let u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,u)}i.removeNode(c)}}return this._getServiceInstanceOrDescriptor(r)}_createServiceInstanceWithOwner(r,e,t=[],i,o){if(this._services.get(r)instanceof ge)return this._createServiceInstance(r,e,t,i,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(r,e,t,i,o);throw new Error(`illegalState - creating UNKNOWN service instance ${e.name}`)}_createServiceInstance(r,e,t=[],i,o,s){if(i){let a=new n(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(r);let l=new Map,c=new pf(()=>{let d=a._createInstance(e,t,o);for(let[u,f]of l){let m=d[u];if(typeof m=="function")for(let v of f)v.disposable=m.apply(d,v.listener)}return l.clear(),s.add(d),d});return new Proxy(Object.create(null),{get(d,u){if(!c.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let v=l.get(u);return v||(v=new Ra,l.set(u,v)),(C,w,_)=>{if(c.isInitialized)return c.value[u](C,w,_);{let D={listener:[C,w,_],disposable:void 0},k=v.push(D);return G(()=>{k(),D.disposable?.dispose()})}}}if(u in d)return d[u];let f=c.value,m=f[u];return typeof m!="function"||(m=m.bind(f),d[u]=m),m},set(d,u,f){return c.value[u]=f,!0},getPrototypeOf(d){return e.prototype}})}else{let a=this._createInstance(e,t,o);return s.add(a),a}}_throwIfStrict(r,e){if(e&&console.warn(r),this._strict)throw new Error(r)}},gp=class n{constructor(r,e){this.type=r;this.name=e;this._start=Date.now();this._dep=[]}static{this.all=new Set}static{this._None=new class extends n{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(r,e){return r?new n(2,e.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):n._None}static traceCreation(r,e){return r?new n(1,e.name):n._None}static{this._totals=0}branch(r,e){let t=new n(3,r.toString());return this._dep.push([r,e,t]),t}stop(){let r=Date.now()-this._start;n._totals+=r;let e=!1;function t(o,s){let a=[],l=new Array(o+1).join("	");for(let[c,d,u]of s._dep)if(d&&u){e=!0,a.push(`${l}CREATES -> ${c}`);let f=t(o+1,u);f&&a.push(f)}else a.push(`${l}uses -> ${c}`);return a.join(`
`)}let i=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${t(1,this)}`,`DONE, took ${r.toFixed(2)}ms (grand total ${n._totals.toFixed(2)}ms)`];(r>2||e)&&n.all.add(i.join(`
`))}}});var Ig,tk=I(()=>{$();te();Ig=class extends $s{constructor(e=nu){super();this.buffer=[];this._logger=void 0;this._logLevelDisposable=this._register(new Qt);this.setLevel(e)}set logger(e){this._logger=e,this.setLevel(e.getLevel()),this._logLevelDisposable.value=e.onDidChangeLogLevel(this.setLevel,this);for(let{level:t,message:i}of this.buffer)ou(e,t,i);this.buffer=[]}log(e,t){this._logger?ou(this._logger,e,t):this.getLevel()<=e&&this.buffer.push({level:e,message:t})}dispose(){this._logger?.dispose(),super.dispose()}flush(){this._logger?.flush()}}});import{session as eF}from"electron";var Bc,rk=I(()=>{$();ze();we();X();qs();ce();Xt();Ai();si();te();en();Bc=class extends T{constructor(e,t,i){super();this.environmentService=e;this.logService=i;this.validRoots=Kr.forPaths(!re);this.validExtensions=new Set([".svg",".png",".jpg",".jpeg",".gif",".bmp",".webp",".mp4",".otf",".ttf"]);this.addValidFileRoot(e.appRoot),this.addValidFileRoot(e.extensionsPath),this.addValidFileRoot(t.defaultProfile.globalStorageHome.with({scheme:W.file}).fsPath),this.addValidFileRoot(e.workspaceStorageHome.with({scheme:W.file}).fsPath),this.handleProtocols()}handleProtocols(){let{defaultSession:e}=eF;e.protocol.registerFileProtocol(W.vscodeFileResource,(t,i)=>this.handleResourceRequest(t,i)),e.protocol.interceptFileProtocol(W.file,(t,i)=>this.handleFileRequest(t,i)),this._register(G(()=>{e.protocol.unregisterProtocol(W.vscodeFileResource),e.protocol.uninterceptProtocol(W.file)}))}addValidFileRoot(e){let t=kt(e);return this.validRoots.get(t)?T.None:(this.validRoots.set(t,!0),G(()=>this.validRoots.delete(t)))}handleFileRequest(e,t){let i=x.parse(e.url);return this.logService.error(`Refused to load resource ${i.fsPath} from ${W.file}: protocol (original URL: ${e.url})`),t({error:-3})}handleResourceRequest(e,t){let i=this.requestToNormalizedFilePath(e),o=Pe(i),s;return this.environmentService.crossOriginIsolated&&(o==="workbench.html"||o==="workbench-dev.html"?s=Wa.CoopAndCoep:s=Wa.getHeadersFromQuery(e.url)),this.environmentService.isBuilt||(s={...s,...d1}),(o==="workbench.html"||o==="workbench-dev.html")&&(s={...s,...u1}),this.validRoots.findSubstr(i)?t({path:i,headers:s}):this.validExtensions.has(ba(i).toLowerCase())?t({path:i,headers:s}):(this.logService.error(`${W.vscodeFileResource}: Refused to load resource ${i} from ${W.vscodeFileResource}: protocol (original URL: ${e.url})`),t({error:-3}))}requestToNormalizedFilePath(e){let t=x.parse(e.url),i=st.uriToFileUri(t);return kt(i.fsPath)}createIPCObjectUrl(){let e,t=x.from({scheme:"vscode",path:ke()}),i=t.toString(),o=async()=>e;return rt.handle(i,o),this.logService.trace(`IPC Object URL: Registered new channel ${i}.`),{resource:t,update:s=>e=s,dispose:()=>{this.logService.trace(`IPC Object URL: Removed channel ${i}.`),rt.removeHandler(i)}}}};Bc=E([g(0,vr),g(1,Dr),g(2,B)],Bc)});function nk(n){return!!n.forwardPort}function tF(n){if(n.scheme!=="http"&&n.scheme!=="https")return;let r=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(n.authority);if(r)return{address:r[1],port:+r[2]}}function wg(n){return vb.indexOf(n)>=0}function Hc(n){return yb.indexOf(n)>=0}function ok(n,r,e,t){if(e===1)return!1;if(e===2&&Hc(r)){let i=/(\d+)\.(\d+)\.(\d+)/g.exec(t);if(i?.length===4&&parseInt(i[1])>=18)return!1}return n<1024}var ik,UCe,vb,yb,Vc,Ib=I(()=>{q();$();X();ce();et();Z();te();ik=O("tunnelService"),UCe=O("sharedTunnelsService");vb=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];yb=["0.0.0.0","0:0:0:0:0:0:0:0","::"];Vc=class extends T{constructor(e,t){super();this.logService=e;this.configurationService=t;this._onTunnelOpened=this._register(new b);this.onTunnelOpened=this._onTunnelOpened.event;this._onTunnelClosed=this._register(new b);this.onTunnelClosed=this._onTunnelClosed.event;this._onAddedTunnelProvider=this._register(new b);this.onAddedTunnelProvider=this._onAddedTunnelProvider.event;this._tunnels=new Map;this._canElevate=!1;this._canChangeProtocol=!0;this._privacyOptions=[];this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){let e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){let e=[],t=Array.from(this._tunnels.values());for(let i of t){let o=Array.from(i.values());for(let s of o){let a=await s.value;a&&typeof a!="string"&&e.push(a)}}return e}async dispose(){super.dispose();for(let e of this._tunnels.values()){for(let{value:t}of e.values())await t.then(i=>typeof i!="string"?i?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,i,o,s){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:o,protocol:s,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(Hc(e)||wg(e))&&(e=vb[0]);let i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,o,s,a=!1,l,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${s}.`);let d=this._tunnelProvider??e;if(!d)return;if(t||(t="localhost"),o||(o=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(i)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}let u=this.retainOrCreateTunnel(d,t,i,o,s,a,l,c);return u?u.then(f=>{if(f){if(typeof f=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(t,i),f}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(t,i);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");let m=this.makeTunnel(f);return(f.tunnelRemoteHost!==t||f.tunnelRemotePort!==i)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),l&&f.privacy!==l&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(m),m}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),u)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);let t=this._tunnels.get(e.tunnelRemoteHost);if(t){let i=t.get(e.tunnelRemotePort);i&&(i.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,i))}}}}async tryDisposeTunnel(e,t,i){if(i.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);let o=i.value.then(async s=>{s&&typeof s!="string"&&(await s.dispose(!0),this._onTunnelClosed.fire({host:s.tunnelRemoteHost,port:s.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),o}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);let i=this._tunnels.get(e);if(i&&i.has(t)){let o=i.get(t);o.refcount=0,await this.tryDisposeTunnel(e,t,o)}}addTunnelToMap(e,t,i){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:i})}async removeEmptyOrErrorTunnelFromMap(e,t){let i=this._tunnels.get(e);if(i){let o=i.get(t),s=o?await o.value:void 0;(!s||typeof s=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){let i=[e];wg(e)?(i.push(...vb),i.push(...yb)):Hc(e)&&i.push(...yb);let o=i.map(s=>this._tunnels.get(s));for(let s of o){let a=s?.get(t);if(a)return a}}canTunnel(e){return!!tF(e)}createWithProvider(e,t,i,o,s,a,l){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${o}.`);let c=i;this._factoryInProgress.add(c);let d=o===void 0?i:o,u={elevationRequired:s?this.isPortPrivileged(d):!1},f={remoteAddress:{host:t,port:i},localAddressPort:o,privacy:a,public:a?a!=="private":void 0,protocol:l},m=e.forwardPort(f,u);return m?(this.addTunnelToMap(t,i,m),m.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(c)})):this._factoryInProgress.delete(c),m}};Vc=E([g(0,B),g(1,ue)],Vc)});var $Ce,$c,sk=I(()=>{He();Z();$Ce=O("remoteAuthorityResolverService"),$c=class n extends ri{static isNotAvailable(r){return r instanceof n&&r._code==="NotAvailable"}static isTemporarilyNotAvailable(r){return r instanceof n&&r._code==="TemporarilyNotAvailable"}static isNoResolverFound(r){return r instanceof n&&r._code==="NoResolverFound"}static isInvalidAuthority(r){return r instanceof n&&r._code==="InvalidAuthority"}static isHandled(r){return r instanceof n&&r.isHandled}constructor(r,e="Unknown",t){super(r),this._message=r,this._code=e,this._detail=t,this.isHandled=e==="NotAvailable"&&t===!0,Object.setPrototypeOf(this,n.prototype)}}});function bb(n){switch(n){case 1:return"Management";case 2:return"ExtensionHost";case 3:return"Tunnel"}}function lk(n){let r=new $e;return setTimeout(()=>r.cancel(),n),r.token}function iF(n,r){if(n.isCancellationRequested||r.isCancellationRequested)return Ce.Cancelled;let e=new $e;return n.onCancellationRequested(()=>e.cancel()),r.onCancellationRequested(()=>e.cancel()),e.token}function nF(n,r){let e=new yp(r);return e.registerDisposable(n.onControlMessage(t=>{let i=JSON.parse(t.toString()),o=cF(i);o?e.reject(o):e.resolve(i)})),e.promise}function oF(n,r,e,t,i,o,s,a){let l=new yp(a),c=ii.create(!1);return n.info(`Creating a socket (${s})...`),Ve(`code/willCreateSocket/${o}`),r.connect(e,t,i,s).then(d=>{l.didTimeout?(Ve(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${s}) finished after ${c.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(Ve(`code/didCreateSocketOK/${o}`),n.info(`Creating a socket (${s}) was successful after ${c.elapsed()} ms.`),l.resolve(d))},d=>{Ve(`code/didCreateSocketError/${o}`),n.info(`Creating a socket (${s}) returned an error after ${c.elapsed()} ms.`),n.error(d),l.reject(d)}),l.promise}function wb(n,r){let e=new yp(r);return n.then(t=>{e.didTimeout||e.resolve(t)},t=>{e.didTimeout||e.reject(t)}),e.promise}async function sF(n,r,e,t){let i=pk(n,r);n.logService.trace(`${i} 1/6. invoking socketFactory.connect().`);let o;try{o=await oF(n.logService,n.remoteSocketFactoryService,n.connectTo,xv.getServerRootPath(),`reconnectionToken=${n.reconnectionToken}&reconnection=${n.reconnectionProtocol?"true":"false"}`,bb(r),`renderer-${bb(r)}-${n.reconnectionToken}`,t)}catch(d){throw n.logService.error(`${i} socketFactory.connect() failed or timed out. Error:`),n.logService.error(d),d}n.logService.trace(`${i} 2/6. socketFactory.connect() was successful.`);let s,a;n.reconnectionProtocol?(n.reconnectionProtocol.beginAcceptReconnection(o,null),s=n.reconnectionProtocol,a=!1):(s=new Df({socket:o}),a=!0),n.logService.trace(`${i} 3/6. sending AuthRequest control message.`);let l=await wb(n.signService.createNewMessage(ke()),t),c={type:"auth",auth:n.connectionToken||"00000000000000000000",data:l.data};s.sendControl(H.fromString(JSON.stringify(c)));try{let d=await nF(s,iF(t,lk(1e4)));if(d.type!=="sign"||typeof d.data!="string"){let v=new Error("Unexpected handshake message");throw v.code="VSCODE_CONNECTION_ERROR",v}if(n.logService.trace(`${i} 4/6. received SignRequest control message.`),!await wb(n.signService.validate(l,d.signedData),t)){let v=new Error("Refused to connect to unsupported server");throw v.code="VSCODE_CONNECTION_ERROR",v}let f=await wb(n.signService.sign(d.data),t),m={type:"connectionType",commit:n.commit,signedData:f,desiredConnectionType:r};return e&&(m.args=e),n.logService.trace(`${i} 5/6. sending ConnectionTypeRequest control message.`),s.sendControl(H.fromString(JSON.stringify(m))),{protocol:s,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(n.logService.error(`${i} the handshake timed out. Error:`),n.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(n.logService.error(`${i} received error control message when negotiating connection. Error:`),n.logService.error(d)),a&&uk(s),d}}async function aF(n,r,e){let t=Date.now(),i=pk(n,3),{protocol:o}=await sF(n,3,r,e);return n.logService.trace(`${i} 6/6. handshake finished, connection is up and running after ${fF(t)}!`),o}async function ck(n,r,e){let{connectTo:t,connectionToken:i}=await n.addressProvider.getAddress();return{commit:n.commit,quality:n.quality,connectTo:t,connectionToken:i,reconnectionToken:r,reconnectionProtocol:e,remoteSocketFactoryService:n.remoteSocketFactoryService,signService:n.signService,logService:n.logService}}async function dk(n,r,e){let t=await ck(n,ke(),null);return await aF(t,{host:r,port:e},Ce.None)}function lF(n){return Ji(r=>new Promise((e,t)=>{let i=setTimeout(e,n*1e3);r.onCancellationRequested(()=>{clearTimeout(i),e()})}))}function uk(n){try{n.acceptDisconnect();let r=n.getSocket();n.dispose(),r.dispose()}catch(r){nt(r)}}function cF(n){if(n&&n.type==="error"){let r=new Error(`Connection error: ${n.reason}`);return r.code="VSCODE_CONNECTION_ERROR",r}return null}function dF(n,r){return typeof n!="number"||!isFinite(n)||n<0?r:n>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:Math.floor(n)}function uF(n,r){for(;n.length<r;)n+=" ";return n}function pF(n,r){return`[remote-connection][${uF(bb(n),13)}][${r.substr(0,5)}\u2026]`}function vp(n,r,e){return`${pF(n,r)}[${e?"reconnect":"initial"}]`}function pk(n,r){return`${vp(r,n.reconnectionToken,!!n.reconnectionProtocol)}[${n.connectTo}]`}function fF(n){return`${Date.now()-n} ms`}var rF,yp,Sb,xb,Pb,bg,Eb,ak,fk=I(()=>{he();ot();wt();He();q();$();ze();hn();_s();Xt();zv();sk();rF=30*1e3;yp=class{get didTimeout(){return this._state==="timedout"}constructor(r){this._state="pending",this._disposables=new j,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=b1(),r.isCancellationRequested?this._timeout():this._disposables.add(r.onCancellationRequested(()=>this._timeout()))}registerDisposable(r){this._state==="pending"?this._disposables.add(r):r.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){let r=new Error("Time limit reached");return r.code="ETIMEDOUT",r.syscall="connect",r}resolve(r){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(r))}reject(r){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(r))}};Sb=class{constructor(r,e){this.reconnectionToken=r;this.millisSinceLastIncomingData=e;this.type=0}},xb=class{constructor(r,e,t,i){this.reconnectionToken=r;this.millisSinceLastIncomingData=e;this.durationSeconds=t;this.cancellableTimer=i;this.type=1}skipWait(){this.cancellableTimer.cancel()}},Pb=class{constructor(r,e,t){this.reconnectionToken=r;this.millisSinceLastIncomingData=e;this.attempt=t;this.type=2}},bg=class{constructor(r,e,t){this.reconnectionToken=r;this.millisSinceLastIncomingData=e;this.attempt=t;this.type=4}},Eb=class{constructor(r,e,t,i){this.reconnectionToken=r;this.millisSinceLastIncomingData=e;this.attempt=t;this.handled=i;this.type=3}},ak=class n extends T{constructor(e,t,i,o,s){super();this._connectionType=e;this._options=t;this.reconnectionToken=i;this.protocol=o;this._reconnectionFailureIsFatal=s;this._onDidStateChange=this._register(new b);this.onDidStateChange=this._onDidStateChange.event;this._permanentFailure=!1;this._isReconnecting=!1;this._isDisposed=!1;this._reconnectionGraceTime=108e5;this._onDidStateChange.fire(new bg(this.reconnectionToken,0,0)),this._register(o.onSocketClose(a=>{let l=vp(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(o.onSocketTimeout(a=>{let l=vp(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${l} received socket timeout event (unacknowledgedMsgCount: ${a.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${a.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${a.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),n._instances.push(this),this._register(G(()=>{let a=n._instances.indexOf(this);a>=0&&n._instances.splice(a,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(n._permanentFailureMillisSinceLastIncomingData,n._permanentFailureAttempt,n._permanentFailureHandled)}static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(o=>o._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 _isPermanentFailure(){return this._permanentFailure||n._permanentFailure}updateGraceTime(e){let t=dF(e,108e5),i=vp(this._connectionType,this.reconnectionToken,!1);this._options.logService.trace(`${i} Applying reconnection grace time: ${t}ms (${Math.floor(t/1e3)}s)`),this._reconnectionGraceTime=t}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=vp(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${e} starting reconnecting loop. You can get more information with the trace log level.`),this._onDidStateChange.fire(new Sb(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));let t=[0,5,5,10,10,10,10,10,30],i=this._reconnectionGraceTime;if(this._options.logService.info(`${e} starting reconnection with grace time: ${i}ms (${Math.floor(i/1e3)}s)`),i<=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 o=Date.now(),s=-1;do{s++;let a=s<t.length?t[s]:t[t.length-1];try{if(a>0){let c=lF(a);this._onDidStateChange.fire(new xb(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),a,c)),this._options.logService.info(`${e} waiting for ${a} seconds before reconnecting...`);try{await c}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new Pb(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s+1)),this._options.logService.info(`${e} resolving connection...`);let l=await ck(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${l.connectTo}...`),await this._reconnect(l,lk(rF)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new bg(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s+1));break}catch(l){if(l.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(l),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),s+1,!1);break}if(Date.now()-o>=i){let c=Math.round(i/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 (${c}s) has expired! Will give up now! Error:`),this._options.logService.error(l),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),s+1,!1);break}if($c.isTemporarilyNotAvailable(l)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(l);continue}if((l.code==="ETIMEDOUT"||l.code==="ENETUNREACH"||l.code==="ECONNREFUSED"||l.code==="ECONNRESET")&&l.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(l);continue}if(od(l)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(l);continue}if(l instanceof $c){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(l),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),s+1,$c.isHandled(l));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(l),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),s+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?n.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new Eb(this.reconnectionToken,e,t,i)),uk(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}}});var Sg,mk=I(()=>{$();Z();Sg=O("remoteSocketFactoryService")});import*as hk from"net";import*as gk from"os";async function mF(n,r,e,t,i){let o;for(let s=3;s&&(o?.dispose(),o=await new Cb(n,r,e,t,i).waitForReady(),!(i&&hI[i]||!hI[o.tunnelLocalPort]));s--);return o}var Cb,Ip,ma,xg,vk=I(()=>{vI();Bd();he();$();X();et();te();qt();fk();mk();kh();Ib();ot();Cb=class extends T{constructor(e,t,i,o,s){super();this.defaultTunnelHost=t;this.suggestedLocalPort=s;this.privacy="private";this._socketsDispose=new Map;this._options=e,this._server=hk.createServer(),this._barrier=new bn,this._listeningListener=()=>this._barrier.open(),this._server.on("listening",this._listeningListener),this._connectionListener=a=>this._onConnection(a),this._server.on("connection",this._connectionListener),this._errorListener=()=>{},this._server.on("error",this._errorListener),this.tunnelRemotePort=o,this.tunnelRemoteHost=i}async dispose(){super.dispose(),this._server.removeListener("listening",this._listeningListener),this._server.removeListener("connection",this._connectionListener),this._server.removeListener("error",this._errorListener),this._server.close(),Array.from(this._socketsDispose.values()).forEach(t=>{t()})}async waitForReady(){let e=this.suggestedLocalPort??this.tunnelRemotePort,t=Hc(this.defaultTunnelHost)?"0.0.0.0":"127.0.0.1",i=await gI(e,2,1e3,t),o=null;return this._server.listen(i,this.defaultTunnelHost),await this._barrier.wait(),o=this._server.address(),o||(i=0,this._server.listen(i,this.defaultTunnelHost),await this._barrier.wait(),o=this._server.address()),this.tunnelLocalPort=o.port,this.localAddress=`${this.tunnelRemoteHost==="127.0.0.1"?"127.0.0.1":"localhost"}:${o.port}`,this}async _onConnection(e){e.pause();let t=wg(this.tunnelRemoteHost)||Hc(this.tunnelRemoteHost)?"localhost":this.tunnelRemoteHost,i=await dk(this._options,t,this.tunnelRemotePort),o=i.getSocket(),s=i.readEntireBuffer();i.dispose(),s.byteLength>0&&e.write(s.buffer),e.on("end",()=>{e.localAddress&&this._socketsDispose.delete(e.localAddress),o.end()}),e.on("close",()=>o.end()),e.on("error",()=>{e.localAddress&&this._socketsDispose.delete(e.localAddress),o instanceof ao?o.socket.destroy():o.end()}),o instanceof ao?this._mirrorNodeSocket(e,o):this._mirrorGenericSocket(e,o),e.localAddress&&this._socketsDispose.set(e.localAddress,()=>{e.end(),o.end()})}_mirrorGenericSocket(e,t){t.onClose(()=>e.destroy()),t.onEnd(()=>e.end()),t.onData(i=>e.write(i.buffer)),e.on("data",i=>t.write(H.wrap(i))),e.resume()}_mirrorNodeSocket(e,t){let i=t.socket;i.on("end",()=>e.end()),i.on("close",()=>e.end()),i.on("error",()=>{e.destroy()}),i.pipe(e),e.pipe(i)}},Ip=class extends Vc{constructor(e,t,i,o,s){super(t,s);this.remoteSocketFactoryService=e;this.signService=i;this.productService=o}isPortPrivileged(e){return ok(e,this.defaultTunnelHost,Ut,gk.release())}retainOrCreateTunnel(e,t,i,o,s,a,l,c){let d=this.getTunnelFromMap(t,i);if(d)return++d.refcount,d.value;if(nk(e))return this.createWithProvider(e,t,i,s,a,l,c);{this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel without provider ${t}:${i} on local port ${s}.`);let u={commit:this.productService.commit,quality:this.productService.quality,addressProvider:e,remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this.signService,logService:this.logService,ipcLogger:null},f=mF(u,o,t,i,s);return this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created without provider."),this.addTunnelToMap(t,i,f),f}}};Ip=E([g(0,Sg),g(1,B),g(2,vs),g(3,Te),g(4,ue)],Ip);ma=class extends Ip{constructor(r,e,t,i,o){super(r,e,t,i,o)}};ma=E([g(0,Sg),g(1,B),g(2,vs),g(3,Te),g(4,ue)],ma);xg=class extends T{constructor(e,t,i,o,s){super();this.remoteSocketFactoryService=e;this.logService=t;this.productService=i;this.signService=o;this.configurationService=s;this._tunnelServices=new Map}async openTunnel(e,t,i,o,s,a,l,c,d){if(this.logService.trace(`ForwardedPorts: (SharedTunnelService) openTunnel request for ${i}:${o} on local port ${a}.`),!this._tunnelServices.has(e)){let u=new ma(this.remoteSocketFactoryService,this.logService,this.signService,this.productService,this.configurationService);this._register(u),this._tunnelServices.set(e,u),u.onTunnelClosed(async()=>{(await u.tunnels).length===0&&(u.dispose(),this._tunnelServices.delete(e))})}return this._tunnelServices.get(e).openTunnel(t,i,o,s,a,l,c,d)}};xg=E([g(0,Sg),g(1,B),g(2,Te),g(3,vs),g(4,ue)],xg)});import{parse as yk}from"url";function hF(n,r){return n.protocol==="http:"?r.HTTP_PROXY||r.http_proxy||null:n.protocol==="https:"&&(r.HTTPS_PROXY||r.https_proxy||r.HTTP_PROXY||r.http_proxy)||null}async function Ik(n,r,e={}){let t=yk(n),i=e.proxyUrl||hF(t,r);if(!i)return null;let o=yk(i);if(!/^https?:$/.test(o.protocol||""))return null;let s={host:o.hostname||"",port:(o.port?+o.port:0)||(o.protocol==="https"?443:80),auth:o.auth,rejectUnauthorized:Gp(e.strictSSL)?e.strictSSL:!0};if(t.protocol==="http:"){let{default:a}=await import("http-proxy-agent");return new a.HttpProxyAgent(i,s)}else{let{default:a}=await import("https-proxy-agent");return new a.HttpsProxyAgent(i,s)}}var wk=I(()=>{Oe()});import{parse as bk}from"url";import{createGunzip as gF}from"zlib";function IF(n){if(n instanceof Error){let r=n.code;return!!r&&vF.has(r)}return!1}async function wF(n,r,e,t){let i=await import("kerberos"),o=i.default||i,s=new URL(n),a=r||(process.platform==="win32"?`HTTP/${s.hostname}`:`HTTP@${s.hostname}`);return e.debug(`${t} Kerberos authentication lookup`,`proxyURL:${s}`,`spn:${a}`),(await o.initializeClient(a)).step("")}async function bF(n){return(bk(n.url).protocol==="https:"?await import("https"):await import("http")).request}async function Sk(n,r){let t,i=yF.test(n.type||"GET");for(let o=1;o<=3;o++)try{return await SF(n,r)}catch(s){if(t=s,s instanceof xt||!i||!IF(s)||o===3)throw s;await lt(100*o,r)}throw t}async function SF(n,r){return vt.withAsyncBody(async(e,t)=>{let i=bk(n.url),o=n.getRawRequest?n.getRawRequest(n):await bF(n),s={hostname:i.hostname,port:i.port?parseInt(i.port):i.protocol==="https:"?443:80,protocol:i.protocol,path:i.path,method:n.type||"GET",headers:n.headers,agent:n.agent,rejectUnauthorized:Gp(n.strictSSL)?n.strictSSL:!0};n.user&&n.password&&(s.auth=n.user+":"+n.password),n.disableCache&&(s.cache="no-store");let a=o(s,c=>{let d=Ki(n.followRedirects)?n.followRedirects:3;if(c.statusCode&&c.statusCode>=300&&c.statusCode<400&&d>0&&c.headers.location)Sk({...n,url:c.headers.location,followRedirects:d-1},r).then(e,t);else{let u=c;!n.isChromiumNetwork&&c.headers["content-encoding"]==="gzip"&&(u=c.pipe(gF())),e({res:c,stream:ux(u)})}});if(a.on("error",t),n.timeout)if(n.isChromiumNetwork){let c=setTimeout(()=>{a.abort(),t(new Error(`Request timeout after ${n.timeout}ms`))},n.timeout);a.on("response",()=>clearTimeout(c)),a.on("error",()=>clearTimeout(c)),a.on("abort",()=>clearTimeout(c))}else a.setTimeout(n.timeout);n.isChromiumNetwork&&a.removeHeader("Content-Length"),n.data&&typeof n.data=="string"&&a.write(n.data),a.end();let l=r.onCancellationRequested(()=>{l.dispose(),a.abort(),t(new xt)});a.on("response",()=>l.dispose()),a.on("error",()=>l.dispose())})}var vF,yF,qc,xk=I(()=>{he();ot();He();Oe();et();si();qu();te();ss();wk();vF=new Set(["EAI_AGAIN","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ENETDOWN","ENETUNREACH","EPROTO"]),yF=/^(GET|HEAD|OPTIONS)$/i;qc=class extends $m{constructor(e,t,i,o){super(o);this.machine=e;this.configurationService=t;this.environmentService=i;this.configure(),this._register(t.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,t){let{proxyUrl:i,strictSSL:o}=this,s;try{s=await cs(this.configurationService,this.logService,this.environmentService.args,process.env)}catch(c){this.shellEnvErrorLogged||(this.shellEnvErrorLogged=!0,this.logService.error("resolving shell environment failed",mr(c)))}let a={...process.env,...s},l=e.agent?e.agent:await Ik(e.url||"",a,{proxyUrl:i,strictSSL:o});return e.agent=l,e.strictSSL=o,this.authorization&&(e.headers={...e.headers||{},"Proxy-Authorization":this.authorization}),this.logAndRequest(e,()=>Sk(e,t))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){try{let t=this.getConfigValue("http.proxyKerberosServicePrincipal");return"Negotiate "+await wF(e,t,this.logService,"RequestService#lookupKerberosAuthorization")}catch(t){this.logService.debug("RequestService#lookupKerberosAuthorization Kerberos authentication failed",t);return}}async loadCertificates(){return(await import("@vscode/proxy-agent")).loadSystemCertificates({loadSystemCertificatesFromNode:()=>this.getConfigValue("http.systemCertificatesNode",SI),log:this.logService})}getConfigValue(e,t){if(this.machine==="remote")return this.configurationService.getValue(e);let i=this.configurationService.inspect(e);return i.userLocalValue??i.defaultValue??t}};qc=E([g(1,ue),g(2,vr),g(3,B)],qc)});import{net as xF}from"electron";function PF(n){return xF.request}var Kc,Pk=I(()=>{xk();et();si();te();Kc=class extends qc{constructor(r,e,t){super("local",r,e,t)}request(r,e){return super.request({...r||{},getRawRequest:PF,isChromiumNetwork:!0},e)}};Kc=E([g(0,ue),g(1,vr),g(2,B)],Kc)});var Pg,Ek=I(()=>{Pg=class n{constructor(){this.validators=new Map}static{this._nextId=1}async createNewMessage(r){try{let e=await this.getValidator();if(e){let t=String(n._nextId++);return this.validators.set(t,e),{id:t,data:e.createNewMessage(r)}}}catch{}return{id:"",data:r}}async validate(r,e){if(!r.id)return!0;let t=this.validators.get(r.id);if(!t)return!1;this.validators.delete(r.id);try{return t.validate(e)==="ok"}catch{return!1}finally{t.dispose?.()}}async sign(r){try{return await this.signValue(r)}catch{}return r}}});var Eg,Ck=I(()=>{Ek();Eg=class extends Pg{getValidator(){return this.vsda().then(r=>new r.validator)}signValue(r){return this.vsda().then(e=>new e.signer().sign(r))}async vsda(){let r="vsda",{default:e}=await import(r);return e}}});var ha,Tk=I(()=>{cn();he();$();te();ha=class extends sa{constructor(e,t){super();this.logService=e;this.productName=t;this.throttler=this._register(new md);this.watcher=this._register(new Qt)}async _updatePolicyDefinitions(e){this.logService.trace(`NativePolicyService#_updatePolicyDefinitions - Found ${Object.keys(e).length} policy definitions`);let{createWatcher:t}=await import("@vscode/policy-watcher");await this.throttler.queue(()=>new Promise((i,o)=>{try{this.logService.trace(`Creating watcher for productName ${this.productName}`),this.watcher.value=t(this.productName,e,s=>{this._onDidPolicyChange(s),i()})}catch(s){this.logService.error("NativePolicyService#_updatePolicyDefinitions - Error creating watcher:",s),o(s)}}))}_onDidPolicyChange(e){this.logService.trace(`NativePolicyService#_onDidPolicyChange - Updated policy values: ${JSON.stringify(e)}`);for(let t in e){let i=e[t];i===void 0?this.policies.delete(t):this.policies.set(t,i)}this._onDidChange.fire(Object.keys(e))}};ha=E([g(0,B)],ha)});function EF(n,r){let e=[];for(let t of new Set(In.concat(n.keys(),r.keys())))n.get(t)!==r.get(t)&&e.push(t);return e}var ga,_k=I(()=>{he();q();ad();Oe();je();te();cn();ga=class extends sa{constructor(e,t,i){super();this.file=e;this.fileService=t;this.logService=i;this.throttledDelayer=this._register(new Tr(500));let o=S.filter(t.onDidFilesChange,s=>s.affects(e));this._register(t.watch(e)),this._register(o(()=>this.throttledDelayer.trigger(()=>this.refresh())))}async _updatePolicyDefinitions(){await this.refresh()}async read(){let e=new Map;try{let t=await this.fileService.readFile(this.file),i=JSON.parse(t.value.toString());if(!Ge(i))throw new Error("Policy file isn't a JSON object");for(let o of Object.keys(i))this.policyDefinitions[o]&&e.set(o,i[o])}catch(t){t.fileOperationResult!==1&&this.logService.error("[FilePolicyService] Failed to read policies",t)}return e}async refresh(){let e=await this.read(),t=EF(this.policies,e);this.policies=e,t.length>0&&this._onDidChange.fire(t)}};ga=E([g(1,Me),g(2,B)],ga)});function kk(n,r,e){r instanceof ge||(r=new ge(r,[],!!e)),CF.push([n,r])}var CF,Rk=I(()=>{Ju();CF=[]});var Cg,va,Dk=I(()=>{Zi();ce();Rk();je();gt();q();$();Jt();Cg=class n{constructor(r){this.uri=r;this.time=n._clock++}static{this._clock=0}touch(){return this.time=n._clock++,this}},va=class{constructor(r){this._fileService=r;this._dispooables=new j;this._limit=2**16;let e=new Map,t=i=>{let o=e.get(i.scheme);return o===void 0&&(o=r.hasProvider(i)&&!this._fileService.hasCapability(i,1024),e.set(i.scheme,o)),o};this._dispooables.add(S.any(r.onDidChangeFileSystemProviderRegistrations,r.onDidChangeFileSystemProviderCapabilities)(i=>{if(e.get(i.scheme)===void 0)return;e.delete(i.scheme);let s=t(x.from({scheme:i.scheme}));if(s!==s)for(let[a,l]of this._canonicalUris.entries())l.uri.scheme===i.scheme&&this._canonicalUris.delete(a)})),this.extUri=new As(t),this._canonicalUris=new Map}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(r){this._fileService.hasProvider(r)&&(r=sf(r));let e=this.extUri.getComparisonKey(r,!0),t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:r.fragment}):(this._canonicalUris.set(e,new Cg(r)),this._checkTrim(),r)}_checkTrim(){if(this._canonicalUris.size<this._limit)return;Cg._clock=1;let r=[...this._canonicalUris.values()].map(t=>t.time),e=Kp(Math.floor(r.length/2),r,(t,i)=>t-i);for(let[t,i]of this._canonicalUris.entries())i.time<=e?this._canonicalUris.delete(t):i.time=0}};va=E([g(0,Me)],va);kk(Rt,va,1)});var Tg,Ak=I(()=>{$();te();Tg=class extends T{constructor(r,e=[]){super(),this.logger=new zf([r,...e]),this._register(r.onDidChangeLogLevel(t=>this.setLevel(t)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(r){this.logger.setLevel(r)}getLevel(){return this.logger.getLevel()}trace(r,...e){this.logger.trace(r,...e)}debug(r,...e){this.logger.debug(r,...e)}info(r,...e){this.logger.info(r,...e)}warn(r,...e){this.logger.warn(r,...e)}error(r,...e){this.logger.error(r,...e)}flush(){this.logger.flush()}}});var _g,Lk=I(()=>{q();$();je();qs();Cr();_g=class extends T{constructor(e,t,i,o,s,a){super();this.fileSystemScheme=e;this.fileSystemProvider=t;this.userDataScheme=i;this.userDataProfilesService=o;this.uriIdentityService=s;this.logService=a;this.capabilities=this.fileSystemProvider.capabilities,this.onDidChangeCapabilities=this.fileSystemProvider.onDidChangeCapabilities,this._onDidChangeFile=this._register(new b),this.onDidChangeFile=this._onDidChangeFile.event,this.watchResources=Kr.forUris(()=>!(this.capabilities&1024)),this.atomicReadWriteResources=new Ea(l=>this.uriIdentityService.extUri.getComparisonKey(this.toFileSystemResource(l))),this.updateAtomicReadWritesResources(),this._register(o.onDidChangeProfiles(()=>this.updateAtomicReadWritesResources())),this._register(this.fileSystemProvider.onDidChangeFile(l=>this.handleFileChanges(l)))}updateAtomicReadWritesResources(){this.atomicReadWriteResources.clear();for(let e of this.userDataProfilesService.profiles)this.atomicReadWriteResources.add(e.settingsResource),this.atomicReadWriteResources.add(e.keybindingsResource),this.atomicReadWriteResources.add(e.tasksResource),this.atomicReadWriteResources.add(e.extensionsResource)}open(e,t){return this.fileSystemProvider.open(this.toFileSystemResource(e),t)}close(e){return this.fileSystemProvider.close(e)}read(e,t,i,o,s){return this.fileSystemProvider.read(e,t,i,o,s)}write(e,t,i,o,s){return this.fileSystemProvider.write(e,t,i,o,s)}watch(e,t){this.watchResources.set(e,e);let i=this.fileSystemProvider.watch(this.toFileSystemResource(e),t);return G(()=>{this.watchResources.delete(e),i.dispose()})}stat(e){return this.fileSystemProvider.stat(this.toFileSystemResource(e))}mkdir(e){return this.fileSystemProvider.mkdir(this.toFileSystemResource(e))}rename(e,t,i){return this.fileSystemProvider.rename(this.toFileSystemResource(e),this.toFileSystemResource(t),i)}readFile(e,t){return this.fileSystemProvider.readFile(this.toFileSystemResource(e),t)}readFileStream(e,t,i){return this.fileSystemProvider.readFileStream(this.toFileSystemResource(e),t,i)}readdir(e){return this.fileSystemProvider.readdir(this.toFileSystemResource(e))}enforceAtomicReadFile(e){return this.atomicReadWriteResources.has(e)}writeFile(e,t,i){return this.fileSystemProvider.writeFile(this.toFileSystemResource(e),t,i)}enforceAtomicWriteFile(e){return this.atomicReadWriteResources.has(e)?{postfix:".vsctmp"}:!1}delete(e,t){return this.fileSystemProvider.delete(this.toFileSystemResource(e),t)}copy(e,t,i){if(su(this.fileSystemProvider))return this.fileSystemProvider.copy(this.toFileSystemResource(e),this.toFileSystemResource(t),i);throw new Error("copy not supported")}cloneFile(e,t){if(Xf(this.fileSystemProvider))return this.fileSystemProvider.cloneFile(this.toFileSystemResource(e),this.toFileSystemResource(t));throw new Error("clone not supported")}handleFileChanges(e){let t=[];for(let i of e){if(i.resource.scheme!==this.fileSystemScheme)continue;let o=this.toUserDataResource(i.resource);this.watchResources.findSubstr(o)&&t.push({resource:o,type:i.type,cId:i.cId})}t.length&&(this.logService.debug("User data changed"),this._onDidChangeFile.fire(t))}toFileSystemResource(e){return e.with({scheme:this.fileSystemScheme})}toUserDataResource(e){return e.with({scheme:this.userDataScheme})}}});var Mk=I(()=>{});import Nr from"electron";var TF,_F,kF,RF,Ok,Fk,Wk,Uk,hi,Jr,Nk=I(()=>{q();$();X();et();xi();Mk();Jt();Kt();te();TF="#FFFFFF",_F="#1F1F1F",kF="#000000",RF="#FFFFFF",Ok="theme",Fk="themeBackground",Wk="windowSplash",Uk="windowSplashWorkspaceOverride",hi=class{constructor(r,e){this.key=r;this.defaultValue=e}getValue(r){return r.getValue(this.key)??this.defaultValue}};(o=>(o.DETECT_COLOR_SCHEME=new o("window.autoDetectColorScheme",!1),o.DETECT_HC=new o("window.autoDetectHighContrast",!0),o.SYSTEM_COLOR_THEME=new o("window.systemColorTheme","default"),o.AUXILIARYBAR_DEFAULT_VISIBILITY=new o("workbench.secondarySideBar.defaultVisibility","visibleInWorkspace"),o.STARTUP_EDITOR=new o("workbench.startupEditor","welcomePage")))(hi||={});Jr=class extends T{constructor(e,t,i){super();this.stateService=e;this.configurationService=t;this.logService=i;this._onDidChangeColorScheme=this._register(new b);this.onDidChangeColorScheme=this._onDidChangeColorScheme.event;re||this._register(this.configurationService.onDidChangeConfiguration(o=>{(o.affectsConfiguration(hi.SYSTEM_COLOR_THEME.key)||o.affectsConfiguration(hi.DETECT_COLOR_SCHEME.key))&&(this.updateSystemColorTheme(),this.logThemeSettings())})),this.updateSystemColorTheme(),this.logThemeSettings(),this._register(S.fromNodeEventEmitter(Nr.nativeTheme,"updated")(()=>{this.logThemeSettings(),this._onDidChangeColorScheme.fire(this.getColorScheme())}))}static{this.DEFAULT_BAR_WIDTH=300}static{this.WORKSPACE_OVERRIDE_LIMIT=50}logThemeSettings(){if(this.logService.getLevel()>=2){let e=i=>`${i.key}=${i.getValue(this.configurationService)}`;this.logService.debug(`[theme main service] ${e(hi.DETECT_COLOR_SCHEME)}, ${e(hi.DETECT_HC)}, ${e(hi.SYSTEM_COLOR_THEME)}`);let t=i=>`${String(i)}=${Nr.nativeTheme[i]}`;this.logService.debug(`[theme main service] electron.nativeTheme: ${t("themeSource")}, ${t("shouldUseDarkColors")}, ${t("shouldUseHighContrastColors")}, ${t("shouldUseInvertedColorScheme")}, ${t("shouldUseDarkColorsForSystemIntegratedUI")}	`),this.logService.debug(`[theme main service] New color scheme: ${JSON.stringify(this.getColorScheme())}`)}}updateSystemColorTheme(){if(re||this.isAutoDetectColorScheme())Nr.nativeTheme.themeSource="system";else switch(hi.SYSTEM_COLOR_THEME.getValue(this.configurationService)){case"dark":Nr.nativeTheme.themeSource="dark";break;case"light":Nr.nativeTheme.themeSource="light";break;case"auto":switch(this.getPreferredBaseTheme()??this.getStoredBaseTheme()){case"vs":Nr.nativeTheme.themeSource="light";break;case"vs-dark":Nr.nativeTheme.themeSource="dark";break;default:Nr.nativeTheme.themeSource="system"}break;default:Nr.nativeTheme.themeSource="system";break}}getColorScheme(){if(F){if(Nr.nativeTheme.shouldUseHighContrastColors)return{dark:Nr.nativeTheme.shouldUseInvertedColorScheme,highContrast:!0}}else if(V){if(Nr.nativeTheme.shouldUseInvertedColorScheme||Nr.nativeTheme.shouldUseHighContrastColors)return{dark:Nr.nativeTheme.shouldUseDarkColors,highContrast:!0}}else if(re&&Nr.nativeTheme.shouldUseHighContrastColors)return{dark:!0,highContrast:!0};return{dark:Nr.nativeTheme.shouldUseDarkColors,highContrast:!1}}getPreferredBaseTheme(){let e=this.getColorScheme();if(hi.DETECT_HC.getValue(this.configurationService)&&e.highContrast)return e.dark?"hc-black":"hc-light";if(this.isAutoDetectColorScheme())return e.dark?"vs-dark":"vs"}isAutoDetectColorScheme(){return!!hi.DETECT_COLOR_SCHEME.getValue(this.configurationService)}getBackgroundColor(){let e=this.getPreferredBaseTheme(),t=this.getStoredBaseTheme();if(e===void 0||e===t){let i=this.stateService.getItem(Fk,null);if(i)return i}switch(e??t){case"vs":return TF;case"hc-black":return kF;case"hc-light":return RF;default:return _F}}getStoredBaseTheme(){switch(this.stateService.getItem(Ok,"vs-dark").split(" ")[0]){case"vs":return"vs";case"hc-black":return"hc-black";case"hc-light":return"hc-light";default:return"vs-dark"}}saveWindowSplash(e,t,i){let o=this.updateWindowSplashOverride(t,i);this.stateService.setItems(at([{key:Ok,data:i.baseTheme},{key:Fk,data:i.colorInfo.background},{key:Wk,data:i},o?{key:Uk,data:o}:void 0])),typeof e=="number"&&this.updateBackgroundColor(e,i),this.updateSystemColorTheme()}updateWindowSplashOverride(e,t){let i,o=!1;return e&&(i={...this.getWindowSplashOverride()},o=this.doUpdateWindowSplashOverride(e,t,i,"sideBar"),o=this.doUpdateWindowSplashOverride(e,t,i,"auxiliaryBar")||o),o?i:void 0}doUpdateWindowSplashOverride(e,t,i,o){let s=o==="sideBar"?t.layoutInfo?.sideBarWidth:t.layoutInfo?.auxiliaryBarWidth,a=o==="sideBar"?i.layoutInfo.sideBarWidth:i.layoutInfo.auxiliaryBarWidth,l=!1;if(typeof s!="number")return i.layoutInfo.workspaces[e.id]&&(delete i.layoutInfo.workspaces[e.id],l=!0),l;let c=i.layoutInfo.workspaces[e.id];if(!c){let d=Object.keys(i.layoutInfo.workspaces);d.length>=Jr.WORKSPACE_OVERRIDE_LIMIT&&(delete i.layoutInfo.workspaces[d[0]],l=!0),c={sideBarVisible:!1,auxiliaryBarVisible:!1},i.layoutInfo.workspaces[e.id]=c,l=!0}if(s>0)switch(a!==s&&(i.layoutInfo[o==="sideBar"?"sideBarWidth":"auxiliaryBarWidth"]=s,l=!0),o){case"sideBar":c.sideBarVisible||(c.sideBarVisible=!0,l=!0);break;case"auxiliaryBar":c.auxiliaryBarVisible||(c.auxiliaryBarVisible=!0,l=!0);break}else switch(o){case"sideBar":c.sideBarVisible&&(c.sideBarVisible=!1,l=!0);break;case"auxiliaryBar":c.auxiliaryBarVisible&&(c.auxiliaryBarVisible=!1,l=!0);break}return l}updateBackgroundColor(e,t){for(let i of Ln())if(i.id===e){i.setBackgroundColor(t.colorInfo.background);break}}getWindowSplash(e){try{return this.doGetWindowSplash(e)}catch(t){this.logService.error("[theme main service] Failed to get window splash",t);return}}doGetWindowSplash(e){let t=this.stateService.getItem(Wk);if(!t?.layoutInfo)return t;let i=this.getWindowSplashOverride(),o;e?i.layoutInfo.workspaces[e.id]?.sideBarVisible===!1?o=0:o=i.layoutInfo.sideBarWidth||t.layoutInfo.sideBarWidth||Jr.DEFAULT_BAR_WIDTH:o=0;let s=hi.AUXILIARYBAR_DEFAULT_VISIBILITY.getValue(this.configurationService),a=hi.STARTUP_EDITOR.getValue(this.configurationService),l;if(e){let c=i.layoutInfo.workspaces[e.id]?.auxiliaryBarVisible;c===!0?l=i.layoutInfo.auxiliaryBarWidth||t.layoutInfo.auxiliaryBarWidth||Jr.DEFAULT_BAR_WIDTH:c===!1?l=0:a!=="agentSessionsWelcomePage"&&(s==="visible"||s==="visibleInWorkspace")?l=i.layoutInfo.auxiliaryBarWidth||t.layoutInfo.auxiliaryBarWidth||Jr.DEFAULT_BAR_WIDTH:a!=="agentSessionsWelcomePage"&&(s==="maximized"||s==="maximizedInWorkspace")?l=Number.MAX_SAFE_INTEGER:l=0}else l=0;return{...t,layoutInfo:{...t.layoutInfo,sideBarWidth:o,auxiliaryBarWidth:l}}}getWindowSplashOverride(){let e=this.stateService.getItem(Uk);return e?.layoutInfo||(e={layoutInfo:{sideBarWidth:Jr.DEFAULT_BAR_WIDTH,auxiliaryBarWidth:Jr.DEFAULT_BAR_WIDTH,workspaces:{}}}),e.layoutInfo.sideBarWidth||(e.layoutInfo.sideBarWidth=Jr.DEFAULT_BAR_WIDTH),e.layoutInfo.auxiliaryBarWidth||(e.layoutInfo.auxiliaryBarWidth=Jr.DEFAULT_BAR_WIDTH),e.layoutInfo.workspaces||(e.layoutInfo.workspaces={}),e}};Jr=E([g(0,Et),g(1,ue),g(2,B)],Jr)});var OF={};import{app as DF,dialog as AF}from"electron";import{unlinkSync as LF,promises as Bk}from"fs";var Tb,MF,Vk=I(()=>{X1();ce();Jt();he();No();He();ni();q();so();ze();we();hn();X();yi();ar();nr();Pn();Bd();$_();xe();et();z_();J_();Lt();Nl();X_();je();Y_();fh();Ju();ek();vh();Ct();tk();te();xd();qt();Hh();rk();Ib();vk();ss();Pk();kh();Ck();xi();So();dl();es();cn();Tk();_k();$();Zi();Dk();Xl();Ak();Ky();Ay();Lk();Ha();Nk();bd();Tb=class{main(){try{this.startup()}catch(r){console.error(r.message),DF.exit(1)}}async startup(){$p(c=>console.error(c));let[r,e,t,i,o,s,a,l]=this.createServices();try{try{await this.initServices(t,l,i,o,a)}catch(c){throw this.handleStartupDataDirError(t,a,c),c}await r.invokeFunction(async c=>{let d=c.get(B),u=c.get(ye),f=c.get(Me),m=c.get(ai),v=await this.claimInstance(d,t,u,r,a,!0);if(Q.writeFile(t.mainLockfile,String(process.pid)).catch(C=>{d.warn(`app#startup(): Error writing main lockfile: ${C.stack}`)}),s.logger=m.createLogger("main",{name:h(164,null)}),S.once(u.onWillShutdown)(C=>{f.dispose(),i.dispose(),C.join("instanceLockfile",Bk.unlink(t.mainLockfile).catch(()=>{}))}),await this.checkInnoSetupMutex(a)){let C=`${a.nameShort} is currently being updated. Please wait for the update to complete before launching.`;r.invokeFunction(this.quit,new Error(C));return}return r.createInstance(bs,v,e).startup()})}catch(c){r.invokeFunction(this.quit,c)}}createServices(){let r=new fs,e=new j;process.once("exit",()=>e.dispose());let t={_serviceBrand:void 0,...Fr};r.set(Te,t);let i=new bi(this.resolveArgs(),t),o=this.patchEnvironment(i);r.set(_e,i);let s=new Ch(tP(i),i.logsHome);r.set(dn,s);let a=new Ig(s.getLogLevel()),l=e.add(new Tg(a,[new Kf(s.getLogLevel())]));r.set(B,l);let c=new xs(l);r.set(Me,c);let d=new ps(l);c.registerProvider(W.file,d);let u=new va(c);r.set(Rt,u);let f=new gl(1,i,l,c);r.set(am,f),r.set(Et,f);let m=new vl(f,u,i,c,l,t);r.set(Ur,m),c.registerProvider(W.vscodeUserData,new _g(W.file,d,W.vscodeUserData,m,u,l));let v,y=F?t.parentPolicyConfig?.win32RegValueName??t.win32RegValueName:t.parentPolicyConfig?.darwinBundleIdentifier??t.darwinBundleIdentifier;F&&y?v=e.add(new ha(l,y)):V&&y?v=e.add(new ha(l,y)):re?v=e.add(new ga(x.file(U1),c,l)):i.policyFile?v=e.add(new ga(i.policyFile,c,l)):v=new Ql,r.set(Ui,v);let C=new gg(m.defaultProfile.settingsResource,c,v,l);return r.set(ue,C),r.set(ye,new ge(Mn,void 0,!1)),r.set(Fi,new ge(Kc,void 0,!0)),r.set(An,new ge(Jr)),r.set(vs,new ge(Eg,void 0,!1)),r.set(ik,new ge(ma)),r.set(ac,new Bc(i,m,l)),[new yg(r,!0),o,i,C,f,a,t,m]}patchEnvironment(r){let e={VSCODE_IPC_HOOK:r.mainIPCHandle};return["VSCODE_NLS_CONFIG","VSCODE_PORTABLE"].forEach(t=>{let i=process.env[t];typeof i=="string"&&(e[t]=i)}),Object.assign(process.env,e),e}async initServices(r,e,t,i,o){await vt.settled([Promise.all([this.allowWindowsUNCPath(r.extensionsPath),r.codeCachePath,r.logsHome.with({scheme:W.file}).fsPath,e.defaultProfile.globalStorageHome.with({scheme:W.file}).fsPath,r.workspaceStorageHome.with({scheme:W.file}).fsPath,r.localHistoryHome.with({scheme:W.file}).fsPath,r.backupHome].map(s=>s?Bk.mkdir(s,{recursive:!0}):void 0)),i.init(),t.initialize()]),e.init()}allowWindowsUNCPath(r){if(F){let e=hf(r);e&&io(e)}return r}async claimInstance(r,e,t,i,o,s){let a;try{Ve("code/willStartMainServer"),a=await Px(e.mainIPCHandle),Ve("code/didStartMainServer"),S.once(t.onWillShutdown)(()=>a.dispose())}catch(l){if(l.code!=="EADDRINUSE")throw this.handleStartupDataDirError(e,o,l),l;let c;try{c=await Ex(e.mainIPCHandle,"main")}catch(m){if(!s||F||m.code!=="ECONNREFUSED")throw m.code==="EPERM"&&this.showStartupWarningDialog(h(165,null,o.nameShort),h(166,null),o),m;try{LF(e.mainIPCHandle)}catch(v){throw r.warn("Could not delete obsolete instance handle",v),v}return this.claimInstance(r,e,t,i,o,!1)}if(e.extensionTestsLocationURI&&!e.debugExtensionHost.break){let m=`Running extension tests from the command line is currently only supported if no other instance of ${o.nameShort} is running.`;throw r.error(m),c.dispose(),new Error(m)}let d;!e.args.wait&&!e.args.status&&(d=setTimeout(()=>{this.showStartupWarningDialog(h(167,null,o.nameShort),h(168,null),o)},1e4));let u=tt.toService(c.getChannel("launch"),{disableMarshalling:!0}),f=tt.toService(c.getChannel("diagnostics"),{disableMarshalling:!0});if(e.args.status)return i.invokeFunction(async()=>{let m=new Nc(Vn,o),v=await f.getMainDiagnostics(),y=await f.getRemoteDiagnostics({includeProcesses:!0,includeWorkspaceMetadata:!0}),C=await m.getDiagnostics(v,y);throw console.log(C),new Sa});throw F&&await this.windowsAllowSetForegroundWindow(u,r),r.trace("Sending env to running instance..."),await u.start(e.args,process.env),c.dispose(),d&&clearTimeout(d),new Sa("Sent env to running instance. Terminating...")}if(e.args.status)throw console.log(h(171,null,o.nameShort)),new Sa("Terminating...");return process.env.VSCODE_PID=String(process.pid),a}handleStartupDataDirError(r,e,t){if(t.code==="EACCES"||t.code==="EPERM"){let i=at([r.userDataPath,r.extensionsPath,Af]).map(o=>oo(x.file(o),{os:Ut,tildify:r}));this.showStartupWarningDialog(h(169,null),h(170,null,_r(t),i.join(`
`)),e)}}showStartupWarningDialog(r,e,t){AF.showMessageBoxSync(Dm({type:"warning",buttons:[h(163,null)],message:r,detail:e},t).options)}async windowsAllowSetForegroundWindow(r,e){if(F){let t=await r.getMainProcessId();e.trace("Sending some foreground love to the running instance:",t);try{(await import("windows-foreground-love")).allowSetForegroundWindow(t)}catch(i){e.error(i)}}}quit(r,e){let t=r.get(B),i=r.get(ye),o=0;e&&(e.isExpected?e.message&&t.trace(e.message):(o=1,e.stack?t.error(e.stack):t.error(`Startup error: ${e.toString()}`))),i.kill(o)}async checkInnoSetupMutex(r){if(!(F&&r.win32MutexName&&r.win32VersionedUpdate))return!1;try{let e=`${r.win32MutexName}-updating`;return(await import("@vscode/windows-mutex")).isActive(e)}catch(e){return console.error("Failed to check Inno Setup mutex:",e),!1}}resolveArgs(){let r=this.validatePaths(q0(process.argv));if(r.wait&&!r.waitMarkerFilePath){let e=Q_(r.verbose);e&&(K0(process.argv,"--waitMarkerFilePath",e),r.waitMarkerFilePath=e)}return r.chat&&(r.chat["new-window"]?r["new-window"]=!0:r.chat["reuse-window"]?r["reuse-window"]=!0:r.chat.profile?r.profile=r.chat.profile:r._=[Zr()]),r}validatePaths(r){if(r["open-url"]&&(r._urls=r._,r._=[]),!r.remote){let e=this.doValidatePaths(r._,r.goto);r._=e}return r}doValidatePaths(r,e){let t=Zr(),i=r.map(a=>{let l=String(a),c;e&&(c=Oa(l),l=c.path),l&&(l=this.preparePath(t,l));let d=rf(l,t),u=Pe(d);return u&&!i1(u)?null:e&&c?(c.path=d,this.toPath(c)):d}),o=F||V,s=Mr(i,a=>a&&o?a.toLowerCase():a||"");return at(s)}preparePath(r,e){return F&&(e=ji(e,'"')),e=uv(uv(e," "),"	"),F&&(e=Er(r,e),e=ji(e,".")),e}toPath(r){let e=[r.path];return typeof r.line=="number"&&e.push(String(r.line)),typeof r.column=="number"&&e.push(String(r.column)),e.join(":")}},MF=new Tb;MF.main()});import*as Bi from"node:path";import*as Vi from"original-fs";import*as qk from"node:os";import{performance as FF}from"node:perf_hooks";import*as xr from"node:path";import*as Og from"node:fs";import{createRequire as tR}from"node:module";var iW=tR(import.meta.url),nW=process.platform==="win32";Error.stackTraceLimit=100;if(!process.env.VSCODE_HANDLES_SIGPIPE){let n=!1;process.on("SIGPIPE",()=>{n||(n=!0,console.error(new Error("Unexpected SIGPIPE")))})}function rR(){try{typeof process.env.VSCODE_CWD!="string"&&(process.env.VSCODE_CWD=process.cwd()),process.platform==="win32"&&process.chdir(xr.dirname(process.execPath))}catch(n){console.error(n)}}rR();function Nb(n){let r=xr.dirname(import.meta.dirname);function e(){return process.env.VSCODE_DEV?r:process.platform==="darwin"?xr.dirname(xr.dirname(xr.dirname(r))):process.platform==="win32"&&n.win32VersionedUpdate?xr.dirname(xr.dirname(xr.dirname(r))):xr.dirname(xr.dirname(r))}function t(){if(process.env.VSCODE_PORTABLE)return process.env.VSCODE_PORTABLE;if(process.platform==="win32"||process.platform==="linux")return xr.join(e(),"data");let l=n.portable||`${n.applicationName}-portable-data`;return xr.join(xr.dirname(e()),l)}let i=t(),o=!("target"in n)&&Og.existsSync(i),s=xr.join(i,"tmp"),a=o&&Og.existsSync(s);return o?process.env.VSCODE_PORTABLE=i:delete process.env.VSCODE_PORTABLE,a&&(process.platform==="win32"?(process.env.TMP=s,process.env.TEMP=s):process.env.TMPDIR=s),{portableDataPath:i,isPortable:o}}import*as Cp from"node:fs";import{register as sR}from"node:module";import{createRequire as iR}from"node:module";var Yc=iR(import.meta.url),_i={BUILD_INSERT_PRODUCT_CONFIGURATION:"BUILD_INSERT_PRODUCT_CONFIGURATION"};_i.BUILD_INSERT_PRODUCT_CONFIGURATION&&(_i=Yc("../product.json"));var Zc={"name":"Code","version":"1.119.0","distro":"ede7ca120c03b0100ffe7da26fb44af20a0fd252","author":{"name":"Microsoft Corporation"},"license":"MIT","main":"./out/main.js","type":"module","private":true,"scripts":{"test":"echo Please run any of the test scripts from the scripts folder.","test-browser":"npx playwright install && node test/unit/browser/index.js","test-browser-no-install":"node test/unit/browser/index.js","test-node":"mocha test/unit/node/index.js --delay --ui=tdd --timeout=5000 --exit","test-extension":"vscode-test","test-build-scripts":"cd build && npm run test","check-cyclic-dependencies":"node build/lib/checkCyclicDependencies.ts out","preinstall":"node build/npm/preinstall.ts","postinstall":"node build/npm/postinstall.ts","compile":"npm run gulp compile","compile-check-ts-native":"tsgo --project ./src/tsconfig.json --noEmit --skipLibCheck","watch":"npm-run-all2 -lp watch-client-transpile watch-client watch-extensions watch-copilot","watchd":"deemon npm run watch","watch-webd":"deemon npm run watch-web","kill-watchd":"deemon --kill npm run watch","kill-watch-webd":"deemon --kill npm run watch-web","restart-watchd":"deemon --restart npm run watch","restart-watch-webd":"deemon --restart npm run watch-web","watch-client":"npm run gulp watch-client","watch-clientd":"deemon npm run watch-client","kill-watch-clientd":"deemon --kill npm run watch-client","transpile-client":"node build/next/index.ts transpile","watch-client-transpile":"node build/next/index.ts transpile --watch","watch-client-transpiled":"deemon npm run watch-client-transpile","kill-watch-client-transpiled":"deemon --kill npm run watch-client-transpile","watch-extensions":"npm run gulp watch-extensions watch-extension-media","watch-extensionsd":"deemon npm run watch-extensions","kill-watch-extensionsd":"deemon --kill npm run watch-extensions","watch-copilot":"npm --prefix extensions/copilot run watch","watch-copilotd":"deemon npm run watch-copilot","kill-watch-copilotd":"deemon --kill npm run watch-copilot","precommit":"node --experimental-strip-types build/hygiene.ts","gulp":"node --experimental-strip-types --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js","electron":"node build/lib/electron.ts","7z":"7z","update-grammars":"node build/npm/update-all-grammars.ts","update-localization-extension":"node build/npm/update-localization-extension.ts","mixin-telemetry-docs":"node build/npm/mixin-telemetry-docs.ts","smoketest":"node build/lib/preLaunch.ts && cd test/smoke && npm run compile && node test/index.js","smoketest-no-compile":"cd test/smoke && node test/index.js","download-builtin-extensions":"node build/lib/builtInExtensions.ts","download-builtin-extensions-cg":"node build/lib/builtInExtensionsCG.ts","monaco-compile-check":"tsgo --project src/tsconfig.monaco.json --noEmit","tsec-compile-check":"node node_modules/tsec/bin/tsec -p src/tsconfig.tsec.json","vscode-dts-compile-check":"tsgo --project src/tsconfig.vscode-dts.json && tsgo --project src/tsconfig.vscode-proposed-dts.json","valid-layers-check":"node build/checker/layersChecker.ts && tsgo --project build/checker/tsconfig.browser.json && tsgo --project build/checker/tsconfig.worker.json && tsgo --project build/checker/tsconfig.node.json && tsgo --project build/checker/tsconfig.electron-browser.json && tsgo --project build/checker/tsconfig.electron-main.json && tsgo --project build/checker/tsconfig.electron-utility.json","define-class-fields-check":"node build/lib/propertyInitOrderChecker.ts && tsgo --project src/tsconfig.defineClassFields.json","update-distro":"node build/npm/update-distro.ts","export-policy-data":"node build/lib/policies/exportPolicyData.ts","web":"echo 'npm run web' is replaced by './scripts/code-server' or './scripts/code-web'","compile-cli":"npm run gulp compile-cli","compile-web":"npm run gulp compile-web","serve-out-rspack":"cd build/rspack && npx rspack serve --config rspack.serve-out.config.mts","watch-web":"npm run gulp watch-web","watch-cli":"npm run gulp watch-cli","eslint":"node build/eslint.ts","stylelint":"node build/stylelint.ts","playwright-install":"npm exec playwright install","compile-build":"npm run gulp compile-build-with-mangling","compile-extensions-build":"npm run gulp compile-extensions-build","minify-vscode":"npm run gulp minify-vscode","minify-vscode-reh":"npm run gulp minify-vscode-reh","minify-vscode-reh-web":"npm run gulp minify-vscode-reh-web","hygiene":"npm run gulp hygiene","core-ci":"npm run gulp core-ci","extensions-ci":"npm run gulp extensions-ci","perf":"node scripts/code-perf.js","perf:chat":"node scripts/chat-simulation/test-chat-perf-regression.js","perf:chat-leak":"node scripts/chat-simulation/test-chat-mem-leaks.js","copilot:setup":"npm --prefix extensions/copilot run setup","copilot:get_token":"npm --prefix extensions/copilot run get_token","update-build-ts-version":"npm install -D typescript@next && npm install -D @typescript/native-preview && (cd build && npm run typecheck)","install-local-component-explorer":"npm install ../vscode-packages/js-component-explorer/dist/vscode-component-explorer-0.1.0.tgz ../vscode-packages/js-component-explorer/dist/vscode-component-explorer-cli-0.1.0.tgz --no-save && cd build/rspack && npm install ../../../vscode-packages/js-component-explorer/dist/vscode-component-explorer-webpack-plugin-0.1.0.tgz --no-save && cd ../vite && npm install ../../../vscode-packages/js-component-explorer/dist/vscode-component-explorer-vite-plugin-0.1.0.tgz --no-save","symlink-local-component-explorer":"npm install ../vscode-packages/js-component-explorer/packages/explorer ../vscode-packages/js-component-explorer/packages/cli --no-save && cd build/rspack && npm install ../../../vscode-packages/js-component-explorer/packages/webpack-plugin ../../../vscode-packages/js-component-explorer/packages/explorer --no-save && cd ../vite && npm install ../../../vscode-packages/js-component-explorer/packages/vite-plugin ../../../vscode-packages/js-component-explorer/packages/explorer --no-save","install-latest-component-explorer":"npm install @vscode/component-explorer@next @vscode/component-explorer-cli@next && cd build/rspack && npm install @vscode/component-explorer-webpack-plugin@next @vscode/component-explorer@next && cd ../vite && npm install @vscode/component-explorer-vite-plugin@next @vscode/component-explorer@next"},"dependencies":{"@anthropic-ai/sdk":"^0.82.0","@github/copilot":"1.0.39","@github/copilot-sdk":"^0.3.0","@microsoft/1ds-core-js":"^3.2.13","@microsoft/1ds-post-js":"^3.2.13","@microsoft/dev-tunnels-connections":"^1.3.41","@microsoft/dev-tunnels-contracts":"^1.3.41","@microsoft/dev-tunnels-management":"^1.3.41","@microsoft/dev-tunnels-ssh":"^3.12.22","@microsoft/dev-tunnels-ssh-tcp":"^3.12.22","@parcel/watcher":"^2.5.6","@types/semver":"^7.5.8","@vscode/codicons":"^0.0.46-6","@vscode/copilot-api":"^0.3.0","@vscode/deviceid":"^0.1.1","@vscode/iconv-lite-umd":"0.7.1","@vscode/native-watchdog":"^1.4.6","@vscode/policy-watcher":"^1.3.2","@vscode/proxy-agent":"^0.41.0","@vscode/ripgrep":"^1.17.1","@vscode/sandbox-runtime":"0.0.1","@vscode/spdlog":"^0.15.8","@vscode/sqlite3":"5.1.12-vscode","@vscode/sudo-prompt":"9.3.2","@vscode/tree-sitter-wasm":"^0.3.1","@vscode/vscode-languagedetection":"1.0.23","@vscode/windows-mutex":"^0.5.0","@vscode/windows-process-tree":"^0.7.0","@vscode/windows-registry":"^1.2.0","@xterm/addon-clipboard":"^0.3.0-beta.197","@xterm/addon-image":"^0.10.0-beta.197","@xterm/addon-ligatures":"^0.11.0-beta.197","@xterm/addon-progress":"^0.3.0-beta.197","@xterm/addon-search":"^0.17.0-beta.197","@xterm/addon-serialize":"^0.15.0-beta.197","@xterm/addon-unicode11":"^0.10.0-beta.197","@xterm/addon-webgl":"^0.20.0-beta.196","@xterm/headless":"^6.1.0-beta.197","@xterm/xterm":"^6.1.0-beta.197","chrome-remote-interface":"^0.33.0","http-proxy-agent":"^7.0.0","https-proxy-agent":"^7.0.2","jschardet":"3.1.4","katex":"^0.16.22","kerberos":"2.1.1","minimist":"^1.2.8","native-is-elevated":"0.9.0","native-keymap":"^3.3.5","node-pty":"^1.2.0-beta.12","open":"^10.1.2","playwright-core":"1.59.1","ssh2":"^1.16.0","tas-client":"0.3.1","undici":"^7.24.0","vscode-oniguruma":"1.7.0","vscode-regexpp":"^3.1.0","vscode-textmate":"^9.3.2","ws":"^8.19.0","yauzl":"^3.0.0","yazl":"^2.4.3"},"devDependencies":{"@playwright/cli":"^0.1.9","@playwright/test":"^1.56.1","@stylistic/eslint-plugin-ts":"^2.8.0","@types/chrome-remote-interface":"^0.33.0","@types/cookie":"^0.3.3","@types/debug":"^4.1.5","@types/eslint":"^9.6.1","@types/gulp-svgmin":"^1.2.1","@types/http-proxy-agent":"^2.0.1","@types/kerberos":"^1.1.2","@types/minimist":"^1.2.1","@types/mocha":"^10.0.10","@types/node":"^22.18.10","@types/sinon":"^10.0.2","@types/sinon-test":"^2.4.2","@types/source-map-support":"^0.5.10","@types/ssh2":"^1.15.4","@types/trusted-types":"^2.0.7","@types/vscode-notebook-renderer":"^1.72.0","@types/wicg-file-system-access":"^2023.10.7","@types/windows-foreground-love":"^0.3.0","@types/winreg":"^1.2.30","@types/ws":"^8.18.1","@types/yauzl":"^2.10.0","@types/yazl":"^2.4.2","@typescript-eslint/utils":"^8.45.0","@typescript/native-preview":"^7.0.0-dev.20260429","@vscode/component-explorer":"^0.2.1-17","@vscode/component-explorer-cli":"^0.2.1-16","@vscode/gulp-electron":"1.41.2","@vscode/l10n-dev":"0.0.35","@vscode/telemetry-extractor":"^1.20.2","@vscode/test-cli":"^0.0.6","@vscode/test-electron":"^2.4.0","@vscode/test-web":"^0.0.76","@vscode/v8-heap-parser":"^0.1.0","@vscode/vscode-perf":"^0.0.19","@webgpu/types":"^0.1.66","ansi-colors":"^3.2.3","asar":"^3.0.3","chromium-pickle-js":"^0.2.0","cookie":"^0.7.2","debounce":"^1.0.0","deemon":"^1.13.6","electron":"39.8.8","eslint":"^9.36.0","eslint-formatter-compact":"^8.40.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"^2.32.0","eslint-plugin-jsdoc":"^50.3.1","event-stream":"3.3.4","fancy-log":"^1.3.3","glob":"^5.0.13","gulp":"^4.0.0","gulp-azure-storage":"^0.12.1","gulp-bom":"^3.0.0","gulp-buffer":"0.0.2","gulp-filter":"^5.1.0","gulp-flatmap":"^1.0.2","gulp-gunzip":"^1.0.0","gulp-gzip":"^1.4.2","gulp-json-editor":"^2.5.0","gulp-plumber":"^1.2.0","gulp-rename":"^1.2.0","gulp-replace":"^0.5.4","gulp-sourcemaps":"^3.0.0","gulp-svgmin":"^4.1.0","husky":"^0.13.1","innosetup":"^6.4.1","istanbul-lib-coverage":"^3.2.0","istanbul-lib-instrument":"^6.0.1","istanbul-lib-report":"^3.0.0","istanbul-lib-source-maps":"^4.0.1","istanbul-reports":"^3.1.5","lazy.js":"^0.4.2","merge-options":"^1.0.1","mime":"^1.4.1","minimatch":"^3.1.5","mocha":"^10.8.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all2":"^8.0.4","os-browserify":"^0.3.0","p-all":"^1.0.0","path-browserify":"^1.0.1","pump":"^1.0.1","rcedit":"^1.1.0","rimraf":"^2.2.8","sinon":"^12.0.1","sinon-test":"^3.1.3","source-map":"0.6.1","source-map-support":"^0.5.21","tar":"^7.5.9","tsec":"0.2.7","tslib":"^2.6.3","typescript":"^6.0.0-dev.20260416","typescript-eslint":"^8.45.0","util":"^0.12.4","xml2js":"^0.5.0","yaserver":"^0.4.0"},"overrides":{"node-gyp-build":"4.8.1","kerberos@2.1.1":{"node-addon-api":"7.1.0"},"serialize-javascript":"^7.0.3","ssh2":{"cpu-features":"0.0.0"}},"repository":{"type":"git","url":"https://github.com/microsoft/vscode.git"},"bugs":{"url":"https://github.com/microsoft/vscode/issues"},"optionalDependencies":{"windows-foreground-love":"0.6.1"},"desktopName":"code.desktop"};Zc.BUILD_INSERT_PACKAGE_CONFIGURATION&&(Zc=Yc("../package.json"));if(process.isEmbeddedApp){_i.parentPolicyConfig={win32RegValueName:_i.win32RegValueName,darwinBundleIdentifier:_i.darwinBundleIdentifier,urlProtocol:_i.urlProtocol};try{let n=Yc("../product.sub.json");_i.embedded&&n.embedded&&(Object.assign(_i.embedded,n.embedded),delete n.embedded),Object.assign(_i,n)}catch{}try{let n=Yc("../package.sub.json");Zc=Object.assign(Zc,n)}catch{}}var Bb={};if(process.env.VSCODE_DEV)try{Bb=Yc("../product.overrides.json"),_i=Object.assign(_i,Bb)}catch{}var Lr=_i,Vb=Zc;hn();(process.env.ELECTRON_RUN_AS_NODE||process.versions.electron)&&sR(`data:text/javascript;base64,${Buffer.from(`
	export async function resolve(specifier, context, nextResolve) {
		if (specifier === 'fs') {
			return {
				format: 'builtin',
				shortCircuit: true,
				url: 'node:original-fs'
			};
		}

		// Defer to the next hook in the chain, which would be the
		// Node.js default resolve if this is the last user-specified loader.
		return nextResolve(specifier, context);
	}`).toString("base64")}`,import.meta.url);globalThis._VSCODE_PRODUCT_JSON={...Lr};globalThis._VSCODE_PACKAGE_JSON={...Vb};globalThis._VSCODE_FILE_ROOT=import.meta.dirname;var Ng;function aR(){return Ng||(Ng=lR()),Ng}async function lR(){Ve("code/willLoadNls");let n,r;if(process.env.VSCODE_NLS_CONFIG)try{n=JSON.parse(process.env.VSCODE_NLS_CONFIG),n?.languagePack?.messagesFile?r=n.languagePack.messagesFile:n?.defaultMessagesFile&&(r=n.defaultMessagesFile),globalThis._VSCODE_NLS_LANGUAGE=n?.resolvedLanguage}catch(e){console.error(`Error reading VSCODE_NLS_CONFIG from environment: ${e}`)}if(!(process.env.VSCODE_DEV||!r)){try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await Cp.promises.readFile(r)).toString())}catch(e){if(console.error(`Error reading NLS messages file ${r}: ${e}`),n?.languagePack?.corruptMarkerFile)try{await Cp.promises.writeFile(n.languagePack.corruptMarkerFile,"corrupted")}catch(t){console.error(`Error writing corrupted NLS marker file: ${t}`)}if(n?.defaultMessagesFile&&n.defaultMessagesFile!==r)try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await Cp.promises.readFile(n.defaultMessagesFile)).toString())}catch(t){console.error(`Error reading default NLS messages file ${n.defaultMessagesFile}: ${t}`)}}return Ve("code/didLoadNls"),n}}async function Hb(){await aR()}var Kk=Fb(Bg(),1);import{app as it,protocol as WF,crashReporter as UF,Menu as NF,contentTracing as BF}from"electron";Vg();_p();hn();we();hn();nr();import{promises as ro}from"fs";async function kv({userLocale:n,osLocale:r,userDataPath:e,commit:t,nlsMetadataPath:i}){if(Ve("code/willGenerateNls"),process.env.VSCODE_DEV||n==="pseudo"||n.startsWith("en")||!t||!e)return wd(n,r,i);try{let o=await ND(e);if(!o)return wd(n,r,i);let s=BD(o,n);if(!s)return wd(n,r,i);let a=o[s],l=a?.translations?.vscode;if(!a||typeof a.hash!="string"||!a.translations||typeof l!="string"||!await Q.exists(l))return wd(n,r,i);let c=`${a.hash}.${s}`,d=N(e,"clp",c),u=N(d,t),f=N(u,"nls.messages.json"),m=N(d,"tcf.json"),v=N(d,"corrupted.info");await Q.exists(v)&&await ro.rm(d,{recursive:!0,force:!0,maxRetries:3});let y={userLocale:n,osLocale:r,resolvedLanguage:s,defaultMessagesFile:N(i,"nls.messages.json"),languagePack:{translationsConfigFile:m,messagesFile:f,corruptMarkerFile:v},locale:n,availableLanguages:{"*":s},_languagePackId:c,_languagePackSupport:!0,_translationsConfigFile:m,_cacheRoot:d,_resolvedLanguagePackCoreLocation:u,_corruptedFile:v};if(await Q.exists(f))return VD(u).catch(()=>{}),Ve("code/didGenerateNls"),y;let[C,w,_]=await Promise.all([ro.readFile(N(i,"nls.keys.json"),"utf-8").then(A=>JSON.parse(A)),ro.readFile(N(i,"nls.messages.json"),"utf-8").then(A=>JSON.parse(A)),ro.readFile(l,"utf-8").then(A=>JSON.parse(A))]),D=[],k=0;for(let[A,de]of C){let L=_.contents[A];for(let J of de)D.push(L?.[J]||w[k]),k++}return await ro.mkdir(u,{recursive:!0}),await Promise.all([ro.writeFile(f,JSON.stringify(D),"utf-8"),ro.writeFile(m,JSON.stringify(a.translations),"utf-8")]),Ve("code/didGenerateNls"),y}catch(o){console.error("Generating translation files failed.",o)}return wd(n,r,i)}async function ND(n){let r=N(n,"languagepacks.json");try{return JSON.parse(await ro.readFile(r,"utf-8"))}catch{return}}function BD(n,r){try{for(;r;){if(n[r])return r;let e=r.lastIndexOf("-");if(e>0)r=r.substring(0,e);else return}}catch(e){console.error("Resolving language pack configuration failed.",e)}}function wd(n,r,e){return Ve("code/didGenerateNls"),{userLocale:n,osLocale:r,resolvedLanguage:"en",defaultMessagesFile:N(e,"nls.messages.json"),locale:n,availableLanguages:{}}}function VD(n){let r=new Date;return ro.utimes(n,r,r)}Ha();Ve("code/didStartMain");Ve("code/willLoadMainBundle",{startTime:Math.floor(FF.timeOrigin)});Ve("code/didLoadMainBundle");var VF=Nb(Lr),Ci=JF(),kg=$F(Ci);Ci.sandbox&&!Ci["disable-chromium-sandbox"]&&!kg["disable-chromium-sandbox"]?it.enableSandbox():it.commandLine.hasSwitch("no-sandbox")&&!it.commandLine.hasSwitch("disable-gpu-sandbox")?it.commandLine.appendSwitch("disable-gpu-sandbox"):(it.commandLine.appendSwitch("no-sandbox"),it.commandLine.appendSwitch("disable-gpu-sandbox"));var zc=ed(Ci,Lr.nameShort??"code-oss-dev");if(process.platform==="win32"){let n=hf(zc);n&&io(n)}it.setPath("userData",zc);var Hk=XF();NF.setApplicationMenu(null);Ve("code/willStartCrashReporter");(Ci["crash-reporter-directory"]||kg["enable-crash-reporter"]&&!Ci["disable-crash-reporter"])&&jF();Ve("code/didStartCrashReporter");VF.isPortable&&it.setAppLogsPath(Bi.join(zc,"logs"));WF.registerSchemesAsPrivileged([{scheme:"vscode-webview",privileges:{standard:!0,secure:!0,supportFetchAPI:!0,corsEnabled:!0,allowServiceWorkers:!0,codeCache:!0}},{scheme:"vscode-file",privileges:{secure:!0,standard:!0,supportFetchAPI:!0,corsEnabled:!0,codeCache:!0}}]);QF();var _b,kb=zk((it.getPreferredSystemLanguages()?.[0]??"en").toLowerCase()),wp=eW(kg);wp&&(_b=kv({userLocale:wp,osLocale:kb,commit:Lr.commit,userDataPath:zc,nlsMetadataPath:import.meta.dirname}));if(process.platform==="win32"||process.platform==="linux"){let n=!wp||wp==="qps-ploc"?"en":wp;it.commandLine.appendSwitch("lang",n)}it.once("ready",function(){if(Ci.trace){let n;if(Ci["trace-memory-infra"]){let r=Ci["trace-category-filter"]?.split(",")||[];r.push("disabled-by-default-memory-infra","disabled-by-default-memory-infra.v8.code_stats"),n={included_categories:r,excluded_categories:["*"],memory_dump_config:{allowed_dump_modes:["light","detailed"],triggers:[{type:"periodic_interval",mode:"detailed",min_time_between_dumps_ms:1e4},{type:"periodic_interval",mode:"light",min_time_between_dumps_ms:1e3}]}}}else n={categoryFilter:Ci["trace-category-filter"]||"*",traceOptions:Ci["trace-options"]||"record-until-full,enable-sampling"};BF.startRecording(n).finally(()=>$k())}else $k()});async function $k(){Ve("code/mainAppReady");try{let[,n]=await Promise.all([YF(Hk),ZF()]);await HF(Hk,n)}catch(n){console.error(n)}}async function HF(n,r){process.env.VSCODE_NLS_CONFIG=JSON.stringify(r),process.env.VSCODE_CODE_CACHE_PATH=n||"",await Hb(),await Promise.resolve().then(()=>(Vk(),OF)),Ve("code/didRunMainBundle")}function $F(n){let r=["disable-hardware-acceleration","force-color-profile","disable-lcd-text","proxy-bypass-list","remote-debugging-port"];process.platform==="linux"&&(r.push("force-renderer-accessibility"),r.push("password-store"));let e=["enable-proposed-api","log-level","use-inmemory-secretstorage","enable-rdp-display-tracking"],t=qF();Object.keys(t).forEach(l=>{let c=t[l];if(r.indexOf(l)!==-1){if(c===!0||c==="true")l==="disable-hardware-acceleration"?it.disableHardwareAcceleration():it.commandLine.appendSwitch(l);else if(typeof c=="string"&&c)if(l==="password-store"){let d=c;(c==="gnome"||c==="gnome-keyring")&&(d="gnome-libsecret"),it.commandLine.appendSwitch(l,d)}else it.commandLine.appendSwitch(l,c)}else if(e.indexOf(l)!==-1)switch(l){case"enable-proposed-api":Array.isArray(c)?c.forEach(d=>d&&typeof d=="string"&&process.argv.push("--enable-proposed-api",d)):console.error("Unexpected value for `enable-proposed-api` in argv.json. Expected array of extension ids.");break;case"log-level":if(typeof c=="string")process.argv.push("--log",c);else if(Array.isArray(c))for(let d of c)process.argv.push("--log",d);break;case"use-inmemory-secretstorage":c&&process.argv.push("--use-inmemory-secretstorage");break;case"enable-rdp-display-tracking":c&&process.argv.push("--enable-rdp-display-tracking");break}});let i=`NetAdapterMaxBufSizeFeature:NetAdapterMaxBufSize/8192,DocumentPolicyIncludeJSCallStacksInCrashReports,EarlyEstablishGpuChannel,EstablishGpuChannelAsync,${it.commandLine.getSwitchValue("enable-features")}`;it.commandLine.appendSwitch("enable-features",i);let o=`CalculateNativeWinOcclusion,${it.commandLine.getSwitchValue("disable-features")}`;it.commandLine.appendSwitch("disable-features",o);let s=`FontMatchingCTMigration,StandardizedBrowserZoom,${it.commandLine.getSwitchValue("disable-blink-features")}`;it.commandLine.appendSwitch("disable-blink-features",s);let a=GF(n,t);return a&&it.commandLine.appendSwitch("js-flags",a),it.commandLine.appendSwitch("xdg-portal-required-version","4"),it.commandLine.appendSwitch("max-active-webgl-contexts","32"),t}function qF(){let n=zF(),r;try{r=Tp(Vi.readFileSync(n).toString())}catch(e){e&&e.code==="ENOENT"?KF(n):console.warn(`Unable to read argv.json configuration file in ${n}, falling back to defaults (${e})`)}return r||(r={}),r}function KF(n){try{let r=Bi.dirname(n);Vi.existsSync(r)||Vi.mkdirSync(r),Vi.writeFileSync(n,["// This configuration file allows you to pass permanent command line arguments to VS Code.","// Only a subset of arguments is currently supported to reduce the likelihood of breaking","// the installation.","//","// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT","//","// NOTE: Changing this file requires a restart of VS Code.","{","	// Use software rendering instead of hardware accelerated rendering.","	// This can help in cases where you see rendering issues in VS Code.",'	// "disable-hardware-acceleration": true',"}"].join(`
`))}catch(r){console.error(`Unable to create argv.json configuration file in ${n}, falling back to defaults (${r})`)}}function zF(){let n=process.env.VSCODE_PORTABLE;if(n)return Bi.join(n,"argv.json");let r=Lr.dataFolderName;return process.env.VSCODE_DEV&&(r=`${r}-dev`),Bi.join(qk.homedir(),r,"argv.json")}function jF(){let n=Ci["crash-reporter-directory"],r="";if(n){if(n=Bi.normalize(n),Bi.isAbsolute(n)||(console.error(`The path '${n}' specified for --crash-reporter-directory must be absolute.`),it.exit(1)),!Vi.existsSync(n))try{Vi.mkdirSync(n,{recursive:!0})}catch{console.error(`The path '${n}' specified for --crash-reporter-directory does not seem to exist or cannot be created.`),it.exit(1)}console.log(`Found --crash-reporter-directory argument. Setting crashDumps directory to be '${n}'`),it.setPath("crashDumps",n)}else{let o=Lr.appCenter;if(o){let s=process.platform==="win32",a=process.platform==="linux",l=process.platform==="darwin",c=kg["crash-reporter-id"];if(c&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(c)){if(s)switch(process.arch){case"x64":r=o["win32-x64"];break;case"arm64":r=o["win32-arm64"];break}else if(l)if(Lr.darwinUniversalAssetId)r=o["darwin-universal"];else switch(process.arch){case"x64":r=o.darwin;break;case"arm64":r=o["darwin-arm64"];break}else a&&(r=o["linux-x64"]);r=r.concat("&uid=",c,"&iid=",c,"&sid=",c);let u=process.argv,f=u.indexOf("--");f===-1?u.push("--crash-reporter-id",c):u.splice(f,0,"--crash-reporter-id",c)}}}let e=(Lr.crashReporter?Lr.crashReporter.productName:void 0)||Lr.nameShort,t=(Lr.crashReporter?Lr.crashReporter.companyName:void 0)||"Microsoft",i=!!(!process.env.VSCODE_DEV&&r&&!n);UF.start({companyName:t,productName:process.env.VSCODE_DEV?`${e} Dev`:e,submitURL:r,uploadToServer:i,compress:!0,ignoreSystemCrashHandler:!0})}function GF(n,r){let e=[];return n["js-flags"]&&e.push(n["js-flags"]),typeof r["js-flags"]=="string"&&r["js-flags"]&&e.push(r["js-flags"]),process.platform==="linux"&&e.push("--nodecommit_pooled_pages"),e.length>0?e.join(" "):null}function JF(){return(0,Kk.default)(process.argv,{string:["user-data-dir","locale","js-flags","crash-reporter-directory"],boolean:["disable-chromium-sandbox"],default:{sandbox:!0},alias:{"no-sandbox":"sandbox"}})}function QF(){let n=[];globalThis.macOpenFiles=n,it.on("open-file",function(t,i){n.push(i)});let r=[],e=function(t,i){t.preventDefault(),r.push(i)};it.on("will-finish-launching",function(){it.on("open-url",e)}),globalThis.getOpenUrls=function(){return it.removeListener("open-url",e),r}}function XF(){if(process.argv.indexOf("--no-cached-data")>0||process.env.VSCODE_DEV)return;let n=Lr.commit;if(n)return Bi.join(zc,"CachedData",n)}async function YF(n){if(typeof n=="string")try{return await Vi.promises.mkdir(n,{recursive:!0}),n}catch{}}function zk(n){if(n.startsWith("zh")){let r=n.split("-")[1];return["hans","cn","sg","my"].includes(r)?"zh-cn":"zh-tw"}return n}async function ZF(){let n=_b?await _b:void 0;if(n)return n;let r=it.getLocale();return r?(r=zk(r.toLowerCase()),kv({userLocale:r,osLocale:kb,commit:Lr.commit,userDataPath:zc,nlsMetadataPath:import.meta.dirname})):{userLocale:"en",osLocale:kb,resolvedLanguage:"en",defaultMessagesFile:Bi.join(import.meta.dirname,"nls.messages.json"),locale:"en",availableLanguages:{}}}function eW(n){let r=Ci.locale;return r?r.toLowerCase():typeof n?.locale=="string"?n.locale.toLowerCase():void 0}
//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/8b640eef5a6c6089c029249d48efa5c99adf7d51/core/main.js.map
