| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619 |
- /*!--------------------------------------------------------
- * 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 t4=Object.create;var Sg=Object.defineProperty;var dR=Object.getOwnPropertyDescriptor;var n4=Object.getOwnPropertyNames;var r4=Object.getPrototypeOf,o4=Object.prototype.hasOwnProperty;var uR=o=>{throw TypeError(o)};var y=(o,t)=>()=>(o&&(t=o(o=0)),t);var i4=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),s4=(o,t)=>{for(var e in t)Sg(o,e,{get:t[e],enumerable:!0})},a4=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of n4(t))!o4.call(o,r)&&r!==e&&Sg(o,r,{get:()=>t[r],enumerable:!(n=dR(t,r))||n.enumerable});return o};var pR=(o,t,e)=>(e=o!=null?t4(r4(o)):{},a4(t||!o||!o.__esModule?Sg(e,"default",{value:o,enumerable:!0}):e,o));var E=(o,t,e,n)=>{for(var r=n>1?void 0:n?dR(t,e):t,i=o.length-1,s;i>=0;i--)(s=o[i])&&(r=(n?s(t,e,r):s(r))||r);return n&&r&&Sg(t,e,r),r},b=(o,t)=>(e,n)=>t(e,n,o);var dx=(o,t,e)=>t.has(o)||uR("Cannot "+e);var Kt=(o,t,e)=>(dx(o,t,"read from private field"),e?e.call(o):t.get(o)),fc=(o,t,e)=>t.has(o)?uR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),rp=(o,t,e,n)=>(dx(o,t,"write to private field"),n?n.call(o,e):t.set(o,e),e),op=(o,t,e)=>(dx(o,t,"access private method"),e);var ux=i4((i$,gR)=>{"use strict";function l4(o,t){var e=o;t.slice(0,-1).forEach(function(r){e=e[r]||{}});var n=t[t.length-1];return n in e}function mR(o){return typeof o=="number"||/^0x[0-9a-f]+$/i.test(o)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(o)}function fR(o,t){return t==="constructor"&&typeof o[t]=="function"||t==="__proto__"}gR.exports=function(o,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(M){e.bools[M]=!0});var n={};function r(M){return n[M].some(function(B){return e.bools[B]})}Object.keys(t.alias||{}).forEach(function(M){n[M]=[].concat(t.alias[M]),n[M].forEach(function(B){n[B]=[M].concat(n[M].filter(function(He){return B!==He}))})}),[].concat(t.string).filter(Boolean).forEach(function(M){e.strings[M]=!0,n[M]&&[].concat(n[M]).forEach(function(B){e.strings[B]=!0})});var i=t.default||{},s={_:[]};function a(M,B){return e.allBools&&/^--[^=]+$/.test(B)||e.strings[M]||e.bools[M]||n[M]}function l(M,B,He){for(var U=M,Y=0;Y<B.length-1;Y++){var G=B[Y];if(fR(U,G))return;U[G]===void 0&&(U[G]={}),(U[G]===Object.prototype||U[G]===Number.prototype||U[G]===String.prototype)&&(U[G]={}),U[G]===Array.prototype&&(U[G]=[]),U=U[G]}var W=B[B.length-1];fR(U,W)||((U===Object.prototype||U===Number.prototype||U===String.prototype)&&(U={}),U===Array.prototype&&(U=[]),U[W]===void 0||e.bools[W]||typeof U[W]=="boolean"?U[W]=He:Array.isArray(U[W])?U[W].push(He):U[W]=[U[W],He])}function c(M,B,He){if(!(He&&e.unknownFn&&!a(M,He)&&e.unknownFn(He)===!1)){var U=!e.strings[M]&&mR(B)?Number(B):B;l(s,M.split("."),U),(n[M]||[]).forEach(function(Y){l(s,Y.split("."),U)})}}Object.keys(e.bools).forEach(function(M){c(M,i[M]===void 0?!1:i[M])});var u=[];o.indexOf("--")!==-1&&(u=o.slice(o.indexOf("--")+1),o=o.slice(0,o.indexOf("--")));for(var p=0;p<o.length;p++){var m=o[p],g,h;if(/^--.+=/.test(m)){var v=m.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var x=v[2];e.bools[g]&&(x=x!=="false"),c(g,x,m)}else if(/^--no-.+/.test(m))g=m.match(/^--no-(.+)/)[1],c(g,!1,m);else if(/^--.+/.test(m))g=m.match(/^--(.+)/)[1],h=o[p+1],h!==void 0&&!/^(-|--)[^-]/.test(h)&&!e.bools[g]&&!e.allBools&&(!n[g]||!r(g))?(c(g,h,m),p+=1):/^(true|false)$/.test(h)?(c(g,h==="true",m),p+=1):c(g,e.strings[g]?"":!0,m);else if(/^-[^-]+/.test(m)){for(var T=m.slice(1,-1).split(""),w=!1,k=0;k<T.length;k++){if(h=m.slice(k+2),h==="-"){c(T[k],h,m);continue}if(/[A-Za-z]/.test(T[k])&&h[0]==="="){c(T[k],h.slice(1),m),w=!0;break}if(/[A-Za-z]/.test(T[k])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(h)){c(T[k],h,m),w=!0;break}if(T[k+1]&&T[k+1].match(/\W/)){c(T[k],m.slice(k+2),m),w=!0;break}else c(T[k],e.strings[T[k]]?"":!0,m)}g=m.slice(-1)[0],!w&&g!=="-"&&(o[p+1]&&!/^(-|--)[^-]/.test(o[p+1])&&!e.bools[g]&&(!n[g]||!r(g))?(c(g,o[p+1],m),p+=1):o[p+1]&&/^(true|false)$/.test(o[p+1])?(c(g,o[p+1]==="true",m),p+=1):c(g,e.strings[g]?"":!0,m))}else if((!e.unknownFn||e.unknownFn(m)!==!1)&&s._.push(e.strings._||!mR(m)?m:Number(m)),t.stopEarly){s._.push.apply(s._,o.slice(p+1));break}}return Object.keys(i).forEach(function(M){l4(s,M.split("."))||(l(s,M.split("."),i[M]),(n[M]||[]).forEach(function(B){l(s,B.split("."),i[M])}))}),t["--"]?s["--"]=u.slice():u.forEach(function(M){s._.push(M)}),s}});function px(o){let t=[];typeof o=="number"&&t.push("code/timeOrigin",o);function e(i,s){t.push(i,s?.startTime??Date.now())}function n(){let i=[];for(let s=0;s<t.length;s+=2)i.push({name:t[s],startTime:t[s+1]});return i}function r(i){if(typeof i>"u"){let s=t.length>=2&&t[0]==="code/timeOrigin",a=s?t[1]:void 0;t.length=0,s&&t.push("code/timeOrigin",a)}else for(let s=t.length-2;s>=0;s-=2)t[s]===i&&t.splice(s,2)}return{mark:e,getMarks:n,clearMarks:r}}function m4(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?px():{mark(o,t){performance.mark(o,t)},clearMarks(o){performance.clearMarks(o)},getMarks(){let o=performance.timeOrigin;typeof o!="number"&&(o=(performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart)??0);let t=[{name:"code/timeOrigin",startTime:Math.round(o)}];for(let e of performance.getEntriesByType("mark"))t.push({name:e.name,startTime:Math.round(o+e.startTime)});return t}};if(typeof process=="object"){let o=performance?.timeOrigin;return px(o)}else return console.trace("perf-util loaded in UNKNOWN environment"),px()}function f4(o){return o.MonacoPerformanceMarks||(o.MonacoPerformanceMarks=m4()),o.MonacoPerformanceMarks}var mx,Ot,d$,xR,zo=y(()=>{mx=f4(globalThis),Ot=mx.mark,d$=mx.clearMarks,xR=mx.getMarks});function y4(){return globalThis._VSCODE_NLS_MESSAGES}function gx(){return globalThis._VSCODE_NLS_LANGUAGE}function wg(o,t){let e;return t.length===0?e=o:e=o.replace(/\{(\d+)\}/g,(n,r)=>{let i=r[0],s=t[i],a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),b4&&(e="\uFF3B"+e.replace(/[aouei]/g,"$&$&")+"\uFF3D"),e}function d(o,t,...e){return wg(typeof o=="number"?ER(o,t):t,e)}function ER(o,t){let e=y4()?.[o];if(typeof e!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return e}function hx(o,t,...e){let n;typeof o=="number"?n=ER(o,t):n=t;let r=wg(n,e);return{value:r,original:t===n?r:wg(t,e)}}var b4,pe=y(()=>{b4=gx()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0});function kg(o){switch(o){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}var zi,lp,cp,ap,CR,TR,vx,I4,yx,x4,PR,Cg,Tg,wR,S4,$i,Gi,Mr,kR,E4,Pg,te,rt,_e,RR,Rg,Yt,w4,DR,_R,LR,Go,fi,Cn,C4,T4,MR,Or,dp,OR,AR,Dg,g$,me=y(()=>{pe();zi="en",lp=!1,cp=!1,ap=!1,CR=!1,TR=!1,vx=!1,I4=!1,yx=!1,x4=!1,PR=!1,Tg=zi,wR=zi,Gi=globalThis;typeof Gi.vscode<"u"&&typeof Gi.vscode.process<"u"?Mr=Gi.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Mr=process);kR=typeof Mr?.versions?.electron=="string",E4=kR&&Mr?.type==="renderer";if(typeof Mr=="object"){lp=Mr.platform==="win32",cp=Mr.platform==="darwin",ap=Mr.platform==="linux",CR=ap&&!!Mr.env.SNAP&&!!Mr.env.SNAP_REVISION,I4=kR,x4=!!Mr.env.CI||!!Mr.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!Mr.env.GITHUB_WORKSPACE,Cg=zi,Tg=zi;let o=Mr.env.VSCODE_NLS_CONFIG;if(o)try{let t=JSON.parse(o);Cg=t.userLocale,wR=t.osLocale,Tg=t.resolvedLanguage||zi,S4=t.languagePack?.translationsConfigFile}catch{}TR=!0}else typeof navigator=="object"&&!E4?($i=navigator.userAgent,lp=$i.indexOf("Windows")>=0,cp=$i.indexOf("Macintosh")>=0,yx=($i.indexOf("Macintosh")>=0||$i.indexOf("iPad")>=0||$i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ap=$i.indexOf("Linux")>=0,PR=$i?.indexOf("Mobi")>=0,vx=!0,Tg=gx()||zi,Cg=navigator.language.toLowerCase(),wR=Cg):console.error("Unable to resolve platform.");Pg=0;cp?Pg=1:lp?Pg=3:ap&&(Pg=2);te=lp,rt=cp,_e=ap,RR=CR,Rg=TR,Yt=vx,w4=vx&&typeof Gi.importScripts=="function",DR=w4?Gi.origin:void 0,_R=yx,LR=PR,Go=Pg,fi=$i,Cn=Tg;(n=>{function o(){return Cn}n.value=o;function t(){return Cn.length===2?Cn==="en":Cn.length>=3?Cn[0]==="e"&&Cn[1]==="n"&&Cn[2]==="-":!1}n.isDefaultVariant=t;function e(){return Cn==="en"}n.isDefault=e})(C4||={});T4=typeof Gi.postMessage=="function"&&!Gi.importScripts,MR=(()=>{if(T4){let o=[];Gi.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let n=0,r=o.length;n<r;n++){let i=o[n];if(i.id===e.data.vscodeScheduleAsyncWork){o.splice(n,1),i.callback();return}}});let t=0;return e=>{let n=++t;o.push({id:n,callback:e}),Gi.postMessage({vscodeScheduleAsyncWork:n},"*")}}return o=>setTimeout(o)})(),Or=cp||yx?2:lp?1:3,dp=!!(fi&&fi.indexOf("Chrome")>=0),OR=!!(fi&&fi.indexOf("Firefox")>=0),AR=!!(!dp&&fi&&fi.indexOf("Safari")>=0),Dg=!!(fi&&fi.indexOf("Edg/")>=0),g$=!!(fi&&fi.indexOf("Android")>=0)});var Ga,bx,to,tn,_g,Lg,no=y(()=>{me();bx=globalThis.vscode;if(typeof bx<"u"&&typeof bx.process<"u"){let o=bx.process;Ga={get platform(){return o.platform},get arch(){return o.arch},get env(){return o.env},cwd(){return o.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Ga={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Ga={get platform(){return te?"win32":rt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};to=Ga.cwd,tn=Ga.env,_g=Ga.platform,Lg=Ga.arch});function L4(o,t){if(o===null||typeof o!="object")throw new Mg(t,"Object",o)}function dn(o,t){if(typeof o!="string")throw new Mg(t,"string",o)}function Ge(o){return o===Wn||o===Ar}function xx(o){return o===Wn}function Ki(o){return o>=P4&&o<=R4||o>=k4&&o<=D4}function Og(o,t,e,n){let r="",i=0,s=-1,a=0,l=0;for(let c=0;c<=o.length;++c){if(c<o.length)l=o.charCodeAt(c);else{if(n(l))break;l=Wn}if(n(l)){if(!(s===c-1||a===1))if(a===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==qa||r.charCodeAt(r.length-2)!==qa){if(r.length>2){let u=r.lastIndexOf(e);u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf(e)),s=c,a=0;continue}else if(r.length!==0){r="",i=0,s=c,a=0;continue}}t&&(r+=r.length>0?`${e}..`:"..",i=2)}else r.length>0?r+=`${e}${o.slice(s+1,c)}`:r=o.slice(s+1,c),i=c-s-1;s=c,a=0}else l===qa&&a!==-1?++a:a=-1}return r}function M4(o){return o?`${o[0]==="."?"":"."}${o}`:""}function NR(o,t){L4(t,"pathObject");let e=t.dir||t.root,n=t.base||`${t.name||""}${M4(t.ext)}`;return e?e===t.root?`${e}${n}`:`${e}${o}${n}`:n}var P4,k4,R4,D4,qa,Wn,Ar,qi,_4,Mg,Nr,nn,O4,We,In,ro,H,Bn,ji,Ct,at,qo,y$,b$,I$,Zt,Ds,Le=y(()=>{no();P4=65,k4=97,R4=90,D4=122,qa=46,Wn=47,Ar=92,qi=58,_4=63,Mg=class extends Error{constructor(t,e,n){let r;typeof e=="string"&&e.indexOf("not ")===0?(r="must not be",e=e.replace(/^not /,"")):r="must be";let i=t.indexOf(".")!==-1?"property":"argument",s=`The "${t}" ${i} ${r} of type ${e}`;s+=`. Received type ${typeof n}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}};Nr=_g==="win32";nn={resolve(...o){let t="",e="",n=!1;for(let r=o.length-1;r>=-1;r--){let i;if(r>=0){if(i=o[r],dn(i,`paths[${r}]`),i.length===0)continue}else t.length===0?i=to():(i=tn[`=${t}`]||to(),(i===void 0||i.slice(0,2).toLowerCase()!==t.toLowerCase()&&i.charCodeAt(2)===Ar)&&(i=`${t}\\`));let s=i.length,a=0,l="",c=!1,u=i.charCodeAt(0);if(s===1)Ge(u)&&(a=1,c=!0);else if(Ge(u))if(c=!0,Ge(i.charCodeAt(1))){let p=2,m=p;for(;p<s&&!Ge(i.charCodeAt(p));)p++;if(p<s&&p!==m){let g=i.slice(m,p);for(m=p;p<s&&Ge(i.charCodeAt(p));)p++;if(p<s&&p!==m){for(m=p;p<s&&!Ge(i.charCodeAt(p));)p++;(p===s||p!==m)&&(l=`\\\\${g}\\${i.slice(m,p)}`,a=p)}}}else a=1;else Ki(u)&&i.charCodeAt(1)===qi&&(l=i.slice(0,2),a=2,s>2&&Ge(i.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(e=`${i.slice(a)}\\${e}`,n=c,c&&t.length>0)break}return e=Og(e,!n,"\\",Ge),n?`${t}\\${e}`:`${t}${e}`||"."},normalize(o){dn(o,"path");let t=o.length;if(t===0)return".";let e=0,n,r=!1,i=o.charCodeAt(0);if(t===1)return xx(i)?"\\":o;if(Ge(i))if(r=!0,Ge(o.charCodeAt(1))){let a=2,l=a;for(;a<t&&!Ge(o.charCodeAt(a));)a++;if(a<t&&a!==l){let c=o.slice(l,a);for(l=a;a<t&&Ge(o.charCodeAt(a));)a++;if(a<t&&a!==l){for(l=a;a<t&&!Ge(o.charCodeAt(a));)a++;if(a===t)return`\\\\${c}\\${o.slice(l)}\\`;a!==l&&(n=`\\\\${c}\\${o.slice(l,a)}`,e=a)}}}else e=1;else Ki(i)&&o.charCodeAt(1)===qi&&(n=o.slice(0,2),e=2,t>2&&Ge(o.charCodeAt(2))&&(r=!0,e=3));let s=e<t?Og(o.slice(e),!r,"\\",Ge):"";if(s.length===0&&!r&&(s="."),s.length>0&&Ge(o.charCodeAt(t-1))&&(s+="\\"),!r&&n===void 0&&o.includes(":")){if(s.length>=2&&Ki(s.charCodeAt(0))&&s.charCodeAt(1)===qi)return`.\\${s}`;let a=o.indexOf(":");do if(a===t-1||Ge(o.charCodeAt(a+1)))return`.\\${s}`;while((a=o.indexOf(":",a+1))!==-1)}return n===void 0?r?`\\${s}`:s:r?`${n}\\${s}`:`${n}${s}`},isAbsolute(o){dn(o,"path");let t=o.length;if(t===0)return!1;let e=o.charCodeAt(0);return Ge(e)||t>2&&Ki(e)&&o.charCodeAt(1)===qi&&Ge(o.charCodeAt(2))},join(...o){if(o.length===0)return".";let t,e;for(let i=0;i<o.length;++i){let s=o[i];dn(s,"path"),s.length>0&&(t===void 0?t=e=s:t+=`\\${s}`)}if(t===void 0)return".";let n=!0,r=0;if(typeof e=="string"&&Ge(e.charCodeAt(0))){++r;let i=e.length;i>1&&Ge(e.charCodeAt(1))&&(++r,i>2&&(Ge(e.charCodeAt(2))?++r:n=!1))}if(n){for(;r<t.length&&Ge(t.charCodeAt(r));)r++;r>=2&&(t=`\\${t.slice(r)}`)}return nn.normalize(t)},relative(o,t){if(dn(o,"from"),dn(t,"to"),o===t)return"";let e=nn.resolve(o),n=nn.resolve(t);if(e===n||(o=e.toLowerCase(),t=n.toLowerCase(),o===t))return"";if(e.length!==o.length||n.length!==t.length){let h=e.split("\\"),v=n.split("\\");h[h.length-1]===""&&h.pop(),v[v.length-1]===""&&v.pop();let x=h.length,T=v.length,w=x<T?x:T,k;for(k=0;k<w&&h[k].toLowerCase()===v[k].toLowerCase();k++);return k===0?n:k===w?T>w?v.slice(k).join("\\"):x>w?"..\\".repeat(x-1-k)+"..":"":"..\\".repeat(x-k)+v.slice(k).join("\\")}let r=0;for(;r<o.length&&o.charCodeAt(r)===Ar;)r++;let i=o.length;for(;i-1>r&&o.charCodeAt(i-1)===Ar;)i--;let s=i-r,a=0;for(;a<t.length&&t.charCodeAt(a)===Ar;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===Ar;)l--;let c=l-a,u=s<c?s:c,p=-1,m=0;for(;m<u;m++){let h=o.charCodeAt(r+m);if(h!==t.charCodeAt(a+m))break;h===Ar&&(p=m)}if(m!==u){if(p===-1)return n}else{if(c>u){if(t.charCodeAt(a+m)===Ar)return n.slice(a+m+1);if(m===2)return n.slice(a+m)}s>u&&(o.charCodeAt(r+m)===Ar?p=m:m===2&&(p=3)),p===-1&&(p=0)}let g="";for(m=r+p+1;m<=i;++m)(m===i||o.charCodeAt(m)===Ar)&&(g+=g.length===0?"..":"\\..");return a+=p,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Ar&&++a,n.slice(a,l))},toNamespacedPath(o){if(typeof o!="string"||o.length===0)return o;let t=nn.resolve(o);if(t.length<=2)return o;if(t.charCodeAt(0)===Ar){if(t.charCodeAt(1)===Ar){let e=t.charCodeAt(2);if(e!==_4&&e!==qa)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Ki(t.charCodeAt(0))&&t.charCodeAt(1)===qi&&t.charCodeAt(2)===Ar)return`\\\\?\\${t}`;return t},dirname(o){dn(o,"path");let t=o.length;if(t===0)return".";let e=-1,n=0,r=o.charCodeAt(0);if(t===1)return Ge(r)?o:".";if(Ge(r)){if(e=n=1,Ge(o.charCodeAt(1))){let a=2,l=a;for(;a<t&&!Ge(o.charCodeAt(a));)a++;if(a<t&&a!==l){for(l=a;a<t&&Ge(o.charCodeAt(a));)a++;if(a<t&&a!==l){for(l=a;a<t&&!Ge(o.charCodeAt(a));)a++;if(a===t)return o;a!==l&&(e=n=a+1)}}}}else Ki(r)&&o.charCodeAt(1)===qi&&(e=t>2&&Ge(o.charCodeAt(2))?3:2,n=e);let i=-1,s=!0;for(let a=t-1;a>=n;--a)if(Ge(o.charCodeAt(a))){if(!s){i=a;break}}else s=!1;if(i===-1){if(e===-1)return".";i=e}return o.slice(0,i)},basename(o,t){t!==void 0&&dn(t,"suffix"),dn(o,"path");let e=0,n=-1,r=!0,i;if(o.length>=2&&Ki(o.charCodeAt(0))&&o.charCodeAt(1)===qi&&(e=2),t!==void 0&&t.length>0&&t.length<=o.length){if(t===o)return"";let s=t.length-1,a=-1;for(i=o.length-1;i>=e;--i){let l=o.charCodeAt(i);if(Ge(l)){if(!r){e=i+1;break}}else a===-1&&(r=!1,a=i+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return e===n?n=a:n===-1&&(n=o.length),o.slice(e,n)}for(i=o.length-1;i>=e;--i)if(Ge(o.charCodeAt(i))){if(!r){e=i+1;break}}else n===-1&&(r=!1,n=i+1);return n===-1?"":o.slice(e,n)},extname(o){dn(o,"path");let t=0,e=-1,n=0,r=-1,i=!0,s=0;o.length>=2&&o.charCodeAt(1)===qi&&Ki(o.charCodeAt(0))&&(t=n=2);for(let a=o.length-1;a>=t;--a){let l=o.charCodeAt(a);if(Ge(l)){if(!i){n=a+1;break}continue}r===-1&&(i=!1,r=a+1),l===qa?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||r===-1||s===0||s===1&&e===r-1&&e===n+1?"":o.slice(e,r)},format:NR.bind(null,"\\"),parse(o){dn(o,"path");let t={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return t;let e=o.length,n=0,r=o.charCodeAt(0);if(e===1)return Ge(r)?(t.root=t.dir=o,t):(t.base=t.name=o,t);if(Ge(r)){if(n=1,Ge(o.charCodeAt(1))){let p=2,m=p;for(;p<e&&!Ge(o.charCodeAt(p));)p++;if(p<e&&p!==m){for(m=p;p<e&&Ge(o.charCodeAt(p));)p++;if(p<e&&p!==m){for(m=p;p<e&&!Ge(o.charCodeAt(p));)p++;p===e?n=p:p!==m&&(n=p+1)}}}}else if(Ki(r)&&o.charCodeAt(1)===qi){if(e<=2)return t.root=t.dir=o,t;if(n=2,Ge(o.charCodeAt(2))){if(e===3)return t.root=t.dir=o,t;n=3}}n>0&&(t.root=o.slice(0,n));let i=-1,s=n,a=-1,l=!0,c=o.length-1,u=0;for(;c>=n;--c){if(r=o.charCodeAt(c),Ge(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===qa?i===-1?i=c:u!==1&&(u=1):i!==-1&&(u=-1)}return a!==-1&&(i===-1||u===0||u===1&&i===a-1&&i===s+1?t.base=t.name=o.slice(s,a):(t.name=o.slice(s,i),t.base=o.slice(s,a),t.ext=o.slice(i,a))),s>0&&s!==n?t.dir=o.slice(0,s-1):t.dir=t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},O4=(()=>{if(Nr){let o=/\\/g;return()=>{let t=to().replace(o,"/");return t.slice(t.indexOf("/"))}}return()=>to()})(),We={resolve(...o){let t="",e=!1;for(let n=o.length-1;n>=0&&!e;n--){let r=o[n];dn(r,`paths[${n}]`),r.length!==0&&(t=`${r}/${t}`,e=r.charCodeAt(0)===Wn)}if(!e){let n=O4();t=`${n}/${t}`,e=n.charCodeAt(0)===Wn}return t=Og(t,!e,"/",xx),e?`/${t}`:t.length>0?t:"."},normalize(o){if(dn(o,"path"),o.length===0)return".";let t=o.charCodeAt(0)===Wn,e=o.charCodeAt(o.length-1)===Wn;return o=Og(o,!t,"/",xx),o.length===0?t?"/":e?"./":".":(e&&(o+="/"),t?`/${o}`:o)},isAbsolute(o){return dn(o,"path"),o.length>0&&o.charCodeAt(0)===Wn},join(...o){if(o.length===0)return".";let t=[];for(let e=0;e<o.length;++e){let n=o[e];dn(n,"path"),n.length>0&&t.push(n)}return t.length===0?".":We.normalize(t.join("/"))},relative(o,t){if(dn(o,"from"),dn(t,"to"),o===t||(o=We.resolve(o),t=We.resolve(t),o===t))return"";let e=1,n=o.length,r=n-e,i=1,s=t.length-i,a=r<s?r:s,l=-1,c=0;for(;c<a;c++){let p=o.charCodeAt(e+c);if(p!==t.charCodeAt(i+c))break;p===Wn&&(l=c)}if(c===a)if(s>a){if(t.charCodeAt(i+c)===Wn)return t.slice(i+c+1);if(c===0)return t.slice(i+c)}else r>a&&(o.charCodeAt(e+c)===Wn?l=c:c===0&&(l=0));let u="";for(c=e+l+1;c<=n;++c)(c===n||o.charCodeAt(c)===Wn)&&(u+=u.length===0?"..":"/..");return`${u}${t.slice(i+l)}`},toNamespacedPath(o){return o},dirname(o){if(dn(o,"path"),o.length===0)return".";let t=o.charCodeAt(0)===Wn,e=-1,n=!0;for(let r=o.length-1;r>=1;--r)if(o.charCodeAt(r)===Wn){if(!n){e=r;break}}else n=!1;return e===-1?t?"/":".":t&&e===1?"//":o.slice(0,e)},basename(o,t){t!==void 0&&dn(t,"suffix"),dn(o,"path");let e=0,n=-1,r=!0,i;if(t!==void 0&&t.length>0&&t.length<=o.length){if(t===o)return"";let s=t.length-1,a=-1;for(i=o.length-1;i>=0;--i){let l=o.charCodeAt(i);if(l===Wn){if(!r){e=i+1;break}}else a===-1&&(r=!1,a=i+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(n=i):(s=-1,n=a))}return e===n?n=a:n===-1&&(n=o.length),o.slice(e,n)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===Wn){if(!r){e=i+1;break}}else n===-1&&(r=!1,n=i+1);return n===-1?"":o.slice(e,n)},extname(o){dn(o,"path");let t=-1,e=0,n=-1,r=!0,i=0;for(let s=o.length-1;s>=0;--s){let a=o[s];if(a==="/"){if(!r){e=s+1;break}continue}n===-1&&(r=!1,n=s+1),a==="."?t===-1?t=s:i!==1&&(i=1):t!==-1&&(i=-1)}return t===-1||n===-1||i===0||i===1&&t===n-1&&t===e+1?"":o.slice(t,n)},format:NR.bind(null,"/"),parse(o){dn(o,"path");let t={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return t;let e=o.charCodeAt(0)===Wn,n;e?(t.root="/",n=1):n=0;let r=-1,i=0,s=-1,a=!0,l=o.length-1,c=0;for(;l>=n;--l){let u=o.charCodeAt(l);if(u===Wn){if(!a){i=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===qa?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){let u=i===0&&e?1:i;r===-1||c===0||c===1&&r===s-1&&r===i+1?t.base=t.name=o.slice(u,s):(t.name=o.slice(u,r),t.base=o.slice(u,s),t.ext=o.slice(r,s))}return i>0?t.dir=o.slice(0,i-1):e&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};We.win32=nn.win32=nn;We.posix=nn.posix=We;In=Nr?nn.normalize:We.normalize,ro=Nr?nn.isAbsolute:We.isAbsolute,H=Nr?nn.join:We.join,Bn=Nr?nn.resolve:We.resolve,ji=Nr?nn.relative:We.relative,Ct=Nr?nn.dirname:We.dirname,at=Nr?nn.basename:We.basename,qo=Nr?nn.extname:We.extname,y$=Nr?nn.format:We.format,b$=Nr?nn.parse:We.parse,I$=Nr?nn.toNamespacedPath:We.toNamespacedPath,Zt=Nr?nn.sep:We.sep,Ds=Nr?nn.delimiter:We.delimiter});function WR(o,t){let e=Object.create(null);for(let n of o){let r=t(n),i=e[r];i||(i=e[r]=[]),i.push(n)}return e}var FR,VR,UR,Sx=y(()=>{UR=class{constructor(t,e){this.toKey=e;this._map=new Map;this[FR]="SetWithKey";for(let n of t)this.add(n)}get size(){return this._map.size}add(t){let e=this.toKey(t);return this._map.set(e,t),this}delete(t){return this._map.delete(this.toKey(t))}has(t){return this._map.has(this.toKey(t))}*entries(){for(let t of this._map.values())yield[t,t]}keys(){return this.values()}*values(){for(let t of this._map.values())yield t}clear(){this._map.clear()}forEach(t,e){this._map.forEach(n=>t.call(e,n,n,this))}[(VR=Symbol.iterator,FR=Symbol.toStringTag,VR)](){return this.values()}}});function Ug(o){up.setUnexpectedErrorHandler(o)}function Fg(o){if(!o||typeof o!="object")return!1;let t=o;return t.code==="EPIPE"&&t.syscall?.toUpperCase()==="WRITE"}function _s(o){up.onUnexpectedError(o)}function Ke(o){Tn(o)||up.onUnexpectedError(o)}function Tn(o){return o instanceof Ye?!0:o instanceof Error&&o.name===Ag&&o.message===Ag}function pp(){let o=new Error(Ag);return o.name=o.message,o}function Je(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function Vg(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}function fe(o){return o?o.message?o.message:o.stack?o.stack.split(`
- `)[0]:String(o):"Error"}var Ex,up,Ag,Ye,Ng,ur,$t,Se=y(()=>{Ex=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?ur.isErrorNoTelemetry(t)?new ur(t.message+`
- `+t.stack):new Error(t.message+`
- `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},up=new Ex;Ag="Canceled";Ye=class extends Error{constructor(){super(Ag),this.name=this.message}},Ng=class o extends Error{static{this._name="PendingMigrationError"}static is(t){return t instanceof o||t instanceof Error&&t.name===o._name}constructor(t){super(t),this.name=o._name}};ur=class o extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof o)return t;let e=new o;return e.message=t.message,e.stack=t.stack,e}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},$t=class o extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,o.prototype)}}});function Ka(o,t){let e=this,n=!1,r;return function(){if(n)return r;if(n=!0,t)try{r=o.apply(e,arguments)}finally{t()}else r=o.apply(e,arguments);return r}}var mp=y(()=>{});function A4(o,t,e=0,n=o.length){let r=e,i=n;for(;r<i;){let s=Math.floor((r+i)/2);t(o[s])?r=s+1:i=s}return r-1}var HR,$R=y(()=>{HR=class o{constructor(t){this._array=t;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(t){if(o.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!t(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let e=A4(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=e+1,e===-1?void 0:this._array[e]}}});function mn(o,t,e=(n,r)=>n===r){if(o===t)return!0;if(!o||!t||o.length!==t.length)return!1;for(let n=0,r=o.length;n<r;n++)if(!e(o[n],t[n]))return!1;return!0}function GR(o,t,e){return N4(o.length,n=>e(o[n],t))}function N4(o,t){let e=0,n=o-1;for(;e<=n;){let r=(e+n)/2|0,i=t(r);if(i<0)e=r+1;else if(i>0)n=r-1;else return r}return-(e+1)}function Wg(o,t,e){if(o=o|0,o>=t.length)throw new TypeError("invalid index");let n=t[Math.floor(t.length*Math.random())],r=[],i=[],s=[];for(let a of t){let l=e(a,n);l<0?r.push(a):l>0?i.push(a):s.push(a)}return o<r.length?Wg(o,r,e):o<r.length+s.length?s[0]:Wg(o-(r.length+s.length),i,e)}function Qn(o){return o.filter(t=>!!t)}function qR(o){let t=0;for(let e=0;e<o.length;e++)o[e]&&(o[t]=o[e],t+=1);o.length=t}function ja(o){return Array.isArray(o)&&o.length>0}function pr(o,t=e=>e){let e=new Set;return o.filter(n=>{let r=t(n);return e.has(r)?!1:(e.add(r),!0)})}function wx(o,t){return o.push(t),()=>U4(o,t)}function U4(o,t){let e=o.indexOf(t);if(e>-1)return o.splice(e,1),t}function Cx(o,t){let e;if(typeof t=="number"){let n=t;e=()=>{let r=Math.sin(n++)*179426549;return r-Math.floor(r)}}else e=Math.random;for(let n=o.length-1;n>0;n-=1){let r=Math.floor(e()*(n+1)),i=o[n];o[n]=o[r],o[r]=i}}function Bg(o){return Array.isArray(o)?o:[o]}function KR(o){return o[Math.floor(Math.random()*o.length)]}function QR(o,t){return(e,n)=>t(o(e),o(n))}var jR,JR,zR,At=y(()=>{$R();Se();(a=>{function o(l){return l<0}a.isLessThan=o;function t(l){return l<=0}a.isLessThanOrEqual=t;function e(l){return l>0}a.isGreaterThan=e;function n(l){return l===0}a.isNeitherLessOrGreaterThan=n,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(jR||={});JR=(o,t)=>o-t,zR=class o{constructor(t){this.iterate=t}static{this.empty=new o(t=>{})}forEach(t){this.iterate(e=>(t(e),!0))}toArray(){let t=[];return this.iterate(e=>(t.push(e),!0)),t}filter(t){return new o(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new o(e=>this.iterate(n=>e(t(n))))}some(t){let e=!1;return this.iterate(n=>(e=t(n),!e)),e}findFirst(t){let e;return this.iterate(n=>t(n)?(e=n,!1):!0),e}findLast(t){let e;return this.iterate(n=>(t(n)&&(e=n),!0)),e}findLastMaxBy(t){let e,n=!0;return this.iterate(r=>((n||jR.isGreaterThan(t(r,e)))&&(n=!1,e=r),!0)),e}}});function F4(o){return Array.isArray(o)}var Tx,XR,lt,YR,Ls,ZR,Px,kx,gi,$g,Hn=y(()=>{Tx=class{constructor(t,e){this.uri=t;this.value=e}};lt=class o{constructor(t,e){this[XR]="ResourceMap";if(t instanceof o)this.map=new Map(t.map),this.toKey=e??o.defaultToKey;else if(F4(t)){this.map=new Map,this.toKey=e??o.defaultToKey;for(let[n,r]of t)this.set(n,r)}else this.map=new Map,this.toKey=t??o.defaultToKey}static{this.defaultToKey=t=>t.toString()}set(t,e){return this.map.set(this.toKey(t),new Tx(t,e)),this}get(t){return this.map.get(this.toKey(t))?.value}has(t){return this.map.has(this.toKey(t))}get size(){return this.map.size}clear(){this.map.clear()}delete(t){return this.map.delete(this.toKey(t))}forEach(t,e){typeof e<"u"&&(t=t.bind(e));for(let[n,r]of this.map)t(r.value,r.uri,this)}*values(){for(let t of this.map.values())yield t.value}*keys(){for(let t of this.map.values())yield t.uri}*entries(){for(let t of this.map.values())yield[t.uri,t.value]}*[(XR=Symbol.toStringTag,Symbol.iterator)](){for(let[,t]of this.map)yield[t.uri,t.value]}},Ls=class{constructor(t,e){this[YR]="ResourceSet";!t||typeof t=="function"?this._map=new lt(t):(this._map=new lt(e),t.forEach(this.add,this))}get size(){return this._map.size}add(t){return this._map.set(t,t),this}clear(){this._map.clear()}delete(t){return this._map.delete(t)}forEach(t,e){this._map.forEach((n,r)=>t.call(e,r,r,this))}has(t){return this._map.has(t)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(YR=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},Px=class{constructor(){this[ZR]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(t){return this._map.has(t)}get(t,e=0){let n=this._map.get(t);if(n)return e!==0&&this.touch(n,e),n.value}set(t,e,n=0){let r=this._map.get(t);if(r)r.value=e,n!==0&&this.touch(r,n);else{switch(r={key:t,value:e,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(t,r),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,e){let n=this._state,r=this._head;for(;r;){if(e?t.bind(e)(r.value,r.key,this):t(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let t=this,e=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let t=this,e=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let t=this,e=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(ZR=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._head,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.next,n--;this._head=e,this._size=n,e&&(e.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._tail,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.previous,n--;this._tail=e,this._size=n,e&&(e.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let e=t.next,n=t.previous;if(!e||!n)throw new Error("Invalid list");e.previous=n,n.next=e}t.next=void 0,t.previous=void 0,this._state++}touch(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(t===this._head)return;let n=t.next,r=t.previous;t===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(e===2){if(t===this._tail)return;let n=t.next,r=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((e,n)=>{t.push([n,e])}),t}fromJSON(t){this.clear();for(let[e,n]of t)this.set(e,n)}},kx=class extends Px{constructor(t,e=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,e=2){return super.get(t,e)}peek(t){return super.get(t,0)}set(t,e){return super.set(t,e,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},gi=class extends kx{constructor(t,e=1){super(t,e)}trim(t){this.trimOld(t)}set(t,e){return super.set(t,e),this.checkTrim(),this}},$g=class{constructor(){this.map=new Map}add(t,e){let n=this.map.get(t);n||(n=new Set,this.map.set(t,n)),n.add(e)}delete(t,e){let n=this.map.get(t);n&&(n.delete(e),n.size===0&&this.map.delete(t))}forEach(t,e){let n=this.map.get(t);n&&n.forEach(e)}get(t){let e=this.map.get(t);return e||new Set}}});function zg(o,t){if(!o)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function Qa(o,t="Unreachable"){throw new Error(t)}function gc(o,t="unexpected state"){if(!o)throw typeof t=="string"?new $t(`Assertion Failed: ${t}`):t}function fp(o){if(!o()){debugger;o(),Ke(new $t("Assertion Failed"))}}var hi=y(()=>{Se()});function ne(o){return typeof o=="string"}function Ue(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function e1(o){let t=Object.getPrototypeOf(Uint8Array);return typeof o=="object"&&o instanceof t}function Jn(o){return typeof o=="number"&&!isNaN(o)}function t1(o){return!!o&&typeof o[Symbol.iterator]=="function"}function Pr(o){return o===!0||o===!1}function Xn(o){return typeof o>"u"}function io(o){return!_t(o)}function _t(o){return Xn(o)||o===null}function gp(o){return gc(o!=null,"Argument is `undefined` or `null`."),o}function hc(o){if(!Ue(o))return!1;for(let t in o)if(W4.call(o,t))return!1;return!0}function vc(o){return typeof o=="function"}function n1(o,t){if(ne(t)){if(typeof o!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(vc(t)){try{if(o instanceof t)return}catch{}if(!_t(o)&&o.constructor===t||t.length===1&&t.call(void 0,o)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function ko(o,t){for(let e in t)if(!(e in o))return!1;return!0}var W4,Me=y(()=>{hi();W4=Object.prototype.hasOwnProperty});var fn,Ko=y(()=>{Me();(He=>{function o(U){return!!U&&typeof U=="object"&&typeof U[Symbol.iterator]=="function"}He.is=o;let t=Object.freeze([]);function e(){return t}He.empty=e;function*n(U){yield U}He.single=n;function r(U){return o(U)?U:n(U)}He.wrap=r;function i(U){return U??t}He.from=i;function*s(U){for(let Y=U.length-1;Y>=0;Y--)yield U[Y]}He.reverse=s;function a(U){return!U||U[Symbol.iterator]().next().done===!0}He.isEmpty=a;function l(U){return U[Symbol.iterator]().next().value}He.first=l;function c(U,Y){let G=0;for(let W of U)if(Y(W,G++))return!0;return!1}He.some=c;function u(U,Y){let G=0;for(let W of U)if(!Y(W,G++))return!1;return!0}He.every=u;function p(U,Y){for(let G of U)if(Y(G))return G}He.find=p;function*m(U,Y){for(let G of U)Y(G)&&(yield G)}He.filter=m;function*g(U,Y){let G=0;for(let W of U)yield Y(W,G++)}He.map=g;function*h(U,Y){let G=0;for(let W of U)yield*Y(W,G++)}He.flatMap=h;function*v(...U){for(let Y of U)t1(Y)?yield*Y:yield Y}He.concat=v;function x(U,Y,G){let W=G;for(let ee of U)W=Y(W,ee);return W}He.reduce=x;function T(U){let Y=0;for(let G of U)Y++;return Y}He.length=T;function*w(U,Y,G=U.length){for(Y<-U.length&&(Y=0),Y<0&&(Y+=U.length),G<0?G+=U.length:G>U.length&&(G=U.length);Y<G;Y++)yield U[Y]}He.slice=w;function k(U,Y=Number.POSITIVE_INFINITY){let G=[];if(Y===0)return[G,U];let W=U[Symbol.iterator]();for(let ee=0;ee<Y;ee++){let se=W.next();if(se.done)return[G,He.empty()];G.push(se.value)}return[G,{[Symbol.iterator](){return W}}]}He.consume=k;async function M(U){let Y=[];for await(let G of U)Y.push(G);return Y}He.asyncToArray=M;async function B(U){let Y=[];for await(let G of U)Y=Y.concat(G);return Y}He.asyncToArrayFlat=B})(fn||={})});function H4(o){yc=o}function Ms(o){return yc?.trackDisposable(o),o}function Os(o){yc?.markAsDisposed(o)}function Xa(o,t){yc?.setParent(o,t)}function $4(o,t){if(yc)for(let e of o)yc.setParent(e,t)}function Gg(o){return typeof o=="object"&&o!==null&&typeof o.dispose=="function"&&o.dispose.length===0}function jt(o){if(fn.is(o)){let t=[];for(let e of o)if(e)try{e.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function qg(...o){let t=ie(()=>jt(o));return $4(o,t),t}function ie(o){return new Rx(o)}function o1(o,t){return o.then(e=>(t.isDisposed?e.dispose():t.add(e),e))}var B4,yc,r1,Rx,le,D,mr,Ur,q=y(()=>{At();Sx();Hn();mp();Ko();Se();B4=!1,yc=null,r1=class o{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(t){let e=this.livingDisposables.get(t);return e||(e={parent:null,source:null,isSingleton:!1,value:t,idx:o.idx++},this.livingDisposables.set(t,e)),e}trackDisposable(t){let e=this.getDisposableData(t);e.source||(e.source=new Error().stack)}setParent(t,e){let n=this.getDisposableData(t);n.parent=e}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,e){let n=e.get(t);if(n)return n;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),e):t;return e.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,t).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(t=10,e){let n;if(e)n=e;else{let l=new Map,c=[...this.livingDisposables.values()].filter(p=>p.source!==null&&!this.getRootParent(p,l).isSingleton);if(c.length===0)return;let u=new Set(c.map(p=>p.value));if(n=c.filter(p=>!(p.parent&&u.has(p.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function r(l){function c(p,m){for(;p.length>0&&m.some(g=>typeof g=="string"?g===p[0]:p[0].match(g));)p.shift()}let u=l.source.split(`
- `).map(p=>p.trim().replace("at ","")).filter(p=>p!=="");return c(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}let i=new $g;for(let l of n){let c=r(l);for(let u=0;u<=c.length;u++)i.add(c.slice(0,u).join(`
- `),l)}n.sort(QR(l=>l.idx,JR));let s="",a=0;for(let l of n.slice(0,t)){a++;let c=r(l),u=[];for(let p=0;p<c.length;p++){let m=c[p];m=`(shared with ${i.get(c.slice(0,p+1).join(`
- `)).size}/${n.length} leaks) at ${m}`;let h=i.get(c.slice(0,p).join(`
- `)),v=WR([...h].map(x=>r(x)[p]),x=>x);delete v[c[p]];for(let[x,T]of Object.entries(v))T&&u.unshift(` - stacktraces of ${T.length} other leaks continue with ${x}`);u.unshift(m)}s+=`
- ==================== Leaking disposable ${a}/${n.length}: ${l.value.constructor.name} ====================
- ${u.join(`
- `)}
- ============================================================
- `}return n.length>t&&(s+=`
- ... and ${n.length-t} more leaking disposables
- `),{leaks:n,details:s}}};if(B4){let o="__is_disposable_tracked__";H4(new class{trackDisposable(t){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[o]||console.log(e)},3e3)}setParent(t,e){if(t&&t!==D.None)try{t[o]=!0}catch{}}markAsDisposed(t){if(t&&t!==D.None)try{t[o]=!0}catch{}}markAsSingleton(t){}})}Rx=class{constructor(t){this._isDisposed=!1,this._fn=t,Ms(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,Os(this),this._fn()}}};le=class o{constructor(){this._toDispose=new Set;this._isDisposed=!1;Ms(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Os(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{jt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===D.None)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Xa(t,this),this._isDisposed?o.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.delete(t)&&Xa(t,null)}assertNotDisposed(){this._isDisposed&&Ke(new $t("Object disposed"))}},D=class{constructor(){this._store=new le;Ms(this),Xa(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){Os(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}},mr=class{constructor(){this._isDisposed=!1;Ms(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),t&&Xa(t,this),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Os(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t&&Xa(t,null),t}},Ur=class{constructor(t=new Map){this._isDisposed=!1;this._store=t,Ms(this)}dispose(){Os(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{jt(this._store.values())}finally{this._store.clear()}}has(t){return this._store.has(t)}get size(){return this._store.size}get(t){return this._store.get(t)}set(t,e,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(t)?.dispose(),this._store.set(t,e),Xa(e,this)}deleteAndDispose(t){this._store.get(t)?.dispose(),this._store.delete(t)}deleteAndLeak(t){let e=this._store.get(t);return e&&Xa(e,null),this._store.delete(t),e}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}});var zt,As,Kg=y(()=>{zt=class o{static{this.Undefined=new o(void 0)}constructor(t){this.element=t,this.next=o.Undefined,this.prev=o.Undefined}},As=class{constructor(){this._first=zt.Undefined;this._last=zt.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===zt.Undefined}clear(){let t=this._first;for(;t!==zt.Undefined;){let e=t.next;t.prev=zt.Undefined,t.next=zt.Undefined,t=e}this._first=zt.Undefined,this._last=zt.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new zt(t);if(this._first===zt.Undefined)this._first=n,this._last=n;else if(e){let i=this._last;this._last=n,n.prev=i,i.next=n}else{let i=this._first;this._first=n,n.next=i,i.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==zt.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==zt.Undefined){let t=this._last.element;return this._remove(this._last),t}}peek(){if(this._last!==zt.Undefined)return this._last.element}_remove(t){if(t.prev!==zt.Undefined&&t.next!==zt.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===zt.Undefined&&t.next===zt.Undefined?(this._first=zt.Undefined,this._last=zt.Undefined):t.next===zt.Undefined?(this._last=this._last.prev,this._last.next=zt.Undefined):t.prev===zt.Undefined&&(this._first=this._first.next,this._first.prev=zt.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==zt.Undefined;)yield t.element,t=t.next}}});var z4,Yn,Ns=y(()=>{z4=globalThis.performance.now.bind(globalThis.performance),Yn=class o{static create(t){return new o(t)}constructor(t){this._now=t===!1?Date.now:z4,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 a1(){return!!tn.VSCODE_DEV}function Ax(o,t){t instanceof le?t.add(o):Array.isArray(t)&&t.push(o)}function c1(o,t){if(t instanceof le)t.delete(o);else if(Array.isArray(t)){let e=t.indexOf(o);e!==-1&&t.splice(e,1)}o.dispose()}var i1,G4,q4,s1,F,Dx,l1,_x,Ic,Lx,Mx,K4,bc,j4,Q4,P,Ox,Ya,jg,hp,de=y(()=>{Sx();Se();mp();q();Kg();no();Ns();i1=!1,G4=!1,q4=100,s1=6e4;(ct=>{ct.None=()=>D.None;function t($){if(G4){let{onDidAddListener:V}=$,K=Ic.create(),Z=0;$.onDidAddListener=()=>{++Z===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),K.print()),V?.()}}}function e($,V,K){return g($,()=>{},0,void 0,V??!0,void 0,K)}ct.defer=e;function n($){return(V,K=null,Z)=>{let ae=!1,ve;return ve=$(Ie=>{if(!ae)return ve?ve.dispose():ae=!0,V.call(K,Ie)},null,Z),ae&&ve.dispose(),ve}}ct.once=n;function r($,V){return ct.once(ct.filter($,V))}ct.onceIf=r;function i($,V,K){return p((Z,ae=null,ve)=>$(Ie=>Z.call(ae,V(Ie)),null,ve),K)}ct.map=i;function s($,V,K){return p((Z,ae=null,ve)=>$(Ie=>{V(Ie),Z.call(ae,Ie)},null,ve),K)}ct.forEach=s;function a($,V,K){return p((Z,ae=null,ve)=>$(Ie=>V(Ie)&&Z.call(ae,Ie),null,ve),K)}ct.filter=a;function l($){return $}ct.signal=l;function c(...$){return(V,K=null,Z)=>{let ae=qg(...$.map(ve=>ve(Ie=>V.call(K,Ie))));return m(ae,Z)}}ct.any=c;function u($,V,K,Z){let ae=K;return i($,ve=>(ae=V(ae,ve),ae),Z)}ct.reduce=u;function p($,V){let K,Z={onWillAddFirstListener(){K=$(ae.fire,ae)},onDidRemoveLastListener(){K?.dispose()}};V||t(Z);let ae=new P(Z);return V?.add(ae),ae.event}function m($,V){return V instanceof Array?V.push($):V&&V.add($),$}function g($,V,K=100,Z=!1,ae=!1,ve,Ie){let mt,Ne,ft,Pt=0,Dt,En={leakWarningThreshold:ve,onWillAddFirstListener(){mt=$(cc=>{Pt++,Ne=V(Ne,cc),Z&&!ft&&(Zr.fire(Ne),Ne=void 0),Dt=()=>{let dc=Ne;Ne=void 0,ft=void 0,(!Z||Pt>1)&&Zr.fire(dc),Pt=0},typeof K=="number"?(ft&&clearTimeout(ft),ft=setTimeout(Dt,K)):ft===void 0&&(ft=null,queueMicrotask(Dt))})},onWillRemoveListener(){ae&&Pt>0&&Dt?.()},onDidRemoveLastListener(){Dt=void 0,mt.dispose()}};Ie||t(En);let Zr=new P(En);return Ie?.add(Zr),Zr.event}ct.debounce=g;function h($,V=0,K,Z){return ct.debounce($,(ae,ve)=>ae?(ae.push(ve),ae):[ve],V,void 0,K??!0,void 0,Z)}ct.accumulate=h;function v($,V,K=100,Z=!0,ae=!0,ve,Ie){let mt,Ne,ft,Pt=0,Dt={leakWarningThreshold:ve,onWillAddFirstListener(){mt=$(Zr=>{Pt++,Ne=V(Ne,Zr),ft===void 0&&(Z&&(En.fire(Ne),Ne=void 0,Pt=0),typeof K=="number"?ft=setTimeout(()=>{ae&&Pt>0&&En.fire(Ne),Ne=void 0,ft=void 0,Pt=0},K):(ft=0,queueMicrotask(()=>{ae&&Pt>0&&En.fire(Ne),Ne=void 0,ft=void 0,Pt=0})))})},onDidRemoveLastListener(){mt.dispose()}};Ie||t(Dt);let En=new P(Dt);return Ie?.add(En),En.event}ct.throttle=v;function x($,V=(Z,ae)=>Z===ae,K){let Z=!0,ae;return a($,ve=>{let Ie=Z||!V(ve,ae);return Z=!1,ae=ve,Ie},K)}ct.latch=x;function T($,V,K){return[ct.filter($,V,K),ct.filter($,Z=>!V(Z),K)]}ct.split=T;function w($,V,K=!1,Z=[],ae){let ve=Z.slice(),Ie;a1()&&(Ie={stack:Ic.create(),timerId:setTimeout(()=>{ve&&ve.length>0&&Ie&&!Ie.warned&&(Ie.warned=!0,console.warn(`[Event.buffer][${V}] potential LEAK detected: ${ve.length} events buffered for ${s1/1e3}s without being consumed. Buffered here:`),Ie.stack.print())},s1),warned:!1},ae&&ae.add(ie(()=>clearTimeout(Ie.timerId))));let mt=()=>{Ie&&clearTimeout(Ie.timerId)},Ne=$(Dt=>{ve?(ve.push(Dt),a1()&&Ie&&!Ie.warned&&ve.length>=q4&&(Ie.warned=!0,console.warn(`[Event.buffer][${V}] potential LEAK detected: ${ve.length} events buffered without being consumed. Buffered here:`),Ie.stack.print())):Pt.fire(Dt)});ae&&ae.add(Ne);let ft=()=>{ve?.forEach(Dt=>Pt.fire(Dt)),ve=null,mt()},Pt=new P({onWillAddFirstListener(){Ne||(Ne=$(Dt=>Pt.fire(Dt)),ae&&ae.add(Ne))},onDidAddFirstListener(){ve&&(K?setTimeout(ft):ft())},onDidRemoveLastListener(){Ne&&Ne.dispose(),Ne=null,mt()}});return ae&&ae.add(Pt),Pt.event}ct.buffer=w;function k($,V){return(Z,ae,ve)=>{let Ie=V(new B);return $(function(mt){let Ne=Ie.evaluate(mt);Ne!==M&&Z.call(ae,Ne)},void 0,ve)}}ct.chain=k;let M=Symbol("HaltChainable");class B{constructor(){this.steps=[]}map(V){return this.steps.push(V),this}forEach(V){return this.steps.push(K=>(V(K),K)),this}filter(V){return this.steps.push(K=>V(K)?K:M),this}reduce(V,K){let Z=K;return this.steps.push(ae=>(Z=V(Z,ae),Z)),this}latch(V=(K,Z)=>K===Z){let K=!0,Z;return this.steps.push(ae=>{let ve=K||!V(ae,Z);return K=!1,Z=ae,ve?ae:M}),this}evaluate(V){for(let K of this.steps)if(V=K(V),V===M)break;return V}}function He($,V,K=Z=>Z){let Z=(...mt)=>Ie.fire(K(...mt)),ae=()=>$.on(V,Z),ve=()=>$.removeListener(V,Z),Ie=new P({onWillAddFirstListener:ae,onDidRemoveLastListener:ve});return Ie.event}ct.fromNodeEventEmitter=He;function U($,V,K=Z=>Z){let Z=(...mt)=>Ie.fire(K(...mt)),ae=()=>$.addEventListener(V,Z),ve=()=>$.removeEventListener(V,Z),Ie=new P({onWillAddFirstListener:ae,onDidRemoveLastListener:ve});return Ie.event}ct.fromDOMEventEmitter=U;function Y($,V){let K,Z,ae=new Promise(ve=>{Z=n($)(ve),Ax(Z,V),K=()=>{c1(Z,V)}});return ae.cancel=K,V&&ae.finally(()=>c1(Z,V)),ae}ct.toPromise=Y;function G($,V){return $(K=>V.fire(K))}ct.forward=G;function W($,V,K){return V(K),$(Z=>V(Z))}ct.runAndSubscribe=W;class ee{constructor(V,K){this._observable=V;this._counter=0;this._hasChanged=!1;let Z={onWillAddFirstListener:()=>{V.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{V.removeObserver(this)}};K||t(Z),this.emitter=new P(Z),K&&K.add(this.emitter)}beginUpdate(V){this._counter++}handlePossibleChange(V){}handleChange(V,K){this._hasChanged=!0}endUpdate(V){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function se($,V){return new ee($,V).emitter.event}ct.fromObservable=se;function Ht($){return(V,K,Z)=>{let ae=0,ve=!1,Ie={beginUpdate(){ae++},endUpdate(){ae--,ae===0&&($.reportChanges(),ve&&(ve=!1,V.call(K)))},handlePossibleChange(){},handleChange(){ve=!0}};$.addObserver(Ie),$.reportChanges();let mt={dispose(){$.removeObserver(Ie)}};return Ax(mt,Z),mt}}ct.fromObservableLight=Ht})(F||={});Dx=class o{constructor(t){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${t}_${o._idPool++}`,o.all.add(this)}static{this.all=new Set}static{this._idPool=0}start(t){this._stopWatch=new Yn,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}},l1=-1,_x=class o{constructor(t,e,n=(o._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t;this.threshold=e;this.name=n;this._warnCountdown=0}static{this._idPool=1}dispose(){this._stacks?.clear()}check(t,e){let n=this.threshold;if(n<=0||e<n)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[i,s]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${s}):`;console.warn(a),console.warn(i);let l=s/e>.3?"dominated":"popular",c=new Lx(l,a,i);this._errorHandler(c)}return()=>{let i=this._stacks.get(t.value)||0;this._stacks.set(t.value,i-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,e=0;for(let[n,r]of this._stacks)(!t||e<r)&&(t=[n,r],e=r);return t}},Ic=class o{constructor(t){this.value=t}static create(){let t=new Error;return new o(t.stack??"")}print(){console.warn(this.value.split(`
- `).slice(2).join(`
- `))}},Lx=class extends Error{constructor(t,e,n){super(`potential listener LEAK detected, ${t}`),this.name="ListenerLeakError",this.details=e,this.stack=n}},Mx=class extends Error{constructor(t,e,n){super(`potential listener LEAK detected, ${t} (REFUSED to add)`),this.name="ListenerRefusalError",this.details=e,this.stack=n}},K4=0,bc=class{constructor(t){this.value=t;this.id=K4++}},j4=2,Q4=(o,t)=>{if(o instanceof bc)t(o);else for(let e=0;e<o.length;e++){let n=o[e];n&&t(n)}},P=class{constructor(t){this._size=0;this._options=t,this._leakageMon=l1>0||this._options?.leakWarningThreshold?new _x(t?.onListenerError??Ke,this._options?.leakWarningThreshold??l1):void 0,this._perfMon=this._options?._profName?new Dx(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(i1){let t=this._listeners;queueMicrotask(()=>{Q4(t,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(t,e,n)=>{if(this._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],u=c[1]/this._size>.3?"dominated":"popular",p=new Mx(u,`${l}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||Ke)(p),D.None}if(this._disposed)return D.None;e&&(t=t.bind(e));let r=new bc(t),i,s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Ic.create(),i=this._leakageMon.check(r.stack,this._size+1)),i1&&(r.stack=s??Ic.create()),this._listeners?this._listeners instanceof bc?(this._deliveryQueue??=new Ox,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=ie(()=>{i?.(),this._removeListener(r)});return Ax(a,n),a},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,n=e.indexOf(t);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*j4<=e.length){let i=0;for(let s=0;s<e.length;s++)e[s]?e[i++]=e[s]:r&&i<this._deliveryQueue.end&&(this._deliveryQueue.end--,i<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=i}}_deliver(t,e){if(!t)return;let n=this._options?.onListenerError||Ke;if(!n){t.value(e);return}try{t.value(e)}catch(r){n(r)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof bc)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Ox=class{constructor(){this.i=-1;this.end=0}enqueue(t,e,n){this.i=0,this.end=n,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ya=class extends P{constructor(e){super(e);this._isPaused=0;this._eventQueue=new As;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))}},jg=class{constructor(){this.hasListeners=!1;this.events=[];this.emitter=new P({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(t){let e={event:t,listener:null};return this.events.push(e),this.hasListeners&&this.hook(e),ie(Ka(()=>{this.hasListeners&&this.unhook(e);let r=this.events.indexOf(e);this.events.splice(r,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(t=>this.hook(t))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(t=>this.unhook(t))}hook(t){t.listener=t.event(e=>this.emitter.fire(e))}unhook(t){t.listener?.dispose(),t.listener=null}dispose(){this.emitter.dispose();for(let t of this.events)t.listener?.dispose();this.events=[]}},hp=class{constructor(){this.listening=!1;this.inputEvent=F.None;this.inputEventListener=D.None;this.emitter=new P({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}});this.event=this.emitter.event}set input(t){this.inputEvent=t,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=t(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}});var d1,Ee,xc,gt,Wt=y(()=>{de();q();d1=Object.freeze(function(o,t){let e=setTimeout(o.bind(t),0);return{dispose(){clearTimeout(e)}}});(n=>{function o(r){return r===n.None||r===n.Cancelled||r instanceof xc?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}n.isCancellationToken=o,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:F.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:d1})})(Ee||={});xc=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?d1:(this._emitter||(this._emitter=new P),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},gt=class{constructor(t){this._token=void 0;this._parentListener=void 0;this._parentListener=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new xc),this._token}cancel(){this._token?this._token instanceof xc&&this._token.cancel():this._token=Ee.Cancelled}dispose(t=!1){t&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof xc&&this._token.dispose():this._token=Ee.None}}});var Ro=y(()=>{});function J4(o){return o}var Qg,u1=y(()=>{Wt();Qg=class{constructor(t,e){this.lastCache=void 0;this.lastArgKey=void 0;typeof t=="function"?(this._fn=t,this._computeKey=J4):(this._fn=e,this._computeKey=t.getCacheKey)}get(t){let e=this._computeKey(t);return this.lastArgKey!==e&&(this.lastArgKey=e,this.lastCache=this._fn(t)),this.lastCache}}});var gn,Qi=y(()=>{gn=class{constructor(t){this.executor=t;this._state=0}get hasValue(){return this._state===2}get value(){if(this._state===0){this._state=1;try{this._value=this.executor()}catch(t){this._error=t}finally{this._state=2}}else if(this._state===1)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}});var Nx=y(()=>{});function vp(o){return!o||typeof o!="string"?!0:o.trim().length===0}function h1(o,...t){return t.length===0?o:o.replace(Y4,function(e,n){let r=parseInt(n,10);return isNaN(r)||r<0||r>=t.length?e:t[r]})}function so(o,t){return Object.keys(t).length===0?o:o.replace(Z4,(e,n)=>t[n]??e)}function ao(o){return o.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Ux(o,t){if(!o||!t)return o;let e=t.length,n=0;if(e===1){let r=t.charCodeAt(0);for(;n<o.length&&o.charCodeAt(n)===r;)n++}else for(;o.startsWith(t,n);)n+=e;return o.substring(n)}function Sc(o,t){if(!o||!t)return o;let e=t.length,n=o.length;if(e===1){let i=n,s=t.charCodeAt(0);for(;i>0&&o.charCodeAt(i-1)===s;)i--;return o.substring(0,i)}let r=n;for(;r>0&&o.endsWith(t,r);)r-=e;return o.substring(0,r)}function v1(o,t,e={}){if(!o)throw new Error("Cannot create regex from empty string");t||(o=ao(o)),e.wholeWord&&(/\B/.test(o.charAt(0))||(o="\\b"+o),/\B/.test(o.charAt(o.length-1))||(o=o+"\\b"));let n="";return e.global&&(n+="g"),e.matchCase||(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),new RegExp(o,n)}function yp(o,t){return o<t?-1:o>t?1:0}function Jg(o,t,e=0,n=o.length,r=0,i=t.length){for(;e<n&&r<i;e++,r++){let l=o.charCodeAt(e),c=t.charCodeAt(r);if(l<c)return-1;if(l>c)return 1}let s=n-e,a=i-r;return s<a?-1:s>a?1:0}function Ec(o,t){return Za(o,t,0,o.length,0,t.length)}function Za(o,t,e=0,n=o.length,r=0,i=t.length){for(;e<n&&r<i;e++,r++){let l=o.charCodeAt(e),c=t.charCodeAt(r);if(l===c)continue;if(l>=128||c>=128)return Jg(o.toLowerCase(),t.toLowerCase(),e,n,r,i);p1(l)&&(l-=32),p1(c)&&(c-=32);let u=l-c;if(u!==0)return u}let s=n-e,a=i-r;return s<a?-1:s>a?1:0}function p1(o){return o>=97&&o<=122}function Fx(o){return o>=65&&o<=90}function Fr(o,t){return o.length===t.length&&Za(o,t)===0}function Us(o,t){let e=t.length;return e<=o.length&&Za(o,t,0,e)===0}function y1(o,t){let e=o.length,n=e-t.length;return n>=0&&Za(o,t,n,e)===0}function b1(o){return 55296<=o&&o<=56319}function Vx(o){return 56320<=o&&o<=57343}function I1(o,t){return(o-55296<<10)+(t-56320)+65536}function Wx(o){return o.charAt(0).toUpperCase()+o.slice(1)}function r5(){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 Y4,Z4,e5,t5,n5,pz,mz,m1,f1,g1,Qt=y(()=>{u1();Ro();Qi();Nx();Y4=/{(\d+)}/g;Z4=/{([^}]+)}/g;e5=/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,t5=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,n5=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,pz=new RegExp("(?:"+[e5.source,t5.source,n5.source].join("|")+")","g"),mz=String.fromCharCode(65279);m1=class o{static{this._INSTANCE=null}static getInstance(){return o._INSTANCE||(o._INSTANCE=new o),o._INSTANCE}constructor(){this._data=r5()}getGraphemeBreakType(t){if(t<32)return t===10?3:t===13?2:4;if(t<127)return 0;let e=this._data,n=e.length/3,r=1;for(;r<=n;)if(t<e[3*r])r=2*r;else if(t>e[3*r+1])r=2*r+1;else return e[3*r+2];return 0}};f1=class o{constructor(t){this.confusableDictionary=t}static{this.ambiguousCharacterData=new gn(()=>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 Qg(t=>{let e=t.split(",");function n(p){let m=new Map;for(let g=0;g<p.length;g+=2)m.set(p[g],p[g+1]);return m}function r(p,m){let g=new Map(p);for(let[h,v]of m)g.set(h,v);return g}function i(p,m){if(!p)return m;let g=new Map;for(let[h,v]of p)m.has(h)&&g.set(h,v);return g}let s=this.ambiguousCharacterData.value,a=e.filter(p=>!p.startsWith("_")&&Object.hasOwn(s,p));a.length===0&&(a=["_default"]);let l;for(let p of a){let m=n(s[p]);l=i(l,m)}let c=n(s._common),u=r(c,l);return new o(u)})}static getInstance(t){return o.cache.get(Array.from(t).join(","))}static{this._locales=new gn(()=>Object.keys(o.ambiguousCharacterData.value).filter(t=>!t.startsWith("_")))}static getLocales(){return o._locales.value}isAmbiguous(t){return this.confusableDictionary.has(t)}containsAmbiguousCharacter(t){for(let e=0;e<t.length;e++){let n=t.codePointAt(e);if(typeof n=="number"&&this.isAmbiguous(n))return!0}return!1}getPrimaryConfusable(t){return this.confusableDictionary.get(t)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},g1=class o{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(o.getRawData())].flat())),this._data}static isInvisibleCharacter(t){return o.getData().has(t)}static containsInvisibleCharacter(t){for(let e=0;e<t.length;e++){let n=t.codePointAt(e);if(typeof n=="number"&&(o.isInvisibleCharacter(n)||n===32))return!0}return!1}static get codePoints(){return o.getData()}}});function Fs(o){return o===47||o===92}function Xg(o){return o.replace(/[\\/]/g,We.sep)}function x1(o){return o.indexOf("/")===-1&&(o=Xg(o)),/^[a-zA-Z]:(\/|$)/.test(o)&&(o="/"+o),o}function Bx(o,t=We.sep){if(!o)return"";let e=o.length,n=o.charCodeAt(0);if(Fs(n)){if(Fs(o.charCodeAt(1))&&!Fs(o.charCodeAt(2))){let i=3,s=i;for(;i<e&&!Fs(o.charCodeAt(i));i++);if(s!==i&&!Fs(o.charCodeAt(i+1))){for(i+=1;i<e;i++)if(Fs(o.charCodeAt(i)))return o.slice(0,i+1).replace(/[\\/]/g,t)}}return t}else if(S1(n)&&o.charCodeAt(1)===58)return Fs(o.charCodeAt(2))?o.slice(0,2)+t:o.slice(0,2);let r=o.indexOf("://");if(r!==-1){for(r+=3;r<e;r++)if(Fs(o.charCodeAt(r)))return o.slice(0,r+1)}return""}function wc(o,t,e){let n=o===t;return!e||n?n:!o||!t?!1:Fr(o,t)}function Vr(o,t,e,n=Zt){if(o===t)return!0;if(!o||!t||t.length>o.length)return!1;if(e){if(!Us(o,t))return!1;if(t.length===o.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,o.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),o.indexOf(t)===0}function S1(o){return o>=65&&o<=90||o>=97&&o<=122}function E1(o){return te?(o=Sc(o,Zt),o.endsWith(":")&&(o+=Zt)):(o=Sc(o,Zt),o||(o=Zt)),o}function Hx(o){let t=In(o);return te?o.length>3?!1:$x(t)&&(o.length===2||t.charCodeAt(2)===92):t===We.sep}function $x(o,t=te){return t?S1(o.charCodeAt(0))&&o.charCodeAt(1)===58:!1}function w1(o,t,e=8){let n="";for(let i=0;i<e;i++){let s;i===0&&te&&!t&&(e===3||e===4)?s=i5:s=o5,n+=s.charAt(Math.floor(Math.random()*s.length))}let r;return t?r=`${t}-${n}`:r=n,o?H(o,r):r}var o5,i5,yi=y(()=>{Ro();Le();me();Qt();Me();o5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i5="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789"});var Cc=y(()=>{});function d5(o,t){if(!o.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${o.authority}", path: "${o.path}", query: "${o.query}", fragment: "${o.fragment}"}`);if(o.scheme&&!a5.test(o.scheme)){let e=[...o.scheme.matchAll(/[^\w\d+.-]/gu)],n=e.length>0?` Found '${e[0][0]}' at index ${e[0].index} (${e.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${o.scheme.length})`)}if(o.path){if(o.authority){if(!l5.test(o.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(c5.test(o.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function u5(o,t){return!o&&!t?"file":o}function p5(o,t){switch(o){case"https":case"http":case"file":t?t[0]!==jo&&(t=jo+t):t=jo;break}return t}function el(o){return!o||typeof o!="object"?!1:typeof o.scheme=="string"&&(typeof o.authority=="string"||typeof o.authority>"u")&&(typeof o.path=="string"||typeof o.path>"u")&&(typeof o.query=="string"||typeof o.query>"u")&&(typeof o.fragment=="string"||typeof o.fragment>"u")}function C1(o,t,e){let n,r=-1;for(let i=0;i<o.length;i++){let s=o.charCodeAt(i);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||t&&s===47||e&&s===91||e&&s===93||e&&s===58)r!==-1&&(n+=encodeURIComponent(o.substring(r,i)),r=-1),n!==void 0&&(n+=o.charAt(i));else{n===void 0&&(n=o.substr(0,i));let a=k1[s];a!==void 0?(r!==-1&&(n+=encodeURIComponent(o.substring(r,i)),r=-1),n+=a):r===-1&&(r=i)}}return r!==-1&&(n+=encodeURIComponent(o.substring(r))),n!==void 0?n:o}function f5(o){let t;for(let e=0;e<o.length;e++){let n=o.charCodeAt(e);n===35||n===63?(t===void 0&&(t=o.substr(0,e)),t+=k1[n]):t!==void 0&&(t+=o[e])}return t!==void 0?t:o}function Tc(o,t){let e;return o.authority&&o.path.length>1&&o.scheme==="file"?e=`//${o.authority}${o.path}`:o.path.charCodeAt(0)===47&&(o.path.charCodeAt(1)>=65&&o.path.charCodeAt(1)<=90||o.path.charCodeAt(1)>=97&&o.path.charCodeAt(1)<=122)&&o.path.charCodeAt(2)===58?t?e=o.path.substr(1):e=o.path[1].toLowerCase()+o.path.substr(2):e=o.path,te&&(e=e.replace(/\//g,"\\")),e}function zx(o,t){let e=t?f5:C1,n="",{scheme:r,authority:i,path:s,query:a,fragment:l}=o;if(r&&(n+=r,n+=":"),(i||r==="file")&&(n+=jo,n+=jo),i){let c=i.indexOf("@");if(c!==-1){let u=i.substr(0,c);i=i.substr(c+1),c=u.lastIndexOf(":"),c===-1?n+=e(u,!1,!1):(n+=e(u.substr(0,c),!1,!1),n+=":",n+=e(u.substr(c+1),!1,!0)),n+="@"}i=i.toLowerCase(),c=i.lastIndexOf(":"),c===-1?n+=e(i,!1,!0):(n+=e(i.substr(0,c),!1,!0),n+=i.substr(c))}if(s){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)}`)}n+=e(s,!0,!1)}return a&&(n+="?",n+=e(a,!1,!1)),l&&(n+="#",n+=t?l:C1(l,!1,!1)),n}function R1(o){try{return decodeURIComponent(o)}catch{return o.length>3?o.substr(0,3)+R1(o.substr(3)):o}}function Yg(o){return o.match(T1)?o.replace(T1,t=>R1(t)):o}var a5,l5,c5,Bt,jo,m5,I,P1,Vs,k1,T1,ce=y(()=>{Ro();Cc();Le();me();a5=/^\w[\w\d+.-]*$/,l5=/^\//,c5=/^\/\//;Bt="",jo="/",m5=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,I=class o{static isUri(t){return t instanceof o?!0:!t||typeof t!="object"?!1:typeof t.authority=="string"&&typeof t.fragment=="string"&&typeof t.path=="string"&&typeof t.query=="string"&&typeof t.scheme=="string"&&typeof t.fsPath=="string"&&typeof t.with=="function"&&typeof t.toString=="function"}constructor(t,e,n,r,i,s=!1){typeof t=="object"?(this.scheme=t.scheme||Bt,this.authority=t.authority||Bt,this.path=t.path||Bt,this.query=t.query||Bt,this.fragment=t.fragment||Bt):(this.scheme=u5(t,s),this.authority=e||Bt,this.path=p5(this.scheme,n||Bt),this.query=r||Bt,this.fragment=i||Bt,d5(this,s))}get fsPath(){return Tc(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:n,path:r,query:i,fragment:s}=t;return e===void 0?e=this.scheme:e===null&&(e=Bt),n===void 0?n=this.authority:n===null&&(n=Bt),r===void 0?r=this.path:r===null&&(r=Bt),i===void 0?i=this.query:i===null&&(i=Bt),s===void 0?s=this.fragment:s===null&&(s=Bt),e===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&s===this.fragment?this:new Vs(e,n,r,i,s)}static parse(t,e=!1){let n=m5.exec(t);return n?new Vs(n[2]||Bt,Yg(n[4]||Bt),Yg(n[5]||Bt),Yg(n[7]||Bt),Yg(n[9]||Bt),e):new Vs(Bt,Bt,Bt,Bt,Bt)}static file(t){let e=Bt;if(te&&(t=t.replace(/\\/g,jo)),t[0]===jo&&t[1]===jo){let n=t.indexOf(jo,2);n===-1?(e=t.substring(2),t=jo):(e=t.substring(2,n),t=t.substring(n)||jo)}return new Vs("file",e,t,Bt,Bt)}static from(t,e){return new Vs(t.scheme,t.authority,t.path,t.query,t.fragment,e)}static joinPath(t,...e){if(!t.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return te&&t.scheme==="file"?n=o.file(nn.join(Tc(t,!0),...e)).path:n=We.join(t.path,...e),t.with({path:n})}toString(t=!1){return zx(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof o)return t;{let e=new Vs(t);return e._formatted=t.external??null,e._fsPath=t._sep===P1?t.fsPath??null:null,e}}else return t}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};P1=te?1:void 0,Vs=class extends I{constructor(){super(...arguments);this._formatted=null;this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Tc(this,!1)),this._fsPath}toString(e=!1){return e?zx(this,!0):(this._formatted||(this._formatted=zx(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=P1),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}},k1={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"};T1=/(%[0-9A-Za-z][0-9A-Za-z])+/g});function Kx(o){return`${o.quality??"oss"}-${o.commit??"dev"}`}var z,Ip,Ws,Gx,D1,_1,L1,M1,jx,qx,yt,Tz,Pz,g5,$e=y(()=>{Se();me();Qt();ce();Le();(xe=>(xe.inMemory="inmemory",xe.vscode="vscode",xe.internal="private",xe.walkThrough="walkThrough",xe.walkThroughSnippet="walkThroughSnippet",xe.http="http",xe.https="https",xe.file="file",xe.mailto="mailto",xe.untitled="untitled",xe.data="data",xe.command="command",xe.vscodeRemote="vscode-remote",xe.vscodeRemoteResource="vscode-remote-resource",xe.vscodeManagedRemoteResource="vscode-managed-remote-resource",xe.vscodeUserData="vscode-userdata",xe.vscodeCustomEditor="vscode-custom-editor",xe.vscodeNotebookCell="vscode-notebook-cell",xe.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",xe.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",xe.vscodeNotebookCellOutput="vscode-notebook-cell-output",xe.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",xe.vscodeNotebookMetadata="vscode-notebook-metadata",xe.vscodeInteractiveInput="vscode-interactive-input",xe.vscodeSettings="vscode-settings",xe.vscodeWorkspaceTrust="vscode-workspace-trust",xe.vscodeTerminal="vscode-terminal",xe.vscodeImageCarousel="vscode-image-carousel",xe.vscodeChatCodeBlock="vscode-chat-code-block",xe.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",xe.vscodeChatEditor="vscode-chat-editor",xe.vscodeChatInput="chatSessionInput",xe.vscodeLocalChatSession="vscode-chat-session",xe.webviewPanel="webview-panel",xe.vscodeWebview="vscode-webview",xe.vscodeBrowser="vscode-browser",xe.extension="extension",xe.vscodeFileResource="vscode-file",xe.tmp="tmp",xe.vsls="vsls",xe.vscodeSourceControl="vscode-scm",xe.commentsInput="comment",xe.codeSetting="code-setting",xe.outputChannel="output",xe.accessibleView="accessible-view",xe.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",xe.chatEditingModel="chat-editing-text-model",xe.copilotPr="copilot-pr"))(z||={});Ip="vscode-tkn",Ws="tkn",Gx=class{constructor(){this._hosts=Object.create(null);this._ports=Object.create(null);this._connectionTokens=Object.create(null);this._preferredWebSchema="http";this._delegate=null;this._serverRootPath="/"}setPreferredWebSchema(t){this._preferredWebSchema=t}setDelegate(t){this._delegate=t}setServerRootPath(t,e){this._serverRootPath=We.join(e??"/",Kx(t))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return We.join(this._serverRootPath,z.vscodeRemoteResource)}set(t,e,n){this._hosts[t]=e,this._ports[t]=n}setConnectionToken(t,e){this._connectionTokens[t]=e}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(t){if(this._delegate)try{return this._delegate(t)}catch(a){return Ke(a),t}let e=t.authority,n=this._hosts[e];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let r=this._ports[e],i=this._connectionTokens[e],s=`path=${encodeURIComponent(t.path)}`;return typeof i=="string"&&(s+=`&${Ws}=${encodeURIComponent(i)}`),I.from({scheme:Yt?this._preferredWebSchema:z.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:s})}},D1=new Gx;_1="vs/../../extensions",L1="vs/../../node_modules",M1="vs/../../node_modules.asar",jx="vscode-app",qx=class o{static{this.FALLBACK_AUTHORITY=jx}asBrowserUri(t){let e=this.toUri(t);return this.uriToBrowserUri(e)}uriToBrowserUri(t){return t.scheme===z.vscodeRemote?D1.rewrite(t):t.scheme===z.file&&(Rg||DR===`${z.vscodeFileResource}://${o.FALLBACK_AUTHORITY}`)?t.with({scheme:z.vscodeFileResource,authority:t.authority||o.FALLBACK_AUTHORITY,query:null,fragment:null}):t}asFileUri(t){let e=this.toUri(t);return this.uriToFileUri(e)}uriToFileUri(t){return t.scheme===z.vscodeFileResource?t.with({scheme:z.file,authority:t.authority!==o.FALLBACK_AUTHORITY?t.authority:null,query:null,fragment:null}):t}toUri(t){if(I.isUri(t))return t;if(globalThis._VSCODE_FILE_ROOT){let e=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(e))return I.joinPath(I.parse(e,!0),t);let n=H(e,t);return I.file(n)}throw new Error("Cannot determine URI for module id!")}},yt=new qx,Tz=Object.freeze({"Cache-Control":"no-cache, no-store"}),Pz=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});(i=>{let o=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);i.CoopAndCoep=Object.freeze(o.get("3"));let e="vscode-coi";function n(s){let a;typeof s=="string"?a=new URL(s).searchParams:s instanceof URL?a=s.searchParams:I.isUri(s)&&(a=new URL(s.toString(!0)).searchParams);let l=a?.get(e);if(l)return o.get(l)}i.getHeadersFromQuery=n;function r(s,a,l){if(!globalThis.crossOriginIsolated)return;let c=a&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(e,c):s[e]=c}i.addSearchParam=r})(g5||={})});function Ji(o){return Tc(o,!0)}var tl,Ze,nl,Qx,bi,Jx,Oz,h5,Zn,eh,th,ye,N1,Az,Nz,U1,O1,A1,Uz,Fz,v5,Nt=y(()=>{Ro();yi();$e();Le();me();Qt();ce();tl=class{constructor(t){this._ignorePathCasing=t}compare(t,e,n=!1){return t===e?0:yp(this.getComparisonKey(t,n),this.getComparisonKey(e,n))}isEqual(t,e,n=!1){return t===e?!0:!t||!e?!1:this.getComparisonKey(t,n)===this.getComparisonKey(e,n)}getComparisonKey(t,e=!1){return t.with({path:this._ignorePathCasing(t)?t.path.toLowerCase():void 0,fragment:e?null:void 0}).toString()}ignorePathCasing(t){return this._ignorePathCasing(t)}isEqualOrParent(t,e,n=!1){if(t.scheme===e.scheme){if(t.scheme===z.file)return Vr(Ji(t),Ji(e),this._ignorePathCasing(t))&&t.query===e.query&&(n||t.fragment===e.fragment);if(O1(t.authority,e.authority))return Vr(t.path,e.path,this._ignorePathCasing(t),"/")&&t.query===e.query&&(n||t.fragment===e.fragment)}return!1}joinPath(t,...e){return I.joinPath(t,...e)}basenameOrAuthority(t){return Zn(t)||t.authority}basename(t,e){return We.basename(t.path,e)}extname(t){return We.extname(t.path)}dirname(t){if(t.path.length===0)return t;let e;return t.scheme===z.file?e=I.file(Ct(Ji(t))).path:(e=We.dirname(t.path),t.authority&&e.length&&e.charCodeAt(0)!==47&&(console.error(`dirname("${t.toString})) resulted in a relative path`),e="/")),t.with({path:e})}normalizePath(t){if(!t.path.length)return t;let e;return t.scheme===z.file?e=I.file(In(Ji(t))).path:e=We.normalize(t.path),t.with({path:e})}relativePath(t,e){if(t.scheme!==e.scheme||!O1(t.authority,e.authority))return;if(t.scheme===z.file){let i=ji(Ji(t),Ji(e));return te?Xg(i):i}let n=t.path||"/",r=e.path||"/";if(this._ignorePathCasing(t)){let i=0;for(let s=Math.min(n.length,r.length);i<s&&!(n.charCodeAt(i)!==r.charCodeAt(i)&&n.charAt(i).toLowerCase()!==r.charAt(i).toLowerCase());i++);n=r.substr(0,i)+n.substr(i)}return We.relative(n,r)}resolvePath(t,e){if(t.scheme===z.file){let n=I.file(Bn(Ji(t),e));return t.with({authority:n.authority,path:n.path})}return e=x1(e),t.with({path:We.resolve(t.path,e)})}isAbsolutePath(t){return!!t.path&&t.path[0]==="/"}isEqualAuthority(t,e){return t===e||t!==void 0&&e!==void 0&&Fr(t,e)}hasTrailingPathSeparator(t,e=Zt){if(t.scheme===z.file){let n=Ji(t);return n.length>Bx(n).length&&n[n.length-1]===e}else{let n=t.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(t.fsPath)}}removeTrailingPathSeparator(t,e=Zt){return A1(t,e)?t.with({path:t.path.substr(0,t.path.length-1)}):t}addTrailingPathSeparator(t,e=Zt){let n=!1;if(t.scheme===z.file){let r=Ji(t);n=r!==void 0&&r.length===Bx(r).length&&r[r.length-1]===e}else{e="/";let r=t.path;n=r.length===1&&r.charCodeAt(r.length-1)===47}return!n&&!A1(t,e)?t.with({path:t.path+"/"}):t}},Ze=new tl(()=>!1),nl=new tl(o=>o.scheme===z.file?!_e:!0),Qx=new tl(o=>!0),bi=Ze.isEqual.bind(Ze),Jx=Ze.isEqualOrParent.bind(Ze),Oz=Ze.getComparisonKey.bind(Ze),h5=Ze.basenameOrAuthority.bind(Ze),Zn=Ze.basename.bind(Ze),eh=Ze.extname.bind(Ze),th=Ze.dirname.bind(Ze),ye=Ze.joinPath.bind(Ze),N1=Ze.normalizePath.bind(Ze),Az=Ze.relativePath.bind(Ze),Nz=Ze.resolvePath.bind(Ze),U1=Ze.isAbsolutePath.bind(Ze),O1=Ze.isEqualAuthority.bind(Ze),A1=Ze.hasTrailingPathSeparator.bind(Ze),Uz=Ze.removeTrailingPathSeparator.bind(Ze),Fz=Ze.addTrailingPathSeparator.bind(Ze);(i=>{i.META_DATA_LABEL="label",i.META_DATA_DESCRIPTION="description",i.META_DATA_SIZE="size",i.META_DATA_MIME="mime";function r(s){let a=new Map;s.path.substring(s.path.indexOf(";")+1,s.path.lastIndexOf(";")).split(";").forEach(u=>{let[p,m]=u.split(":");p&&m&&a.set(p,m)});let c=s.path.substring(0,s.path.indexOf(";"));return c&&a.set(i.META_DATA_MIME,c),a}i.parseMetaData=r})(v5||={})});var F1,V1=y(()=>{F1=Symbol("MicrotaskDelay")});function wp(o){return!!o&&typeof o.then=="function"}function Rr(o){let t=new gt,e=o(t.token),n=!1,r=new Promise((i,s)=>{let a=t.token.onCancellationRequested(()=>{n=!0,a.dispose(),s(new Ye)});Promise.resolve(e).then(l=>{a.dispose(),t.dispose(),n?Gg(l)&&l.dispose():i(l)},l=>{a.dispose(),t.dispose(),s(l)})});return new class{cancel(){t.cancel(),t.dispose()}then(i,s){return r.then(i,s)}catch(i){return this.then(void 0,i)}finally(i){return r.finally(i)}}}function eS(){let o,t;return{promise:new Promise((n,r)=>{o=n,t=r}),resolve:o,reject:t}}function uo(o,t){return t?new Promise((e,n)=>{let r=setTimeout(()=>{i.dispose(),e()},o),i=t.onCancellationRequested(()=>{clearTimeout(r),i.dispose(),n(new Ye)})}):Rr(e=>uo(o,e))}async function H1(o,t,e){let n;for(let r=0;r<e;r++)try{return await o()}catch(i){n=i,await uo(t)}throw n}var Xx,rh,Pc,y5,b5,xp,kr,lo,Sp,co,kc,Qo,Ep,oh,Rc,tS,nh,Yx,ih,Wr,rn,W1,Zx,B1,ze=y(()=>{Wt();Se();de();q();Nt();me();V1();Qi();Xx=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new gt}queue(t){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=t,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(e,e).then(n)})}return new Promise((e,n)=>{this.queuedPromise.then(e,n)})}return this.activePromise=t(this.cancellationTokenSource.token),new Promise((e,n)=>{this.activePromise.then(r=>{this.activePromise=null,e(r)},r=>{this.activePromise=null,n(r)})})}dispose(){this.cancellationTokenSource.cancel()}},rh=class{constructor(){this.current=Promise.resolve(null)}queue(t){return this.current=this.current.then(()=>t(),()=>t())}},Pc=class{constructor(){this.promiseMap=new Map}queue(t,e){let r=(this.promiseMap.get(t)??Promise.resolve()).catch(()=>{}).then(e).finally(()=>{this.promiseMap.get(t)===r&&this.promiseMap.delete(t)});return this.promiseMap.set(t,r),r}peek(t){return this.promiseMap.get(t)||void 0}keys(){return this.promiseMap.keys()}},y5=(o,t)=>{let e=!0,n=setTimeout(()=>{e=!1,t()},o);return{isTriggered:()=>e,dispose:()=>{clearTimeout(n),e=!1}}},b5=o=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,o())}),{isTriggered:()=>t,dispose:()=>{t=!1}}},xp=class{constructor(t){this.defaultDelay=t;this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(t,e=this.defaultDelay){this.task=t,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((r,i)=>{this.doResolve=r,this.doReject=i}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let r=this.task;return this.task=null,r()}}));let n=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=e===F1?b5(n):y5(e,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Ye),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},kr=class{constructor(t){this.delayer=new xp(t),this.throttler=new Xx}trigger(t,e){return this.delayer.trigger(()=>this.throttler.queue(t),e)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},lo=class{constructor(){this._isOpen=!1,this._promise=new Promise((t,e)=>{this._completePromise=t})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Sp=class{constructor(t){this._size=0;this._isDisposed=!1;this.maxDegreeOfParalellism=t,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new P}whenIdle(){return this.size>0?F.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(t){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((e,n)=>{this.outstandingPromises.push({factory:t,c:e,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){let t=this.outstandingPromises.shift();this.runningPromises++;let e=t.factory();e.then(t.c,t.e),e.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}},co=class extends Sp{constructor(){super(1)}},kc=class{constructor(){this.queues=new Map;this.drainers=new Set;this.drainListeners=void 0;this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let t=new Wr;return this.drainers.add(t),t.p}isDrained(){for(let[,t]of this.queues)if(t.size>0)return!1;return!0}queueSize(t,e=Ze){let n=e.getComparisonKey(t);return this.queues.get(n)?.size??0}queueFor(t,e,n=Ze){let r=n.getComparisonKey(t),i=this.queues.get(r);if(!i){i=new co;let s=this.drainListenerCount++,a=F.once(i.onDrained)(()=>{i?.dispose(),this.queues.delete(r),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(s),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Ur),this.drainListeners.set(s,a),this.queues.set(r,i)}return i.queue(e)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let t of this.drainers)t.complete();this.drainers.clear()}dispose(){for(let[,t]of this.queues)t.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}},Qo=class{constructor(t,e){this.timeoutToken=void 0,this.runner=t,this.timeout=e,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(t=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,t)}get delay(){return this.timeout}set delay(t){this.timeout=t}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}},Ep=class{constructor(t,e){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.runner=t,this.timeout=e,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(t=this.timeout){t%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${t}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(t/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}},oh=class extends Qo{constructor(e,n){super(e,n);this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}},Rc=class extends D{constructor(e,n){super();this.options=e;this.handler=n;this.pendingWork=[];this.throttler=this._register(new mr);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 r of e)this.pendingWork.push(r);let n=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||n>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-n,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new Qo(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};(function(){let o=globalThis;typeof o.requestIdleCallback!="function"||typeof o.cancelIdleCallback!="function"?nh=(t,e,n)=>{MR(()=>{if(r)return;let i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let r=!1;return{dispose(){r||(r=!0)}}}:nh=(t,e,n)=>{let r=t.requestIdleCallback(e,typeof n=="number"?{timeout:n}:void 0),i=!1;return{dispose(){i||(i=!0,t.cancelIdleCallback(r))}}},tS=(t,e)=>nh(globalThis,t,e)})();Yx=class{constructor(t,e){this._didRun=!1;this._executor=()=>{try{this._value=e()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=nh(t,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},ih=class extends Yx{constructor(t){super(globalThis,t)}};Wr=class o{static fromPromise(t){let e=new o;return e.settleWith(t),e}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((t,e)=>{this.completeCallback=t,this.errorCallback=e})}complete(t){return this.isSettled?Promise.resolve():new Promise(e=>{this.completeCallback(t),this.outcome={outcome:0,value:t},e()})}error(t){return this.isSettled?Promise.resolve():new Promise(e=>{this.errorCallback(t),this.outcome={outcome:1,value:t},e()})}settleWith(t){return t.then(e=>this.complete(e),e=>this.error(e))}cancel(){return this.error(new Ye)}};(e=>{async function o(n){let r,i=await Promise.all(n.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return i}e.settled=o;function t(n){return new Promise(async(r,i)=>{try{await n(r,i)}catch(s){i(s)}})}e.withAsyncBody=t})(rn||={});W1=class o{static fromArray(t){return new o(e=>{e.emitMany(t)})}static fromPromise(t){return new o(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new o(async e=>{await Promise.all(t.map(async n=>e.emitOne(await n)))})}static merge(t){return new o(async e=>{await Promise.all(t.map(async n=>{for await(let r of n)e.emitOne(r)}))})}static{this.EMPTY=o.fromArray([])}constructor(t,e){this._state=0,this._results=[],this._error=null,this._onReturn=e,this._onStateChanged=new P,queueMicrotask(async()=>{let n={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(n)),this.resolve()}catch(r){this.reject(r)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await F.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,e){return new o(async n=>{for await(let r of t)n.emitOne(e(r))})}map(t){return o.map(this,t)}static filter(t,e){return new o(async n=>{for await(let r of t)e(r)&&n.emitOne(r)})}filter(t){return o.filter(this,t)}static coalesce(t){return o.filter(t,e=>!!e)}coalesce(){return o.coalesce(this)}static async toPromise(t){let e=[];for await(let n of t)e.push(n);return e}toPromise(){return o.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}},Zx=class{constructor(){this._unsatisfiedConsumers=[];this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(t){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let e=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(e,t)}else this._unconsumedValues.push(t)}produceFinal(t){this._ensureNoFinalValue(),this._finalValue=t;for(let e of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(e,t);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new $t("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(t,e){e.ok?t.complete(e.value):t.error(e.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let t=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return t.ok?Promise.resolve(t.value):Promise.reject(t.error)}else{let t=new Wr;return this._unsatisfiedConsumers.push(t),t.p}}},B1=class o{constructor(t,e){this._onReturn=e;this._producerConsumer=new Zx;this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async t=>(this._finishError(t),{done:!0,value:void 0})};queueMicrotask(async()=>{let n=t({emitOne:r=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:r}}),emitMany:r=>{for(let i of r)this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}})},reject:r=>this._finishError(r)});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(r){this._finishError(r)}})}static fromArray(t){return new o(e=>{e.emitMany(t)})}static fromPromise(t){return new o(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new o(async e=>{await Promise.all(t.map(async n=>e.emitOne(await n)))})}static merge(t){return new o(async e=>{await Promise.all(t.map(async n=>{for await(let r of n)e.emitOne(r)}))})}static{this.EMPTY=o.fromArray([])}static map(t,e){return new o(async n=>{for await(let r of t)n.emitOne(e(r))})}static tee(t){let e,n,r=new Wr,i=async()=>{if(!(!e||!n))try{for await(let l of t)e.emitOne(l),n.emitOne(l)}catch(l){e.reject(l),n.reject(l)}finally{r.complete()}},s=new o(async l=>(e=l,i(),r.p)),a=new o(async l=>(n=l,i(),r.p));return[s,a]}map(t){return o.map(this,t)}static coalesce(t){return o.filter(t,e=>!!e)}coalesce(){return o.coalesce(this)}static filter(t,e){return new o(async n=>{for await(let r of t)e(r)&&n.emitOne(r)})}filter(t){return o.filter(this,t)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(t){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:t})}[Symbol.asyncIterator](){return this._iterator}}});function Cp(o){return $1(o,"NFC",I5)}function S5(o){return $1(o,"NFD",x5)}function $1(o,t,e){if(!o)return o;let n=e.get(o);if(n)return n;let r;return E5.test(o)?r=o.normalize(t):r=o,e.set(o,r),r}var I5,x5,E5,w5,sh=y(()=>{Hn();I5=new gi(1e4);x5=new gi(1e4);E5=/[^\u0000-\u0080]/;w5=(function(){let o=new gi(1e4),t=/[\u0300-\u036f]/g;return function(e){let n=o.get(e);if(n)return n;let r=S5(e).replace(t,""),i=(r.length===e.length?r:e).toLowerCase();return o.set(e,i),i}})()});import*as ke from"fs";import{tmpdir as C5}from"os";import{promisify as Tp}from"util";async function q1(o,t=0,e){if(Hx(o))throw new Error("rimraf - will refuse to recursively delete root");return t===0?nS(o):T5(o,e)}async function T5(o,t=w1(C5())){try{try{await ke.promises.rename(o,t)}catch(e){return e.code==="ENOENT"?void 0:nS(o)}nS(t).catch(()=>{})}catch(e){if(e.code!=="ENOENT")throw e}}async function nS(o){return ke.promises.rm(o,{recursive:!0,force:!0,maxRetries:3})}async function ah(o,t){try{return await z1(o,t)}catch(e){if(e.code==="ENOENT"&&te&&Hx(o))try{return await z1(`${o}.`,t)}catch{}throw e}}async function z1(o,t){return k5(await(t?P5(o):ke.promises.readdir(o)))}async function P5(o){try{return await ke.promises.readdir(o,{withFileTypes:!0})}catch(n){n.code!=="ENOENT"&&console.warn("[node.js fs] readdir with filetypes failed with error: ",n)}let t=[],e=await ah(o);for(let n of e){let r=!1,i=!1,s=!1;try{let a=await ke.promises.lstat(H(o,n));r=a.isFile(),i=a.isDirectory(),s=a.isSymbolicLink()}catch(a){a.code!=="ENOENT"&&console.warn("[node.js fs] unexpected error from lstat after readdir: ",a)}t.push({name:n,isFile:()=>r,isDirectory:()=>i,isSymbolicLink:()=>s})}return t}function k5(o){return o.map(t=>typeof t=="string"?rt?Cp(t):t:(t.name=rt?Cp(t.name):t.name,t))}async function R5(o){let t=await ah(o),e=[];for(let n of t)await er.existsDirectory(H(o,n))&&e.push(n);return e}function _5(o,t,e){return D5.queueFor(I.file(o),()=>{let n=O5(e);return new Promise((r,i)=>M5(o,t,n,s=>s?i(s):r()))},nl)}function L5(o){K1=o}function M5(o,t,e,n){if(!K1)return ke.writeFile(o,t,{mode:e.mode,flag:e.flag},n);ke.open(o,e.flag,e.mode,(r,i)=>{if(r)return n(r);ke.writeFile(i,t,s=>{if(s)return ke.close(i,()=>n(s));ke.fdatasync(i,a=>(a&&(console.warn("[node.js fs] fdatasync is now disabled for this session because it failed: ",a),L5(!1)),ke.close(i,l=>n(l))))})})}function O5(o){return o?{mode:typeof o.mode=="number"?o.mode:438,flag:typeof o.flag=="string"?o.flag:"w"}:{mode:438,flag:"w"}}async function A5(o,t,e=6e4){if(o!==t)try{te&&typeof e=="number"?await j1(o,t,Date.now(),e):await ke.promises.rename(o,t)}catch(n){if(o.toLowerCase()!==t.toLowerCase()&&n.code==="EXDEV"||o.endsWith("."))await Q1(o,t,{preserveSymlinks:!1}),await q1(o,1);else throw n}}async function j1(o,t,e,n,r=0){try{return await ke.promises.rename(o,t)}catch(i){if(i.code!=="EACCES"&&i.code!=="EPERM"&&i.code!=="EBUSY")throw i;if(Date.now()-e>=n)throw console.error(`[node.js fs] rename failed after ${r} retries with error: ${i}`),i;if(r===0){let s=!1;try{let{stat:a}=await er.stat(t);a.isFile()||(s=!0)}catch{}if(s)throw i}return await uo(Math.min(100,r*10)),j1(o,t,e,n,r+1)}}async function Q1(o,t,e){return J1(o,t,{root:{source:o,target:t},options:e,handledSourcePaths:new Set})}async function J1(o,t,e){if(e.handledSourcePaths.has(o))return;e.handledSourcePaths.add(o);let{stat:n,symbolicLink:r}=await er.stat(o);if(r){if(e.options.preserveSymlinks)try{return await F5(o,t,e)}catch{}if(r.dangling)return}return n.isDirectory()?N5(o,t,n.mode&G1,e):U5(o,t,n.mode&G1)}async function N5(o,t,e,n){await ke.promises.mkdir(t,{recursive:!0,mode:e});let r=await ah(o);for(let i of r)await J1(H(o,i),H(t,i),n)}async function U5(o,t,e){await ke.promises.copyFile(o,t),await ke.promises.chmod(t,e)}async function F5(o,t,e){let n=await ke.promises.readlink(o);Vr(n,e.root.source,!_e)&&(n=H(e.root.target,n.substr(e.root.source.length+1))),await ke.promises.symlink(n,t)}async function V5(o){try{return await Tp(ke.realpath)(o)}catch{let t=W5(o);return await ke.promises.access(t,ke.constants.R_OK),t}}function W5(o){return Sc(In(o),Zt)}var er,D5,K1,G1,Te,fr=y(()=>{ze();yi();sh();Le();me();Nt();ce();Qt();(n=>{async function o(r){let i;try{if(i=await ke.promises.lstat(r),!i.isSymbolicLink())return{stat:i}}catch{}try{return{stat:await ke.promises.stat(r),symbolicLink:i?.isSymbolicLink()?{dangling:!1}:void 0}}catch(s){if(s.code==="ENOENT"&&i)return{stat:i,symbolicLink:{dangling:!0}};if(te&&s.code==="EACCES")try{return{stat:await ke.promises.stat(await ke.promises.readlink(r)),symbolicLink:{dangling:!1}}}catch(a){if(a.code==="ENOENT"&&i)return{stat:i,symbolicLink:{dangling:!0}};throw a}throw s}}n.stat=o;async function t(r){try{let{stat:i,symbolicLink:s}=await n.stat(r);return i.isFile()&&s?.dangling!==!0}catch{}return!1}n.existsFile=t;async function e(r){try{let{stat:i,symbolicLink:s}=await n.stat(r);return i.isDirectory()&&s?.dangling!==!0}catch{}return!1}n.existsDirectory=e})(er||={});D5=new kc;K1=!0;G1=511;Te=new class{get read(){return(o,t,e,n,r)=>new Promise((i,s)=>{ke.read(o,t,e,n,r,(a,l,c)=>a?s(a):i({bytesRead:l,buffer:c}))})}get write(){return(o,t,e,n,r)=>new Promise((i,s)=>{ke.write(o,t,e,n,r,(a,l,c)=>a?s(a):i({bytesWritten:l,buffer:c}))})}get fdatasync(){return Tp(ke.fdatasync)}get open(){return Tp(ke.open)}get close(){return Tp(ke.close)}get ftruncate(){return Tp(ke.ftruncate)}async exists(o){try{return await ke.promises.access(o),!0}catch{return!1}}get readdir(){return ah}get readDirsInDir(){return R5}get writeFile(){return _5}get rm(){return q1}get rename(){return A5}get copy(){return Q1}get realpath(){return V5}}});import{promises as Xi}from"fs";async function ch({userLocale:o,osLocale:t,userDataPath:e,commit:n,nlsMetadataPath:r}){if(Ot("code/willGenerateNls"),process.env.VSCODE_DEV||o==="pseudo"||o.startsWith("en")||!n||!e)return Pp(o,t,r);try{let i=await B5(e);if(!i)return Pp(o,t,r);let s=H5(i,o);if(!s)return Pp(o,t,r);let a=i[s],l=a?.translations?.vscode;if(!a||typeof a.hash!="string"||!a.translations||typeof l!="string"||!await Te.exists(l))return Pp(o,t,r);let c=`${a.hash}.${s}`,u=H(e,"clp",c),p=H(u,n),m=H(p,"nls.messages.json"),g=H(u,"tcf.json"),h=H(u,"corrupted.info");await Te.exists(h)&&await Xi.rm(u,{recursive:!0,force:!0,maxRetries:3});let v={userLocale:o,osLocale:t,resolvedLanguage:s,defaultMessagesFile:H(r,"nls.messages.json"),languagePack:{translationsConfigFile:g,messagesFile:m,corruptMarkerFile:h},locale:o,availableLanguages:{"*":s},_languagePackId:c,_languagePackSupport:!0,_translationsConfigFile:g,_cacheRoot:u,_resolvedLanguagePackCoreLocation:p,_corruptedFile:h};if(await Te.exists(m))return $5(p).catch(()=>{}),Ot("code/didGenerateNls"),v;let[x,T,w]=await Promise.all([Xi.readFile(H(r,"nls.keys.json"),"utf-8").then(B=>JSON.parse(B)),Xi.readFile(H(r,"nls.messages.json"),"utf-8").then(B=>JSON.parse(B)),Xi.readFile(l,"utf-8").then(B=>JSON.parse(B))]),k=[],M=0;for(let[B,He]of x){let U=w.contents[B];for(let Y of He)k.push(U?.[Y]||T[M]),M++}return await Xi.mkdir(p,{recursive:!0}),await Promise.all([Xi.writeFile(m,JSON.stringify(k),"utf-8"),Xi.writeFile(g,JSON.stringify(a.translations),"utf-8")]),Ot("code/didGenerateNls"),v}catch(i){console.error("Generating translation files failed.",i)}return Pp(o,t,r)}async function B5(o){let t=H(o,"languagepacks.json");try{return JSON.parse(await Xi.readFile(t,"utf-8"))}catch{return}}function H5(o,t){try{for(;t;){if(o[t])return t;let e=t.lastIndexOf("-");if(e>0)t=t.substring(0,e);else return}}catch(e){console.error("Resolving language pack configuration failed.",e)}}function Pp(o,t,e){return Ot("code/didGenerateNls"),{userLocale:o,osLocale:t,resolvedLanguage:"en",defaultMessagesFile:H(e,"nls.messages.json"),locale:o,availableLanguages:{}}}function $5(o){let t=new Date;return Xi.utimes(o,t,t)}var rS=y(()=>{Le();zo();fr()});var Bs,dh=y(()=>{Bs=class{constructor(...t){this._entries=new Map;for(let[e,n]of t)this.set(e,n)}set(t,e){let n=this._entries.get(t);return this._entries.set(t,e),n}has(t){return this._entries.has(t)}get(t){return this._entries.get(t)}}});function oS(o,t){return t&&(o.stack||o.stacktrace)?d(70,null,Y1(o),X1(o.stack)||X1(o.stacktrace)):Y1(o)}function X1(o){return Array.isArray(o)?o.join(`
- `):o}function Y1(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?d(69,null,o.message):o.message||d(67,null)}function Do(o=null,t=!1){if(!o)return d(67,null);if(Array.isArray(o)){let e=Qn(o),n=Do(e[0],t);return e.length>1?d(68,null,n,e.length):n}if(ne(o))return o;if(o.detail){let e=o.detail;if(e.error)return oS(e.error,t);if(e.exception)return oS(e.exception,t)}return o.stack?oS(o,t):o.message?o.message:d(67,null)}var rl=y(()=>{At();Me();pe()});function kp(o){let t=o;return t?[t.on,t.pause,t.resume,t.destroy].every(e=>typeof e=="function"):!1}function uh(o){let t=o;return t?kp(t.stream)&&Array.isArray(t.buffer)&&typeof t.ended=="boolean":!1}function Hs(o,t){return new iS(o,t)}function Z1(o,t){let e=[],n;for(;(n=o.read())!==null;)e.push(n);return t(e)}function eD(o,t,e){let n=[],r;for(;(r=o.read())!==null&&n.length<e;)n.push(r);return r===null&&n.length>0?t(n):{read:()=>{if(n.length>0)return n.shift();if(typeof r<"u"){let i=r;return r=void 0,i}return o.read()}}}function ph(o,t){return new Promise((e,n)=>{let r=[];Dc(o,{onData:i=>{t&&r.push(i)},onError:i=>{t?n(i):e(void 0)},onEnd:()=>{e(t?t(r):void 0)}})})}function Dc(o,t,e){o.on("error",n=>{e?.isCancellationRequested||t.onError(n)}),o.on("end",()=>{e?.isCancellationRequested||t.onEnd()}),o.on("data",n=>{e?.isCancellationRequested||t.onData(n)})}function tD(o,t){return new Promise((e,n)=>{let r=new le,i=[],s=c=>{if(i.push(c),i.length>t)return r.dispose(),o.pause(),e({stream:o,buffer:i,ended:!1})},a=c=>(r.dispose(),n(c)),l=()=>(r.dispose(),e({stream:o,buffer:i,ended:!0}));r.add(ie(()=>o.removeListener("error",a))),o.on("error",a),r.add(ie(()=>o.removeListener("end",l))),o.on("end",l),r.add(ie(()=>o.removeListener("data",s))),o.on("data",s)})}function nD(o){let t=!1;return{read:()=>t?null:(t=!0,o)}}function mh(o,t,e){let n=Hs(e);return Dc(o,{onData:r=>n.write(t.data(r)),onError:r=>n.error(t.error?t.error(r):r),onEnd:()=>n.end()}),n}var iS,_c=y(()=>{Se();q();iS=class{constructor(t,e){this.reducer=t;this.options=e;this.state={flowing:!1,ended:!1,destroyed:!1};this.buffer={data:[],error:[]};this.listeners={data:[],error:[],end:[]};this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(t){if(!this.state.destroyed){if(this.state.flowing)this.emitData(t);else if(this.buffer.data.push(t),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(e=>this.pendingWritePromises.push(e))}}error(t){this.state.destroyed||(this.state.flowing?this.emitError(t):this.buffer.error.push(t))}end(t){this.state.destroyed||(typeof t<"u"&&this.write(t),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(t){this.listeners.data.slice(0).forEach(e=>e(t))}emitError(t){this.listeners.error.length===0?Ke(t):this.listeners.error.slice(0).forEach(e=>e(t))}emitEnd(){this.listeners.end.slice(0).forEach(t=>t())}on(t,e){if(!this.state.destroyed)switch(t){case"data":this.listeners.data.push(e),this.resume();break;case"end":this.listeners.end.push(e),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(e),this.state.flowing&&this.flowErrors();break}}removeListener(t,e){if(this.state.destroyed)return;let n;switch(t){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let r=n.indexOf(e);r>=0&&n.splice(r,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let e=this.reducer(this.buffer.data);this.emitData(e)}else for(let e of this.buffer.data)this.emitData(e);this.buffer.data.length=0;let t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(e=>e())}flowErrors(){if(this.listeners.error.length>0){for(let t of this.buffer.error)this.emitError(t);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}});function q5(o,t,e=0){let n=t.byteLength,r=o.byteLength;if(n===0)return 0;if(n===1)return o.indexOf(t[0],e);if(n>r-e)return-1;let i=G5.value;i.fill(t.length);for(let c=0;c<t.length;c++)i[t[c]]=t.length-c-1;let s=e+t.length-1,a=s,l=-1;for(;s<r;)if(o[s]===t[a]){if(a===0){l=s;break}s--,a--}else s+=Math.max(t.length-a,i[o[s]]),a=t.length-1;return l}function K5(o,t){return o[t]*2**24+o[t+1]*2**16+o[t+2]*2**8+o[t+3]}function j5(o,t,e){o[e+3]=t,t=t>>>8,o[e+2]=t,t=t>>>8,o[e+1]=t,t=t>>>8,o[e]=t}function Q5(o,t){return o[t+0]<<0>>>0|o[t+1]<<8>>>0|o[t+2]<<16>>>0|o[t+3]<<24>>>0}function J5(o,t,e){o[e+0]=t&255,t=t>>>8,o[e+1]=t&255,t=t>>>8,o[e+2]=t&255,t=t>>>8,o[e+3]=t&255}function X5(o,t){return o[t]}function Y5(o,t,e){o[e]=t}function iD(o){return Z1(o,t=>A.concat(t))}function sD(o){return nD(o)}function Br(o){return ph(o,t=>A.concat(t))}async function aD(o){return o.ended?A.concat(o.buffer):A.concat([...o.buffer,await Br(o.stream)])}function lD(o){return mh(o,{data:t=>typeof t=="string"?A.fromString(t):A.wrap(t)},t=>A.concat(t))}function cD(o){return Hs(t=>A.concat(t),o)}function Yi(o){let t=0,e=0,n=0,r=new Uint8Array(Math.floor(o.length/4*3)),i=a=>{switch(e){case 3:r[n++]=t|a,e=0;break;case 2:r[n++]=t|a>>>2,t=a<<6,e=3;break;case 1:r[n++]=t|a>>>4,t=a<<4,e=2;break;default:t=a<<2,e=1}};for(let a=0;a<o.length;a++){let l=o.charCodeAt(a);if(l>=65&&l<=90)i(l-65);else if(l>=97&&l<=122)i(l-97+26);else if(l>=48&&l<=57)i(l-48+52);else if(l===43||l===45)i(62);else if(l===47||l===95)i(63);else{if(l===61)break;throw new SyntaxError(`Unexpected base64 character ${o[a]}`)}}let s=n;for(;e>0;)i(0);return A.wrap(r).slice(0,s)}function _o({buffer:o},t=!0,e=!1){let n=e?e7:Z5,r="",i=o.byteLength%3,s=0;for(;s<o.byteLength-i;s+=3){let a=o[s+0],l=o[s+1],c=o[s+2];r+=n[a>>>2],r+=n[(a<<4|l>>>4)&63],r+=n[(l<<2|c>>>6)&63],r+=n[c&63]}if(i===1){let a=o[s+0];r+=n[a>>>2],r+=n[a<<4&63],t&&(r+="==")}else if(i===2){let a=o[s+0],l=o[s+1];r+=n[a>>>2],r+=n[(a<<4|l>>>4)&63],r+=n[l<<2&63],t&&(r+="=")}return r}function Dp({buffer:o}){let t="";for(let e=0;e<o.length;e++){let n=o[e];t+=rD[n>>>4],t+=rD[n&15]}return t}function dD(o){if(o.length%2!==0)throw new SyntaxError("Hex string must have an even length");let t=new Uint8Array(o.length>>1);for(let e=0;e<o.length;)t[e>>1]=oD(o,e++)<<4|oD(o,e++);return A.wrap(t)}function oD(o,t){let e=o.charCodeAt(t);if(e>=48&&e<=57)return e-48;if(e>=97&&e<=102)return e-87;if(e>=65&&e<=70)return e-55;throw new SyntaxError(`Invalid hex character at position ${t}`)}var Rp,G5,sS,aS,A,Z5,e7,rD,et=y(()=>{Qi();_c();Rp=typeof Buffer<"u",G5=new gn(()=>new Uint8Array(256)),A=class o{static alloc(t){return Rp?new o(Buffer.allocUnsafe(t)):new o(new Uint8Array(t))}static wrap(t){return Rp&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new o(t)}static fromString(t,e){return!(e?.dontUseNodeBuffer||!1)&&Rp?new o(Buffer.from(t)):(sS||(sS=new TextEncoder),new o(sS.encode(t)))}static fromByteArray(t){let e=o.alloc(t.length);for(let n=0,r=t.length;n<r;n++)e.buffer[n]=t[n];return e}static concat(t,e){if(typeof e>"u"){e=0;for(let i=0,s=t.length;i<s;i++)e+=t[i].byteLength}let n=o.alloc(e),r=0;for(let i=0,s=t.length;i<s;i++){let a=t[i];n.set(a,r),r+=a.byteLength}return n}static isNativeBuffer(t){return Rp&&Buffer.isBuffer(t)}constructor(t){this.buffer=t,this.byteLength=this.buffer.byteLength}clone(){let t=o.alloc(this.byteLength);return t.set(this),t}toString(){return Rp?this.buffer.toString():(aS||(aS=new TextDecoder(void 0,{ignoreBOM:!0})),aS.decode(this.buffer))}slice(t,e){return new o(this.buffer.subarray(t,e))}set(t,e){if(t instanceof o)this.buffer.set(t.buffer,e);else if(t instanceof Uint8Array)this.buffer.set(t,e);else if(t instanceof ArrayBuffer)this.buffer.set(new Uint8Array(t),e);else if(ArrayBuffer.isView(t))this.buffer.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),e);else throw new Error("Unknown argument 'array'")}readUInt32BE(t){return K5(this.buffer,t)}writeUInt32BE(t,e){j5(this.buffer,t,e)}readUInt32LE(t){return Q5(this.buffer,t)}writeUInt32LE(t,e){J5(this.buffer,t,e)}readUInt8(t){return X5(this.buffer,t)}writeUInt8(t,e){Y5(this.buffer,t,e)}indexOf(t,e=0){return q5(this.buffer,t instanceof o?t.buffer:t,e)}equals(t){return this===t?!0:this.byteLength!==t.byteLength?!1:this.buffer.every((e,n)=>e===t.buffer[n])}};Z5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";rD="0123456789abcdef"});function po(o){return cS(o,0)}function cS(o,t){switch(typeof o){case"object":return o===null?Zi(349,t):Array.isArray(o)?n7(o,t):r7(o,t);case"string":return pD(o,t);case"boolean":return t7(o,t);case"number":return Zi(o,t);case"undefined":return Zi(937,t);default:return Zi(617,t)}}function Zi(o,t){return(t<<5)-t+o|0}function t7(o,t){return Zi(o?433:863,t)}function pD(o,t){t=Zi(149417,t);for(let e=0,n=o.length;e<n;e++)t=Zi(o.charCodeAt(e),t);return t}function n7(o,t){return t=Zi(104579,t),o.reduce((e,n)=>cS(n,e),t)}function r7(o,t){return t=Zi(181387,t),Object.keys(o).sort().reduce((e,n)=>(e=pD(n,e),cS(o[n],e)),t)}function lS(o,t,e=32){let n=e-t,r=~((1<<n)-1);return(o<<t|(r&o)>>>n)>>>0}function _p(o,t=32){return o instanceof ArrayBuffer?Dp(A.wrap(new Uint8Array(o))):(o>>>0).toString(16).padStart(t/4,"0")}var uD,ol=y(()=>{et();Qt();uD=class o{constructor(){this._h0=1732584193;this._h1=4023233417;this._h2=2562383102;this._h3=271733878;this._h4=3285377520;this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}update(t){let e=t.length;if(e===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,s,a;for(i!==0?(s=i,a=-1,i=0):(s=t.charCodeAt(0),a=0);;){let l=s;if(b1(s))if(a+1<e){let c=t.charCodeAt(a+1);Vx(c)?(a++,l=I1(s,c)):l=65533}else{i=s;break}else Vx(s)&&(l=65533);if(r=this._push(n,r,l),a++,a<e)s=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=i}_push(t,e,n){return n<128?t[e++]=n:n<2048?(t[e++]=192|(n&1984)>>>6,t[e++]=128|(n&63)>>>0):n<65536?(t[e++]=224|(n&61440)>>>12,t[e++]=128|(n&4032)>>>6,t[e++]=128|(n&63)>>>0):(t[e++]=240|(n&1835008)>>>18,t[e++]=128|(n&258048)>>>12,t[e++]=128|(n&4032)>>>6,t[e++]=128|(n&63)>>>0),e>=64&&(this._step(),e-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),e}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),_p(this._h0)+_p(this._h1)+_p(this._h2)+_p(this._h3)+_p(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=o._bigBlock32,e=this._buffDV;for(let p=0;p<64;p+=4)t.setUint32(p,e.getUint32(p,!1),!1);for(let p=64;p<320;p+=4)t.setUint32(p,lS(t.getUint32(p-12,!1)^t.getUint32(p-32,!1)^t.getUint32(p-56,!1)^t.getUint32(p-64,!1),1),!1);let n=this._h0,r=this._h1,i=this._h2,s=this._h3,a=this._h4,l,c,u;for(let p=0;p<80;p++)p<20?(l=r&i|~r&s,c=1518500249):p<40?(l=r^i^s,c=1859775393):p<60?(l=r&i|r&s|i&s,c=2400959708):(l=r^i^s,c=3395469782),u=lS(n,5)+l+a+c+t.getUint32(p*4,!1)&4294967295,a=s,s=i,i=lS(r,30),r=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+i&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}});function dS(...o){switch(o.length){case 1:return d(648,null,o[0]);case 2:return d(649,null,o[0],o[1]);case 3:return d(650,null,o[0],o[1],o[2]);default:return}}var o7,i7,$s,mD=y(()=>{Ro();Se();pe();o7=d(647,null),i7=d(646,null),$s=class o{constructor(){this._input="";this._start=0;this._current=0;this._tokens=[];this._errors=[];this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(t){switch(t.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return t.isTripleEq?"===":"==";case 4:return t.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return t.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return t.lexeme;case 18:return t.lexeme;case 19:return t.lexeme;case 20:return"EOF";default:throw Vg(`unhandled token type: ${JSON.stringify(t)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(t=>t.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(t){return this._input=t,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){let e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){let e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(dS("==","=~"));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(dS("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(dS("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(t){return this._isAtEnd()||this._input.charCodeAt(this._current)!==t?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(t){this._tokens.push({type:t,offset:this._start})}_error(t){let e=this._start,n=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:n};this._errors.push({offset:e,lexeme:n,additionalInfo:t}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;let t=this.stringRe.exec(this._input);if(t){this._current=this._start+t[0].length;let e=this._input.substring(this._start,this._current),n=o._keywords.get(e);n?this._addToken(n):this._tokens.push({type:17,lexeme:e,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(o7);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let t=this._current,e=!1,n=!1;for(;;){if(t>=this._input.length){this._current=t,this._error(i7);return}let i=this._input.charCodeAt(t);if(e)e=!1;else if(i===47&&!n){t++;break}else i===91?n=!0:i===92?e=!0:i===93&&(n=!1);t++}for(;t<this._input.length&&o._regexFlags.has(this._input.charCodeAt(t));)t++;this._current=t;let r=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:r,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}});function s7(o,t,e){t[Jo.DI_TARGET]===t?t[Jo.DI_DEPENDENCIES].push({id:o,index:e}):(t[Jo.DI_DEPENDENCIES]=[{id:o,index:e}],t[Jo.DI_TARGET]=t)}function _(o){if(Jo.serviceIds.has(o))return Jo.serviceIds.get(o);let t=function(e,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");s7(t,e,r)};return t.toString=()=>o,Jo.serviceIds.set(o,t),t}var Jo,gr,re=y(()=>{(r=>{r.serviceIds=new Map,r.DI_TARGET="$di$target",r.DI_DEPENDENCIES="$di$dependencies";function n(i){return i[r.DI_DEPENDENCIES]||[]}r.getServiceDependencies=n})(Jo||={});gr=_("instantiationService")});function Lp(o,t){return o.cmp(t)}function gh(o,t){if(typeof o=="string"){let e=parseFloat(o);isNaN(e)||(o=e)}return typeof o=="string"||typeof o=="number"?t(o):tr.INSTANCE}function hD(o){let t=null;for(let e=0,n=o.length;e<n;e++){let r=o[e].substituteConstants();if(o[e]!==r&&t===null){t=[];for(let i=0;i<e;i++)t[i]=o[i]}t!==null&&(t[e]=r)}return t===null?o:t}function vD(o,t){return o<t?-1:o>t?1:0}function ll(o,t,e,n){return o<e?-1:o>e?1:t<n?-1:t>n?1:0}function gD(o){return o.type===9?o.expr:[o]}var Pn,a7,l7,c7,d7,u7,fD,p7,m7,f7,g7,uS,Lt,tr,hr,es,zs,Lc,Mc,Gs,ts,qs,il,sl,al,Ks,pS,fh,Mp,S,js,mo=y(()=>{Ro();me();Qt();mD();re();pe();Se();Pn=new Map;Pn.set("false",!1);Pn.set("true",!0);Pn.set("isMac",rt);Pn.set("isLinux",_e);Pn.set("isWindows",te);Pn.set("isWeb",Yt);Pn.set("isMacNative",rt&&!Yt);Pn.set("isEdge",Dg);Pn.set("isFirefox",OR);Pn.set("isChrome",dp);Pn.set("isSafari",AR);a7=Object.prototype.hasOwnProperty,l7={regexParsingWithErrorRecovery:!0},c7=d(627,null),d7=d(628,null),u7=d(630,null),fD=d(626,null),p7=d(633,null),m7=d(634,null),f7=d(631,null),g7=d(632,null),uS=class o{constructor(t=l7){this._config=t;this._scanner=new $s;this._tokens=[];this._current=0;this._parsingErrors=[];this._flagsGYRe=/g|y/g}static{this._parseError=new Error}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}parse(t){if(t===""){this._parsingErrors.push({message:c7,offset:0,lexeme:"",additionalInfo:d7});return}this._tokens=this._scanner.reset(t).scan(),this._current=0,this._parsingErrors=[];try{let e=this._expr();if(!this._isAtEnd()){let n=this._peek(),r=n.type===17?m7:void 0;throw this._parsingErrors.push({message:p7,offset:n.offset,lexeme:$s.getLexeme(n),additionalInfo:r}),o._parseError}return e}catch(e){if(e!==o._parseError)throw e;return}}_expr(){return this._or()}_or(){let t=[this._and()];for(;this._matchOne(16);){let e=this._and();t.push(e)}return t.length===1?t[0]:Lt.or(...t)}_and(){let t=[this._term()];for(;this._matchOne(15);){let e=this._term();t.push(e)}return t.length===1?t[0]:Lt.and(...t)}_term(){if(this._matchOne(2)){let t=this._peek();switch(t.type){case 11:return this._advance(),tr.INSTANCE;case 12:return this._advance(),hr.INSTANCE;case 0:{this._advance();let e=this._expr();return this._consume(1,fD),e?.negate()}case 17:return this._advance(),ts.create(t.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",t)}}return this._primary()}_primary(){let t=this._peek();switch(t.type){case 11:return this._advance(),Lt.true();case 12:return this._advance(),Lt.false();case 0:{this._advance();let e=this._expr();return this._consume(1,fD),e}case 17:{let e=t.lexeme;if(this._advance(),this._matchOne(9)){let r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);let i=r.lexeme,s=i.lastIndexOf("/"),a=s===i.length-1?void 0:this._removeFlagsGY(i.substring(s+1)),l;try{l=new RegExp(i.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return Ks.create(e,l)}switch(r.type){case 10:case 19:{let i=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let m=0;m<r.lexeme.length;m++)r.lexeme.charCodeAt(m)===40?a++:r.lexeme.charCodeAt(m)===41&&a--;for(;!this._isAtEnd()&&s.type!==15&&s.type!==16;){switch(s.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let m=0;m<s.lexeme.length;m++)s.lexeme.charCodeAt(m)===40?a++:r.lexeme.charCodeAt(m)===41&&a--}if(a<0)break;i.push($s.getLexeme(s)),this._advance(),s=this._peek()}let l=i.join(""),c=l.lastIndexOf("/"),u=c===l.length-1?void 0:this._removeFlagsGY(l.substring(c+1)),p;try{p=new RegExp(l.substring(1,c),u)}catch{throw this._errExpectedButGot("REGEX",r)}return Lt.regex(e,p)}case 18:{let i=r.lexeme;this._advance();let s=null;if(!vp(i)){let a=i.indexOf("/"),l=i.lastIndexOf("/");if(a!==l&&a>=0){let c=i.slice(a+1,l),u=i[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return Ks.create(e,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,u7);let r=this._value();return Lt.notIn(e,r)}switch(this._peek().type){case 3:{this._advance();let r=this._value();if(this._previous().type===18)return Lt.equals(e,r);switch(r){case"true":return Lt.has(e);case"false":return Lt.not(e);default:return Lt.equals(e,r)}}case 4:{this._advance();let r=this._value();if(this._previous().type===18)return Lt.notEquals(e,r);switch(r){case"true":return Lt.not(e);case"false":return Lt.has(e);default:return Lt.notEquals(e,r)}}case 5:return this._advance(),sl.create(e,this._value());case 6:return this._advance(),al.create(e,this._value());case 7:return this._advance(),qs.create(e,this._value());case 8:return this._advance(),il.create(e,this._value());case 13:return this._advance(),Lt.in(e,this._value());default:return Lt.has(e)}}case 20:throw this._parsingErrors.push({message:f7,offset:t.offset,lexeme:"",additionalInfo:g7}),o._parseError;default:throw this._errExpectedButGot(`true | false | KEY
- | KEY '=~' REGEX
- | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let t=this._peek();switch(t.type){case 17:case 18:return this._advance(),t.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(t){return t.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(t){return this._check(t)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(t,e){if(this._check(t))return this._advance();throw this._errExpectedButGot(e,this._peek())}_errExpectedButGot(t,e,n){let r=d(629,null,t,$s.getLexeme(e)),i=e.offset,s=$s.getLexeme(e);return this._parsingErrors.push({message:r,offset:i,lexeme:s,additionalInfo:n}),o._parseError}_check(t){return this._peek().type===t}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},Lt=class{static false(){return tr.INSTANCE}static true(){return hr.INSTANCE}static has(t){return es.create(t)}static equals(t,e){return zs.create(t,e)}static notEquals(t,e){return Gs.create(t,e)}static regex(t,e){return Ks.create(t,e)}static in(t,e){return Lc.create(t,e)}static notIn(t,e){return Mc.create(t,e)}static not(t){return ts.create(t)}static and(...t){return fh.create(t,null,!0)}static or(...t){return Mp.create(t,null,!0)}static greater(t,e){return qs.create(t,e)}static greaterEquals(t,e){return il.create(t,e)}static smaller(t,e){return sl.create(t,e)}static smallerEquals(t,e){return al.create(t,e)}static{this._parser=new uS({regexParsingWithErrorRecovery:!1})}static deserialize(t){return t==null?void 0:this._parser.parse(t)}};tr=class o{constructor(){this.type=0}static{this.INSTANCE=new o}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!1}serialize(){return"false"}keys(){return[]}map(t){return this}negate(){return hr.INSTANCE}},hr=class o{constructor(){this.type=1}static{this.INSTANCE=new o}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!0}serialize(){return"true"}keys(){return[]}map(t){return this}negate(){return tr.INSTANCE}},es=class o{constructor(t,e){this.key=t;this.negated=e;this.type=2}static create(t,e=null){let n=Pn.get(t);return typeof n=="boolean"?n?hr.INSTANCE:tr.INSTANCE:new o(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:vD(this.key,t.key)}equals(t){return t.type===this.type?this.key===t.key:!1}substituteConstants(){let t=Pn.get(this.key);return typeof t=="boolean"?t?hr.INSTANCE:tr.INSTANCE:this}evaluate(t){return!!t.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(t){return t.mapDefined(this.key)}negate(){return this.negated||(this.negated=ts.create(this.key,this)),this.negated}},zs=class o{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=4}static create(t,e,n=null){if(typeof e=="boolean")return e?es.create(t,n):ts.create(t,n);let r=Pn.get(t);return typeof r=="boolean"?e===(r?"true":"false")?hr.INSTANCE:tr.INSTANCE:new o(t,e,n)}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){let t=Pn.get(this.key);if(typeof t=="boolean"){let e=t?"true":"false";return this.value===e?hr.INSTANCE:tr.INSTANCE}return this}evaluate(t){return t.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(t){return t.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=Gs.create(this.key,this.value,this)),this.negated}},Lc=class o{constructor(t,e){this.key=t;this.valueKey=e;this.type=10;this.negated=null}static create(t,e){return new o(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.valueKey,t.key,t.valueKey)}equals(t){return t.type===this.type?this.key===t.key&&this.valueKey===t.valueKey:!1}substituteConstants(){return this}evaluate(t){let e=t.getValue(this.valueKey),n=t.getValue(this.key);if(Array.isArray(e)){if(e.includes(n))return!0;if(te&&typeof n=="string"&&n.startsWith("file:///")){let r=n.toLowerCase();return e.some(i=>typeof i=="string"&&i.toLowerCase()===r)}return!1}if(typeof n=="string"&&typeof e=="object"&&e!==null){if(a7.call(e,n))return!0;if(te&&n.startsWith("file:///")){let r=n.toLowerCase();return Object.keys(e).some(i=>i.toLowerCase()===r)}return!1}return!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(t){return t.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=Mc.create(this.key,this.valueKey)),this.negated}},Mc=class o{constructor(t,e){this.key=t;this.valueKey=e;this.type=11;this._negated=Lc.create(t,e)}static create(t,e){return new o(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:this._negated.cmp(t._negated)}equals(t){return t.type===this.type?this._negated.equals(t._negated):!1}substituteConstants(){return this}evaluate(t){return!this._negated.evaluate(t)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(t){return t.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},Gs=class o{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=5}static create(t,e,n=null){if(typeof e=="boolean")return e?ts.create(t,n):es.create(t,n);let r=Pn.get(t);return typeof r=="boolean"?e===(r?"true":"false")?tr.INSTANCE:hr.INSTANCE:new o(t,e,n)}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){let t=Pn.get(this.key);if(typeof t=="boolean"){let e=t?"true":"false";return this.value===e?tr.INSTANCE:hr.INSTANCE}return this}evaluate(t){return t.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(t){return t.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=zs.create(this.key,this.value,this)),this.negated}},ts=class o{constructor(t,e){this.key=t;this.negated=e;this.type=3}static create(t,e=null){let n=Pn.get(t);return typeof n=="boolean"?n?tr.INSTANCE:hr.INSTANCE:new o(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:vD(this.key,t.key)}equals(t){return t.type===this.type?this.key===t.key:!1}substituteConstants(){let t=Pn.get(this.key);return typeof t=="boolean"?t?tr.INSTANCE:hr.INSTANCE:this}evaluate(t){return!t.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(t){return t.mapNot(this.key)}negate(){return this.negated||(this.negated=es.create(this.key,this)),this.negated}};qs=class o{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=12}static create(t,e,n=null){return gh(e,r=>new o(t,r,n))}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(t){return t.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=al.create(this.key,this.value,this)),this.negated}},il=class o{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=13}static create(t,e,n=null){return gh(e,r=>new o(t,r,n))}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(t){return t.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=sl.create(this.key,this.value,this)),this.negated}},sl=class o{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=14}static create(t,e,n=null){return gh(e,r=>new o(t,r,n))}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(t){return t.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=il.create(this.key,this.value,this)),this.negated}},al=class o{constructor(t,e,n){this.key=t;this.value=e;this.negated=n;this.type=15}static create(t,e,n=null){return gh(e,r=>new o(t,r,n))}cmp(t){return t.type!==this.type?this.type-t.type:ll(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type?this.key===t.key&&this.value===t.value:!1}substituteConstants(){return this}evaluate(t){return typeof this.value=="string"?!1:parseFloat(t.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(t){return t.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=qs.create(this.key,this.value,this)),this.negated}},Ks=class o{constructor(t,e){this.key=t;this.regexp=e;this.type=7;this.negated=null}static create(t,e){return new o(t,e)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.key<t.key)return-1;if(this.key>t.key)return 1;let e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return e<n?-1:e>n?1:0}equals(t){if(t.type===this.type){let e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return this.key===t.key&&e===n}return!1}substituteConstants(){return this}evaluate(t){let e=t.getValue(this.key);return this.regexp?this.regexp.test(e):!1}serialize(){let t=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${t}`}keys(){return[this.key]}map(t){return t.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=pS.create(this)),this.negated}},pS=class o{constructor(t){this._actual=t;this.type=8}static create(t){return new o(t)}cmp(t){return t.type!==this.type?this.type-t.type:this._actual.cmp(t._actual)}equals(t){return t.type===this.type?this._actual.equals(t._actual):!1}substituteConstants(){return this}evaluate(t){return!this._actual.evaluate(t)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(t){return new o(this._actual.map(t))}negate(){return this._actual}};fh=class o{constructor(t,e){this.expr=t;this.negated=e;this.type=6}static create(t,e,n){return o._normalizeArr(t,e,n)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let e=0,n=this.expr.length;e<n;e++){let r=Lp(this.expr[e],t.expr[e]);if(r!==0)return r}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].equals(t.expr[e]))return!1;return!0}return!1}substituteConstants(){let t=hD(this.expr);return t===this.expr?this:o.create(t,this.negated,!1)}evaluate(t){for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].evaluate(t))return!1;return!0}static _normalizeArr(t,e,n){let r=[],i=!1;for(let s of t)if(s){if(s.type===1){i=!0;continue}if(s.type===0)return tr.INSTANCE;if(s.type===6){r.push(...s.expr);continue}r.push(s)}if(r.length===0&&i)return hr.INSTANCE;if(r.length!==0){if(r.length===1)return r[0];r.sort(Lp);for(let s=1;s<r.length;s++)r[s-1].equals(r[s])&&(r.splice(s,1),s--);if(r.length===1)return r[0];for(;r.length>1;){let s=r[r.length-1];if(s.type!==9)break;r.pop();let a=r.pop(),l=r.length===0,c=Mp.create(s.expr.map(u=>o.create([u,a],null,n)),null,l);c&&(r.push(c),r.sort(Lp))}if(r.length===1)return r[0];if(n){for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++)if(r[s].negate().equals(r[a]))return tr.INSTANCE;if(r.length===1)return r[0]}return new o(r,e)}}serialize(){return this.expr.map(t=>t.serialize()).join(" && ")}keys(){let t=[];for(let e of this.expr)t.push(...e.keys());return t}map(t){return new o(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());this.negated=Mp.create(t,this,!0)}return this.negated}},Mp=class o{constructor(t,e){this.expr=t;this.negated=e;this.type=9}static create(t,e,n){return o._normalizeArr(t,e,n)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let e=0,n=this.expr.length;e<n;e++){let r=Lp(this.expr[e],t.expr[e]);if(r!==0)return r}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].equals(t.expr[e]))return!1;return!0}return!1}substituteConstants(){let t=hD(this.expr);return t===this.expr?this:o.create(t,this.negated,!1)}evaluate(t){for(let e=0,n=this.expr.length;e<n;e++)if(this.expr[e].evaluate(t))return!0;return!1}static _normalizeArr(t,e,n){let r=[],i=!1;if(t){for(let s=0,a=t.length;s<a;s++){let l=t[s];if(l){if(l.type===0){i=!0;continue}if(l.type===1)return hr.INSTANCE;if(l.type===9){r=r.concat(l.expr);continue}r.push(l)}}if(r.length===0&&i)return tr.INSTANCE;r.sort(Lp)}if(r.length!==0){if(r.length===1)return r[0];for(let s=1;s<r.length;s++)r[s-1].equals(r[s])&&(r.splice(s,1),s--);if(r.length===1)return r[0];if(n){for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++)if(r[s].negate().equals(r[a]))return hr.INSTANCE;if(r.length===1)return r[0]}return new o(r,e)}}serialize(){return this.expr.map(t=>t.serialize()).join(" || ")}keys(){let t=[];for(let e of this.expr)t.push(...e.keys());return t}map(t){return new o(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());for(;t.length>1;){let e=t.shift(),n=t.shift(),r=[];for(let i of gD(e))for(let s of gD(n))r.push(fh.create([i,s],null,!1));t.unshift(o.create(r,null,!1))}this.negated=o.create(t,this,!0)}return this.negated}},S=class o extends es{static{this._info=[]}static all(){return o._info.values()}constructor(t,e,n){super(t,null),this._defaultValue=e,typeof n=="object"?o._info.push({...n,key:t}):n!==!0&&o._info.push({key:t,description:n,type:e!=null?typeof e:void 0})}bindTo(t){return t.createKey(this.key,this._defaultValue)}getValue(t){return t.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(t){return zs.create(this.key,t)}notEqualsTo(t){return Gs.create(this.key,t)}greater(t){return qs.create(this.key,t)}},js=_("contextKeyService")});function fS(o){return Jn(o)}function h7(o,t){return o!==0&&o<=t}function yD(o,t,e){switch(t){case 1:o.trace(e);break;case 2:o.debug(e);break;case 3:o.info(e);break;case 4:o.warn(e);break;case 5:o.error(e);break;case 0:break;default:throw new Error(`Invalid log level ${t}`)}}function Oc(o,t=!1){let e="";for(let n=0;n<o.length;n++){let r=o[n];if(r instanceof Error&&(r=Do(r,t)),typeof r=="object")try{r=JSON.stringify(r)}catch{}e+=(n>0?" ":"")+r}return e}function Up(o){if(o.verbose)return 1;if(typeof o.logLevel=="string"){let t=v7(o.logLevel.toLowerCase());if(t!==void 0)return t}return Np}function gS(o){switch(o){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 v7(o){switch(o){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 Q,vr,Np,cl,Op,hh,vh,Ap,mS,yh,sq,Fe=y(()=>{pe();rl();de();ol();q();Hn();me();Nt();Me();ce();mo();re();Q=_("logService"),vr=_("loggerService");Np=3;cl=class extends D{constructor(){super(...arguments);this.level=Np;this._onDidChangeLogLevel=this._register(new P)}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 h7(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}},Op=class extends cl{constructor(e){super();this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...n){this.canLog(1)&&this.log(1,Oc([e,...n],!0))}debug(e,...n){this.canLog(2)&&this.log(2,Oc([e,...n]))}info(e,...n){this.canLog(3)&&this.log(3,Oc([e,...n]))}warn(e,...n){this.canLog(4)&&this.log(4,Oc([e,...n]))}error(e,...n){if(this.canLog(5))if(e instanceof Error){let r=Array.prototype.slice.call(arguments);r[0]=e.stack,this.log(5,Oc(r))}else this.log(5,Oc([e,...n]))}flush(){}},hh=class extends cl{constructor(e=Np,n=!0){super();this.useColors=n;this.setLevel(e)}trace(e,...n){this.canLog(1)&&(this.useColors?console.log("%cTRACE","color: #888",e,...n):console.log(e,...n))}debug(e,...n){this.canLog(2)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...n):console.log(e,...n))}info(e,...n){this.canLog(3)&&(this.useColors?console.log("%c INFO","color: #33f",e,...n):console.log(e,...n))}warn(e,...n){this.canLog(4)&&(this.useColors?console.warn("%c WARN","color: #993",e,...n):console.log(e,...n))}error(e,...n){this.canLog(5)&&(this.useColors?console.error("%c ERR","color: #f33",e,...n):console.error(e,...n))}flush(){}},vh=class extends cl{constructor(e){super();this.loggers=e;e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let n of this.loggers)n.setLevel(e);super.setLevel(e)}trace(e,...n){for(let r of this.loggers)r.trace(e,...n)}debug(e,...n){for(let r of this.loggers)r.debug(e,...n)}info(e,...n){for(let r of this.loggers)r.info(e,...n)}warn(e,...n){for(let r of this.loggers)r.warn(e,...n)}error(e,...n){for(let r of this.loggers)r.error(e,...n)}flush(){for(let e of this.loggers)e.flush()}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}},Ap=class extends D{constructor(e,n,r){super();this.logLevel=e;this.logsHome=n;this._loggers=new lt;this._onDidChangeLoggers=this._register(new P);this.onDidChangeLoggers=this._onDidChangeLoggers.event;this._onDidChangeLogLevel=this._register(new P);this.onDidChangeLogLevel=this._onDidChangeLogLevel.event;this._onDidChangeVisibility=this._register(new P);this.onDidChangeVisibility=this._onDidChangeVisibility.event;if(r)for(let i of r)this._loggers.set(i.resource,{logger:void 0,info:i})}getLoggerEntry(e){return ne(e)?[...this._loggers.values()].find(n=>n.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,n){let r=this.toResource(e),i=ne(e)?e:n?.id??po(r.toString()).toString(16),s=this._loggers.get(r)?.logger,a=n?.logLevel==="always"?1:n?.logLevel;s||(s=this.doCreateLogger(r,a??this.getLogLevel(r)??this.logLevel,{...n,id:i}));let l={logger:s,info:{resource:r,id:i,logLevel:a,name:n?.name,hidden:n?.hidden,group:n?.group,extensionId:n?.extensionId,when:n?.when}};return this.registerLogger(l.info),this._loggers.set(r,l),s}toResource(e){return ne(e)?ye(this.logsHome,`${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`):e}setLogLevel(e,n){if(I.isUri(e)){let r=e,i=n,s=this._loggers.get(r);s&&i!==s.info.logLevel&&(s.info.logLevel=i===this.logLevel?void 0:i,s.logger?.setLevel(i),this._loggers.set(s.info.resource,s),this._onDidChangeLogLevel.fire([r,i]))}else{this.logLevel=e;for(let[r,i]of this._loggers.entries())this._loggers.get(r)?.info.logLevel===void 0&&i.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,n){let r=this.getLoggerEntry(e);r&&n!==!r.info.hidden&&(r.info.hidden=!n,this._loggers.set(r.info.resource,r),this._onDidChangeVisibility.fire([r.info.resource,n]))}getLogLevel(e){let n;return e&&(n=this._loggers.get(e)?.info.logLevel),n??this.logLevel}registerLogger(e){let n=this._loggers.get(e.resource);n?n.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){let n=this.toResource(e),r=this._loggers.get(n);r&&(r.logger&&r.logger.dispose(),this._loggers.delete(n),this._onDidChangeLoggers.fire({added:[],removed:[r.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()}},mS=class{constructor(){this.onDidChangeLogLevel=new P().event}setLevel(t){}getLevel(){return 3}trace(t,...e){}debug(t,...e){}info(t,...e){}warn(t,...e){}error(t,...e){}critical(t,...e){}dispose(){}flush(){}},yh=class extends mS{};sq=new S("logLevel",gS(3))});var tt,Fp=y(()=>{tt=class{constructor(t,e=[],n=!1){this.ctor=t,this.staticArguments=e,this.supportsDelayedInstantiation=n}}});function vS(o,t=!1){let e=0,n=o.length,r="",i=0,s=16,a=0;function l(v){let x=0,T=0;for(;x<v;){let w=o.charCodeAt(e);if(w>=48&&w<=57)T=T*16+w-48;else if(w>=65&&w<=70)T=T*16+w-65+10;else if(w>=97&&w<=102)T=T*16+w-97+10;else break;e++,x++}return x<v&&(T=-1),T}function c(v){e=v,r="",i=0,s=16,a=0}function u(){let v=e;if(o.charCodeAt(e)===48)e++;else for(e++;e<o.length&&Ac(o.charCodeAt(e));)e++;if(e<o.length&&o.charCodeAt(e)===46)if(e++,e<o.length&&Ac(o.charCodeAt(e)))for(e++;e<o.length&&Ac(o.charCodeAt(e));)e++;else return a=3,o.substring(v,e);let x=e;if(e<o.length&&(o.charCodeAt(e)===69||o.charCodeAt(e)===101))if(e++,(e<o.length&&o.charCodeAt(e)===43||o.charCodeAt(e)===45)&&e++,e<o.length&&Ac(o.charCodeAt(e))){for(e++;e<o.length&&Ac(o.charCodeAt(e));)e++;x=e}else a=3;return o.substring(v,x)}function p(){let v="",x=e;for(;;){if(e>=n){v+=o.substring(x,e),a=2;break}let T=o.charCodeAt(e);if(T===34){v+=o.substring(x,e),e++;break}if(T===92){if(v+=o.substring(x,e),e++,e>=n){a=2;break}switch(o.charCodeAt(e++)){case 34:v+='"';break;case 92:v+="\\";break;case 47:v+="/";break;case 98:v+="\b";break;case 102:v+="\f";break;case 110:v+=`
- `;break;case 114:v+="\r";break;case 116:v+=" ";break;case 117:{let k=l(4);k>=0?v+=String.fromCharCode(k):a=4;break}default:a=5}x=e;continue}if(T>=0&&T<=31)if(bh(T)){v+=o.substring(x,e),a=2;break}else a=6;e++}return v}function m(){if(r="",a=0,i=e,e>=n)return i=n,s=17;let v=o.charCodeAt(e);if(hS(v)){do e++,r+=String.fromCharCode(v),v=o.charCodeAt(e);while(hS(v));return s=15}if(bh(v))return e++,r+=String.fromCharCode(v),v===13&&o.charCodeAt(e)===10&&(e++,r+=`
- `),s=14;switch(v){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++,r=p(),s=10;case 47:{let x=e-1;if(o.charCodeAt(e+1)===47){for(e+=2;e<n&&!bh(o.charCodeAt(e));)e++;return r=o.substring(x,e),s=12}if(o.charCodeAt(e+1)===42){e+=2;let T=n-1,w=!1;for(;e<T;){if(o.charCodeAt(e)===42&&o.charCodeAt(e+1)===47){e+=2,w=!0;break}e++}return w||(e++,a=1),r=o.substring(x,e),s=13}return r+=String.fromCharCode(v),e++,s=16}case 45:if(r+=String.fromCharCode(v),e++,e===n||!Ac(o.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 r+=u(),s=11;default:for(;e<n&&g(v);)e++,v=o.charCodeAt(e);if(i!==e){switch(r=o.substring(i,e),r){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return r+=String.fromCharCode(v),e++,s=16}}function g(v){if(hS(v)||bh(v))return!1;switch(v){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function h(){let v;do v=m();while(v>=12&&v<=15);return v}return{setPosition:c,getPosition:()=>e,scan:t?h:m,getToken:()=>s,getTokenValue:()=>r,getTokenOffset:()=>i,getTokenLength:()=>e-i,getTokenError:()=>a}}function hS(o){return o===32||o===9||o===11||o===12||o===160||o===5760||o>=8192&&o<=8203||o===8239||o===8287||o===12288||o===65279}function bh(o){return o===10||o===13||o===8232||o===8233}function Ac(o){return o>=48&&o<=57}function Lo(o,t=[],e=Ih.DEFAULT){let n=null,r=[],i=[];function s(l){Array.isArray(r)?r.push(l):n!==null&&(r[n]=l)}return Nc(o,{onObjectBegin:()=>{let l={};s(l),i.push(r),r=l,n=null},onObjectProperty:l=>{n=l},onObjectEnd:()=>{r=i.pop()},onArrayBegin:()=>{let l=[];s(l),i.push(r),r=l,n=null},onArrayEnd:()=>{r=i.pop()},onLiteralValue:s,onError:(l,c,u)=>{t.push({error:l,offset:c,length:u})}},e),r[0]}function bD(o,t=[],e=Ih.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function r(l){n.type==="property"&&(n.length=l-n.offset,n=n.parent)}function i(l){return n.children.push(l),l}Nc(o,{onObjectBegin:l=>{n=i({type:"object",offset:l,length:-1,parent:n,children:[]})},onObjectProperty:(l,c,u)=>{n=i({type:"property",offset:c,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:l,offset:c,length:u,parent:n})},onObjectEnd:(l,c)=>{n.length=l+c-n.offset,n=n.parent,r(l+c)},onArrayBegin:(l,c)=>{n=i({type:"array",offset:l,length:-1,parent:n,children:[]})},onArrayEnd:(l,c)=>{n.length=l+c-n.offset,n=n.parent,r(l+c)},onLiteralValue:(l,c,u)=>{i({type:Qs(l),offset:c,length:u,parent:n,value:l}),r(c+u)},onSeparator:(l,c,u)=>{n.type==="property"&&(l===":"?n.colonOffset=c:l===","&&r(c))},onError:(l,c,u)=>{t.push({error:l,offset:c,length:u})}},e);let a=n.children[0];return a&&delete a.parent,a}function yS(o,t){if(!o)return;let e=o;for(let n of t)if(typeof n=="string"){if(e.type!=="object"||!Array.isArray(e.children))return;let r=!1;for(let i of e.children)if(Array.isArray(i.children)&&i.children[0].value===n){e=i.children[1],r=!0;break}if(!r)return}else{let r=n;if(e.type!=="array"||r<0||!Array.isArray(e.children)||r>=e.children.length)return;e=e.children[r]}return e}function Nc(o,t,e=Ih.DEFAULT){let n=vS(o,!1);function r(G){return G?()=>G(n.getTokenOffset(),n.getTokenLength()):()=>!0}function i(G){return G?W=>G(W,n.getTokenOffset(),n.getTokenLength()):()=>!0}let s=r(t.onObjectBegin),a=i(t.onObjectProperty),l=r(t.onObjectEnd),c=r(t.onArrayBegin),u=r(t.onArrayEnd),p=i(t.onLiteralValue),m=i(t.onSeparator),g=r(t.onComment),h=i(t.onError),v=e&&e.disallowComments,x=e&&e.allowTrailingComma;function T(){for(;;){let G=n.scan();switch(n.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:v||w(11);break;case 2:w(12);break;case 6:w(16);break}switch(G){case 12:case 13:v?w(10):g();break;case 16:w(1);break;case 15:case 14:break;default:return G}}}function w(G,W=[],ee=[]){if(h(G),W.length+ee.length>0){let se=n.getToken();for(;se!==17;){if(W.indexOf(se)!==-1){T();break}else if(ee.indexOf(se)!==-1)break;se=T()}}}function k(G){let W=n.getTokenValue();return G?p(W):a(W),T(),!0}function M(){switch(n.getToken()){case 11:{let G=0;try{G=JSON.parse(n.getTokenValue()),typeof G!="number"&&(w(2),G=0)}catch{w(2)}p(G);break}case 7:p(null);break;case 8:p(!0);break;case 9:p(!1);break;default:return!1}return T(),!0}function B(){return n.getToken()!==10?(w(3,[],[2,5]),!1):(k(!1),n.getToken()===6?(m(":"),T(),Y()||w(4,[],[2,5])):w(5,[],[2,5]),!0)}function He(){s(),T();let G=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(G||w(4,[],[]),m(","),T(),n.getToken()===2&&x)break}else G&&w(6,[],[]);B()||w(4,[],[2,5]),G=!0}return l(),n.getToken()!==2?w(7,[2],[]):T(),!0}function U(){c(),T();let G=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(G||w(4,[],[]),m(","),T(),n.getToken()===4&&x)break}else G&&w(6,[],[]);Y()||w(4,[],[4,5]),G=!0}return u(),n.getToken()!==4?w(8,[4],[]):T(),!0}function Y(){switch(n.getToken()){case 3:return U();case 1:return He();case 10:return k(!0);default:return M()}}return T(),n.getToken()===17?e.allowEmptyContent?!0:(w(4,[],[]),!1):Y()?(n.getToken()!==17&&w(9,[],[]),!0):(w(4,[],[]),!1)}function Qs(o){switch(typeof o){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(o){if(Array.isArray(o))return"array"}else return"null";return"object"}default:return"null"}}var Ih,Ii=y(()=>{(t=>t.DEFAULT={allowTrailingComma:!0})(Ih||={})});function xD(o,t,e){let n,r,i,s,a;if(t){for(s=t.offset,a=s+t.length,i=s;i>0&&!Vp(o,i-1);)i--;let k=a;for(;k<o.length&&!Vp(o,k);)k++;r=o.substring(i,k),n=y7(r,e)}else r=o,n=0,i=0,s=0,a=o.length;let l=b7(e,o),c=!1,u=0,p;e.insertSpaces?p=bS(" ",e.tabSize||4):p=" ";let m=vS(r,!1),g=!1;function h(){return l+bS(p,n+u)}function v(){let k=m.scan();for(c=!1;k===15||k===14;)c=c||k===14,k=m.scan();return g=k===16||m.getTokenError()!==0,k}let x=[];function T(k,M,B){!g&&M<a&&B>s&&o.substring(M,B)!==k&&x.push({offset:M,length:B-M,content:k})}let w=v();if(w!==17){let k=m.getTokenOffset()+i,M=bS(p,n);T(M,i,k)}for(;w!==17;){let k=m.getTokenOffset()+m.getTokenLength()+i,M=v(),B="";for(;!c&&(M===12||M===13);){let U=m.getTokenOffset()+i;T(" ",k,U),k=m.getTokenOffset()+m.getTokenLength()+i,B=M===12?h():"",M=v()}if(M===2)w!==1&&(u--,B=h());else if(M===4)w!==3&&(u--,B=h());else{switch(w){case 3:case 1:u++,B=h();break;case 5:case 12:B=h();break;case 13:c?B=h():B=" ";break;case 6:B=" ";break;case 10:if(M===6){B="";break}case 7:case 8:case 9:case 11:case 2:case 4:M===12||M===13?B=" ":M!==5&&M!==17&&(g=!0);break;case 16:g=!0;break}c&&(M===12||M===13)&&(B=h())}let He=m.getTokenOffset()+i;T(B,k,He),w=M}return x}function bS(o,t){let e="";for(let n=0;n<t;n++)e+=o;return e}function y7(o,t){let e=0,n=0,r=t.tabSize||4;for(;e<o.length;){let i=o.charAt(e);if(i===" ")n++;else if(i===" ")n+=r;else break;e++}return Math.floor(n/r)}function b7(o,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n==="\r")return e+1<t.length&&t.charAt(e+1)===`
- `?`\r
- `:"\r";if(n===`
- `)return`
- `}return o&&o.eol||`
- `}function Vp(o,t){return`\r
- `.indexOf(o.charAt(t))!==-1}var SD=y(()=>{Ii()});function ED(o,t,e,n,r){let i=t.slice(),a=bD(o,[]),l,c;for(;i.length>0&&(c=i.pop(),l=yS(a,i),l===void 0&&e!==void 0);)typeof c=="string"?e={[c]:e}:e=[e];if(l)if(l.type==="object"&&typeof c=="string"&&Array.isArray(l.children)){let u=yS(l,[c]);if(u!==void 0)if(e===void 0){if(!u.parent)throw new Error("Malformed AST");let p=l.children.indexOf(u.parent),m,g=u.parent.offset+u.parent.length;if(p>0){let h=l.children[p-1];m=h.offset+h.length}else m=l.offset+1,l.children.length>1&&(g=l.children[1].offset);return Uc(o,{offset:m,length:g-m,content:""},n)}else return Uc(o,{offset:u.offset,length:u.length,content:JSON.stringify(e)},n);else{if(e===void 0)return[];let p=`${JSON.stringify(c)}: ${JSON.stringify(e)}`,m=r?r(l.children.map(h=>h.children[0].value)):l.children.length,g;if(m>0){let h=l.children[m-1];g={offset:h.offset+h.length,length:0,content:","+p}}else l.children.length===0?g={offset:l.offset+1,length:0,content:p}:g={offset:l.offset+1,length:0,content:p+","};return Uc(o,g,n)}}else if(l.type==="array"&&typeof c=="number"&&Array.isArray(l.children))if(e!==void 0){let u=`${JSON.stringify(e)}`,p;if(l.children.length===0||c===0)p={offset:l.offset+1,length:0,content:l.children.length===0?u:u+","};else{let m=c===-1||c>l.children.length?l.children.length:c,g=l.children[m-1];p={offset:g.offset+g.length,length:0,content:","+u}}return Uc(o,p,n)}else{let u=c,p=l.children[u],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===u){let g=l.children[u-1],h=g.offset+g.length,v=l.offset+l.length;m={offset:h,length:v-2-h,content:""}}else m={offset:p.offset,length:l.children[u+1].offset-p.offset,content:""};return Uc(o,m,n)}else throw new Error(`Can not add ${typeof c!="number"?"index":"property"} to parent of type ${l.type}`);else return e===void 0?[]:Uc(o,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(e)},n)}function Uc(o,t,e){let n=IS(o,t),r=t.offset,i=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;r>0&&!Vp(n,r-1);)r--;for(;i<n.length&&!Vp(n,i);)i++}let s=xD(n,{offset:r,length:i-r},e);for(let l=s.length-1;l>=0;l--){let c=s[l];n=IS(n,c),r=Math.min(r,c.offset),i=Math.max(i,c.offset+c.length),i+=c.content.length-c.length}let a=o.length-(n.length-i)-r;return[{offset:r,length:a,content:n.substring(r,i)}]}function IS(o,t){return o.substring(0,t.offset)+t.content+o.substring(t.offset+t.length)}function wD(o,t){let e=t.slice(0).sort((r,i)=>{let s=r.offset-i.offset;return s===0?r.length-i.length:s}),n=o.length;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.offset+i.length<=n)o=IS(o,i);else throw new Error("Overlapping edit");n=i.offset}return o}var CD=y(()=>{Ii();SD()});function fo(o){if(!o||typeof o!="object"||o instanceof RegExp)return o;let t=Array.isArray(o)?[]:{};return Object.entries(o).forEach(([e,n])=>{t[e]=n&&typeof n=="object"?fo(n):n}),t}function TD(o){if(!o||typeof o!="object")return o;let t=[o];for(;t.length>0;){let e=t.shift();Object.freeze(e);for(let n in e)if(PD.call(e,n)){let r=e[n];typeof r=="object"&&!Object.isFrozen(r)&&!e1(r)&&t.push(r)}}return o}function yr(o,t){return xS(o,t,new Set)}function xS(o,t,e){if(_t(o))return o;let n=t(o);if(typeof n<"u")return n;if(Array.isArray(o)){let r=[];for(let i of o)r.push(xS(i,t,e));return r}if(Ue(o)){if(e.has(o))throw new Error("Cannot clone recursive data-structure");e.add(o);let r={};for(let i in o)PD.call(o,i)&&(r[i]=xS(o[i],t,e));return e.delete(o),r}return o}function ns(o,t,e=!0){return Ue(o)?(Ue(t)&&Object.keys(t).forEach(n=>{n in o?e&&(Ue(o[n])&&Ue(t[n])?ns(o[n],t[n],e):o[n]=t[n]):o[n]=t[n]}),o):t}function Ut(o,t){if(o===t)return!0;if(o==null||t===null||t===void 0||typeof o!=typeof t||typeof o!="object"||Array.isArray(o)!==Array.isArray(t))return!1;let e,n;if(Array.isArray(o)){if(o.length!==t.length)return!1;for(e=0;e<o.length;e++)if(!Ut(o[e],t[e]))return!1}else{let r=[];for(n in o)r.push(n);r.sort();let i=[];for(n in t)i.push(n);if(i.sort(),!Ut(r,i))return!1;for(e=0;e<r.length;e++)if(!Ut(o[r[e]],t[r[e]]))return!1}return!0}function Fc(o){let t=new Set;return JSON.stringify(o,(e,n)=>{if(Ue(n)||Array.isArray(n)){if(t.has(n))return"[Circular]";t.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}function SS(o,t){let e=t.toLowerCase(),n=Object.keys(o).find(r=>r.toLowerCase()===e);return n?o[n]:o[t]}var PD,on=y(()=>{Me();PD=Object.prototype.hasOwnProperty});function xh(o){let t=o;return t&&typeof t=="object"&&(!t.overrideIdentifier||typeof t.overrideIdentifier=="string")&&(!t.resource||t.resource instanceof I)}function kD(o){let t=o;return t&&typeof t=="object"&&(!t.overrideIdentifiers||Array.isArray(t.overrideIdentifiers))&&!t.overrideIdentifier&&(!t.resource||t.resource instanceof I)}function RD(o){switch(o){case 1:return"APPLICATION";case 2:return"USER";case 3:return"USER_LOCAL";case 4:return"USER_REMOTE";case 5:return"WORKSPACE";case 6:return"WORKSPACE_FOLDER";case 7:return"DEFAULT";case 8:return"MEMORY"}}function Sh(o,t){let e=Object.create(null);for(let n in o)wS(e,n,o[n],t);return e}function wS(o,t,e,n){let r=t.split("."),i=r.pop(),s=o;for(let a=0;a<r.length;a++){let l=r[a],c=s[l];switch(typeof c){case"undefined":c=s[l]=Object.create(null);break;case"object":if(c===null){n(`Ignoring ${t} as ${r.slice(0,a+1).join(".")} is null`);return}break;default:n(`Ignoring ${t} as ${r.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}s=c}if(typeof s=="object"&&s!==null)try{s[i]=e}catch{n(`Ignoring ${t} as ${r.join(".")} is ${JSON.stringify(s)}`)}else n(`Ignoring ${t} as ${r.join(".")} is ${JSON.stringify(s)}`)}function DD(o,t){let e=t.split(".");_D(o,e)}function _D(o,t){if(!o)return;let e=o,n=t.shift();if(t.length===0){delete e[n];return}if(Object.keys(e).indexOf(n)!==-1){let r=e[n];typeof r=="object"&&!Array.isArray(r)&&(_D(r,t),Object.keys(r).length===0&&delete e[n])}}function Wp(o,t,e){function n(s,a){let l=s;for(let c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}let r=t.split("."),i=n(o,r);return typeof i>"u"?e:i}function LD(o){return o.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")}var xt,xn=y(()=>{hi();Me();ce();re();xt=_("configurationService")});function MD(o){let t=!1,e=new Map,n=new Map;if(I7(o,u=>{if(o===u)return!0;let p=JSON.stringify(u);if(p.length<30)return!0;let m=e.get(p);if(!m){let g={schemas:[u]};return e.set(p,g),n.set(u,g),!0}return m.schemas.push(u),n.set(u,m),t=!0,!1}),e.clear(),!t)return JSON.stringify(o);let i="$defs";for(;o.hasOwnProperty(i);)i+="_";let s=[];function a(u){return JSON.stringify(u,(p,m)=>{if(m!==u){let g=n.get(m);if(g&&g.schemas.length>1)return g.id||(g.id=`_${s.length}`,s.push(g.schemas[0])),{$ref:`#/${i}/${g.id}`}}return m})}let l=a(o),c=[];for(let u=0;u<s.length;u++)c.push(`"_${u}":${a(s[u])}`);return c.length?`${l.substring(0,l.length-1)},"${i}":{${c.join(",")}}}`:l}function Vc(o){return typeof o=="object"&&o!==null}function I7(o,t){if(!o||typeof o!="object")return;let e=(...l)=>{for(let c of l)Vc(c)&&s.push(c)},n=(...l)=>{for(let c of l)if(Vc(c))for(let u in c){let p=c[u];Vc(p)&&s.push(p)}},r=(...l)=>{for(let c of l)if(Array.isArray(c))for(let u of c)Vc(u)&&s.push(u)},i=l=>{if(Array.isArray(l))for(let c of l)Vc(c)&&s.push(c);else Vc(l)&&s.push(l)},s=[o],a=s.pop();for(;a;)t(a)&&(e(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),n(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),r(a.anyOf,a.allOf,a.oneOf,a.prefixItems),i(a.items)),a=s.pop()}var OD=y(()=>{});var CS,bt,Hr=y(()=>{hi();Me();CS=class{constructor(){this.data=new Map}add(t,e){zg(ne(t)),zg(Ue(e)),zg(!this.data.has(t),"There is already an extension with this id"),this.data.set(t,e)}knows(t){return this.data.has(t)}as(t){return this.data.get(t)||null}dispose(){this.data.forEach(t=>{vc(t.dispose)&&t.dispose()}),this.data.clear()}},bt=new CS});function AD(o){return o.length>0&&o.charAt(o.length-1)==="#"?o.substring(0,o.length-1):o}var Bp,TS,S7,PS=y(()=>{de();OD();q();Hr();Bp={JSONContribution:"base.contributions.json"};TS=class extends D{constructor(){super(...arguments);this.schemasById={};this.schemaAssociations={};this._onDidChangeSchema=this._register(new P);this.onDidChangeSchema=this._onDidChangeSchema.event;this._onDidChangeSchemaAssociations=this._register(new P);this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(e,n,r){let i=AD(e);this.schemasById[i]=n,this._onDidChangeSchema.fire(e),r&&r.add(ie(()=>{delete this.schemasById[i],this._onDidChangeSchema.fire(e)}))}registerSchemaAssociation(e,n){let r=AD(e);return this.schemaAssociations[r]||(this.schemaAssociations[r]=[]),this.schemaAssociations[r].includes(n)||(this.schemaAssociations[r].push(n),this._onDidChangeSchemaAssociations.fire()),ie(()=>{let i=this.schemaAssociations[r];if(i){let s=i.indexOf(n);s!==-1&&(i.splice(s,1),i.length===0&&delete this.schemaAssociations[r],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){let n=this.schemasById[e];return n?MD(n):void 0}hasSchemaContent(e){return!!this.schemasById[e]}getSchemaAssociations(){return this.schemaAssociations}},S7=new TS;bt.add(Bp.JSONContribution,S7)});var $r,kS,St,Js=y(()=>{no();kS=globalThis.vscode;if(typeof kS<"u"&&typeof kS.context<"u"){let o=kS.context.configuration();if(o)$r=o.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($r=globalThis._VSCODE_PRODUCT_JSON,tn.VSCODE_DEV&&Object.assign($r,{nameShort:`${$r.nameShort} Dev`,nameLong:`${$r.nameLong} Dev`,dataFolderName:`${$r.dataFolderName}-dev`,serverDataFolderName:$r.serverDataFolderName?`${$r.serverDataFolderName}-dev`:void 0}),!$r.version){let o=globalThis._VSCODE_PACKAGE_JSON;Object.assign($r,{version:o.version})}}else $r={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",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.112.0",sha256:"c24322931434940938f8cf76ebc3dac1e95a5539b9625b165b6672d7f7eafea8",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-dotnettools.csdevkit":{onFileOpen:[{pathGlob:"{**/*.cs,**/global.json,**/*.csproj,**/*.cshtml,**/*.sln}",important:!0},{languages:["csharp"],important:!0},{pathGlob:"{**/project.json,**/appsettings.json}"}]},"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++"}],onboardingExtensions:[{id:"ms-vscode-remote.remote-containers",name:"Dev Containers",publisher:"Microsoft",description:"Develop inside a container with a full-featured editor",icon:"remote-explorer"},{id:"ms-azuretools.vscode-docker",name:"Docker",publisher:"Microsoft",description:"Build, manage, and deploy containerized applications",icon:"package"},{id:"dbaeumer.vscode-eslint",name:"ESLint",publisher:"Microsoft",description:"Find and fix problems in your JavaScript code",icon:"lightbulb"},{id:"GitHub.vscode-pull-request-github",name:"GitHub Pull Requests",publisher:"GitHub",description:"Review and manage GitHub pull requests and issues",icon:"git-pull-request"},{id:"ms-python.python",name:"Python",publisher:"Microsoft",description:"Rich Python language support with IntelliSense and debugging",icon:"symbol-misc"},{id:"ms-vscode-remote.remote-ssh",name:"Remote - SSH",publisher:"Microsoft",description:"Open folders and files on a remote machine via SSH",icon:"remote"}],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"],"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"]},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",completionsRefreshTokenCommand:"github.copilot.signIn",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.116.0",commit:"560a9dba96f961efea7b1612916f89e5d5d4d679",date:"2026-04-15T00:28:13Z"},Object.keys($r).length===0&&Object.assign($r,{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:[]}});St=$r});function E7(o,t){return o===t?!0:!o||!t?!1:typeof o=="string"||typeof t=="string"?o===t:o.id===t.id}function Wc(o){let t=[];if(xi.test(o)){let e=ND.exec(o);for(;e?.length;){let n=e[1].trim();n&&t.push(n),e=ND.exec(o)}}return pr(t)}function FD(o){return o.reduce((t,e)=>`${t}[${e}]`,"")}function w7(o){switch(Array.isArray(o)?o[0]:o){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function C7(o,t,e){return o.trim()?xi.test(o)?d(621,null,o):Dh.getConfigurationProperties()[o]!==void 0&&(!e||!T7.has(e.toLowerCase()))?d(619,null,o):t.policy?.name&&Dh.getPolicyConfigurations().get(t.policy?.name)!==void 0?d(618,null,o,t.policy?.name,Dh.getPolicyConfigurations().get(t.policy?.name)):null:d(620,null)}var kn,Eh,wh,Ch,Th,Ph,kh,Hp,dl,Rh,RS,UD,ND,Xs,xi,Dh,T7,Si=y(()=>{At();de();Me();pe();xn();PS();Hr();q();Js();kn={Configuration:"base.contributions.configuration"};Eh={properties:{},patternProperties:{}},wh={properties:{},patternProperties:{}},Ch={properties:{},patternProperties:{}},Th={properties:{},patternProperties:{}},Ph={properties:{},patternProperties:{}},kh={properties:{},patternProperties:{}},Hp={properties:{},patternProperties:{}},dl="vscode://schemas/settings/resourceLanguage",Rh=bt.as(Bp.JSONContribution),RS=class extends D{constructor(){super();this.registeredConfigurationDefaults=[];this.overrideIdentifiers=new Set;this._onDidSchemaChange=this._register(new P);this.onDidSchemaChange=this._onDidSchemaChange.event;this._onDidUpdateConfiguration=this._register(new P);this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event;this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:d(623,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Rh.registerSchema(dl,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,n=!0){return this.registerConfigurations([e],n),e}registerConfigurations(e,n=!0){let r=new Set;this.doRegisterConfigurations(e,n,r),Rh.registerSchema(dl,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:r})}deregisterConfigurations(e){let n=new Set;this.doDeregisterConfigurations(e,n),Rh.registerSchema(dl,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}updateConfigurations({add:e,remove:n}){let r=new Set;this.doDeregisterConfigurations(n,r),this.doRegisterConfigurations(e,!1,r),Rh.registerSchema(dl,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:r})}registerDefaultConfigurations(e){let n=new Set;this.doRegisterDefaultConfigurations(e,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,n){this.registeredConfigurationDefaults.push(...e);let r=[];for(let{overrides:i,source:s}of e)for(let a in i){n.add(a);let l=this.configurationDefaultsOverrides.get(a)??this.configurationDefaultsOverrides.set(a,{configurationDefaultOverrides:[]}).get(a),c=i[a];if(l.configurationDefaultOverrides.push({value:c,source:s}),xi.test(a)){let u=this.mergeDefaultConfigurationsForOverrideIdentifier(a,c,s,l.configurationDefaultOverrideValue);if(!u)continue;l.configurationDefaultOverrideValue=u,this.updateDefaultOverrideProperty(a,u,s),r.push(...Wc(a))}else{let u=this.mergeDefaultConfigurationsForConfigurationProperty(a,c,s,l.configurationDefaultOverrideValue);if(!u)continue;l.configurationDefaultOverrideValue=u;let p=this.configurationProperties[a];p&&(this.updatePropertyDefaultValue(a,p),this.updateSchema(a,p))}}this.doRegisterOverrideIdentifiers(r)}deregisterDefaultConfigurations(e){let n=new Set;this.doDeregisterDefaultConfigurations(e,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,n){for(let r of e){let i=this.registeredConfigurationDefaults.indexOf(r);i!==-1&&this.registeredConfigurationDefaults.splice(i,1)}for(let{overrides:r,source:i}of e)for(let s in r){let a=this.configurationDefaultsOverrides.get(s);if(!a)continue;let l=a.configurationDefaultOverrides.findIndex(c=>i?E7(c.source,i):c.value===r[s]);if(l!==-1){if(a.configurationDefaultOverrides.splice(l,1),a.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(s),xi.test(s)){let c;for(let u of a.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(s,u.value,u.source,c);c&&!hc(c.value)?(a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(s,c,i)):(this.configurationDefaultsOverrides.delete(s),delete this.configurationProperties[s],delete this.defaultLanguageConfigurationOverridesNode.properties[s])}else{let c;for(let p of a.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(s,p.value,p.source,c);a.configurationDefaultOverrideValue=c;let u=this.configurationProperties[s];u&&(this.updatePropertyDefaultValue(s,u),this.updateSchema(s,u))}n.add(s)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,n,r){let i={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:n.value,description:d(622,null,LD(e)),$ref:dl,defaultDefaultValue:n.value,source:r,defaultValueSource:r};this.configurationProperties[e]=i,this.defaultLanguageConfigurationOverridesNode.properties[e]=i}mergeDefaultConfigurationsForOverrideIdentifier(e,n,r,i){let s=i?.value||{},a=i?.source??new Map;if(!(a instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(let l of Object.keys(n)){let c=n[l];if(Ue(c)&&(Xn(s[l])||Ue(s[l]))){if(s[l]={...s[l]??{},...c},r)for(let p in c)a.set(`${l}.${p}`,r)}else s[l]=c,r?a.set(l,r):a.delete(l)}return{value:s,source:a}}mergeDefaultConfigurationsForConfigurationProperty(e,n,r,i){let s=this.configurationProperties[e],a=i?.value??s?.defaultDefaultValue,l=r;if(Ue(n)&&(s!==void 0&&s.type==="object"||s===void 0&&(Xn(a)||Ue(a)))){if(l=i?.source??new Map,!(l instanceof Map)){console.error("defaultValueSource is not a Map");return}for(let u in n)r&&l.set(`${e}.${u}`,r);n={...Ue(a)?a:{},...n}}return{value:n,source:l}}deltaConfiguration(e){let n=!1,r=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,r),n=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,r),n=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,r),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,r),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:r,defaultsOverrides:n})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let n of e)this.overrideIdentifiers.add(n);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,n,r){e.forEach(i=>{this.validateAndRegisterProperties(i,n,i.extensionInfo,i.restrictedProperties,void 0,r),this.configurationContributors.push(i),this.registerJSONConfiguration(i)})}doDeregisterConfigurations(e,n){let r=i=>{if(i.properties)for(let s in i.properties){n.add(s);let a=this.configurationProperties[s];a?.policy?.name&&this.policyConfigurations.delete(a.policy.name),delete this.configurationProperties[s],this.removeFromSchema(s,i.properties[s])}i.allOf?.forEach(s=>r(s))};for(let i of e){r(i);let s=this.configurationContributors.indexOf(i);s!==-1&&this.configurationContributors.splice(s,1)}}validateAndRegisterProperties(e,n=!0,r,i,s=4,a){s=_t(e.scope)?s:e.scope;let l=e.properties;if(l)for(let u in l){let p=l[u];if(p.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},n&&C7(u,p,r?.id)){delete l[u];continue}p.source=r,p.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,p),xi.test(u)?p.scope=void 0:(p.scope=_t(p.scope)?s:p.scope,p.restricted=_t(p.restricted)?!!i?.includes(u):p.restricted),p.experiment?p.tags?.some(h=>h.toLowerCase()==="onexp")||(p.tags=p.tags??[],p.tags.push("onExP")):p.tags?.some(h=>h.toLowerCase()==="onexp")&&(console.error(`Invalid tag 'onExP' found for property '${u}'. Please use 'experiment' property instead.`),p.experiment={mode:"startup"});let m=l[u].hasOwnProperty("included")&&!l[u].included,g=l[u].policy?.name;m?(this.excludedConfigurationProperties[u]=l[u],g&&(this.policyConfigurations.set(g,u),a.add(u)),delete l[u]):(a.add(u),g&&this.policyConfigurations.set(g,u),this.configurationProperties[u]=l[u],!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage))}let c=e.allOf;if(c)for(let u of c)this.validateAndRegisterProperties(u,n,r,i,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[n,r]of this.configurationDefaultsOverrides)r.configurationDefaultOverrideValue&&e.set(n,r.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){let n=r=>{let i=r.properties;if(i)for(let a in i)this.updateSchema(a,i[a]);r.allOf?.forEach(n)};n(e)}updateSchema(e,n){switch(Eh.properties[e]=n,n.scope){case 1:wh.properties[e]=n;break;case 2:Th.properties[e]=n;break;case 3:Ch.properties[e]=n;break;case 7:Ph.properties[e]=n;break;case 4:kh.properties[e]=n;break;case 5:Hp.properties[e]=n;break;case 6:Hp.properties[e]=n,this.resourceLanguageSettingsSchema.properties[e]=n;break}}removeFromSchema(e,n){switch(delete Eh.properties[e],n.scope){case 1:delete wh.properties[e];break;case 2:delete Th.properties[e];break;case 3:delete Ch.properties[e];break;case 7:delete Ph.properties[e];break;case 4:delete kh.properties[e];break;case 5:case 6:delete Hp.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let n=`[${e}]`,r={type:"object",description:d(624,null),errorMessage:d(625,null),$ref:dl};this.updatePropertyDefaultValue(n,r),Eh.properties[n]=r,wh.properties[n]=r,Ch.properties[n]=r,Th.properties[n]=r,Ph.properties[n]=r,kh.properties[n]=r,Hp.properties[n]=r}}registerOverridePropertyPatternKey(){let e={type:"object",description:d(624,null),errorMessage:d(625,null),$ref:dl};Eh.patternProperties[Xs]=e,wh.patternProperties[Xs]=e,Ch.patternProperties[Xs]=e,Th.patternProperties[Xs]=e,Ph.patternProperties[Xs]=e,kh.patternProperties[Xs]=e,Hp.patternProperties[Xs]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,n){let r=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue,i,s;r&&(!n.disallowConfigurationDefault||!r.source)&&(i=r.value,s=r.source),Xn(i)&&(i=n.defaultDefaultValue,s=void 0),Xn(i)&&(i=w7(n.type)),n.default=i,n.defaultValueSource=s}},UD="\\[([^\\]]+)\\]",ND=new RegExp(UD,"g"),Xs=`^(${UD})+$`,xi=new RegExp(Xs);Dh=new RS;bt.add(kn.Configuration,Dh);T7=new Set(St.defaultChatAgent?[St.defaultChatAgent.extensionId,St.defaultChatAgent.chatExtensionId].map(o=>o.toLowerCase()):[])});var DS,_S,_h,LS,rs,Bc,Xo,$p=y(()=>{At();hi();Ro();Qt();DS=class{constructor(){this._value="";this._pos=0}reset(t){return this._value=t,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(t){let e=t.charCodeAt(0),n=this._value.charCodeAt(this._pos);return e-n}value(){return this._value[this._pos]}},_S=class{constructor(t=!0){this._caseSensitive=t}reset(t){return this._value=t,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let t=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(t)this._from++;else break;else t=!1;return this}cmp(t){return this._caseSensitive?Jg(t,this._value,0,t.length,this._from,this._to):Za(t,this._value,0,t.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},_h=class{constructor(t=!0,e=!0){this._splitOnBackslash=t;this._caseSensitive=e}reset(t){this._from=0,this._to=0,this._value=t,this._valueLen=t.length;for(let e=t.length-1;e>=0;e--,this._valueLen--){let n=this._value.charCodeAt(e);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let t=!0;for(;this._to<this._valueLen;this._to++){let e=this._value.charCodeAt(this._to);if(e===47||this._splitOnBackslash&&e===92)if(t)this._from++;else break;else t=!1}return this}cmp(t){return this._caseSensitive?Jg(t,this._value,0,t.length,this._from,this._to):Za(t,this._value,0,t.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},LS=class{constructor(t,e){this._ignorePathCasing=t;this._ignoreQueryAndFragment=e;this._states=[];this._stateIdx=0}reset(t){return this._value=t,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new _h(!1,!this._ignorePathCasing(t)),this._pathIterator.reset(t.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(t)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(t){if(this._states[this._stateIdx]===1)return Ec(t,this._value.scheme);if(this._states[this._stateIdx]===2)return Ec(t,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(t);if(this._states[this._stateIdx]===4)return yp(t,this._value.query);if(this._states[this._stateIdx]===5)return yp(t,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}},rs=class o{static{this.Val=Symbol("undefined_placeholder")}static wrap(t){return t===void 0?o.Val:t}static unwrap(t){return t===o.Val?void 0:t}},Bc=class{constructor(){this.height=1;this.value=void 0;this.key=void 0;this.left=void 0;this.mid=void 0;this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){let t=this.right;return this.right=t.left,t.left=this,this.updateHeight(),t.updateHeight(),t}rotateRight(){let t=this.left;return this.left=t.right,t.right=this,this.updateHeight(),t.updateHeight(),t}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}},Xo=class o{static forUris(t=()=>!1,e=()=>!1){return new o(new LS(t,e))}static forPaths(t=!1){return new o(new _h(void 0,!t))}static forStrings(){return new o(new DS)}static forConfigKeys(){return new o(new _S)}constructor(t){this._iter=t}clear(){this._root=void 0}fill(t,e){if(e){let n=e.slice(0);Cx(n);for(let r of n)this.set(r,t)}else{let n=t.slice(0);Cx(n);for(let r of n)this.set(r[0],r[1])}}set(t,e){let n=this._iter.reset(t),r;this._root||(this._root=new Bc,this._root.segment=n.value());let i=[];for(r=this._root;;){let a=n.cmp(r.segment);if(a>0)r.left||(r.left=new Bc,r.left.segment=n.value()),i.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new Bc,r.right.segment=n.value()),i.push([1,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new Bc,r.mid.segment=n.value()),i.push([0,r]),r=r.mid;else break}let s=rs.unwrap(r.value);r.value=rs.wrap(e),r.key=t;for(let a=i.length-1;a>=0;a--){let l=i[a][1];l.updateHeight();let c=l.balanceFactor();if(c<-1||c>1){let u=i[a][0],p=i[a+1][0];if(u===1&&p===1)i[a][1]=l.rotateLeft();else if(u===-1&&p===-1)i[a][1]=l.rotateRight();else if(u===1&&p===-1)l.right=i[a+1][1]=i[a+1][1].rotateRight(),i[a][1]=l.rotateLeft();else if(u===-1&&p===1)l.left=i[a+1][1]=i[a+1][1].rotateLeft(),i[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(i[a-1][0]){case-1:i[a-1][1].left=i[a][1];break;case 1:i[a-1][1].right=i[a][1];break;case 0:i[a-1][1].mid=i[a][1];break}else this._root=i[0][1]}}return s}get(t){return rs.unwrap(this._getNode(t)?.value)}_getNode(t){let e=this._iter.reset(t),n=this._root;for(;n;){let r=e.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(e.hasNext())e.next(),n=n.mid;else break}return n}has(t){let e=this._getNode(t);return!(e?.value===void 0&&e?.mid===void 0)}delete(t){return this._delete(t,!1)}deleteSuperstr(t){return this._delete(t,!0)}_delete(t,e){let n=this._iter.reset(t),r=[],i=this._root;for(;i;){let s=n.cmp(i.segment);if(s>0)r.push([-1,i]),i=i.left;else if(s<0)r.push([1,i]),i=i.right;else if(n.hasNext())n.next(),r.push([0,i]),i=i.mid;else break}if(i){if(e?(i.left=void 0,i.mid=void 0,i.right=void 0,i.height=1):(i.key=void 0,i.value=void 0),!i.mid&&!i.value)if(i.left&&i.right){let s=[[1,i]],a=this._min(i.right,s);if(a.key){i.key=a.key,i.value=a.value,i.segment=a.segment;let l=a.right;if(s.length>1){let[u,p]=s[s.length-1];switch(u){case-1:p.left=l;break;case 0:gc(!1);case 1:gc(!1)}}else i.right=l;let c=this._balanceByStack(s);if(r.length>0){let[u,p]=r[r.length-1];switch(u){case-1:p.left=c;break;case 0:p.mid=c;break;case 1:p.right=c;break}}else this._root=c}}else{let s=i.left??i.right;if(r.length>0){let[a,l]=r[r.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(r)??this._root}}_min(t,e){for(;t.left;)e.push([-1,t]),t=t.left;return t}_balanceByStack(t){for(let e=t.length-1;e>=0;e--){let n=t[e][1];n.updateHeight();let r=n.balanceFactor();if(r>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),t[e][1]=n.rotateLeft()):r<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),t[e][1]=n.rotateRight()),e>0)switch(t[e-1][0]){case-1:t[e-1][1].left=t[e][1];break;case 1:t[e-1][1].right=t[e][1];break;case 0:t[e-1][1].mid=t[e][1];break}else return t[0][1]}}findSubstr(t){let e=this._iter.reset(t),n=this._root,r;for(;n;){let i=e.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else if(e.hasNext())e.next(),r=rs.unwrap(n.value)||r,n=n.mid;else break}return n&&rs.unwrap(n.value)||r}findSuperstr(t){return this._findSuperstrOrElement(t,!1)}_findSuperstrOrElement(t,e){let n=this._iter.reset(t),r=this._root;for(;r;){let i=n.cmp(r.segment);if(i>0)r=r.left;else if(i<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else return r.mid?this._entries(r.mid):e?rs.unwrap(r.value):void 0}}hasElementOrSubtree(t){return this._findSuperstrOrElement(t,!0)!==void 0}forEach(t){for(let[e,n]of this)t(n,e)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(t){let e=[];return this._dfsEntries(t,e),e[Symbol.iterator]()}_dfsEntries(t,e){t&&(t.left&&this._dfsEntries(t.left,e),t.value!==void 0&&e.push([t.key,rs.unwrap(t.value)]),t.mid&&this._dfsEntries(t.mid,e),t.right&&this._dfsEntries(t.right,e))}_isBalanced(){let t=e=>{if(!e)return!0;let n=e.balanceFactor();return n<-1||n>1?!1:t(e.left)&&t(e.right)};return t(this._root)}}});function ul(o){return o.create===!0}function go(o){return!!(o.capabilities&2)}function VD(o){return!!(o.capabilities&524288)}function MS(o){return!!(o.capabilities&8)}function WD(o){return!!(o.capabilities&131072)}function BD(o){return!!(o.capabilities&262144)}function is(o){return!!(o.capabilities&4)}function Mh(o){return!!(o.capabilities&16)}function Oh(o){return go(o)?!!(o.capabilities&16384):!1}function OS(o){return go(o)?!!(o.capabilities&32768):!1}function HD(o){return!!(o.capabilities&65536)}function Mo(o,t){return Hc.create(o,t)}function ss(o){return o||Mo(d(840,null),"Unknown")}function AS(o,t){return o.name=t?`${t} (FileSystemError)`:"FileSystemError",o}function zp(o){if(!o)return"Unknown";if(o instanceof Hc)return o.code;let t=/^(.+) \(FileSystemError\)$/.exec(o.name);if(!t)return"Unknown";switch(t[1]){case"EntryExists":return"EntryExists";case"EntryIsADirectory":return"EntryIsADirectory";case"EntryNotADirectory":return"EntryNotADirectory";case"EntryNotFound":return"EntryNotFound";case"EntryTooLarge":return"EntryTooLarge";case"EntryWriteLocked":return"EntryWriteLocked";case"NoPermissions":return"NoPermissions";case"Unavailable":return"Unavailable"}return"Unknown"}function kt(o){if(o instanceof hn)return o.fileOperationResult;switch(zp(o)){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 $D(o,t,e){return!o||!t||o===t||t.length>o.length?!1:(t.charAt(t.length-1)!==Zt&&(t+=Zt),e?Us(o,t):o.indexOf(t)===0)}function NS(o){if(!(typeof o.size!="number"||typeof o.mtime!="number"))return o.mtime.toString(29)+o.size.toString(31)}var Oe,Hc,os,Lh,hn,$c,zc,Ah,Yo,nt=y(()=>{$p();Le();Qt();Me();ce();pe();re();me();$e();Qi();Oe=_("fileService");Hc=class o extends Error{constructor(e,n){super(e);this.code=n}static create(e,n){let r=new o(e.toString(),n);return AS(r,n),r}};os=class{constructor(t,e,n){this.resource=t;this.operation=e;this.target=n}isOperation(t){return this.operation===t}},Lh=class o{constructor(t,e){this.ignorePathCasing=e;this.correlationId=void 0;this.added=new gn(()=>{let t=Xo.forUris(()=>this.ignorePathCasing);return t.fill(this.rawAdded.map(e=>[e,!0])),t});this.updated=new gn(()=>{let t=Xo.forUris(()=>this.ignorePathCasing);return t.fill(this.rawUpdated.map(e=>[e,!0])),t});this.deleted=new gn(()=>{let t=Xo.forUris(()=>this.ignorePathCasing);return t.fill(this.rawDeleted.map(e=>[e,!0])),t});this.rawAdded=[];this.rawUpdated=[];this.rawDeleted=[];for(let n of t){switch(n.type){case 1:this.rawAdded.push(n.resource);break;case 0:this.rawUpdated.push(n.resource);break;case 2:this.rawDeleted.push(n.resource);break}this.correlationId!==o.MIXED_CORRELATION&&(typeof n.cId=="number"?this.correlationId===void 0?this.correlationId=n.cId:this.correlationId!==n.cId&&(this.correlationId=o.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=o.MIXED_CORRELATION))}}static{this.MIXED_CORRELATION=null}contains(t,...e){return this.doContains(t,{includeChildren:!1},...e)}affects(t,...e){return this.doContains(t,{includeChildren:!0},...e)}doContains(t,e,...n){if(!t)return!1;let r=n.length>0;return!!((!r||n.includes(1))&&(this.added.value.get(t)||e.includeChildren&&this.added.value.findSuperstr(t))||(!r||n.includes(0))&&(this.updated.value.get(t)||e.includeChildren&&this.updated.value.findSuperstr(t))||(!r||n.includes(2))&&(this.deleted.value.findSubstr(t)||e.includeChildren&&this.deleted.value.findSuperstr(t)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(t){return this.correlationId===t}hasCorrelation(){return typeof this.correlationId=="number"}};hn=class extends Error{constructor(e,n,r){super(e);this.fileOperationResult=n;this.options=r}},$c=class extends hn{constructor(e,n,r,i){super(e,n,i);this.fileOperationResult=n;this.size=r}},zc=class extends hn{constructor(e,n,r){super(e,2,r);this.stat=n}},Ah="";Yo=class o{static{this.KB=1024}static{this.MB=o.KB*o.KB}static{this.GB=o.MB*o.KB}static{this.TB=o.GB*o.KB}static formatSize(t){return Jn(t)||(t=0),t<o.KB?d(835,null,t.toFixed(0)):t<o.MB?d(837,null,(t/o.KB).toFixed(2)):t<o.GB?d(838,null,(t/o.MB).toFixed(2)):t<o.TB?d(836,null,(t/o.GB).toFixed(2)):d(839,null,(t/o.TB).toFixed(2))}}});function Gp(o){return Object.isFrozen(o)?o:TD(o)}function Ys(o,t){let{added:e,removed:n,updated:r}=zD(t?.rawConfiguration,o?.rawConfiguration),i=[],s=o?.getAllOverrideIdentifiers()||[],a=t?.getAllOverrideIdentifiers()||[];if(t){let l=a.filter(c=>!s.includes(c));for(let c of l)i.push([c,t.getKeysForOverrideIdentifier(c)])}if(o){let l=s.filter(c=>!a.includes(c));for(let c of l)i.push([c,o.getKeysForOverrideIdentifier(c)])}if(t&&o){for(let l of s)if(a.includes(l)){let c=zD({contents:o.getOverrideValue(void 0,l)||{},keys:o.getKeysForOverrideIdentifier(l)},{contents:t.getOverrideValue(void 0,l)||{},keys:t.getKeysForOverrideIdentifier(l)});i.push([l,[...c.added,...c.removed,...c.updated]])}}return{added:e,removed:n,updated:r,overrides:i}}function zD(o,t){let e=o?t?o.keys.filter(i=>t.keys.indexOf(i)===-1):[...o.keys]:[],n=t?o?t.keys.filter(i=>o.keys.indexOf(i)===-1):[...t.keys]:[],r=[];if(o&&t){for(let i of t.keys)if(o.keys.indexOf(i)!==-1){let s=Wp(t.contents,i),a=Wp(o.contents,i);Ut(s,a)||r.push(i)}}return{added:e,removed:n,updated:r}}var Jt,Nh,Uh,US,Gc,Fh,FS=y(()=>{At();de();Ii();q();Hn();on();Me();ce();xn();Si();nt();Hr();Jt=class o{constructor(t,e,n,r,i){this._contents=t;this._keys=e;this._overrides=n;this._raw=r;this.logService=i;this.overrideConfigurations=new Map}static createEmptyModel(t){return new o({},[],[],void 0,t)}get rawConfiguration(){if(!this._rawConfiguration)if(this._raw){let t=(Array.isArray(this._raw)?this._raw:[this._raw]).map(e=>{if(e instanceof o)return e;let n=new Nh("",this.logService);return n.parseRaw(e),n.configurationModel});this._rawConfiguration=t.reduce((e,n)=>n===e?n:e.merge(n),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}get raw(){if(this._raw&&!(Array.isArray(this._raw)&&this._raw.every(t=>t instanceof o)))return this._raw}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(t){return t?Wp(this.contents,t):this.contents}inspect(t,e){let n=this;return{get value(){return Gp(n.rawConfiguration.getValue(t))},get override(){return e?Gp(n.rawConfiguration.getOverrideValue(t,e)):void 0},get merged(){return Gp(e?n.rawConfiguration.override(e).getValue(t):n.rawConfiguration.getValue(t))},get overrides(){let r=[];for(let{contents:i,identifiers:s,keys:a}of n.rawConfiguration.overrides){let l=new o(i,a,[],void 0,n.logService).getValue(t);l!==void 0&&r.push({identifiers:s,value:l})}return r.length?Gp(r):void 0}}}getOverrideValue(t,e){let n=this.getContentsForOverrideIdentifer(e);return n?t?Wp(n,t):n:void 0}getKeysForOverrideIdentifier(t){let e=[];for(let n of this.overrides)n.identifiers.includes(t)&&e.push(...n.keys);return pr(e)}getAllOverrideIdentifiers(){let t=[];for(let e of this.overrides)t.push(...e.identifiers);return pr(t)}override(t){let e=this.overrideConfigurations.get(t);return e||(e=this.createOverrideConfigurationModel(t),this.overrideConfigurations.set(t,e)),e}merge(...t){let e=fo(this.contents),n=fo(this.overrides),r=[...this.keys],i=this._raw?Array.isArray(this._raw)?[...this._raw]:[this._raw]:[this];for(let s of t)if(i.push(...s._raw?Array.isArray(s._raw)?s._raw:[s._raw]:[s]),!s.isEmpty()){this.mergeContents(e,s.contents);for(let a of s.overrides){let[l]=n.filter(c=>mn(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=pr(l.keys)):n.push(fo(a))}for(let a of s.keys)r.indexOf(a)===-1&&r.push(a)}return new o(e,r,n,!i.length||i.every(s=>s instanceof o)?void 0:i,this.logService)}createOverrideConfigurationModel(t){let e=this.getContentsForOverrideIdentifer(t);if(!e||typeof e!="object"||!Object.keys(e).length)return this;let n={};for(let r of pr([...Object.keys(this.contents),...Object.keys(e)])){let i=this.contents[r],s=e[r];s&&(typeof i=="object"&&typeof s=="object"?(i=fo(i),this.mergeContents(i,s)):i=s),n[r]=i}return new o(n,this.keys,this.overrides,void 0,this.logService)}mergeContents(t,e){for(let n of Object.keys(e)){if(n in t&&Ue(t[n])&&Ue(e[n])){this.mergeContents(t[n],e[n]);continue}t[n]=fo(e[n])}}getContentsForOverrideIdentifer(t){let e=null,n=null,r=i=>{i&&(n?this.mergeContents(n,i):n=fo(i))};for(let i of this.overrides)i.identifiers.length===1&&i.identifiers[0]===t?e=i.contents:i.identifiers.includes(t)&&r(i.contents);return r(e),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(t,e){this.updateValue(t,e,!0)}setValue(t,e){this.updateValue(t,e,!1)}removeValue(t){let e=this.keys.indexOf(t);e!==-1&&(this.keys.splice(e,1),DD(this.contents,t),xi.test(t)&&this.overrides.splice(this.overrides.findIndex(n=>mn(n.identifiers,Wc(t))),1))}updateValue(t,e,n){if(wS(this.contents,t,e,r=>this.logService.error(r)),n=n||this.keys.indexOf(t)===-1,n&&this.keys.push(t),xi.test(t)){let r=this.contents[t],i=Wc(t),s={identifiers:i,keys:Object.keys(r),contents:Sh(r,l=>this.logService.error(l))},a=this.overrides.findIndex(l=>mn(l.identifiers,i));a!==-1?this.overrides[a]=s:this.overrides.push(s)}}},Nh=class{constructor(t,e){this._name=t;this.logService=e;this._raw=null;this._configurationModel=null;this._restrictedConfigurations=[];this._parseErrors=[]}get configurationModel(){return this._configurationModel||Jt.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(t,e){if(!_t(t)){let n=this.doParseContent(t);this.parseRaw(n,e)}}reparse(t){this._raw&&this.parseRaw(this._raw,t)}parseRaw(t,e){this._raw=t;let{contents:n,keys:r,overrides:i,restricted:s,hasExcludedProperties:a}=this.doParseRaw(t,e);this._configurationModel=new Jt(n,r,i,a?[t]:void 0,this.logService),this._restrictedConfigurations=s||[]}doParseContent(t){let e={},n=null,r=[],i=[],s=[];function a(c){Array.isArray(r)?r.push(c):n!==null&&(r[n]=c)}let l={onObjectBegin:()=>{let c={};a(c),i.push(r),r=c,n=null},onObjectProperty:c=>{n=c},onObjectEnd:()=>{r=i.pop()},onArrayBegin:()=>{let c=[];a(c),i.push(r),r=c,n=null},onArrayEnd:()=>{r=i.pop()},onLiteralValue:a,onError:(c,u,p)=>{s.push({error:c,offset:u,length:p})}};if(t)try{Nc(t,l),e=r[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return e}doParseRaw(t,e){let n=bt.as(kn.Configuration),r=n.getConfigurationProperties(),i=n.getExcludedConfigurationProperties(),s=this.filter(t,r,i,!0,e);t=s.raw;let a=Sh(t,u=>this.logService.error(`Conflict in settings file ${this._name}: ${u}`)),l=Object.keys(t),c=this.toOverrides(t,u=>this.logService.error(`Conflict in settings file ${this._name}: ${u}`));return{contents:a,keys:l,overrides:c,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(t,e,n,r,i){let s=!1;if(!i?.scopes&&!i?.skipRestricted&&!i?.skipUnregistered&&!i?.exclude?.length)return{raw:t,restricted:[],hasExcludedProperties:s};let a={},l=[];for(let c in t)if(xi.test(c)&&r){let u=this.filter(t[c],e,n,!1,i);a[c]=u.raw,s=s||u.hasExcludedProperties,l.push(...u.restricted)}else{let u=e[c];u?.restricted&&l.push(c),this.shouldInclude(c,u,n,i)?a[c]=t[c]:s=!0}return{raw:a,restricted:l,hasExcludedProperties:s}}shouldInclude(t,e,n,r){if(r.exclude?.includes(t))return!1;if(r.include?.includes(t))return!0;if(r.skipRestricted&&e?.restricted||r.skipUnregistered&&!e)return!1;let i=e??n[t],s=i?typeof i.scope<"u"?i.scope:4:void 0;return s===void 0||r.scopes===void 0?!0:r.scopes.includes(s)}toOverrides(t,e){let n=[];for(let r of Object.keys(t))if(xi.test(r)){let i={},s=t[r];for(let a in s)i[a]=s[a];n.push({identifiers:Wc(r),keys:Object.keys(i),contents:Sh(i,e)})}return n}},Uh=class extends D{constructor(e,n,r,i,s){super();this.userSettingsResource=e;this.parseOptions=n;this.fileService=i;this.logService=s;this._onDidChange=this._register(new P);this.onDidChange=this._onDidChange.event;this.parser=new Nh(this.userSettingsResource.toString(),s),this._register(this.fileService.watch(r.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(F.any(F.filter(this.fileService.onDidFilesChange,a=>a.contains(this.userSettingsResource)),F.filter(this.fileService.onDidRunOperation,a=>(a.isOperation(0)||a.isOperation(3)||a.isOperation(1)||a.isOperation(4))&&r.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 Jt.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}},US=class{constructor(t,e,n,r,i,s,a,l,c,u,p,m,g){this.key=t;this.overrides=e;this._value=n;this.overrideIdentifiers=r;this.defaultConfiguration=i;this.policyConfiguration=s;this.applicationConfiguration=a;this.userConfiguration=l;this.localUserConfiguration=c;this.remoteUserConfiguration=u;this.workspaceConfiguration=p;this.folderConfigurationModel=m;this.memoryConfigurationModel=g}get value(){return Gp(this._value)}toInspectValue(t){return t?.value!==void 0||t?.override!==void 0||t?.overrides!==void 0?t:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}},Gc=class o{constructor(t,e,n,r,i,s,a,l,c,u){this._defaultConfiguration=t;this._policyConfiguration=e;this._applicationConfiguration=n;this._localUserConfiguration=r;this._remoteUserConfiguration=i;this._workspaceConfiguration=s;this._folderConfigurations=a;this._memoryConfiguration=l;this._memoryConfigurationByResource=c;this.logService=u;this._workspaceConsolidatedConfiguration=null;this._foldersConsolidatedConfigurations=new lt;this._userConfiguration=null}getValue(t,e,n){return this.getConsolidatedConfigurationModel(t,e,n).getValue(t)}updateValue(t,e,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=Jt.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,e===void 0?r.removeValue(t):r.setValue(t,e),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(t,e,n){let r=this.getConsolidatedConfigurationModel(t,e,n),i=this.getFolderConfigurationModelForResource(e.resource,n),s=e.resource?this._memoryConfigurationByResource.get(e.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(let l of r.overrides)for(let c of l.identifiers)r.getOverrideValue(t,c)!==void 0&&a.add(c);return new US(t,e,r.getValue(t),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,i||void 0,s)}keys(t){let e=this.getFolderConfigurationModelForResource(void 0,t);return{default:this._defaultConfiguration.keys.slice(0),policy:this._policyConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:e?e.keys.slice(0):[]}}updateDefaultConfiguration(t){this._defaultConfiguration=t,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(t){this._policyConfiguration=t}updateApplicationConfiguration(t){this._applicationConfiguration=t,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(t){this._localUserConfiguration=t,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(t){this._remoteUserConfiguration=t,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(t){this._workspaceConfiguration=t,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(t,e){this._folderConfigurations.set(t,e),this._foldersConsolidatedConfigurations.delete(t)}deleteFolderConfiguration(t){this.folderConfigurations.delete(t),this._foldersConsolidatedConfigurations.delete(t)}compareAndUpdateDefaultConfiguration(t,e){let n=[];if(!e){let{added:r,updated:i,removed:s}=Ys(this._defaultConfiguration,t);e=[...r,...i,...s]}for(let r of e)for(let i of Wc(r)){let s=this._defaultConfiguration.getKeysForOverrideIdentifier(i),a=t.getKeysForOverrideIdentifier(i),l=[...a.filter(c=>s.indexOf(c)===-1),...s.filter(c=>a.indexOf(c)===-1),...s.filter(c=>!Ut(this._defaultConfiguration.override(i).getValue(c),t.override(i).getValue(c)))];n.push([i,l])}return this.updateDefaultConfiguration(t),{keys:e,overrides:n}}compareAndUpdatePolicyConfiguration(t){let{added:e,updated:n,removed:r}=Ys(this._policyConfiguration,t),i=[...e,...n,...r];return i.length&&this.updatePolicyConfiguration(t),{keys:i,overrides:[]}}compareAndUpdateApplicationConfiguration(t){let{added:e,updated:n,removed:r,overrides:i}=Ys(this.applicationConfiguration,t),s=[...e,...n,...r];return s.length&&this.updateApplicationConfiguration(t),{keys:s,overrides:i}}compareAndUpdateLocalUserConfiguration(t){let{added:e,updated:n,removed:r,overrides:i}=Ys(this.localUserConfiguration,t),s=[...e,...n,...r];return s.length&&this.updateLocalUserConfiguration(t),{keys:s,overrides:i}}compareAndUpdateRemoteUserConfiguration(t){let{added:e,updated:n,removed:r,overrides:i}=Ys(this.remoteUserConfiguration,t),s=[...e,...n,...r];return s.length&&this.updateRemoteUserConfiguration(t),{keys:s,overrides:i}}compareAndUpdateWorkspaceConfiguration(t){let{added:e,updated:n,removed:r,overrides:i}=Ys(this.workspaceConfiguration,t),s=[...e,...n,...r];return s.length&&this.updateWorkspaceConfiguration(t),{keys:s,overrides:i}}compareAndUpdateFolderConfiguration(t,e){let n=this.folderConfigurations.get(t),{added:r,updated:i,removed:s,overrides:a}=Ys(n,e),l=[...r,...i,...s];return(l.length||!n)&&this.updateFolderConfiguration(t,e),{keys:l,overrides:a}}compareAndDeleteFolderConfiguration(t){let e=this.folderConfigurations.get(t);if(!e)throw new Error("Unknown folder");this.deleteFolderConfiguration(t);let{added:n,updated:r,removed:i,overrides:s}=Ys(e,void 0);return{keys:[...n,...r,...i],overrides:s}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{let t=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Jt(t.contents,t.keys,t.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(t,e,n){let r=this.getConsolidatedConfigurationModelForResource(e,n);if(e.overrideIdentifier&&(r=r.override(e.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(t)!==void 0){r=r.merge();for(let i of this._policyConfiguration.keys)r.setValue(i,this._policyConfiguration.getValue(i))}return r}getConsolidatedConfigurationModelForResource({resource:t},e){let n=this.getWorkspaceConsolidatedConfiguration();if(e&&t){let r=e.getFolder(t);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);let i=this._memoryConfigurationByResource.get(t);i&&(n=n.merge(i))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(t){let e=this._foldersConsolidatedConfigurations.get(t);if(!e){let n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(t);r?(e=n.merge(r),this._foldersConsolidatedConfigurations.set(t,e)):e=n}return e}getFolderConfigurationModelForResource(t,e){if(e&&t){let n=e.getFolder(t);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((t,e)=>{let{contents:n,overrides:r,keys:i}=this._folderConfigurations.get(e);return t.push([e,{contents:n,overrides:r,keys:i}]),t},[])}}allKeys(){let t=new Set;return this._defaultConfiguration.keys.forEach(e=>t.add(e)),this.userConfiguration.keys.forEach(e=>t.add(e)),this._workspaceConfiguration.keys.forEach(e=>t.add(e)),this._folderConfigurations.forEach(e=>e.keys.forEach(n=>t.add(n))),[...t.values()]}allOverrideIdentifiers(){let t=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(e=>t.add(e)),this.userConfiguration.getAllOverrideIdentifiers().forEach(e=>t.add(e)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(e=>t.add(e)),this._folderConfigurations.forEach(e=>e.getAllOverrideIdentifiers().forEach(n=>t.add(n))),[...t.values()]}getAllKeysForOverrideIdentifier(t){let e=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(t).forEach(n=>e.add(n)),this.userConfiguration.getKeysForOverrideIdentifier(t).forEach(n=>e.add(n)),this._workspaceConfiguration.getKeysForOverrideIdentifier(t).forEach(n=>e.add(n)),this._folderConfigurations.forEach(n=>n.getKeysForOverrideIdentifier(t).forEach(r=>e.add(r))),[...e.values()]}static parse(t,e){let n=this.parseConfigurationModel(t.defaults,e),r=this.parseConfigurationModel(t.policy,e),i=this.parseConfigurationModel(t.application,e),s=this.parseConfigurationModel(t.userLocal,e),a=this.parseConfigurationModel(t.userRemote,e),l=this.parseConfigurationModel(t.workspace,e),c=t.folders.reduce((u,p)=>(u.set(I.revive(p[0]),this.parseConfigurationModel(p[1],e)),u),new lt);return new o(n,r,i,s,a,l,c,Jt.createEmptyModel(e),new lt,e)}static parseConfigurationModel(t,e){return new Jt(t.contents,t.keys,t.overrides,t.raw,e)}},Fh=class{constructor(t,e,n,r,i){this.change=t;this.previous=e;this.currentConfiguraiton=n;this.currentWorkspace=r;this.logService=i;this._marker=`
- `;this._markerCode1=this._marker.charCodeAt(0);this._markerCode2=46;this.affectedKeys=new Set;this._previousConfiguration=void 0;for(let s of t.keys)this.affectedKeys.add(s);for(let[,s]of t.overrides)for(let a of s)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(let s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Gc.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(t,e){let n=this._marker+t,r=this._affectsConfigStr.indexOf(n);if(r<0)return!1;let i=r+n.length;if(i>=this._affectsConfigStr.length)return!1;let s=this._affectsConfigStr.charCodeAt(i);if(s!==this._markerCode1&&s!==this._markerCode2)return!1;if(e){let a=this.previousConfiguration?this.previousConfiguration.getValue(t,e,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(t,e,this.currentWorkspace);return!Ut(a,l)}return!0}}});var GD,Zs,Kp=y(()=>{de();Ko();q();re();GD=_("policy"),Zs=class{constructor(){this.onDidChange=F.None;this.policyDefinitions={}}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}});var Vh,Wh,qc,qD=y(()=>{At();de();q();on();Me();FS();Si();Fe();Kp();Hr();Se();Ii();Vh=class extends D{constructor(e){super();this.logService=e;this._onDidChangeConfiguration=this._register(new P);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this._configurationModel=Jt.createEmptyModel(e)}get configurationModel(){return this._configurationModel}async initialize(){return this.resetConfigurationModel(),this._register(bt.as(kn.Configuration).onDidUpdateConfiguration(({properties:e,defaultsOverrides:n})=>this.onDidUpdateConfiguration(Array.from(e),n))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(e,n){this.updateConfigurationModel(e,bt.as(kn.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Jt.createEmptyModel(this.logService);let e=bt.as(kn.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,n){let r=this.getConfigurationDefaultOverrides();for(let i of e){let s=r[i],a=n[i];s!==void 0?this._configurationModel.setValue(i,s):a?this._configurationModel.setValue(i,fo(a.default)):this._configurationModel.removeValue(i)}}},Wh=class{constructor(){this.onDidChangeConfiguration=F.None;this.configurationModel=Jt.createEmptyModel(new yh)}async initialize(){return this.configurationModel}},qc=class extends D{constructor(e,n,r){super();this.defaultConfiguration=e;this.policyService=n;this.logService=r;this._onDidChangeConfiguration=this._register(new P);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this._configurationModel=Jt.createEmptyModel(this.logService),this.configurationRegistry=bt.as(kn.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 n={},r=[],i=this.configurationRegistry.getConfigurationProperties(),s=this.configurationRegistry.getExcludedConfigurationProperties();for(let a of e){let l=i[a]??s[a];if(!l){r.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}=l.policy;r.push(a),n[l.policy.name]={type:l.type==="number"?"number":l.type==="boolean"?"boolean":"string",value:c}}}return hc(n)||await this.policyService.updatePolicyDefinitions(n),r}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);let n=this.configurationRegistry.getPolicyConfigurations(),r=Qn(e.map(i=>n.get(i)));this.update(r,!0)}update(e,n){this.logService.trace("PolicyConfiguration#update",e);let r=this.configurationRegistry.getConfigurationProperties(),i=this.configurationRegistry.getExcludedConfigurationProperties(),s=[],a=this._configurationModel.isEmpty();for(let l of e){let c=r[l]??i[l],u=c?.policy?.name;if(u){let p=this.policyService.getPolicyValue(u);if(ne(p)&&c.type!=="string")try{p=this.parse(p)}catch(m){this.logService.error(`Error parsing policy value ${u}:`,fe(m));continue}(a?p!==void 0:!Ut(this._configurationModel.getValue(l),p))&&s.push([l,p])}else this._configurationModel.getValue(l)!==void 0&&s.push([l,void 0])}if(s.length){this.logService.trace("PolicyConfiguration#changed",s);let l=this._configurationModel;this._configurationModel=Jt.createEmptyModel(this.logService);for(let c of l.keys)this._configurationModel.setValue(c,l.getValue(c));for(let[c,u]of s)u===void 0?this._configurationModel.removeValue(c):this._configurationModel.setValue(c,u);n&&this._onDidChangeConfiguration.fire(this._configurationModel)}}parse(e){let n={},r=null,i=[],s=[],a=[];function l(u){if(Array.isArray(i))i.push(u);else if(r!==null){if(i[r]!==void 0)throw new Error(`Duplicate property found: ${r}`);i[r]=u}}if(e&&(Nc(e,{onObjectBegin:()=>{let u={};l(u),s.push(i),i=u,r=null},onObjectProperty:u=>{r=u},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{let u=[];l(u),s.push(i),i=u,r=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:l,onError:(u,p,m)=>{a.push({error:u,offset:p,length:m})}}),n=i[0]||n),a.length>0)throw new Error(a.map(u=>fe(u.error)).join(`
- `));return n}};qc=E([b(1,GD),b(2,Q)],qc)});var Kc,VS,WS=y(()=>{At();ze();et();de();Ii();CD();q();Hn();on();me();Nt();xn();FS();Si();qD();nt();Kp();Kc=class extends D{constructor(e,n,r,i){super();this.settingsResource=e;this.logService=i;this._onDidChangeConfiguration=this._register(new P);this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this.defaultConfiguration=this._register(new Vh(i)),this.policyConfiguration=r instanceof Zs?new Wh:this._register(new qc(this.defaultConfiguration,r,i)),this.userConfiguration=this._register(new Uh(this.settingsResource,{},nl,n,i)),this.configuration=new Gc(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,Jt.createEmptyModel(i),Jt.createEmptyModel(i),Jt.createEmptyModel(i),Jt.createEmptyModel(i),new lt,Jt.createEmptyModel(i),new lt,i),this.configurationEditing=new VS(e,n,this),this.reloadConfigurationScheduler=this._register(new Qo(()=>this.reloadConfiguration(),50)),this._register(this.defaultConfiguration.onDidChangeConfiguration(({defaults:s,properties:a})=>this.onDidDefaultConfigurationChange(s,a))),this._register(this.policyConfiguration.onDidChangeConfiguration(s=>this.onDidPolicyConfigurationChange(s))),this._register(this.userConfiguration.onDidChange(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){let[e,n,r]=await Promise.all([this.defaultConfiguration.initialize(),this.policyConfiguration.initialize(),this.userConfiguration.loadConfiguration()]);this.configuration=new Gc(e,n,Jt.createEmptyModel(this.logService),r,Jt.createEmptyModel(this.logService),Jt.createEmptyModel(this.logService),new lt,Jt.createEmptyModel(this.logService),new lt,this.logService)}getConfigurationData(){return this.configuration.toData()}getValue(e,n){let r=typeof e=="string"?e:void 0,i=xh(e)?e:xh(n)?n:{};return this.configuration.getValue(r,i,void 0)}async updateValue(e,n,r,i,s){let a=kD(r)?r:xh(r)?{resource:r.resource,overrideIdentifiers:r.overrideIdentifier?[r.overrideIdentifier]:void 0}:void 0,l=a?i:r;if(l!==void 0&&l!==3&&l!==2)throw new Error(`Unable to write ${e} to target ${l}.`);a?.overrideIdentifiers&&(a.overrideIdentifiers=pr(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(Ut(n,c.defaultValue)&&(n=void 0),a?.overrideIdentifiers?.length&&a.overrideIdentifiers.length>1){let p=a.overrideIdentifiers.sort(),m=this.configuration.localUserConfiguration.overrides.find(g=>mn([...g.identifiers].sort(),p));m&&(a.overrideIdentifiers=m.identifiers)}let u=a?.overrideIdentifiers?.length?[FD(a.overrideIdentifiers),e]:[e];await this.configurationEditing.write(u,n),await this.reloadConfiguration()}inspect(e,n={}){return this.configuration.inspect(e,n,void 0)}keys(){return this.configuration.keys(void 0)}async reloadConfiguration(){let e=await this.userConfiguration.loadConfiguration();this.onDidChangeUserConfiguration(e)}onDidChangeUserConfiguration(e){let n=this.configuration.toData(),r=this.configuration.compareAndUpdateLocalUserConfiguration(e);this.trigger(r,n,2)}onDidDefaultConfigurationChange(e,n){let r=this.configuration.toData(),i=this.configuration.compareAndUpdateDefaultConfiguration(e,n);this.trigger(i,r,7)}onDidPolicyConfigurationChange(e){let n=this.configuration.toData(),r=this.configuration.compareAndUpdatePolicyConfiguration(e);this.trigger(r,n,7)}trigger(e,n,r){let i=new Fh(e,{data:n},this.configuration,void 0,this.logService);i.source=r,this._onDidChangeConfiguration.fire(i)}},VS=class{constructor(t,e,n){this.settingsResource=t;this.fileService=e;this.configurationService=n;this.queue=new co}write(t,e){return this.queue.queue(()=>this.doWriteConfiguration(t,e))}async doWriteConfiguration(t,e){let n;try{n=(await this.fileService.readFile(this.settingsResource)).value.toString()}catch(s){if(s.fileOperationResult===1)n="{}";else throw s}let r=[];if(Lo(n,r,{allowTrailingComma:!0,allowEmptyContent:!0}),r.length>0)throw new Error("Unable to write into the settings file. Please open the file to correct errors/warnings in the file and try again.");let i=this.getEdits(n,t,e);n=wD(n,i),await this.fileService.writeFile(this.settingsResource,A.fromString(n))}getEdits(t,e,n){let{tabSize:r,insertSpaces:i,eol:s}=this.formattingOptions;if(!e.length){let a=JSON.stringify(n,null,i?" ".repeat(r):" ");return[{content:a,length:a.length,offset:0}]}return ED(t,e,n,{tabSize:r,insertSpaces:i,eol:s})}get formattingOptions(){if(!this._formattingOptions){let t=Or===3||Or===2?`
- `:`\r
- `,e=this.configurationService.getValue("files.eol",{overrideIdentifier:"jsonc"});e&&typeof e=="string"&&e!=="auto"&&(t=e),this._formattingOptions={eol:t,insertSpaces:!!this.configurationService.getValue("editor.insertSpaces",{overrideIdentifier:"jsonc"}),tabSize:this.configurationService.getValue("editor.tabSize",{overrideIdentifier:"jsonc"})}}return this._formattingOptions}}});function Hh(o){return o.res.statusCode&&o.res.statusCode>=200&&o.res.statusCode<300||o.res.statusCode===1223}function XD(o){return!!o.res.statusCode&&o.res.statusCode>=400&&o.res.statusCode<500}function YD(o){return!!o.res.statusCode&&o.res.statusCode>=500&&o.res.statusCode<600}function ZD(o){return o.res.statusCode===204}async function jc(o){return ZD(o)?null:(await Br(o.stream)).toString()}async function wi(o){if(!Hh(o))throw new Error("Server returned "+o.res.statusCode);return jc(o)}async function Ci(o){if(!Hh(o))throw new Error("Server returned "+o.res.statusCode);if(ZD(o))return null;let e=(await Br(o.stream)).toString();try{return JSON.parse(e)}catch(n){throw n.message+=`:
- `+e,n}}function k7(o=!0,t=!0){if(jD===o&&QD===t)return;jD=o,QD=t;let e=bt.as(kn.Configuration),n=BS;BS=[{id:"http",order:15,title:d(898,null),type:"object",scope:2,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:t,markdownDescription:d(913,null),restricted:!0}}},{id:"http",order:15,title:d(898,null),type:"object",scope:1,properties:{"http.electronFetch":{type:"boolean",default:!1,description:d(896,null),restricted:!0}}},{id:"http",order:15,title:d(898,null),type:"object",scope:o?1:2,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:d(901,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:d(909,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:d(903,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:d(900,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:d(902,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[d(906,null),d(907,null),d(905,null),d(908,null)],default:"override",markdownDescription:d(904,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:d(910,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificatesNode":{type:"boolean",tags:["experimental"],default:$S,markdownDescription:d(911,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:d(912,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:d(897,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.webSocketAdditionalSupport":{type:"boolean",default:!0,markdownDescription:d(914,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0},"http.experimental.networkInterfaceCheckInterval":{type:"number",default:300,minimum:-1,tags:["experimental"],markdownDescription:d(899,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0,experiment:{mode:"auto"}}}}],e.updateConfigurations({add:BS,remove:n})}var Rn,JD,HS,Bh,$S,BS,jD,QD,Zo=y(()=>{et();Se();de();q();pe();Si();re();Hr();Rn=_("requestService"),JD="NO_FETCH_TELEMETRY",HS=class{constructor(t){this.original=t}toJSON(){if(!this.headers){let t=Object.create(null);for(let e in this.original)e.toLowerCase()==="authorization"||e.toLowerCase()==="proxy-authorization"?t[e]="*****":t[e]=this.original[e];this.headers=t}return this.headers}},Bh=class extends D{constructor(e){super();this.logService=e;this.counter=0;this._onDidCompleteRequest=this._register(new P);this.onDidCompleteRequest=this._onDidCompleteRequest.event}async logAndRequest(e,n){let r=`#${++this.counter}: ${e.url}`;this.logService.trace(`${r} - begin`,e.type,new HS(e.headers??{}));let i=Date.now();try{let s=await n();return this.logService.trace(`${r} - end`,e.type,s.res.statusCode,s.res.headers),this._onDidCompleteRequest.fire({callSite:e.callSite,latency:Date.now()-i,statusCode:s.res.statusCode}),s}catch(s){throw this.logService.error(`${r} - error`,e.type,fe(s)),s}}};$S=!1,BS=[];k7()});var It,Dn,vn=y(()=>{re();It=_("environmentService"),Dn=It});function e0(o){return R7.test(o)}var R7,Ce,sn=y(()=>{R7=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ce=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(o),o[6]=o[6]&15|64,o[8]=o[8]&63|128;let n=0,r="";return r+=t[o[n++]],r+=t[o[n++]],r+=t[o[n++]],r+=t[o[n++]],r+="-",r+=t[o[n++]],r+=t[o[n++]],r+="-",r+=t[o[n++]],r+=t[o[n++]],r+="-",r+=t[o[n++]],r+=t[o[n++]],r+="-",r+=t[o[n++]],r+=t[o[n++]],r+=t[o[n++]],r+=t[o[n++]],r+=t[o[n++]],r+=t[o[n++]],r}})()});import*as zS from"os";function M7({useAlternateBitness:o=!1}={}){return o?Qp===0?process.env["ProgramFiles(x86)"]||null:Qc===0&&process.env.ProgramW6432||null:process.env.ProgramFiles||null}async function $h({useAlternateBitness:o=!1,findPreview:t=!1}={}){let e=M7({useAlternateBitness:o});if(!e)return null;let n=H(e,"PowerShell");if(!await er.existsDirectory(n))return null;let r=-1,i=null;for(let l of await Te.readdir(n)){let c=-1;if(t){let p=l.indexOf("-");if(p<0)continue;let m=l.substring(0,p);if(!t0.test(m)||l.substring(p+1)!=="preview")continue;c=parseInt(m,10)}else{if(!t0.test(l))continue;c=parseInt(l,10)}if(c<=r)continue;let u=H(n,l,"pwsh.exe");await er.existsFile(u)&&(i=u,r=c)}if(!i)return null;let s=e.includes("x86")?" (x86)":"",a=t?" Preview":"";return new ml(i,`PowerShell${a}${s}`,!0)}async function n0({findPreview:o}={}){if(!process.env.LOCALAPPDATA)return null;let t=H(process.env.LOCALAPPDATA,"Microsoft","WindowsApps");if(!await er.existsDirectory(t))return null;let{pwshMsixDirRegex:e,pwshMsixName:n}=o?{pwshMsixDirRegex:L7,pwshMsixName:"PowerShell Preview (Store)"}:{pwshMsixDirRegex:_7,pwshMsixName:"PowerShell (Store)"};for(let r of await Te.readdir(t))if(e.test(r)){let i=H(t,r,"pwsh.exe");return new ml(i,n)}return null}function O7(){let o=H(zS.homedir(),".dotnet","tools","pwsh.exe");return new ml(o,".NET Core PowerShell Global Tool")}function A7(){let o=H(zS.homedir(),"scoop","apps"),t=H(o,"pwsh","current","pwsh.exe");return new ml(t,"PowerShell (Scoop)")}function N7(){let o=H(process.env.windir,Qp===1&&Qc!==1?"SysNative":"System32","WindowsPowerShell","v1.0","powershell.exe");return new ml(o,"Windows PowerShell",!0)}async function*U7(){let o=await $h();o&&(yield o),o=await $h({useAlternateBitness:!0}),o&&(yield o),o=await n0(),o&&(yield o),o=O7(),o&&(yield o),o=await $h({findPreview:!0}),o&&(yield o),o=await n0({findPreview:!0}),o&&(yield o),o=await $h({useAlternateBitness:!0,findPreview:!0}),o&&(yield o),o=await A7(),o&&(yield o),o=N7(),o&&(yield o)}async function*GS(){for await(let o of U7())await o.exists()&&(yield o)}async function r0(){for await(let o of GS())return o;return null}var t0,_7,L7,Qp,Qc,ml,qS=y(()=>{Le();fr();t0=/^\d+$/,_7=/^Microsoft.PowerShell_.*/,L7=/^Microsoft.PowerShellPreview_.*/;switch(process.arch){case"ia32":Qp=1;break;case"arm":case"arm64":Qp=2;break;default:Qp=0;break}process.env.PROCESSOR_ARCHITEW6432?Qc=process.env.PROCESSOR_ARCHITEW6432==="ARM64"?2:0:process.env.PROCESSOR_ARCHITECTURE==="ARM64"?Qc=2:process.env.PROCESSOR_ARCHITECTURE==="X86"?Qc=1:Qc=0;ml=class{constructor(t,e,n){this.exePath=t;this.displayName=e;this.knownToExist=n}async exists(){return this.knownToExist===void 0&&(this.knownToExist=await er.existsFile(this.exePath)),this.knownToExist}}});function o0(o,...t){let e=t.reduce((i,s)=>(i[s]=!0,i),{}),n=[/^ELECTRON_.+$/,/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,/^SNAP(|_.*)$/,/^GDK_PIXBUF_.+$/];Object.keys(o).filter(i=>!e[i]).forEach(i=>{for(let s=0;s<n.length;s++)if(i.search(n[s])!==-1){delete o[i];break}})}function zh(o){o&&(delete o.DEBUG,_e&&delete o.LD_PRELOAD)}var Jp=y(()=>{me()});import{promises as i0}from"fs";function s0(o=tn){return o.comspec||"cmd.exe"}function a0(o){let t=[],e=!1,n=function(r){if(e){t.push(r);return}(!o.send(r,s=>{if(s&&console.error(s),e=!1,t.length>0){let a=t.slice(0);t=[],a.forEach(l=>n(l))}})||te)&&(e=!0)};return{send:n}}async function F7(o){if(await Te.exists(o)){let t;try{t=await i0.stat(o)}catch(e){e.message.startsWith("EACCES")&&(t=await i0.lstat(o))}return t?!t.isDirectory():!1}return!1}async function Xp(o,t,e,n=tn,r=F7){if(ro(o))return await r(o)?o:void 0;if(t===void 0&&(t=to()),Ct(o)!=="."){let l=H(t,o);return await r(l)?l:void 0}let s=SS(n,"PATH");if(e===void 0&&ne(s)&&(e=s.split(Ds)),e===void 0||e.length===0){let l=H(t,o);return await r(l)?l:void 0}for(let l of e){let c;if(ro(l)?c=H(l,o):c=H(t,l,o),te){let p=(SS(n,"PATHEXT")||".COM;.EXE;.BAT;.CMD").split(";").map(async m=>{let g=c+m;return await r(g)?g:void 0});for(let m of p){let g=await m;if(g)return g}}if(await r(c))return c}let a=H(t,o);return await r(a)?a:void 0}var Yp=y(()=>{on();Le();me();no();Jp();Me();fr();$e()});import{userInfo as W7}from"os";async function Gh(o,t){return o===1?te?H7():s0(t):B7(o,t)}function B7(o,t){if(_e&&o===2||rt&&o===3)return"/bin/bash";if(!KS){let e;if(te)e="/bin/bash";else{if(e=t.SHELL,!e)try{e=W7().shell}catch{}e||(e="sh"),e==="/bin/false"&&(e="/bin/bash")}KS=e}return KS}async function H7(){return jS||(jS=(await r0()).exePath),jS}var KS,jS,QS=y(()=>{me();qS();Yp();KS=null;jS=null});function qh(o,t,e=z7){let n=o.find((m,g)=>m.length>0&&m[0]!=="-"&&t.hasOwnProperty(m)&&t[m].type==="subcommand"),r={},i=["_"],s=[],a={},l;for(let m in t){let g=t[m];g.type==="subcommand"?m===n&&(l=g):(g.alias&&(r[m]=g.alias),g.type==="string"||g.type==="string[]"?(i.push(m),g.deprecates&&i.push(...g.deprecates)):g.type==="boolean"&&(s.push(m),g.deprecates&&s.push(...g.deprecates)),g.global&&(a[m]=g))}if(l&&n){let m=a;for(let x in l.options)m[x]=l.options[x];let g=o.filter(x=>x!==n),h=e.getSubcommandReporter?e.getSubcommandReporter(n):void 0,v=qh(g,m,h);return{[n]:v,_:[]}}let c=(0,c0.default)(o,{string:i,boolean:s,alias:r}),u={},p=c;u._=c._.map(m=>String(m)).filter(m=>m.length>0),delete p._;for(let m in t){let g=t[m];if(g.type==="subcommand")continue;g.alias&&delete p[g.alias];let h=p[m];if(g.deprecates)for(let v of g.deprecates)p.hasOwnProperty(v)&&(h||(h=p[v],h&&e.onDeprecatedOption(v,g.deprecationMessage||d(665,null,m))),delete p[v]);if(typeof h<"u"){if(g.type==="string[]"){if(Array.isArray(h)||(h=[h]),!g.allowEmptyValue){let v=h.filter(x=>x.length>0);v.length!==h.length&&(e.onEmptyValue(m),h=v.length>0?v:void 0)}}else g.type==="string"&&(Array.isArray(h)?(h=h.pop(),e.onMultipleValues(m,h)):!h&&!g.allowEmptyValue&&(e.onEmptyValue(m),h=void 0));u[m]=h,g.deprecationMessage&&e.onDeprecatedOption(m,g.deprecationMessage)}delete p[m]}for(let m in p)e.onUnknownOption(m);return u}function G7(o,t){let e="";return t.args&&(Array.isArray(t.args)?e=` <${t.args.join("> <")}>`:e=` <${t.args}>`),t.alias?`-${t.alias} --${o}${e}`:`--${o}${e}`}function q7(o,t){let e=[];for(let n in o){let r=o[n],i=G7(n,r);e.push([i,r.description])}return d0(e,t)}function d0(o,t){let n=o.reduce((s,a)=>Math.max(s,a[0].length),12)+2+1;if(t-n<25)return o.reduce((s,a)=>s.concat([` ${a[0]}`,` ${a[1]}`]),[]);let r=t-n-1,i=[];for(let s of o){let a=s[0],l=K7(s[1],r),c=l0(n-a.length-2);i.push(" "+a+c+l[0]);for(let u=1;u<l.length;u++)i.push(l0(n)+l[u])}return i}function l0(o){return" ".repeat(o)}function K7(o,t){let e=[];for(;o.length;){let n=o.length<t?o.length:o.lastIndexOf(" ",t);n===0&&(n=t);let r=o.slice(0,n).trim();o=o.slice(n).trimStart(),e.push(r)}return e}function u0(o,t,e,n,r){let i=process.stdout.isTTY&&process.stdout.columns||80,s=r?.noInputFiles?"":r?.isChat?` [${d(664,null)}]`:` [${d(691,null)}...]`,a=r?.isChat?" chat":"",l=[`${o} ${e}`];l.push(""),l.push(`${d(710,null)}: ${t}${a} [${d(689,null)}]${s}`),l.push(""),r?.noPipe!==!0&&(l.push(j7(t,r?.isChat)),l.push(""));let c={},u=[];for(let p in n){let m=n[p];if(m.type==="subcommand")m.description&&u.push({command:p,description:m.description});else if(m.description&&m.cat){let g=m.cat,h=c[g];h||(c[g]=h={}),h[p]=m}}for(let p in c){let m=p,g=c[m];g&&(l.push($7[m]),l.push(...q7(g,i)),l.push(""))}return u.length&&(l.push(d(701,null)),l.push(...d0(u.map(p=>[p.command,p.description]),i)),l.push("")),l.join(`
- `)}function j7(o,t){let e;return te?t?e=`echo Hello World | ${o} chat <prompt> -`:e=`echo Hello World | ${o} -`:t?e=`ps aux | grep code | ${o} chat <prompt> -`:e=`ps aux | grep code | ${o} -`,d(700,null,e)}function p0(o,t){return`${o||d(708,null)}
- ${t||d(707,null)}
- ${process.arch}`}var c0,$7,Rt,z7,Zp=y(()=>{c0=pR(ux(),1);me();pe();$7={o:d(690,null),e:d(674,null),t:d(704,null),m:d(685,null)},Rt={chat:{type:"subcommand",description:"Pass in a prompt to run in a chat session in the current working directory.",options:{_:{type:"string[]",description:d(694,null)},mode:{type:"string",cat:"o",alias:"m",args:"mode",description:d(662,null)},"add-file":{type:"string[]",cat:"o",alias:"a",args:"path",description:d(657,null)},maximize:{type:"boolean",cat:"o",description:d(661,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:d(697,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:d(688,null)},profile:{type:"string",cat:"o",args:"profileName",description:d(693,null)},help:{type:"boolean",alias:"h",description:d(676,null)}}},"serve-web":{type:"subcommand",description:"Run a server that displays the editor UI in browsers.",options:{"cli-data-dir":{type:"string",args:"dir",description:d(663,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"}}},"agent-host":{type:"subcommand",description:"Run a server that hosts agents.",options:{"cli-data-dir":{type:"string",args:"dir",description:d(663,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"}}},tunnel:{type:"subcommand",description:"Make the current machine accessible from vscode.dev or other machines through a secure tunnel.",options:{"cli-data-dir":{type:"string",args:"dir",description:d(663,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"},user:{type:"subcommand",options:{login:{type:"subcommand",options:{provider:{type:"string"},"access-token":{type:"string"}}}}}}},diff:{type:"boolean",cat:"o",alias:"d",args:["file","file"],description:d(666,null)},merge:{type:"boolean",cat:"o",alias:"m",args:["path1","path2","base","result"],description:d(686,null)},add:{type:"boolean",cat:"o",alias:"a",args:"folder",description:d(656,null)},remove:{type:"boolean",cat:"o",args:"folder",description:d(695,null)},goto:{type:"boolean",cat:"o",alias:"g",args:"file:line[:character]",description:d(675,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:d(687,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:d(696,null)},agents:{type:"boolean",cat:"o",deprecates:["sessions"],description:d(659,null)},wait:{type:"boolean",cat:"o",alias:"w",description:d(714,null)},waitMarkerFilePath:{type:"string"},locale:{type:"string",cat:"o",args:"locale",description:d(682,null)},"user-data-dir":{type:"string",cat:"o",args:"dir",description:d(711,null)},profile:{type:"string",cat:"o",args:"profileName",description:d(693,null)},help:{type:"boolean",cat:"o",alias:"h",description:d(676,null)},"extensions-dir":{type:"string",deprecates:["extensionHomePath"],cat:"e",args:"dir",description:d(673,null)},"extensions-download-dir":{type:"string"},"builtin-extensions-dir":{type:"string"},"list-extensions":{type:"boolean",cat:"e",description:d(681,null)},"agent-plugins-dir":{type:"string"},"show-versions":{type:"boolean",cat:"e",description:d(698,null)},category:{type:"string",allowEmptyValue:!0,cat:"e",description:d(660,null),args:"category"},"install-extension":{type:"string[]",cat:"e",args:"ext-id | path",description:d(680,null)},"pre-release":{type:"boolean",cat:"e",description:d(679,null)},"uninstall-extension":{type:"string[]",cat:"e",args:"ext-id",description:d(706,null)},"update-extensions":{type:"boolean",cat:"e",description:d(709,null)},"enable-proposed-api":{type:"string[]",allowEmptyValue:!0,cat:"e",args:"ext-id",description:d(672,null)},"add-mcp":{type:"string[]",cat:"m",args:"json",description:d(658,null)},version:{type:"boolean",cat:"t",alias:"v",description:d(713,null)},verbose:{type:"boolean",cat:"t",global:!0,description:d(712,null)},log:{type:"string[]",cat:"t",args:"level",global:!0,description:d(684,null)},status:{type:"boolean",alias:"s",cat:"t",description:d(699,null)},"prof-startup":{type:"boolean",cat:"t",description:d(692,null)},"prof-append-timers":{type:"string"},"prof-duration-markers":{type:"string[]"},"prof-duration-markers-file":{type:"string"},"no-cached-data":{type:"boolean"},"prof-startup-prefix":{type:"string"},"prof-v8-extensions":{type:"boolean"},"disable-extensions":{type:"boolean",deprecates:["disableExtensions"],cat:"t",description:d(669,null)},"disable-extension":{type:"string[]",cat:"t",args:"ext-id",description:d(668,null)},sync:{type:"string",cat:"t",description:d(705,null),args:["on | off"]},"inspect-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugPluginHost"],args:"port",cat:"t",description:d(678,null)},"inspect-brk-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugBrkPluginHost"],args:"port",cat:"t",description:d(677,null)},"disable-lcd-text":{type:"boolean",cat:"t",description:d(671,null)},"disable-gpu":{type:"boolean",cat:"t",description:d(670,null)},"disable-chromium-sandbox":{type:"boolean",cat:"t",description:d(667,null)},sandbox:{type:"boolean"},"locate-shell-integration-path":{type:"string",cat:"t",args:["shell"],description:d(683,null)},telemetry:{type:"boolean",cat:"t",description:d(702,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"},transient:{type:"boolean",cat:"t",description:d(703,null)},"use-inmemory-secretstorage":{type:"boolean",deprecates:["disable-keytar"]},"password-store":{type:"string"},"disable-workspace-trust":{type:"boolean"},"disable-crash-reporter":{type:"boolean"},"crash-reporter-directory":{type:"string"},"crash-reporter-id":{type:"string"},"skip-add-to-recently-opened":{type:"boolean"},"open-url":{type:"boolean"},"file-write":{type:"boolean"},"file-chmod":{type:"boolean"},"install-builtin-extension":{type:"string[]"},force:{type:"boolean"},"do-not-sync":{type:"boolean"},"do-not-include-pack-dependencies":{type:"boolean"},trace:{type:"boolean"},"trace-memory-infra":{type:"boolean"},"trace-category-filter":{type:"string"},"trace-options":{type:"string"},"preserve-env":{type:"boolean"},"force-user-env":{type:"boolean"},"force-disable-user-env":{type:"boolean"},"open-devtools":{type:"boolean"},"disable-gpu-sandbox":{type:"boolean"},logsPath:{type:"string"},"__enable-file-policy":{type:"boolean"},editSessionId:{type:"string"},continueOn:{type:"string"},"enable-coi":{type:"boolean"},"unresponsive-sample-interval":{type:"string"},"unresponsive-sample-period":{type:"string"},"enable-rdp-display-tracking":{type:"boolean"},"disable-layout-restore":{type:"boolean"},"disable-experiments":{type:"boolean"},"no-proxy-server":{type:"boolean"},"no-sandbox":{type:"boolean",alias:"sandbox"},"proxy-server":{type:"string"},"proxy-bypass-list":{type:"string"},"proxy-pac-url":{type:"string"},"js-flags":{type:"string"},inspect:{type:"string",allowEmptyValue:!0},"inspect-brk":{type:"string",allowEmptyValue:!0},nolazy:{type:"boolean"},"force-device-scale-factor":{type:"string"},"force-renderer-accessibility":{type:"boolean"},"ignore-certificate-errors":{type:"boolean"},"allow-insecure-localhost":{type:"boolean"},"log-net-log":{type:"string"},vmodule:{type:"string"},_urls:{type:"string[]"},"disable-dev-shm-usage":{type:"boolean"},"profile-temp":{type:"boolean"},"ozone-platform":{type:"string"},"enable-tracing":{type:"string"},"trace-startup-format":{type:"string"},"trace-startup-file":{type:"string"},"trace-startup-duration":{type:"string"},"xdg-portal-required-version":{type:"string"},_:{type:"string[]"}},z7={onUnknownOption:()=>{},onMultipleValues:()=>{},onEmptyValue:()=>{},onDeprecatedOption:()=>{}}});function JS(o){return o.VSCODE_CLI==="1"}var m0=y(()=>{Le();me();pe();Zp()});function f0(o,t,e){return Math.min(Math.max(o,t),e)}var g0=y(()=>{hi()});import{spawn as Q7}from"child_process";async function Jc(o,t,e,n){return e["force-disable-user-env"]?(t.trace("resolveShellEnv(): skipped (--force-disable-user-env)"),{}):te?(t.trace("resolveShellEnv(): skipped (Windows)"),{}):JS(n)&&!e["force-user-env"]?(t.trace("resolveShellEnv(): skipped (VSCODE_CLI is set)"),{}):(JS(n)?t.trace("resolveShellEnv(): running (--force-user-env)"):t.trace("resolveShellEnv(): running (macOS/Linux)"),XS||(XS=rn.withAsyncBody(async(r,i)=>{let s=new gt,a=1e4,l=o.getValue("application.shellEnvironmentResolutionTimeout");typeof l=="number"&&(a=f0(l,1,120)*1e3);let c=setTimeout(()=>{s.dispose(!0),i(new Error(d(917,null)))},a);try{r(await J7(t,s.token))}catch(u){!Tn(u)&&!s.token.isCancellationRequested?i(new Error(d(915,null,Do(u)))):r({})}finally{clearTimeout(c),s.dispose()}})),XS)}async function J7(o,t){let e=process.env.ELECTRON_RUN_AS_NODE;o.trace("getUnixShellEnvironment#runAsNode",e);let n=process.env.ELECTRON_NO_ATTACH_CONSOLE;o.trace("getUnixShellEnvironment#noAttach",n);let r=Ce().replace(/-/g,"").substr(0,12),i=new RegExp(r+"({.*})"+r),s={...process.env,ELECTRON_RUN_AS_NODE:"1",ELECTRON_NO_ATTACH_CONSOLE:"1",VSCODE_RESOLVING_ENVIRONMENT:"1"};o.trace("getUnixShellEnvironment#env",s);let a=await Gh(Or,s);return o.trace("getUnixShellEnvironment#shell",a),new Promise((l,c)=>{if(t.isCancellationRequested)return c(new Ye);let u=at(a),p,m,g="";/^(?:pwsh|powershell)(?:-preview)?$/.test(u)?(p=`& '${process.execPath}' ${g} -p '''${r}'' + JSON.stringify(process.env) + ''${r}'''`,m=["-Login","-Command"]):u==="nu"?(p=`^'${process.execPath}' ${g} -p '"${r}" + JSON.stringify(process.env) + "${r}"'`,m=["-i","-l","-c"]):u==="xonsh"?(p=`import os, json; print("${r}", json.dumps(dict(os.environ)), "${r}")`,m=["-i","-l","-c"]):(p=`'${process.execPath}' ${g} -p '"${r}" + JSON.stringify(process.env) + "${r}"'`,u==="tcsh"||u==="csh"?m=["-ic"]:m=["-i","-l","-c"]),o.trace("getUnixShellEnvironment#spawn",JSON.stringify(m),p);let h=Q7(a,[...m,p],{detached:!0,stdio:["ignore","pipe","pipe"],env:s});t.onCancellationRequested(()=>(h.kill(),c(new Ye))),h.on("error",T=>{o.error("getUnixShellEnvironment#errorChildProcess",Do(T)),c(T)});let v=[];h.stdout.on("data",T=>v.push(T));let x=[];h.stderr.on("data",T=>x.push(T)),h.on("close",(T,w)=>{let k=Buffer.concat(v).toString("utf8");o.trace("getUnixShellEnvironment#raw",k);let M=Buffer.concat(x).toString("utf8");if(M.trim()&&o.trace("getUnixShellEnvironment#stderr",M),T||w)return c(new Error(d(916,null,T,w)));let B=i.exec(k),He=B?B[1]:"{}";try{let U=JSON.parse(He);e?U.ELECTRON_RUN_AS_NODE=e:delete U.ELECTRON_RUN_AS_NODE,n?U.ELECTRON_NO_ATTACH_CONSOLE=n:delete U.ELECTRON_NO_ATTACH_CONSOLE,delete U.VSCODE_RESOLVING_ENVIRONMENT,delete U.XDG_RUNTIME_DIR,o.trace("getUnixShellEnvironment#result",U),l(U)}catch(U){o.error("getUnixShellEnvironment#errorCaught",Do(U)),c(U)}})})}var XS,Kh=y(()=>{Le();pe();Wt();rl();Se();me();sn();QS();m0();ze();g0()});import{parse as h0}from"url";function X7(o,t){return o.protocol==="http:"?t.HTTP_PROXY||t.http_proxy||null:o.protocol==="https:"&&(t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy)||null}async function v0(o,t,e={}){let n=h0(o),r=e.proxyUrl||X7(n,t);if(!r)return null;let i=h0(r);if(!/^https?:$/.test(i.protocol||""))return null;let s={host:i.hostname||"",port:(i.port?+i.port:0)||(i.protocol==="https"?443:80),auth:i.auth,rejectUnauthorized:Pr(e.strictSSL)?e.strictSSL:!0};if(n.protocol==="http:"){let{default:a}=await import("http-proxy-agent");return new a.HttpProxyAgent(r,s)}else{let{default:a}=await import("https-proxy-agent");return new a.HttpsProxyAgent(r,s)}}var y0=y(()=>{Me()});import{parse as b0}from"url";import{createGunzip as Y7}from"zlib";function tV(o){if(o instanceof Error){let t=o.code;return!!t&&Z7.has(t)}return!1}async function nV(o,t,e,n){let r=await import("kerberos"),i=r.default||r,s=new URL(o),a=t||(process.platform==="win32"?`HTTP/${s.hostname}`:`HTTP@${s.hostname}`);return e.debug(`${n} Kerberos authentication lookup`,`proxyURL:${s}`,`spn:${a}`),(await i.initializeClient(a)).step("")}async function rV(o){return(b0(o.url).protocol==="https:"?await import("https"):await import("http")).request}async function I0(o,t){let n,r=eV.test(o.type||"GET");for(let i=1;i<=3;i++)try{return await oV(o,t)}catch(s){if(n=s,s instanceof Ye||!r||!tV(s)||i===3)throw s;await uo(100*i,t)}throw n}async function oV(o,t){return rn.withAsyncBody(async(e,n)=>{let r=b0(o.url),i=o.getRawRequest?o.getRawRequest(o):await rV(o),s={hostname:r.hostname,port:r.port?parseInt(r.port):r.protocol==="https:"?443:80,protocol:r.protocol,path:r.path,method:o.type||"GET",headers:o.headers,agent:o.agent,rejectUnauthorized:Pr(o.strictSSL)?o.strictSSL:!0};o.user&&o.password&&(s.auth=o.user+":"+o.password),o.disableCache&&(s.cache="no-store");let a=i(s,c=>{let u=Jn(o.followRedirects)?o.followRedirects:3;if(c.statusCode&&c.statusCode>=300&&c.statusCode<400&&u>0&&c.headers.location)I0({...o,url:c.headers.location,followRedirects:u-1},t).then(e,n);else{let p=c;!o.isChromiumNetwork&&c.headers["content-encoding"]==="gzip"&&(p=c.pipe(Y7())),e({res:c,stream:lD(p)})}});if(a.on("error",n),o.timeout)if(o.isChromiumNetwork){let c=setTimeout(()=>{a.abort(),n(new Error(`Request timeout after ${o.timeout}ms`))},o.timeout);a.on("response",()=>clearTimeout(c)),a.on("error",()=>clearTimeout(c)),a.on("abort",()=>clearTimeout(c))}else a.setTimeout(o.timeout);o.isChromiumNetwork&&a.removeHeader("Content-Length"),o.data&&typeof o.data=="string"&&a.write(o.data),a.end();let l=t.onCancellationRequested(()=>{l.dispose(),a.abort(),n(new Ye)});a.on("response",()=>l.dispose()),a.on("error",()=>l.dispose())})}var Z7,eV,ea,YS=y(()=>{ze();et();Se();Me();xn();vn();Kh();Fe();Zo();y0();Z7=new Set(["EAI_AGAIN","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ENETDOWN","ENETUNREACH","EPROTO"]),eV=/^(GET|HEAD|OPTIONS)$/i;ea=class extends Bh{constructor(e,n,r,i){super(i);this.machine=e;this.configurationService=n;this.environmentService=r;this.configure(),this._register(n.onDidChangeConfiguration(s=>{s.affectsConfiguration("http")&&this.configure()}))}configure(){this.proxyUrl=this.getConfigValue("http.proxy"),this.strictSSL=!!this.getConfigValue("http.proxyStrictSSL"),this.authorization=this.getConfigValue("http.proxyAuthorization")}async request(e,n){let{proxyUrl:r,strictSSL:i}=this,s;try{s=await Jc(this.configurationService,this.logService,this.environmentService.args,process.env)}catch(c){this.shellEnvErrorLogged||(this.shellEnvErrorLogged=!0,this.logService.error("resolving shell environment failed",fe(c)))}let a={...process.env,...s},l=e.agent?e.agent:await v0(e.url||"",a,{proxyUrl:r,strictSSL:i});return e.agent=l,e.strictSSL=i,this.authorization&&(e.headers={...e.headers||{},"Proxy-Authorization":this.authorization}),this.logAndRequest(e,()=>I0(e,n))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){try{let n=this.getConfigValue("http.proxyKerberosServicePrincipal");return"Negotiate "+await nV(e,n,this.logService,"RequestService#lookupKerberosAuthorization")}catch(n){this.logService.debug("RequestService#lookupKerberosAuthorization Kerberos authentication failed",n);return}}async loadCertificates(){return(await import("@vscode/proxy-agent")).loadSystemCertificates({loadSystemCertificatesFromNode:()=>this.getConfigValue("http.systemCertificatesNode",$S),log:this.logService})}getConfigValue(e,n){if(this.machine==="remote")return this.configurationService.getValue(e);let r=this.configurationService.inspect(e);return r.userLocalValue??r.defaultValue??n}};ea=E([b(1,xt),b(2,Dn),b(3,Q)],ea)});function ZS(o){if(!o)return;let t=o.indexOf("+");return t<0?o:o.substr(0,t)}var eE=y(()=>{$e()});function iV(o){if(Go===2&&/^penguin(\.|$)/i.test(o))return"chromebook"}function x0(o,t,e,n,r,i,s,a,l,c,u){let p=Object.create(null);p["common.machineId"]=i,p["common.sqmId"]=s,p["common.devDeviceId"]=a,p.sessionID=Ce()+Date.now(),p.commitHash=n,p.version=r,p["common.releaseDate"]=c,p["common.platformVersion"]=(o||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),p["common.platform"]=kg(Go),p["common.nodePlatform"]=_g,p["common.nodeArch"]=e,p["common.product"]=u||"desktop",l&&(p["common.msftInternal"]=l);let m=0,g=Date.now();Object.defineProperties(p,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-g,enumerable:!0},"common.sequence":{get:()=>m++,enumerable:!0}}),RR&&(p["common.snap"]="true");let h=iV(t);return h&&(p["common.platformDetail"]=h),p}function S0(o){let t=tn.USERDNSDOMAIN;if(!t)return!1;let e=t.toLowerCase();return o.some(n=>e===n)}var nE=y(()=>{me();no();sn()});var Ft,IJ,E0,Xc,jh,em,nr=y(()=>{re();Ft=_("telemetryService"),IJ=_("customEndpointTelemetryService"),E0="telemetry",Xc="telemetry.telemetryLevel",jh="telemetry.enableCrashReporter",em="telemetry.enableTelemetry"});function Jh(o,t){return!t.isBuilt&&!t.disableTelemetry?!0:!(t.disableTelemetry||!o.enableTelemetry)}function Xh(o,t){return t.extensionTestsLocationURI?!0:!(t.isBuilt||t.disableTelemetry||o.enableTelemetry&&o.aiConfig?.ariaKey)}function Yh(o){let t=o.getValue(Xc),e=o.getValue(jh);if(o.getValue(em)===!1||e===!1)return 0;switch(t??"all"){case"all":return 3;case"error":return 2;case"crash":return 1;case"off":return 0}}function Zh(o){let t={},e={},n={};P0(o,n);for(let r in n){r=r.length>150?r.substr(r.length-149):r;let i=n[r];typeof i=="number"?e[r]=i:typeof i=="boolean"?e[r]=i?1:0:typeof i=="string"?(i.length>8192&&console.warn(`Telemetry property: ${r} has been trimmed to 8192, the original length is ${i.length}`),t[r]=i.substring(0,8191)):typeof i<"u"&&i!==null&&(t[r]=String(i))}return{properties:t,measurements:e}}function T0(o,t){if(!o)return"none";let e=ZS(o),n=t?.remoteExtensionTips;if(n&&Object.prototype.hasOwnProperty.call(n,e))return e;let r=t?.virtualWorkspaceExtensionTips;return r&&Object.prototype.hasOwnProperty.call(r,e)?e:"other"}function P0(o,t,e=0,n){if(!o||typeof o!="object"&&typeof o!="function")return;let r=o;for(let i of Object.getOwnPropertyNames(r)){let s=r[i],a=n?n+i:i;Array.isArray(s)?t[a]=Fc(s):s instanceof Date?t[a]=s.toISOString():Ue(s)?e<2?P0(s,t,e+1,a+"."):t[a]=Fc(s):t[a]=s}}function k0(o,t){let e=o.msftInternalDomains||[],n=t.getValue("telemetry.internalTesting");return S0(e)||n}function R0(o){return[o.appRoot,o.extensionsPath,o.userHome.fsPath,o.tmpDir.fsPath,o.userDataPath]}function aV(o,t){if(!o||!o.includes("/")&&!o.includes("\\"))return o;let e=o,n=[];for(let l of t)for(;;){let c=l.exec(o);if(!c)break;n.push([c.index,l.lastIndex])}let r=/(?:^|[\\\/])((node_modules|node_modules\.asar)[\\\/].*)$/,i=/^(.*?)((?:\.vscode(?:-[a-z]+)*|resources[\\\/]app)[\\\/]extensions[\\\/].*)$/i,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w\-\._@]+(\\\\|\\|\/))+[\w\-\._@]*/g,a=0;for(e="";;){let l=s.exec(o);if(!l)break;if(!n.some(([u,p])=>l.index<p&&u<s.lastIndex)){let u=i.exec(l[0]);if(u)e+=o.substring(a,l.index)+"<REDACTED: user-file-path>/"+u[2];else{let p=r.exec(l[0]);p?e+=o.substring(a,l.index)+"<REDACTED: user-file-path>/"+p[1]:e+=o.substring(a,l.index)+"<REDACTED: user-file-path>"}a=s.lastIndex}}return a<o.length&&(e+=o.substr(a)),e}function lV(o){if(!o)return o;let t=[{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 t)if(e.regex.test(o))return`<REDACTED: ${e.label}>`;return o}function nm(o,t){return o?yr(o,e=>{if(e instanceof Oo||Object.hasOwnProperty.call(e,"isTrustedTelemetryValue"))return e.value;if(typeof e=="string"){let n=e.replaceAll("%20"," ");n=aV(n,t);for(let r of t)n=n.replace(r,"");return n=lV(n),n}}):{}}var Oo,tm,w0,rE,Qh,C0,Ao=y(()=>{on();Me();pe();eE();nE();nr();Oo=class{constructor(t){this.value=t;this.isTrustedTelemetryValue=!0}},tm=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(){}},w0=new tm,rE="telemetry",Qh={id:rE,name:d(938,null)},C0={log:()=>null,flush:()=>Promise.resolve(void 0)}});var OJ,oE=y(()=>{pe();OJ={Extensions:{name:{key:"extensionsConfigurationTitle",value:d(80,null)}},IntegratedTerminal:{name:{key:"terminalIntegratedConfigurationTitle",value:d(83,null)}},InteractiveSession:{name:{key:"interactiveSessionConfigurationTitle",value:d(81,null)}},Telemetry:{name:{key:"telemetryConfigurationTitle",value:d(82,null)}},Update:{name:{key:"updateConfigurationTitle",value:d(84,null)}}}});function iE(o){return cV(o)}function cV(o){return o.contributes&&o.contributes.localizations?o.contributes.localizations.length>0:!1}function _0(o){return o.map(t=>{let[e,n]=t.split("@");return{proposalName:e,version:n?parseInt(n):void 0}})}function L0(o){return o.map(t=>t.split("@")[0])}var ev,D0,tv,nv,un,rm,gl,FJ,_n=y(()=>{Qt();re();eE();ev="extensions.user.cache",D0="extensions.builtin.cache",tv="undefined_publisher",nv=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"],un=class{constructor(t){this.value=t,this._lower=t.toLowerCase()}static equals(t,e){if(typeof t>"u"||t===null)return typeof e>"u"||e===null;if(typeof e>"u"||e===null)return!1;if(typeof t=="string"||typeof e=="string"){let n=typeof t=="string"?t:t.value,r=typeof e=="string"?e:e.value;return Fr(n,r)}return t._lower===e._lower}static toKey(t){return typeof t=="string"?t.toLowerCase():t._lower}},rm=class{constructor(t){this._set=new Set;if(t)for(let e of t)this.add(e)}get size(){return this._set.size}add(t){this._set.add(un.toKey(t))}delete(t){return this._set.delete(un.toKey(t))}has(t){return this._set.has(un.toKey(t))}},gl=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(t){this._map.delete(un.toKey(t))}get(t){return this._map.get(un.toKey(t))}has(t){return this._map.has(un.toKey(t))}set(t,e){this._map.set(un.toKey(t),e)}values(){return this._map.values()}forEach(t){this._map.forEach(t)}[Symbol.iterator](){return this._map[Symbol.iterator]()}};FJ=_("IBuiltinExtensionsScannerService")});function aE(o){switch(o){case"win32-x64":return"Windows 64 bit";case"win32-arm64":return"Windows ARM";case"linux-x64":return"Linux 64 bit";case"linux-arm64":return"Linux ARM 64";case"linux-armhf":return"Linux ARM";case"alpine-x64":return"Alpine Linux 64 bit";case"alpine-arm64":return"Alpine ARM 64";case"darwin-x64":return"Mac";case"darwin-arm64":return"Mac Silicon";case"web":return"Web";case"universal":return"universal";case"unknown":return"unknown";case"undefined":return"undefined"}}function N0(o){switch(o){case"win32-x64":return"win32-x64";case"win32-arm64":return"win32-arm64";case"linux-x64":return"linux-x64";case"linux-arm64":return"linux-arm64";case"linux-armhf":return"linux-armhf";case"alpine-x64":return"alpine-x64";case"alpine-arm64":return"alpine-arm64";case"darwin-x64":return"darwin-x64";case"darwin-arm64":return"darwin-arm64";case"web":return"web";case"universal":return"universal";default:return"unknown"}}function rv(o,t){switch(o){case 3:return t==="x64"?"win32-x64":t==="arm64"?"win32-arm64":"unknown";case 2:return t==="x64"?"linux-x64":t==="arm64"?"linux-arm64":t==="arm"?"linux-armhf":"unknown";case"alpine":return t==="x64"?"alpine-x64":t==="arm64"?"alpine-arm64":"unknown";case 1:return t==="x64"?"darwin-x64":t==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}function Zc(o,t){return t==="web"&&!o.includes("web")}function sm(o,t,e){return Zc(t,e)?!1:o==="undefined"||o==="universal"?!0:o==="unknown"?!1:o===e}function U0(o){let t=o;return!!t&&typeof t=="object"&&typeof t.id=="string"&&(!t.uuid||typeof t.uuid=="string")}async function ov(o,t){let e;try{e=await t.resolve(o)}catch(n){if(n.fileOperationResult===1)return 0;throw n}return e.children?(await Promise.all(e.children.map(r=>ov(r.resource,t)))).reduce((r,i)=>r+i,0):e.size??0}function W0(o,t){return o?t?.capabilities.signing?.allPrivateRepositorySigned===!0:t?.capabilities.signing?.allPublicRepositorySigned===!0}var om,im,M0,sE,O0,A0,$n,ho,Et,ed,tX,nX,vo,rX,oX,am,F0,V0,rr=y(()=>{me();oE();pe();Si();_n();nt();re();Hr();om="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",im=new RegExp(om),M0="__web_extension",sE="extensionInstallSource",O0="dependecyOrPackExtensionInstall",A0="clientTargetPlatform";$n=_("extensionGalleryService"),ho=class extends Error{constructor(e,n){super(e);this.code=n;this.name=n}},Et=class extends Error{constructor(e,n){super(e);this.code=n;this.name=n}},ed=_("extensionManagementService"),tX=_("IGlobalExtensionEnablementService"),nX=_("IExtensionTipsService"),vo=_("IAllowedExtensionsService");rX=hx(742,"Extensions"),oX=hx(759,"Preferences"),am="extensions.allowed",F0="extensions.verifySignature",V0="extensions.requestTimeout";bt.as(kn.Configuration).registerConfiguration({id:"extensions",order:30,title:d(758,null),type:"object",properties:{[am]:{type:"object",markdownDescription:d(748,null),default:"*",defaultSnippets:[{body:{},description:d(753,null)},{body:{"*":!0},description:d(749,null)}],scope:1,policy:{name:"AllowedExtensions",category:"Extensions",minimumVersion:"1.96",localization:{description:{key:"extensions.allowed.policy",value:d(754,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:d(746,null),enumDescriptions:[d(752,null),d(750,null),d(751,null)]},{type:"array",items:{type:"string"},description:d(747,null)}]},"([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:["boolean","string"],enum:[!0,!1,"stable"],description:d(741,null),enumDescriptions:[d(757,null),d(755,null),d(756,null)]},"\\*":{type:"boolean",enum:[!0,!1],description:d(743,null),enumDescriptions:[d(745,null),d(744,null)]}}}}})});var iv,Xe,sX,aX,B0,lX,cX,dX,uX,pX,mX,fX,Ti,H0,sv,gX,$0,hX,vX,yX,av,bX,IX,xX,SX,EX,wX,CX,z0,TX,PX,kX,RX,DX,_X,LX,MX,OX,AX,ta=y(()=>{iv={},Xe={exports:iv};(function(o,t){if(typeof iv=="object"&&typeof Xe=="object")Xe.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e=t();for(var n in e)(typeof iv=="object"?iv:o)[n]=e[n]}})(typeof self<"u"?self:void 0,(function(){return(function(o){var t={};function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return o[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=o,e.c=t,e.d=function(n,r,i){e.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:i})},e.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,r){if(1&r&&(n=e(n)),8&r||4&r&&typeof n=="object"&&n&&n.__esModule)return n;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&r&&typeof n!="string")for(var s in n)e.d(i,s,function(a){return n[a]}.bind(null,s));return i},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.p="",e(e.s=0)})([function(o,t,e){(function(n){var r;t=o.exports=ht,r=typeof n=="object"&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var C=Array.prototype.slice.call(arguments,0);C.unshift("SEMVER"),console.log.apply(console,C)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=t.re=[],l=t.src=[],c=0,u=c++;l[u]="0|[1-9]\\d*";var p=c++;l[p]="[0-9]+";var m=c++;l[m]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var g=c++;l[g]="("+l[u]+")\\.("+l[u]+")\\.("+l[u]+")";var h=c++;l[h]="("+l[p]+")\\.("+l[p]+")\\.("+l[p]+")";var v=c++;l[v]="(?:"+l[u]+"|"+l[m]+")";var x=c++;l[x]="(?:"+l[p]+"|"+l[m]+")";var T=c++;l[T]="(?:-("+l[v]+"(?:\\."+l[v]+")*))";var w=c++;l[w]="(?:-?("+l[x]+"(?:\\."+l[x]+")*))";var k=c++;l[k]="[0-9A-Za-z-]+";var M=c++;l[M]="(?:\\+("+l[k]+"(?:\\."+l[k]+")*))";var B=c++,He="v?"+l[g]+l[T]+"?"+l[M]+"?";l[B]="^"+He+"$";var U="[v=\\s]*"+l[h]+l[w]+"?"+l[M]+"?",Y=c++;l[Y]="^"+U+"$";var G=c++;l[G]="((?:<|>)?=?)";var W=c++;l[W]=l[p]+"|x|X|\\*";var ee=c++;l[ee]=l[u]+"|x|X|\\*";var se=c++;l[se]="[v=\\s]*("+l[ee]+")(?:\\.("+l[ee]+")(?:\\.("+l[ee]+")(?:"+l[T]+")?"+l[M]+"?)?)?";var Ht=c++;l[Ht]="[v=\\s]*("+l[W]+")(?:\\.("+l[W]+")(?:\\.("+l[W]+")(?:"+l[w]+")?"+l[M]+"?)?)?";var ct=c++;l[ct]="^"+l[G]+"\\s*"+l[se]+"$";var $=c++;l[$]="^"+l[G]+"\\s*"+l[Ht]+"$";var V=c++;l[V]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var K=c++;l[K]="(?:~>?)";var Z=c++;l[Z]="(\\s*)"+l[K]+"\\s+",a[Z]=new RegExp(l[Z],"g");var ae=c++;l[ae]="^"+l[K]+l[se]+"$";var ve=c++;l[ve]="^"+l[K]+l[Ht]+"$";var Ie=c++;l[Ie]="(?:\\^)";var mt=c++;l[mt]="(\\s*)"+l[Ie]+"\\s+",a[mt]=new RegExp(l[mt],"g");var Ne=c++;l[Ne]="^"+l[Ie]+l[se]+"$";var ft=c++;l[ft]="^"+l[Ie]+l[Ht]+"$";var Pt=c++;l[Pt]="^"+l[G]+"\\s*("+U+")$|^$";var Dt=c++;l[Dt]="^"+l[G]+"\\s*("+He+")$|^$";var En=c++;l[En]="(\\s*)"+l[G]+"\\s*("+U+"|"+l[se]+")",a[En]=new RegExp(l[En],"g");var Zr=c++;l[Zr]="^\\s*("+l[se]+")\\s+-\\s+("+l[se]+")\\s*$";var cc=c++;l[cc]="^\\s*("+l[Ht]+")\\s+-\\s+("+l[Ht]+")\\s*$";var dc=c++;l[dc]="(<|>)?=?\\s*\\*";for(var Bi=0;Bi<35;Bi++)r(Bi,l[Bi]),a[Bi]||(a[Bi]=new RegExp(l[Bi]));function xe(C,O){if(C instanceof ht)return C;if(typeof C!="string"||C.length>i||!(O?a[Y]:a[B]).test(C))return null;try{return new ht(C,O)}catch{return null}}function ht(C,O){if(C instanceof ht){if(C.loose===O)return C;C=C.version}else if(typeof C!="string")throw new TypeError("Invalid Version: "+C);if(C.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof ht))return new ht(C,O);r("SemVer",C,O),this.loose=O;var N=C.trim().match(O?a[Y]:a[B]);if(!N)throw new TypeError("Invalid Version: "+C);if(this.raw=C,this.major=+N[1],this.minor=+N[2],this.patch=+N[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");N[4]?this.prerelease=N[4].split(".").map((function(be){if(/^[0-9]+$/.test(be)){var Pe=+be;if(Pe>=0&&Pe<s)return Pe}return be})):this.prerelease=[],this.build=N[5]?N[5].split("."):[],this.format()}t.parse=xe,t.valid=function(C,O){var N=xe(C,O);return N?N.version:null},t.clean=function(C,O){var N=xe(C.trim().replace(/^[=v]+/,""),O);return N?N.version:null},t.SemVer=ht,ht.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},ht.prototype.toString=function(){return this.version},ht.prototype.compare=function(C){return r("SemVer.compare",this.version,this.loose,C),C instanceof ht||(C=new ht(C,this.loose)),this.compareMain(C)||this.comparePre(C)},ht.prototype.compareMain=function(C){return C instanceof ht||(C=new ht(C,this.loose)),$a(this.major,C.major)||$a(this.minor,C.minor)||$a(this.patch,C.patch)},ht.prototype.comparePre=function(C){if(C instanceof ht||(C=new ht(C,this.loose)),this.prerelease.length&&!C.prerelease.length)return-1;if(!this.prerelease.length&&C.prerelease.length)return 1;if(!this.prerelease.length&&!C.prerelease.length)return 0;var O=0;do{var N=this.prerelease[O],be=C.prerelease[O];if(r("prerelease compare",O,N,be),N===void 0&&be===void 0)return 0;if(be===void 0)return 1;if(N===void 0)return-1;if(N!==be)return $a(N,be)}while(++O)},ht.prototype.inc=function(C,O){switch(C){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",O);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",O);break;case"prepatch":this.prerelease.length=0,this.inc("patch",O),this.inc("pre",O);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",O),this.inc("pre",O);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 N=this.prerelease.length;--N>=0;)typeof this.prerelease[N]=="number"&&(this.prerelease[N]++,N=-2);N===-1&&this.prerelease.push(0)}O&&(this.prerelease[0]===O?isNaN(this.prerelease[1])&&(this.prerelease=[O,0]):this.prerelease=[O,0]);break;default:throw new Error("invalid increment argument: "+C)}return this.format(),this.raw=this.version,this},t.inc=function(C,O,N,be){typeof N=="string"&&(be=N,N=void 0);try{return new ht(C,N).inc(O,be).version}catch{return null}},t.diff=function(C,O){if(yg(C,O))return null;var N=xe(C),be=xe(O);if(N.prerelease.length||be.prerelease.length){for(var Pe in N)if((Pe==="major"||Pe==="minor"||Pe==="patch")&&N[Pe]!==be[Pe])return"pre"+Pe;return"prerelease"}for(var Pe in N)if((Pe==="major"||Pe==="minor"||Pe==="patch")&&N[Pe]!==be[Pe])return Pe},t.compareIdentifiers=$a;var sx=/^[0-9]+$/;function $a(C,O){var N=sx.test(C),be=sx.test(O);return N&&be&&(C=+C,O=+O),N&&!be?-1:be&&!N?1:C<O?-1:C>O?1:0}function mi(C,O,N){return new ht(C,N).compare(new ht(O,N))}function Zu(C,O,N){return mi(C,O,N)>0}function ep(C,O,N){return mi(C,O,N)<0}function yg(C,O,N){return mi(C,O,N)===0}function ax(C,O,N){return mi(C,O,N)!==0}function bg(C,O,N){return mi(C,O,N)>=0}function Ig(C,O,N){return mi(C,O,N)<=0}function tp(C,O,N,be){var Pe;switch(O){case"===":typeof C=="object"&&(C=C.version),typeof N=="object"&&(N=N.version),Pe=C===N;break;case"!==":typeof C=="object"&&(C=C.version),typeof N=="object"&&(N=N.version),Pe=C!==N;break;case"":case"=":case"==":Pe=yg(C,N,be);break;case"!=":Pe=ax(C,N,be);break;case">":Pe=Zu(C,N,be);break;case">=":Pe=bg(C,N,be);break;case"<":Pe=ep(C,N,be);break;case"<=":Pe=Ig(C,N,be);break;default:throw new TypeError("Invalid operator: "+O)}return Pe}function eo(C,O){if(C instanceof eo){if(C.loose===O)return C;C=C.value}if(!(this instanceof eo))return new eo(C,O);r("comparator",C,O),this.loose=O,this.parse(C),this.semver===uc?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(C,O){return $a(O,C)},t.major=function(C,O){return new ht(C,O).major},t.minor=function(C,O){return new ht(C,O).minor},t.patch=function(C,O){return new ht(C,O).patch},t.compare=mi,t.compareLoose=function(C,O){return mi(C,O,!0)},t.rcompare=function(C,O,N){return mi(O,C,N)},t.sort=function(C,O){return C.sort((function(N,be){return t.compare(N,be,O)}))},t.rsort=function(C,O){return C.sort((function(N,be){return t.rcompare(N,be,O)}))},t.gt=Zu,t.lt=ep,t.eq=yg,t.neq=ax,t.gte=bg,t.lte=Ig,t.cmp=tp,t.Comparator=eo;var uc={};function en(C,O){if(C instanceof en)return C.loose===O?C:new en(C.raw,O);if(C instanceof eo)return new en(C.value,O);if(!(this instanceof en))return new en(C,O);if(this.loose=O,this.raw=C,this.set=C.split(/\s*\|\|\s*/).map((function(N){return this.parseRange(N.trim())}),this).filter((function(N){return N.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+C);this.format()}function dr(C){return!C||C.toLowerCase()==="x"||C==="*"}function lR(C,O,N,be,Pe,wn,vt,Cr,ln,jn,Ho,cn,Un){return((O=dr(N)?"":dr(be)?">="+N+".0.0":dr(Pe)?">="+N+"."+be+".0":">="+O)+" "+(Cr=dr(ln)?"":dr(jn)?"<"+(+ln+1)+".0.0":dr(Ho)?"<"+ln+"."+(+jn+1)+".0":cn?"<="+ln+"."+jn+"."+Ho+"-"+cn:"<="+Cr)).trim()}function cR(C,O){for(var N=0;N<C.length;N++)if(!C[N].test(O))return!1;if(O.prerelease.length){for(N=0;N<C.length;N++)if(r(C[N].semver),C[N].semver!==uc&&C[N].semver.prerelease.length>0){var be=C[N].semver;if(be.major===O.major&&be.minor===O.minor&&be.patch===O.patch)return!0}return!1}return!0}function np(C,O,N){try{O=new en(O,N)}catch{return!1}return O.test(C)}function xg(C,O,N,be){var Pe,wn,vt,Cr,ln;switch(C=new ht(C,be),O=new en(O,be),N){case">":Pe=Zu,wn=Ig,vt=ep,Cr=">",ln=">=";break;case"<":Pe=ep,wn=bg,vt=Zu,Cr="<",ln="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(np(C,O,be))return!1;for(var jn=0;jn<O.set.length;++jn){var Ho=O.set[jn],cn=null,Un=null;if(Ho.forEach((function(Tr){Tr.semver===uc&&(Tr=new eo(">=0.0.0")),cn=cn||Tr,Un=Un||Tr,Pe(Tr.semver,cn.semver,be)?cn=Tr:vt(Tr.semver,Un.semver,be)&&(Un=Tr)})),cn.operator===Cr||cn.operator===ln||(!Un.operator||Un.operator===Cr)&&wn(C,Un.semver)||Un.operator===ln&&vt(C,Un.semver))return!1}return!0}eo.prototype.parse=function(C){var O=this.loose?a[Pt]:a[Dt],N=C.match(O);if(!N)throw new TypeError("Invalid comparator: "+C);this.operator=N[1],this.operator==="="&&(this.operator=""),N[2]?this.semver=new ht(N[2],this.loose):this.semver=uc},eo.prototype.toString=function(){return this.value},eo.prototype.test=function(C){return r("Comparator.test",C,this.loose),this.semver===uc||(typeof C=="string"&&(C=new ht(C,this.loose)),tp(C,this.operator,this.semver,this.loose))},eo.prototype.intersects=function(C,O){if(!(C instanceof eo))throw new TypeError("a Comparator is required");var N;if(this.operator==="")return N=new en(C.value,O),np(this.value,N,O);if(C.operator==="")return N=new en(this.value,O),np(C.semver,N,O);var be=!(this.operator!==">="&&this.operator!==">"||C.operator!==">="&&C.operator!==">"),Pe=!(this.operator!=="<="&&this.operator!=="<"||C.operator!=="<="&&C.operator!=="<"),wn=this.semver.version===C.semver.version,vt=!(this.operator!==">="&&this.operator!=="<="||C.operator!==">="&&C.operator!=="<="),Cr=tp(this.semver,"<",C.semver,O)&&(this.operator===">="||this.operator===">")&&(C.operator==="<="||C.operator==="<"),ln=tp(this.semver,">",C.semver,O)&&(this.operator==="<="||this.operator==="<")&&(C.operator===">="||C.operator===">");return be||Pe||wn&&vt||Cr||ln},t.Range=en,en.prototype.format=function(){return this.range=this.set.map((function(C){return C.join(" ").trim()})).join("||").trim(),this.range},en.prototype.toString=function(){return this.range},en.prototype.parseRange=function(C){var O=this.loose;C=C.trim(),r("range",C,O);var N=O?a[cc]:a[Zr];C=C.replace(N,lR),r("hyphen replace",C),C=C.replace(a[En],"$1$2$3"),r("comparator trim",C,a[En]),C=(C=(C=C.replace(a[Z],"$1~")).replace(a[mt],"$1^")).split(/\s+/).join(" ");var be=O?a[Pt]:a[Dt],Pe=C.split(" ").map((function(wn){return(function(vt,Cr){return r("comp",vt),vt=(function(ln,jn){return ln.trim().split(/\s+/).map((function(Ho){return(function(cn,Un){r("caret",cn,Un);var Tr=Un?a[ft]:a[Ne];return cn.replace(Tr,(function(Co,De,Qe,Mt,qt){var Fn;return r("caret",cn,Co,De,Qe,Mt,qt),dr(De)?Fn="":dr(Qe)?Fn=">="+De+".0.0 <"+(+De+1)+".0.0":dr(Mt)?Fn=De==="0"?">="+De+"."+Qe+".0 <"+De+"."+(+Qe+1)+".0":">="+De+"."+Qe+".0 <"+(+De+1)+".0.0":qt?(r("replaceCaret pr",qt),qt.charAt(0)!=="-"&&(qt="-"+qt),Fn=De==="0"?Qe==="0"?">="+De+"."+Qe+"."+Mt+qt+" <"+De+"."+Qe+"."+(+Mt+1):">="+De+"."+Qe+"."+Mt+qt+" <"+De+"."+(+Qe+1)+".0":">="+De+"."+Qe+"."+Mt+qt+" <"+(+De+1)+".0.0"):(r("no pr"),Fn=De==="0"?Qe==="0"?">="+De+"."+Qe+"."+Mt+" <"+De+"."+Qe+"."+(+Mt+1):">="+De+"."+Qe+"."+Mt+" <"+De+"."+(+Qe+1)+".0":">="+De+"."+Qe+"."+Mt+" <"+(+De+1)+".0.0"),r("caret return",Fn),Fn}))})(Ho,jn)})).join(" ")})(vt,Cr),r("caret",vt),vt=(function(ln,jn){return ln.trim().split(/\s+/).map((function(Ho){return(function(cn,Un){var Tr=Un?a[ve]:a[ae];return cn.replace(Tr,(function(Co,De,Qe,Mt,qt){var Fn;return r("tilde",cn,Co,De,Qe,Mt,qt),dr(De)?Fn="":dr(Qe)?Fn=">="+De+".0.0 <"+(+De+1)+".0.0":dr(Mt)?Fn=">="+De+"."+Qe+".0 <"+De+"."+(+Qe+1)+".0":qt?(r("replaceTilde pr",qt),qt.charAt(0)!=="-"&&(qt="-"+qt),Fn=">="+De+"."+Qe+"."+Mt+qt+" <"+De+"."+(+Qe+1)+".0"):Fn=">="+De+"."+Qe+"."+Mt+" <"+De+"."+(+Qe+1)+".0",r("tilde return",Fn),Fn}))})(Ho,jn)})).join(" ")})(vt,Cr),r("tildes",vt),vt=(function(ln,jn){return r("replaceXRanges",ln,jn),ln.split(/\s+/).map((function(Ho){return(function(cn,Un){cn=cn.trim();var Tr=Un?a[$]:a[ct];return cn.replace(Tr,(function(Co,De,Qe,Mt,qt,Fn){r("xRange",cn,Co,De,Qe,Mt,qt,Fn);var lx=dr(Qe),pc=lx||dr(Mt),mc=pc||dr(qt);return De==="="&&mc&&(De=""),lx?Co=De===">"||De==="<"?"<0.0.0":"*":De&&mc?(pc&&(Mt=0),mc&&(qt=0),De===">"?(De=">=",pc?(Qe=+Qe+1,Mt=0,qt=0):mc&&(Mt=+Mt+1,qt=0)):De==="<="&&(De="<",pc?Qe=+Qe+1:Mt=+Mt+1),Co=De+Qe+"."+Mt+"."+qt):pc?Co=">="+Qe+".0.0 <"+(+Qe+1)+".0.0":mc&&(Co=">="+Qe+"."+Mt+".0 <"+Qe+"."+(+Mt+1)+".0"),r("xRange return",Co),Co}))})(Ho,jn)})).join(" ")})(vt,Cr),r("xrange",vt),vt=(function(ln,jn){return r("replaceStars",ln,jn),ln.trim().replace(a[dc],"")})(vt,Cr),r("stars",vt),vt})(wn,O)})).join(" ").split(/\s+/);return this.loose&&(Pe=Pe.filter((function(wn){return!!wn.match(be)}))),Pe=Pe.map((function(wn){return new eo(wn,O)}))},en.prototype.intersects=function(C,O){if(!(C instanceof en))throw new TypeError("a Range is required");return this.set.some((function(N){return N.every((function(be){return C.set.some((function(Pe){return Pe.every((function(wn){return be.intersects(wn,O)}))}))}))}))},t.toComparators=function(C,O){return new en(C,O).set.map((function(N){return N.map((function(be){return be.value})).join(" ").trim().split(" ")}))},en.prototype.test=function(C){if(!C)return!1;typeof C=="string"&&(C=new ht(C,this.loose));for(var O=0;O<this.set.length;O++)if(cR(this.set[O],C))return!0;return!1},t.satisfies=np,t.maxSatisfying=function(C,O,N){var be=null,Pe=null;try{var wn=new en(O,N)}catch{return null}return C.forEach((function(vt){wn.test(vt)&&(be&&Pe.compare(vt)!==-1||(Pe=new ht(be=vt,N)))})),be},t.minSatisfying=function(C,O,N){var be=null,Pe=null;try{var wn=new en(O,N)}catch{return null}return C.forEach((function(vt){wn.test(vt)&&(be&&Pe.compare(vt)!==1||(Pe=new ht(be=vt,N)))})),be},t.validRange=function(C,O){try{return new en(C,O).range||"*"}catch{return null}},t.ltr=function(C,O,N){return xg(C,O,"<",N)},t.gtr=function(C,O,N){return xg(C,O,">",N)},t.outside=xg,t.prerelease=function(C,O){var N=xe(C,O);return N&&N.prerelease.length?N.prerelease:null},t.intersects=function(C,O,N){return C=new en(C,N),O=new en(O,N),C.intersects(O)},t.coerce=function(C){if(C instanceof ht)return C;if(typeof C!="string")return null;var O=C.match(a[V]);return O==null?null:xe((O[1]||"0")+"."+(O[2]||"0")+"."+(O[3]||"0"))}}).call(this,e(1))},function(o,t){var e,n,r=o.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(x){if(e===setTimeout)return setTimeout(x,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(x,0);try{return e(x,0)}catch{try{return e.call(null,x,0)}catch{return e.call(this,x,0)}}}(function(){try{e=typeof setTimeout=="function"?setTimeout:i}catch{e=i}try{n=typeof clearTimeout=="function"?clearTimeout:s}catch{n=s}})();var l,c=[],u=!1,p=-1;function m(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&g())}function g(){if(!u){var x=a(m);u=!0;for(var T=c.length;T;){for(l=c,c=[];++p<T;)l&&l[p].run();p=-1,T=c.length}l=null,u=!1,(function(w){if(n===clearTimeout)return clearTimeout(w);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(w);try{n(w)}catch{try{return n.call(null,w)}catch{return n.call(this,w)}}})(x)}}function h(x,T){this.fun=x,this.array=T}function v(){}r.nextTick=function(x){var T=new Array(arguments.length-1);if(arguments.length>1)for(var w=1;w<arguments.length;w++)T[w-1]=arguments[w];c.push(new h(x,T)),c.length!==1||u||a(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(x){return[]},r.binding=function(x){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(x){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}])}));sX=Xe.exports.SEMVER_SPEC_VERSION,aX=Xe.exports.parse,B0=Xe.exports.valid,lX=Xe.exports.coerce,cX=Xe.exports.clean,dX=Xe.exports.inc,uX=Xe.exports.major,pX=Xe.exports.minor,mX=Xe.exports.patch,fX=Xe.exports.prerelease,Ti=Xe.exports.gt,H0=Xe.exports.gte,sv=Xe.exports.lt,gX=Xe.exports.lte,$0=Xe.exports.eq,hX=Xe.exports.neq,vX=Xe.exports.cmp,yX=Xe.exports.compare,av=Xe.exports.rcompare,bX=Xe.exports.compareIdentifiers,IX=Xe.exports.rcompareIdentifiers,xX=Xe.exports.compareBuild,SX=Xe.exports.sort,EX=Xe.exports.rsort,wX=Xe.exports.diff,CX=Xe.exports.validRange,z0=Xe.exports.satisfies,TX=Xe.exports.maxSatisfying,PX=Xe.exports.minSatisfying,kX=Xe.exports.minVersion,RX=Xe.exports.gtr,DX=Xe.exports.ltr,_X=Xe.exports.outside,LX=Xe.exports.intersects,MX=Xe.exports.SemVer,OX=Xe.exports.Comparator,AX=Xe.exports.Range});function dE(o){return o instanceof cE?!0:o instanceof Error&&o.name===lE&&o.message===lE}var lE,cE,G0=y(()=>{lE="Offline";cE=class extends Error{constructor(){super(lE),this.name=this.message}}});function we(o,t){return o.uuid&&t.uuid?o.uuid===t.uuid:o.id===t.id?!0:Ec(o.id,t.id)===0}function cm(o){let t=pV.exec(o);return t&&t[1]?[lm(t[1]),t[2]]:[lm(o),void 0]}function nd(o,t){return`${o}.${t}`}function lm(o){return o.toLowerCase()}function or(o,t){return lm(nd(o??tv,t))}function lv(o,t){let e=[],n=r=>{for(let i of e)if(i.some(s=>we(t(s),t(r))))return i;return null};for(let r of o){let i=n(r);i?i.push(r):e.push([r])}return e}function q0(o){return{id:o.identifier.id,name:o.manifest.name,galleryId:null,publisherId:o.publisherId,publisherName:o.manifest.publisher,publisherDisplayName:o.publisherDisplayName,dependencies:o.manifest.extensionDependencies&&o.manifest.extensionDependencies.length>0}}function dm(o){return{id:new Oo(o.identifier.id),name:new Oo(o.name),extensionVersion:o.version,galleryId:o.identifier.uuid,publisherId:o.publisherId,publisherName:o.publisher,publisherDisplayName:o.publisherDisplayName,isPreReleaseVersion:o.properties.isPreReleaseVersion,dependencies:!!(o.properties.dependencies&&o.properties.dependencies.length>0),isSigned:o.isSigned,...o.telemetryData}}async function mV(o,t){if(!_e)return!1;let e;try{e=(await o.readFile(I.file("/etc/os-release"))).value.toString()}catch{try{e=(await o.readFile(I.file("/usr/lib/os-release"))).value.toString()}catch(r){t.debug("Error while getting the os-release file.",fe(r))}}return!!e&&(e.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function cv(o,t){let e=await mV(o,t),n=rv(e?"alpine":Go,Lg);return t.debug("ComputeTargetPlatform:",n),n}function K0(o,t){return fV(o,t)!==void 0}function fV(o,t){return t.find(({extensionOrPublisher:e})=>ne(e)?Ec(o.id.split(".")[0],e)===0:we(o,e))}var uV,Ln,pV,XX,No=y(()=>{Qt();rr();_n();me();ce();Se();no();Ao();Me();uV=/^([^.]+\..+)-(\d+\.\d+\.\d+)(-(.+))?$/,Ln=class o{constructor(t,e,n="undefined"){this.identifier=t;this.version=e;this.targetPlatform=n;this.id=t.id}static create(t){let e=t.manifest?t.manifest.version:t.version,n=t.manifest?t.targetPlatform:t.properties.targetPlatform;return new o(t.identifier,e,n)}static parse(t){let e=uV.exec(t);return e&&e[1]&&e[2]?new o({id:e[1]},e[2],e[4]||void 0):null}toString(){return`${this.id}-${this.version}${this.targetPlatform!=="undefined"?`-${this.targetPlatform}`:""}`}equals(t){return t instanceof o?we(this,t)&&this.version===t.version&&this.targetPlatform===t.targetPlatform:!1}},pV=/^([^.]+\..+)@((prerelease)|(\d+\.\d+\.\d+(-.*)?))$/;XX=new un("pprice.better-merge")});var dv,Ae,as=y(()=>{Qt();dv=(r=>(r[r.Ignore=0]="Ignore",r[r.Info=1]="Info",r[r.Warning=2]="Warning",r[r.Error=3]="Error",r))(dv||{});(a=>{let o="error",t="warning",e="warn",n="info",r="ignore";function i(l){return l?Fr(o,l)?3:Fr(t,l)||Fr(e,l)?2:Fr(n,l)?1:0:0}a.fromValue=i;function s(l){switch(l){case 3:return o;case 2:return t;case 1:return n;default:return r}}a.toString=s})(dv||={});Ae=dv});var gV,hl,uE=y(()=>{gV={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},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:1},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts",version:4},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"},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"}},hl=Object.freeze(gV)});function vV(o){return o=o.trim(),o==="*"||j0.test(o)}function mE(o){if(!vV(o))return null;if(o=o.trim(),o==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let t=o.match(j0);return t?{hasCaret:t[1]==="^",hasGreaterEquals:t[1]===">=",majorBase:t[2]==="x"?0:parseInt(t[2],10),majorMustEqual:t[2]!=="x",minorBase:t[4]==="x"?0:parseInt(t[4],10),minorMustEqual:t[4]!=="x",patchBase:t[6]==="x"?0:parseInt(t[6],10),patchMustEqual:t[6]!=="x",preRelease:t[8]||null}:null}function fE(o){if(!o)return null;let t=o.majorBase,e=o.majorMustEqual,n=o.minorBase,r=o.minorMustEqual,i=o.patchBase,s=o.patchMustEqual;o.hasCaret&&(t===0||(r=!1),s=!1);let a=0;if(o.preRelease){let l=hV.exec(o.preRelease);if(l){let[,c,u,p,m,g]=l;a=Date.UTC(Number(c),Number(u)-1,Number(p),Number(m)||0,Number(g)||0)}}return{majorBase:t,majorMustEqual:e,minorBase:n,minorMustEqual:r,patchBase:i,patchMustEqual:s,isMinimum:o.hasGreaterEquals,notBefore:a}}function yV(o,t,e){let n;typeof o=="string"?n=fE(mE(o)):n=o;let r;t instanceof Date?r=t.getTime():typeof t=="string"&&(r=new Date(t).getTime());let i;if(typeof e=="string"?i=fE(mE(e)):i=e,!n||!i)return!1;let s=n.majorBase,a=n.minorBase,l=n.patchBase,c=i.majorBase,u=i.minorBase,p=i.patchBase,m=i.notBefore,g=i.majorMustEqual,h=i.minorMustEqual,v=i.patchMustEqual;return i.isMinimum?s>c?!0:s<c?!1:a>u?!0:a<u||r&&r<m?!1:l>=p:(s===1&&c===0&&(!g||!h||!v)&&(c=1,u=0,p=0,g=!0,h=!1,v=!1),s<c?!1:s>c?!g:a<u?!1:a>u?!h:l<p?!1:l>p?!v:!(r&&r<m))}function Q0(o,t,e,n,r,i){let s=[];if(typeof n.publisher<"u"&&typeof n.publisher!="string")return s.push([Ae.Error,d(823,null)]),s;if(typeof n.name!="string")return s.push([Ae.Error,d(822,null,"name")]),s;if(typeof n.version!="string")return s.push([Ae.Error,d(824,null,"version")]),s;if(!n.engines)return s.push([Ae.Error,d(815,null,"engines")]),s;if(typeof n.engines.vscode!="string")return s.push([Ae.Error,d(816,null,"engines.vscode")]),s;if(typeof n.extensionDependencies<"u"&&!pE(n.extensionDependencies))return s.push([Ae.Error,d(818,null,"extensionDependencies")]),s;if(typeof n.extensionAffinity<"u"&&!pE(n.extensionAffinity))return s.push([Ae.Error,d(817,null,"extensionAffinity")]),s;if(typeof n.activationEvents<"u"){if(!pE(n.activationEvents))return s.push([Ae.Error,d(811,null,"activationEvents")]),s;if(typeof n.main>"u"&&typeof n.browser>"u")return s.push([Ae.Error,d(812,null,"activationEvents","main","browser")]),s}if(typeof n.extensionKind<"u"&&typeof n.main>"u"&&s.push([Ae.Warning,d(819,null,"extensionKind")]),typeof n.main<"u"){if(typeof n.main!="string")return s.push([Ae.Error,d(820,null,"main")]),s;{let c=ye(e,n.main);Jx(c,e)||s.push([Ae.Warning,d(821,null,c.path,e.path)])}}if(typeof n.browser<"u"){if(typeof n.browser!="string")return s.push([Ae.Error,d(813,null,"browser")]),s;{let c=ye(e,n.browser);Jx(c,e)||s.push([Ae.Warning,d(814,null,c.path,e.path)])}}if(!B0(n.version))return s.push([Ae.Error,d(825,null)]),s;let a=[];if(!bV(o,t,n,r,a))for(let c of a)s.push([Ae.Error,c]);if(i&&n.enabledApiProposals?.length){let c=[];if(!pm([...n.enabledApiProposals],c))for(let u of c)s.push([Ae.Error,u])}return s}function bV(o,t,e,n,r){return n||typeof e.main>"u"&&typeof e.browser>"u"?!0:J0(o,t,e.engines.vscode,r)}function um(o,t,e){return o==="*"||J0(t,e,o)}function pm(o,t){if(o.length===0)return!0;let e=Array.isArray(t)?t:void 0,n=(Array.isArray(t)?void 0:t)??hl,r=[],i=_0(o);for(let{proposalName:s,version:a}of i){if(!a)continue;n[s]?.version!==a&&r.push(s)}return r.length?(e&&(r.length===1?e.push(d(809,null,r[0])):e.push(d(810,null,r.slice(0,r.length-1).map(s=>`'${s}'`).join(", "),r[r.length-1]))),!1):!0}function J0(o,t,e,n=[]){let r=fE(mE(e));if(!r)return n.push(d(829,null,e)),!1;if(r.majorBase===0){if(!r.majorMustEqual||!r.minorMustEqual)return n.push(d(827,null,e)),!1}else if(!r.majorMustEqual)return n.push(d(828,null,e)),!1;return yV(o,t,r)?!0:(n.push(d(826,null,o,e)),!1)}function pE(o){if(!Array.isArray(o))return!1;for(let t=0,e=o.length;t<e;t++)if(typeof o[t]!="string")return!1;return!0}var j0,hV,mm=y(()=>{Nt();as();pe();ta();_n();uE();j0=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,hV=/^-(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?$/});var Ve,X0,yn=y(()=>{re();Ve=_("productService"),X0="vscode://schemas/vscode-product"});function Y0(o){return JSON.stringify(o,IV)}function uv(o){let t=JSON.parse(o);return t=ir(t),t}function IV(o,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function ir(o,t=0){if(!o||t>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return I.revive(o);case 2:return new RegExp(o.source,o.flags);case 17:return new Date(o.source)}if(o instanceof A||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let e=0;e<o.length;++e)o[e]=ir(o[e],t+1);else for(let e in o)Object.hasOwnProperty.call(o,e)&&(o[e]=ir(o[e],t+1))}return o}var rd=y(()=>{et();ce();Cc()});var od,id,Z0=y(()=>{ze();de();q();rd();Me();od=class o extends D{constructor(e,n=Object.create(null)){super();this.database=e;this.options=n;this._onDidChangeStorage=this._register(new Ya);this.onDidChangeStorage=this._onDidChangeStorage.event;this.state=0;this.cache=new Map;this.flushDelayer=this._register(new kr(o.DEFAULT_FLUSH_DELAY));this.pendingDeletes=new Set;this.pendingInserts=new Map;this.pendingClose=void 0;this.whenFlushedCallbacks=[];this.registerListeners()}static{this.DEFAULT_FLUSH_DELAY=100}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((n,r)=>this.acceptExternal(r,n)),e.deleted?.forEach(n=>this.acceptExternal(n,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,n){if(this.state===2)return;let r=!1;_t(n)?r=this.cache.delete(e):this.cache.get(e)!==n&&(this.cache.set(e,n),r=!0),r&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===0&&(this.state=1,this.options.hint!==0&&(this.cache=await this.database.getItems()))}get(e,n){let r=this.cache.get(e);return _t(r)?n:r}getBoolean(e,n){let r=this.get(e);return _t(r)?n:r==="true"}getNumber(e,n){let r=this.get(e);return _t(r)?n:parseInt(r,10)}getObject(e,n){let r=this.get(e);return _t(r)?n:uv(r)}async set(e,n,r=!1){if(this.state===2)return;if(_t(n))return this.delete(e,r);let i=Ue(n)||Array.isArray(n)?Y0(n):String(n);if(this.cache.get(e)!==i)return this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:r}),this.doFlush()}async delete(e,n=!1){if(!(this.state===2||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async optimize(){if(this.state!==2)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=2;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===2||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===1?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===1}},id=class{constructor(){this.onDidChangeItemsExternal=F.None;this.items=new Map}async getItems(){return this.items}async updateItems(t){t.insert?.forEach((e,n)=>this.items.set(n,e)),t.delete?.forEach(e=>this.items.delete(e))}async optimize(){}async close(){}}});function t_(o){let t=o;return typeof t?.id=="string"&&I.isUri(t.uri)}function n_(o){let t=o;return typeof t?.id=="string"&&I.isUri(t.configPath)}function o_(o){return(typeof o=="string"?qo(o):eh(o))===xV}var e_,r_,xV,RY,pv=y(()=>{pe();Le();$p();Nt();ce();re();$e();e_=_("contextService");r_="code-workspace",xV=`.${r_}`,RY=[{name:d(984,null),extensions:[r_]}]});var ot,br=y(()=>{re();ot=_("IUriIdentityService")});function i_(o){let t=o;return!!(t&&typeof t=="object"&&typeof t.id=="string"&&typeof t.isDefault=="boolean"&&typeof t.name=="string"&&I.isUri(t.location)&&I.isUri(t.globalStorageHome)&&I.isUri(t.settingsResource)&&I.isUri(t.keybindingsResource)&&I.isUri(t.tasksResource)&&I.isUri(t.snippetsHome)&&I.isUri(t.promptsHome)&&I.isUri(t.extensionsResource)&&I.isUri(t.mcpResource))}function gE(o,t){return{id:o.id,isDefault:o.isDefault,name:o.name,icon:o.icon,location:I.revive(o.location).with({scheme:t}),globalStorageHome:I.revive(o.globalStorageHome).with({scheme:t}),settingsResource:I.revive(o.settingsResource).with({scheme:t}),keybindingsResource:I.revive(o.keybindingsResource).with({scheme:t}),tasksResource:I.revive(o.tasksResource).with({scheme:t}),snippetsHome:I.revive(o.snippetsHome).with({scheme:t}),promptsHome:I.revive(o.promptsHome).with({scheme:t}),extensionsResource:I.revive(o.extensionsResource).with({scheme:t}),mcpResource:I.revive(o.mcpResource).with({scheme:t}),cacheHome:I.revive(o.cacheHome).with({scheme:t}),useDefaultFlags:o.useDefaultFlags,isTransient:o.isTransient,workspaces:o.workspaces?.map(e=>I.revive(e))}}function mv(o,t,e,n,r,i){return{id:o,name:t,location:e,isDefault:!1,icon:r?.icon,globalStorageHome:i&&r?.useDefaultFlags?.globalState?i.globalStorageHome:ye(e,"globalStorage"),settingsResource:i&&r?.useDefaultFlags?.settings?i.settingsResource:ye(e,"settings.json"),keybindingsResource:i&&r?.useDefaultFlags?.keybindings?i.keybindingsResource:ye(e,"keybindings.json"),tasksResource:i&&r?.useDefaultFlags?.tasks?i.tasksResource:ye(e,"tasks.json"),snippetsHome:i&&r?.useDefaultFlags?.snippets?i.snippetsHome:ye(e,"snippets"),promptsHome:i&&r?.useDefaultFlags?.prompts?i.promptsHome:ye(e,"prompts"),extensionsResource:i&&r?.useDefaultFlags?.extensions?i.extensionsResource:ye(e,"extensions.json"),mcpResource:i&&r?.useDefaultFlags?.mcp?i.mcpResource:ye(e,"mcp.json"),cacheHome:ye(n,o),useDefaultFlags:r?.useDefaultFlags,isTransient:r?.transient,workspaces:r?.workspaces}}var an,sd,zr=y(()=>{ol();de();q();Nt();ce();pe();vn();nt();re();Fe();pv();br();ze();sn();Qt();Me();an=_("IUserDataProfilesService");sd=class extends D{constructor(e,n,r,i){super();this.environmentService=e;this.fileService=n;this.uriIdentityService=r;this.logService=i;this._onDidChangeProfiles=this._register(new P);this.onDidChangeProfiles=this._onDidChangeProfiles.event;this._onWillCreateProfile=this._register(new P);this.onWillCreateProfile=this._onWillCreateProfile.event;this._onWillRemoveProfile=this._register(new P);this.onWillRemoveProfile=this._onWillRemoveProfile.event;this._onDidResetWorkspaces=this._register(new P);this.onDidResetWorkspaces=this._onDidResetWorkspaces.event;this.profileCreationPromises=new Map;this.transientProfilesObject={profiles:[],emptyWindows:new Map};this.profilesHome=ye(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=ye(this.environmentService.cacheHome,"CachedProfilesData")}static{this.PROFILES_KEY="userDataProfiles"}static{this.PROFILE_ASSOCIATIONS_KEY="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){let e=this.createDefaultProfile(),n=[e];try{for(let i of this.getStoredProfiles()){if(this.isInvalidProfile(i)){this.logService.warn("Skipping the invalid stored profile",i.location||i.name);continue}let s=Zn(i.location);n.push(mv(s,i.name,i.location,this.profilesCacheHome,{icon:i.icon,useDefaultFlags:i.useDefaultFlags},e))}}catch(i){this.logService.error(i)}let r=new Map;if(n.length)try{let i=this.getStoredProfileAssociations();if(i.workspaces)for(let[s,a]of Object.entries(i.workspaces)){let l=I.parse(s),c=n.find(u=>u.id===a);if(c){let u=c.workspaces?c.workspaces.slice(0):[];u.push(l),c.workspaces=u}}if(i.emptyWindows)for(let[s,a]of Object.entries(i.emptyWindows)){let l=n.find(c=>c.id===a);l&&r.set(s,l)}}catch(i){this.logService.error(i)}this._profilesObject={profiles:n,emptyWindows:r}}return this._profilesObject}isInvalidProfile(e){return!!(!e.name||!ne(e.name)||!e.location||e.isSystem||this.uriIdentityService.extUri.basename(this.uriIdentityService.extUri.dirname(e.location))==="builtin")}createDefaultProfile(){let e=mv("__default__profile__",d(983,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){let n="Temp",r=new RegExp(`${ao(n)}\\s(\\d+)`),i=0;for(let a of this.profiles){let l=r.exec(a.name),c=l?parseInt(l[1]):0;i=c>i?c:i}let s=`${n} ${i+1}`;return this.createProfile(po(Ce()).toString(16),s,{transient:!0},e)}async createNamedProfile(e,n,r){return this.createProfile(po(Ce()).toString(16),e,n,r)}async createProfile(e,n,r,i){return await this.doCreateProfile(e,n,r,i)}async doCreateProfile(e,n,r,i){if(!ne(n)||!n)throw new Error("Name of the profile is mandatory and must be of type `string`");let s=this.profileCreationPromises.get(n);return s||(s=(async()=>{try{if(this.profiles.find(p=>p.id===e||!p.isTransient&&!r?.transient&&p.name===n))throw new Error(`Profile with ${n} name already exists`);let l=i?this.getWorkspace(i):void 0;I.isUri(l)&&(r={...r,workspaces:[l]});let c=mv(e,n,this.uriIdentityService.extUri.joinPath(this.profilesHome,e),this.profilesCacheHome,r,this.defaultProfile);await this.fileService.createFolder(c.location);let u=[];return this._onWillCreateProfile.fire({profile:c,join(p){u.push(p)}}),await rn.settled(u),l&&!I.isUri(l)&&this.updateEmptyWindowAssociation(l,c,!!c.isTransient),this.updateProfiles([c],[],[]),c}finally{this.profileCreationPromises.delete(n)}})(),this.profileCreationPromises.set(n,s)),s}async updateProfile(e,n){let r=[];for(let s of this.profiles){let a;if(e.id===s.id)s.isDefault?n.workspaces&&(a=s,a.workspaces=n.workspaces):a=mv(s.id,n.name??s.name,s.location,this.profilesCacheHome,{icon:n.icon===null?void 0:n.icon??s.icon,transient:n.transient??s.isTransient,useDefaultFlags:n.useDefaultFlags??s.useDefaultFlags,workspaces:n.workspaces??s.workspaces},this.defaultProfile);else if(n.workspaces){let l=s.workspaces?.filter(c=>!n.workspaces?.some(u=>this.uriIdentityService.extUri.isEqual(c,u)));s.workspaces?.length!==l?.length&&(a=s,a.workspaces=l)}a&&r.push(a)}if(!r.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],r);let i=this.profiles.find(s=>s.id===e.id);if(!i)throw new Error(`Profile '${e.name}' was not updated`);return i}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");let n=this.profiles.find(i=>i.id===e.id);if(!n)throw new Error(`Profile '${e.name}' does not exist`);let r=[];this._onWillRemoveProfile.fire({profile:n,join(i){r.push(i)}});try{await Promise.allSettled(r)}catch(i){this.logService.error(i)}this.updateProfiles([],[n],[]);try{await this.fileService.del(n.cacheHome,{recursive:!0})}catch(i){kt(i)!==1&&this.logService.error(i)}}async setProfileForWorkspace(e,n){let r=this.profiles.find(s=>s.id===n.id);if(!r)throw new Error(`Profile '${n.name}' does not exist`);let i=this.getWorkspace(e);if(I.isUri(i)){let s=r.workspaces?[...r.workspaces]:[];s.some(a=>this.uriIdentityService.extUri.isEqual(a,i))||(s.push(i),await this.updateProfile(r,{workspaces:s}))}else this.updateEmptyWindowAssociation(i,r,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,n=!1){let r=this.getWorkspace(e);if(I.isUri(r)){let i=this.getProfileForWorkspace(e);i&&this.updateProfile(i,{workspaces:i.workspaces?.filter(s=>!this.uriIdentityService.extUri.isEqual(s,r))})}else this.updateEmptyWindowAssociation(r,void 0,n),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(let e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){try{if(await this.fileService.exists(this.profilesHome)){let e=this.uriIdentityService.extUri.joinPath(this.profilesHome,"builtin");if(await this.fileService.exists(e))try{await this.fileService.del(e,{recursive:!0})}catch(r){this.logService.error(r)}let n=await this.fileService.resolve(this.profilesHome);await Promise.all((n.children||[]).filter(r=>r.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,r.resource))).map(r=>this.fileService.del(r.resource,{recursive:!0})))}}catch(e){this.logService.error("Error deleting redundant profile folders",e)}try{let e=this.getStoredProfiles(),n=[];for(let r of this.getStoredProfiles())this.isInvalidProfile(r)?this.logService.warn(`Invalid user data profile found: ${r.name}`):n.push(r);e.length!==n.length&&this.saveStoredProfiles(n)}catch(e){this.logService.error("Error removing invalid stored profiles",e)}}async cleanUpTransientProfiles(){let e=this.transientProfilesObject.profiles.filter(n=>!this.isProfileAssociatedToWorkspace(n));await Promise.allSettled(e.map(n=>this.removeProfile(n)))}getProfileForWorkspace(e){let n=this.getWorkspace(e);return I.isUri(n)?this.profiles.find(r=>r.workspaces?.some(i=>this.uriIdentityService.extUri.isEqual(i,n))):this.profilesObject.emptyWindows.get(n)??this.transientProfilesObject.emptyWindows.get(n)}getWorkspace(e){return t_(e)?e.uri:n_(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(n=>this.uriIdentityService.extUri.isEqual(n.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(n=>this.uriIdentityService.extUri.isEqual(n.location,e.location)))}updateProfiles(e,n,r,i=!1){let s=[...this.profiles,...e],a=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];let l=[];for(let c of s){if(n.some(u=>c.id===u.id)){for(let u of[...this.profilesObject.emptyWindows.keys()])c.id===this.profilesObject.emptyWindows.get(u)?.id&&this.profilesObject.emptyWindows.delete(u);continue}if(!c.isDefault){c=r.find(p=>c.id===p.id)??c;let u=a.find(p=>c.id===p.id);if(c.isTransient)this.transientProfilesObject.profiles.push(c);else if(u){for(let[p,m]of this.transientProfilesObject.emptyWindows.entries())if(c.id===m.id){this.transientProfilesObject.emptyWindows.delete(p),this.profilesObject.emptyWindows.set(p,c);break}}}c.workspaces?.length===0&&(c.workspaces=void 0),l.push(c)}this.updateStoredProfiles(l),i||this.triggerProfilesChanges(e,n,r)}triggerProfilesChanges(e,n,r){this._onDidChangeProfiles.fire({added:e,removed:n,updated:r,all:this.profiles})}updateEmptyWindowAssociation(e,n,r){r=n?.isTransient?!0:r,r?n?this.transientProfilesObject.emptyWindows.set(e,n):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),n?this.profilesObject.emptyWindows.set(e,n):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){let n=[],r={},i={};for(let s of e)if(!s.isTransient&&(s.isDefault||n.push({location:s.location,name:s.name,icon:s.icon,useDefaultFlags:s.useDefaultFlags}),s.workspaces))for(let a of s.workspaces)r[a.toString()]=s.id;for(let[s,a]of this.profilesObject.emptyWindows.entries())i[s.toString()]=a.id;this.saveStoredProfileAssociations({workspaces:r,emptyWindows:i}),this.saveStoredProfiles(n),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}};sd=E([b(0,It),b(1,Oe),b(2,ot),b(3,Q)],sd)});function EV(o){let t=o.get(fv);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}function s_(o){return o.isDefault||!!o.useDefaultFlags?.globalState}async function wV(o,t,e,n,r,i){let s=v=>{try{return JSON.parse(v)}catch{return v}},a=new Map,l=new Map;o.forEach((v,x)=>{a.set(x,v),l.set(x,s(v))});let c=new Map,u=new Map;t.forEach((v,x)=>{c.set(x,v),u.set(x,s(v))});let p=new Map,m=new Map;e.forEach((v,x)=>{p.set(x,v),m.set(x,s(v))}),console.group(n!==r?`Storage: Application (path: ${n})`:`Storage: Application & Profile (path: ${n}, default profile)`);let g=[];if(a.forEach((v,x)=>{g.push({key:x,value:v})}),console.table(g),console.groupEnd(),console.log(l),n!==r){console.group(`Storage: Profile (path: ${r}, profile specific)`);let v=[];c.forEach((x,T)=>{v.push({key:T,value:x})}),console.table(v),console.groupEnd(),console.log(u)}console.group(`Storage: Workspace (path: ${i})`);let h=[];p.forEach((v,x)=>{h.push({key:x,value:v})}),console.table(h),console.groupEnd(),console.log(m)}var SV,fv,na,hE,gv,ad=y(()=>{ze();de();q();zo();Me();Z0();re();zr();SV="__$__isNewStorageMarker",fv="__$__targetStorageMarker",na=_("storageService");hE=class o extends D{constructor(e={flushInterval:o.DEFAULT_FLUSH_INTERVAL}){super();this._onDidChangeValue=this._register(new Ya);this._onDidChangeTarget=this._register(new Ya);this.onDidChangeTarget=this._onDidChangeTarget.event;this._onWillSaveState=this._register(new P);this.onWillSaveState=this._onWillSaveState.event;this.runFlushWhenIdle=this._register(new mr);this._workspaceKeyTargets=void 0;this._profileKeyTargets=void 0;this._applicationKeyTargets=void 0;this.flushWhenIdleScheduler=this._register(new Qo(()=>this.doFlushWhenIdle(),e.flushInterval))}static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}onDidChangeValue(e,n,r){return F.filter(this._onDidChangeValue.event,i=>i.scope===e&&(n===void 0||i.key===n),r)}doFlushWhenIdle(){this.runFlushWhenIdle.value=tS(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){jt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{Ot("code/willInitStorage");try{await this.doInitialize()}finally{Ot("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,n){let{key:r,external:i}=n;if(r===fv){switch(e){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:r,target:this.getKeyTargets(e)[r],external:i})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,n,r){return this.getStorage(n)?.get(e,r)}getBoolean(e,n,r){return this.getStorage(n)?.getBoolean(e,r)}getNumber(e,n,r){return this.getStorage(n)?.getNumber(e,r)}getObject(e,n,r){return this.getStorage(n)?.getObject(e,r)}storeAll(e,n){this.withPausedEmitters(()=>{for(let r of e)this.store(r.key,r.value,r.scope,r.target,n)})}store(e,n,r,i,s=!1){if(_t(n)){this.remove(e,r,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,r,i),this.getStorage(r)?.set(e,n,s)})}remove(e,n,r=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,n,void 0),this.getStorage(n)?.delete(e,r)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,n){let r=[],i=this.getKeyTargets(e);for(let s of Object.keys(i))i[s]===n&&r.push(s);return r}updateKeyTarget(e,n,r,i=!1){let s=this.getKeyTargets(n);typeof r=="number"?s[e]!==r&&(s[e]=r,this.getStorage(n)?.set(fv,JSON.stringify(s),i)):typeof s[e]=="number"&&(delete s[e],this.getStorage(n)?.set(fv,JSON.stringify(s),i))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let n=this.getStorage(e);return n?EV(n):Object.create(null)}isNew(e){return this.getBoolean(SV,e)===!0}async flush(e=0){this._onWillSaveState.fire({reason:e});let n=this.getStorage(-1),r=this.getStorage(0),i=this.getStorage(1);switch(e){case 0:await rn.settled([n?.whenFlushed()??Promise.resolve(),r?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve()]);break;case 1:await rn.settled([n?.flush(0)??Promise.resolve(),r?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve()]);break}}async log(){let e=this.getStorage(-1)?.items??new Map,n=this.getStorage(0)?.items??new Map,r=this.getStorage(1)?.items??new Map;return wV(e,n,r,this.getLogDetails(-1)??"",this.getLogDetails(0)??"",this.getLogDetails(1)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,n){return this.emitWillSaveState(0),i_(e)?this.switchToProfile(e,n):this.switchToWorkspace(e,n)}canSwitchProfile(e,n){return!(e.id===n.id||s_(n)&&s_(e))}switchData(e,n,r){this.withPausedEmitters(()=>{let i=new Set;for(let[s,a]of e)i.add(s),n.get(s)!==a&&this.emitDidChangeValue(r,{key:s,external:!0});for(let[s]of n.items)i.has(s)||this.emitDidChangeValue(r,{key:s,external:!0})})}};gv=class extends hE{constructor(){super();this.applicationStorage=this._register(new od(new id,{hint:1}));this.profileStorage=this._register(new od(new id,{hint:1}));this.workspaceStorage=this._register(new od(new id,{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)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case-1:return"inMemory (application)";case 0:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}});async function a_(o,t,e){let n=e&&e.get("storage.serviceMachineId",-1)||null;if(n)return n;try{let i=(await t.readFile(o.serviceMachineIdResource)).value.toString();n=e0(i)?i:null}catch{n=null}if(!n){n=Ce();try{await t.writeFile(o.serviceMachineIdResource,A.fromString(n))}catch{}}return e?.store("storage.serviceMachineId",n,-1,1),n}var l_=y(()=>{et();sn();ad()});async function c_(o,t,e,n,r,i,s){let a={"X-Market-Client-Id":`VSCode ${o}`,"User-Agent":`VSCode ${o} (${t.nameShort})`};if(Jh(t,e)&&Yh(n)===3){let l=await a_(e,r,i);a["X-Market-User-Id"]=l,a["VSCode-SessionId"]=s.machineId||l}return a}var d_=y(()=>{l_();nr();Ao()});function vl(o,t){let[e,n]=t.split("/");for(let r of o.resources){let[i,s]=r.type.split("/");if(i===e){if(!n||s===n)return r.id;break}}}var Pi,yl=y(()=>{re();Pi=_("IExtensionGalleryManifestService")});function SE(o,t){let e=(o||[]).filter(n=>n.statisticName===t)[0];return e?e.value:0}function LV(o){let t="Microsoft.VisualStudio.Code.Translation.";return o.files.filter(n=>n.assetType.indexOf(t)===0).reduce((n,r)=>{let i=ei(o,r.assetType);return i&&n.push([r.assetType.substring(t.length),i]),n},[])}function MV(o){if(o.properties){let t=o.properties.filter(r=>r.key===Mn.Repository),e=new RegExp("((git|ssh|http(s)?)|(git@[\\w.]+))(:(//)?)([\\w.@:/\\-~]+)(.git)(/)?"),n=t.filter(r=>e.test(r.value))[0];return n?{uri:n.value,fallbackUri:n.value}:null}return ei(o,Mn.Repository)}function OV(o){return{uri:`${o.fallbackAssetUri}/${Mn.VSIX}?redirect=true${o.targetPlatform?`&targetPlatform=${o.targetPlatform}`:""}`,fallbackUri:`${o.fallbackAssetUri}/${Mn.VSIX}${o.targetPlatform?`?targetPlatform=${o.targetPlatform}`:""}`}}function ei(o,t){return o.files.filter(n=>n.assetType===t)[0]?{uri:`${o.assetUri}/${t}${o.targetPlatform?`?targetPlatform=${o.targetPlatform}`:""}`,fallbackUri:`${o.fallbackAssetUri}/${t}${o.targetPlatform?`?targetPlatform=${o.targetPlatform}`:""}`}:null}function u_(o,t){let e=o.properties?o.properties.filter(r=>r.key===t):[],n=e.length>0&&e[0].value;return n?n.split(",").map(r=>lm(r)):[]}function Iv(o){let t=o.properties?o.properties.filter(e=>e.key===ti.Engine):[];return t.length>0&&t[0].value||""}function AV(o,t){o.properties=o.properties??[],o.properties.push({key:ti.Engine,value:t})}function dd(o){let t=o.properties?o.properties.filter(e=>e.key===ti.PreRelease):[];return t.length>0&&t[0].value==="true"}function g_(o,t){return t.extensionProperties?.[o.toLowerCase()]?.hasPrereleaseVersion}function NV(o,t){return t.extensionProperties?.[o.toLowerCase()]?.excludeVersionRange}function UV(o){let t=o.properties?o.properties.filter(e=>e.key===ti.Private):[];return t.length>0&&t[0].value==="true"}function FV(o){let t=o.properties?o.properties.filter(e=>e.key===ti.ExecutesCode):[];return t.length>0?t[0].value==="true":void 0}function wE(o){let t=o.properties?o.properties.filter(n=>n.key===ti.EnabledApiProposals):[],e=t.length>0&&t[0].value||"";return e?e.split(","):[]}function VV(o){let t=o.properties?o.properties.filter(n=>n.key===ti.LocalizedLanguages):[],e=t.length>0&&t[0].value||"";return e?e.split(","):[]}function WV(o){return o.properties?.find(t=>t.key===ti.SponsorLink)?.value}function BV(o){return o.properties?.find(t=>t.key===ti.SupportLink)?.value}function HV(o){return o.indexOf("preview")!==-1}function bl(o){return o.targetPlatform?N0(o.targetPlatform):"undefined"}function vv(o){let t=pr(o.versions.map(bl)),e=!!o.tags?.includes(M0),n=t.indexOf("web");return e?n===-1&&t.push("web"):n!==-1&&t.splice(n,1),t}function p_(o,t){for(let e=0;e<o.length;e++){let n=o[e];if(n.version===o[e-1]?.version){let r=e;if(bl(n)===t)for(;r>0&&o[r-1].version===n.version;)r--;r!==e&&(o.splice(e,1),o.splice(r,0,n))}}return o}function $V(o,t,e){let n=[],r=-1,i=-1;for(let s of o){let a=bl(s);if(!sm(a,e,t)){n.push(s);continue}dd(s)?r===-1?(r=n.length,n.push(s)):a===t&&n[r].version===s.version&&(n[r]=s):i===-1?(i=n.length,n.push(s)):a===t&&n[i].version===s.version&&(n[i]=s)}return n}function m_(o,t,e){o.telemetryData={index:t,querySource:e,queryActivityId:o.queryContext?.[bv]}}function EE(o,t,e,n,r,i){let s=o.versions[0],a={manifest:ei(t,Mn.Manifest),readme:ei(t,Mn.Details),changelog:ei(t,Mn.Changelog),license:ei(t,Mn.License),repository:MV(t),download:OV(t),icon:ei(t,Mn.Icon),signature:ei(t,Mn.Signature),coreTranslations:LV(t)},l=vl(n,o.linkType??"ExtensionDetailsViewUriTemplate"),c=vl(n,o.publisher.linkType??"PublisherViewUriTemplate"),u=vl(n,o.ratingLinkType??"ExtensionRatingViewUriTemplate"),p=or(o.publisher.publisherName,o.extensionName);return{type:"gallery",identifier:{id:p,uuid:o.extensionId},name:o.extensionName,version:t.version,displayName:o.displayName,publisherId:o.publisher.publisherId,publisher:o.publisher.publisherName,publisherDisplayName:o.publisher.displayName,publisherDomain:o.publisher.domain?{link:o.publisher.domain,verified:!!o.publisher.isDomainVerified}:void 0,publisherSponsorLink:WV(s),description:o.shortDescription??"",installCount:SE(o.statistics,"install"),rating:SE(o.statistics,"averagerating"),ratingCount:SE(o.statistics,"ratingcount"),categories:o.categories||[],tags:o.tags||[],releaseDate:Date.parse(o.releaseDate),lastUpdated:Date.parse(o.lastUpdated),allTargetPlatforms:e,assets:a,properties:{dependencies:u_(t,ti.Dependency),extensionPack:u_(t,ti.ExtensionPack),engine:Iv(t),enabledApiProposals:wE(t),localizedLanguages:VV(t),targetPlatform:bl(t),isPreReleaseVersion:dd(t),executesCode:FV(t)},hasPreReleaseVersion:g_(p,r)??dd(s),hasReleaseVersion:!0,private:UV(s),preview:HV(o.flags),isSigned:!!a.signature,queryContext:i,supportLink:BV(s),detailsLink:l?so(l,{publisher:o.publisher.publisherName,name:o.extensionName}):void 0,publisherLink:c?so(c,{publisher:o.publisher.publisherName}):void 0,ratingLink:u?so(u,{publisher:o.publisher.publisherName,name:o.extensionName}):void 0}}var hv,bv,bE,IE,xE,Mn,ti,DV,_V,ld,cd,yv,ra,TE=y(()=>{At();Wt();ta();Se();me();no();Me();ce();G0();xn();vn();rr();No();_n();mm();nt();Fe();yn();Zo();d_();ad();nr();Ns();Qt();yl();Ao();hv=Yt?"web":rv(Go,Lg),bv="X-Market-Search-Activity-Id",bE="Activityid",IE="Server",xE="X-Vss-E2eid",Mn={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source",Signature:"Microsoft.VisualStudio.Services.VsixSignature"},ti={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",PreRelease:"Microsoft.VisualStudio.Code.PreRelease",EnabledApiProposals:"Microsoft.VisualStudio.Code.EnabledApiProposals",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages",WebExtension:"Microsoft.VisualStudio.Code.WebExtension",SponsorLink:"Microsoft.VisualStudio.Code.SponsorLink",SupportLink:"Microsoft.VisualStudio.Services.Links.Support",ExecutesCode:"Microsoft.VisualStudio.Code.ExecutesCode",Private:"PrivateMarketplace"},DV=10,_V={pageNumber:1,pageSize:DV,sortBy:"NoneOrRelevance",sortOrder:0,flags:[],criteria:[],assetTypes:[]},ld=class o{constructor(t=_V){this.state=t}get pageNumber(){return this.state.pageNumber}get pageSize(){return this.state.pageSize}get sortBy(){return this.state.sortBy}get sortOrder(){return this.state.sortOrder}get flags(){return this.state.flags}get criteria(){return this.state.criteria}get assetTypes(){return this.state.assetTypes}get source(){return this.state.source}get searchText(){let t=this.state.criteria.filter(e=>e.filterType==="SearchText")[0];return t&&t.value?t.value:""}withPage(t,e=this.state.pageSize){return new o({...this.state,pageNumber:t,pageSize:e})}withFilter(t,...e){let n=[...this.state.criteria,...e.length?e.map(r=>({filterType:t,value:r})):[{filterType:t}]];return new o({...this.state,criteria:n})}withSortBy(t){return new o({...this.state,sortBy:t})}withSortOrder(t){return new o({...this.state,sortOrder:t})}withFlags(...t){return new o({...this.state,flags:pr(t)})}withAssetTypes(...t){return new o({...this.state,assetTypes:t})}withSource(t){return new o({...this.state,source:t})}};cd=class{constructor(t,e,n,r,i,s,a,l,c,u){this.requestService=e;this.logService=n;this.environmentService=r;this.telemetryService=i;this.fileService=s;this.productService=a;this.configurationService=l;this.allowedExtensionsService=c;this.extensionGalleryManifestService=u;this.extensionsControlUrl=a.extensionsGallery?.controlUrl,this.unpkgResourceApi=a.extensionsGallery?.extensionUrlTemplate,this.extensionsEnabledWithApiProposalVersion=a.extensionsEnabledWithApiProposalVersion?.map(p=>p.toLowerCase())??[],this.commonHeadersPromise=c_(a.version,a,this.environmentService,this.configurationService,this.fileService,t,this.telemetryService)}isEnabled(){return this.extensionGalleryManifestService.extensionGalleryManifestStatus==="available"}async getExtensions(t,e,n){let r=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!r)throw new Error("No extension gallery service configured.");let i=Ee.isCancellationToken(e)?{}:e,s=Ee.isCancellationToken(e)?e:n,a=this.getResourceApi(r),l=a?await this.getExtensionsUsingResourceApi(t,i,a,r,s):await this.getExtensionsUsingQueryApi(t,i,r,s),c=l.map(p=>p.identifier.uuid),u=[];for(let p of t)p.uuid&&!c.includes(p.uuid)&&u.push({...p,uuid:void 0});if(u.length){this.telemetryService.publicLog2("galleryService:additionalQueryByName",{count:u.length});let p=await this.getExtensionsUsingQueryApi(u,i,r,s);l.push(...p)}return l}getResourceApi(t){let e=vl(t,"ExtensionLatestVersionUriTemplate");if(e)return{uri:e,fallback:this.unpkgResourceApi}}async getExtensionsUsingQueryApi(t,e,n,r){let i=[],s=[],a=[],l=[],c=!0;for(let m of t)m.uuid?s.push(m.uuid):i.push(m.id),m.version?l.push({id:m.id,uuid:m.uuid,version:m.version}):a.push({id:m.id,uuid:m.uuid,includePreRelease:!!m.preRelease}),c=c&&!!m.hasPreRelease&&!m.preRelease;if(!s.length&&!i.length)return[];let u=new ld().withPage(1,t.length);s.length&&(u=u.withFilter("ExtensionId",...s)),i.length&&(u=u.withFilter("ExtensionName",...i)),e.queryAllVersions&&(u=u.withFlags(...u.flags,"IncludeVersions")),e.source&&(u=u.withSource(e.source));let{extensions:p}=await this.queryGalleryExtensions(u,{targetPlatform:e.targetPlatform??hv,includePreRelease:a,versions:l,compatible:!!e.compatible,productVersion:e.productVersion??{version:this.productService.version,date:this.productService.date},isQueryForReleaseVersionFromPreReleaseVersion:c},n,r);return e.source&&p.forEach((m,g)=>m_(m,g,e.source)),p}async getExtensionsUsingResourceApi(t,e,n,r,i){let s=[],a=[],l=[];for(let c of t)im.test(c.id)&&(c.version?a.push(c):l.push(c));if(await Promise.all(l.map(async c=>{let u;try{u=await this.getLatestGalleryExtension(c,e,n,r,i),ne(u)?u==="LATEST_IS_OUTDATED"?this.logService.debug(`Skipping query API fallback for extension ${c.id} because the latest gallery version is older than the current version`):(this.telemetryService.publicLog2("galleryService:fallbacktoquery",{extension:c.id,preRelease:!!c.preRelease,compatible:!!e.compatible,errorCode:u}),a.push(c)):s.push(u)}catch(p){if(p instanceof ho)switch(p.code){case"Offline":case"Cancelled":case"Timeout":throw p}this.logService.error(`Error while getting the latest version for the extension ${c.id}.`,fe(p)),this.telemetryService.publicLog2("galleryService:fallbacktoquery",{extension:c.id,preRelease:!!c.preRelease,compatible:!!e.compatible,errorCode:p instanceof ho?p.code:"Unknown"}),a.push(c)}})),a.length){let c=await this.getExtensionsUsingQueryApi(a,e,r,i);s.push(...c)}return s}async getLatestGalleryExtension(t,e,n,r,i){let s=await this.getLatestRawGalleryExtensionWithFallback(t,n,i);if(!s)return"NOT_FOUND";let a=vv(s),l=await this.getValidRawGalleryExtensionVersionFromLatestVersions(s,s.versions,t,e,a);if(!l){if(t.currentVersion){let c=s.versions.length>0?s.versions[0].version:void 0;if(c&&sv(c,t.currentVersion))return"LATEST_IS_OUTDATED"}return"NOT_COMPATIBLE"}return EE(s,l,a,r,this.productService)}async getValidRawGalleryExtensionVersionFromLatestVersions(t,e,n,r,i){let s=r.targetPlatform??hv,a=$V(e,s,i),l=await this.getValidRawGalleryExtensionVersion(t,a,{targetPlatform:s,compatible:!!r.compatible,productVersion:r.productVersion??{version:this.productService.version,date:this.productService.date},version:n.preRelease?1:0},i);if(!n.preRelease)return l;let c=l,u=await this.getValidRawGalleryExtensionVersion(t,a,{targetPlatform:s,compatible:!!r.compatible,productVersion:r.productVersion??{version:this.productService.version,date:this.productService.date},version:0},i);if(c&&u)return Ti(u.version,c.version)?u:c;if(r.compatible){if(u){let p=await this.getValidRawGalleryExtensionVersion(t,a,{targetPlatform:s,compatible:!1,productVersion:r.productVersion??{version:this.productService.version,date:this.productService.date},version:1},i);if(!p||Ti(u.version,p.version))return u}return c}return c??u??null}async getCompatibleExtension(t,e,n,r={version:this.productService.version,date:this.productService.date}){return Zc(t.allTargetPlatforms,n)?null:await this.isExtensionCompatible(t,e,n)?t:this.allowedExtensionsService.isAllowed({id:t.identifier.id,publisherDisplayName:t.publisherDisplayName})!==!0?null:(await this.getExtensions([{...t.identifier,preRelease:e,hasPreRelease:t.hasPreReleaseVersion}],{compatible:!0,productVersion:r,queryAllVersions:!0,targetPlatform:n},Ee.None))[0]??null}async isExtensionCompatible(t,e,n,r={version:this.productService.version,date:this.productService.date}){return this.isValidVersion({id:t.identifier.id,version:t.version,isPreReleaseVersion:t.properties.isPreReleaseVersion,targetPlatform:t.properties.targetPlatform,manifestAsset:t.assets.manifest,engine:t.properties.engine,enabledApiProposals:t.properties.enabledApiProposals},{targetPlatform:n,compatible:!0,productVersion:r,version:e?2:0},t.publisherDisplayName,t.allTargetPlatforms)}async isValidVersion(t,{targetPlatform:e,compatible:n,productVersion:r,version:i},s,a){let l=g_(t.id,this.productService),c=NV(t.id,this.productService);if(t.isPreReleaseVersion&&l===!1||c&&z0(t.version,c))return!1;if(ne(i)){if(t.version!==i)return!1}else if((i===0||i===1)&&t.isPreReleaseVersion!==(i===1))return!1;return!(e&&!sm(t.targetPlatform,a,e)||n&&(this.allowedExtensionsService.isAllowed({id:t.id,publisherDisplayName:s,version:t.version,prerelease:t.isPreReleaseVersion,targetPlatform:t.targetPlatform})!==!0||!this.areApiProposalsCompatible(t.id,t.enabledApiProposals)||!await this.isEngineValid(t.id,t.version,t.engine,t.manifestAsset,r)))}areApiProposalsCompatible(t,e){return!e||!this.extensionsEnabledWithApiProposalVersion.includes(t.toLowerCase())?!0:pm(e)}async isEngineValid(t,e,n,r,i){if(!n)try{n=await this.getEngine(t,e,r)}catch(s){return this.logService.error(`Error while getting the engine for the version ${e}.`,fe(s)),!1}return n?um(n,i.version,i.date):(this.logService.error(`Missing engine for the extension ${t} with version ${e}`),!1)}async getEngine(t,e,n){if(!n){this.logService.error(`Missing engine and manifest asset for the extension ${t} with version ${e}`);return}try{this.telemetryService.publicLog2("galleryService:engineFallback",{extension:t,extensionVersion:e});let r={"Accept-Encoding":"gzip"},i=await this.getAsset(t,n,Mn.Manifest,e,"extensionGalleryService.engineVersion",{headers:r}),s=await Ci(i);if(!s){this.logService.error(`Manifest was not found for the extension ${t} with version ${e}`);return}return s.engines.vscode}catch(r){this.logService.error(`Error while getting the engine for the version ${e}.`,fe(r));return}}async query(t,e){let n=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!n)throw new Error("No extension gallery service configured.");let r=t.text||"",i=t.pageSize??50,s=new ld().withPage(1,i);r?(r=r.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(p,m,g)=>(s=s.withFilter("Category",g||m),"")),r=r.replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(p,m,g)=>(s=s.withFilter("Tag",g||m),"")),r=r.replace(/\bfeatured(\s+|\b|$)/g,()=>(s=s.withFilter("Featured"),"")),r=r.trim(),r&&(r=r.length<200?r:r.substring(0,200),s=s.withFilter("SearchText",r)),n.capabilities.extensionQuery.sorting?.some(p=>p.name==="NoneOrRelevance")&&(s=s.withSortBy("NoneOrRelevance"))):n.capabilities.extensionQuery.sorting?.some(p=>p.name==="InstallCount")&&(s=s.withSortBy("InstallCount")),t.sortBy&&n.capabilities.extensionQuery.sorting?.some(p=>p.name===t.sortBy)&&(s=s.withSortBy(t.sortBy)),typeof t.sortOrder=="number"&&(s=s.withSortOrder(t.sortOrder)),t.source&&(s=s.withSource(t.source));let a=async(p,m)=>{let{extensions:g,total:h}=await this.queryGalleryExtensions(p,{targetPlatform:hv,compatible:!1,includePreRelease:!!t.includePreRelease,productVersion:t.productVersion??{version:this.productService.version,date:this.productService.date}},n,m),v=[],x;for(let T=0;T<g.length;T++){let w=g[T];m_(w,(p.pageNumber-1)*p.pageSize+T,t.source),we(w.identifier,{id:this.productService.defaultChatAgent.extensionId})?x=w:v.push(w)}return x&&v.push(x),{extensions:v,total:h}},{extensions:l,total:c}=await a(s,e),u=async(p,m)=>{if(m.isCancellationRequested)throw new Ye;let{extensions:g}=await a(s.withPage(p+1),m);return g};return{firstPage:l,total:c,pageSize:s.pageSize,getPage:u}}async queryGalleryExtensions(t,e,n,r){let i=t.flags;t.flags.includes("IncludeLatestVersionOnly")&&t.flags.includes("IncludeVersions")&&(t=t.withFlags(...t.flags.filter(m=>m!=="IncludeVersions"))),!t.flags.includes("IncludeLatestVersionOnly")&&!t.flags.includes("IncludeVersions")&&(t=t.withFlags(...t.flags,"IncludeLatestVersionOnly")),(e.versions?.length||e.isQueryForReleaseVersionFromPreReleaseVersion)&&(t=t.withFlags(...t.flags.filter(m=>m!=="IncludeLatestVersionOnly"),"IncludeVersions")),t=t.withFlags(...t.flags,"IncludeAssetUri","IncludeCategoryAndTags","IncludeFiles","IncludeStatistics","IncludeVersionProperties");let{galleryExtensions:s,total:a,context:l}=await this.queryRawGalleryExtensions(t,n,r);if(!t.flags.includes("IncludeLatestVersionOnly")){let m=[];for(let g of s){let h=vv(g),v={id:or(g.publisher.publisherName,g.extensionName),uuid:g.extensionId},x=Pr(e.includePreRelease)?e.includePreRelease:!!e.includePreRelease.find(w=>we(w,v))?.includePreRelease,T=await this.getValidRawGalleryExtensionVersion(g,g.versions,{compatible:e.compatible,targetPlatform:e.targetPlatform,productVersion:e.productVersion,version:e.versions?.find(w=>we(w,v))?.version??(x?2:0)},h);T&&m.push(EE(g,T,h,n,this.productService,l))}return{extensions:m,total:a}}let u=[],p=new Map;for(let m=0;m<s.length;m++){let g=s[m],h={id:or(g.publisher.publisherName,g.extensionName),uuid:g.extensionId},v=Pr(e.includePreRelease)?e.includePreRelease:!!e.includePreRelease.find(k=>we(k,h))?.includePreRelease,x=vv(g);if(e.compatible&&(Zc(x,e.targetPlatform)||this.allowedExtensionsService.isAllowed({id:h.id,publisherDisplayName:g.publisher.displayName})!==!0))continue;let T=await this.getValidRawGalleryExtensionVersion(g,g.versions,{compatible:e.compatible,targetPlatform:e.targetPlatform,productVersion:e.productVersion,version:e.versions?.find(k=>we(k,h))?.version??(v?2:0)},x),w=T?EE(g,T,x,n,this.productService,l):null;!w||w.properties.isPreReleaseVersion&&(!v||!w.hasReleaseVersion)||!w.properties.isPreReleaseVersion&&w.properties.targetPlatform!==e.targetPlatform&&w.hasPreReleaseVersion?p.set(g.extensionId,m):u.push([m,w])}if(p.size){let m=new Yn,g=new ld().withFlags(...i.filter(v=>v!=="IncludeLatestVersionOnly"),"IncludeVersions").withPage(1,p.size).withFilter("ExtensionId",...p.keys()),{extensions:h}=await this.queryGalleryExtensions(g,e,n,r);this.telemetryService.publicLog2("galleryService:additionalQuery",{duration:m.elapsed(),count:p.size});for(let v of h){let x=p.get(v.identifier.uuid);u.push([x,v])}}return{extensions:u.sort((m,g)=>m[0]-g[0]).map(([,m])=>m),total:a}}async getValidRawGalleryExtensionVersion(t,e,n,r){let i={id:or(t.publisher.publisherName,t.extensionName),uuid:t.extensionId},s=p_(e,n.targetPlatform);if(n.compatible&&Zc(r,n.targetPlatform))return null;let a=ne(n.version)?n.version:void 0;for(let l=0;l<s.length;l++){let c=s[l];if(n.compatible&&await this.setEngineIfNotExists(i.id,c),await this.isValidVersion({id:i.id,version:c.version,isPreReleaseVersion:dd(c),targetPlatform:bl(c),engine:Iv(c),manifestAsset:ei(c,Mn.Manifest),enabledApiProposals:wE(c)},n,t.publisher.displayName,r))return c;if(a&&c.version===a)return null}return a||n.compatible?null:t.versions[0]}async setEngineIfNotExists(t,e){if(!Iv(e))try{let n=await this.getEngine(t,e.version,ei(e,Mn.Manifest));n&&AV(e,n)}catch(n){this.logService.error(`Error while getting the engine for the version ${e.version}.`,fe(n))}}async queryRawGalleryExtensions(t,e,n){let r=vl(e,"ExtensionQueryService");if(!r)throw new Error("No extension gallery query service configured.");t=t.withFlags(...t.flags,"ExcludeNonValidated").withFilter("Target","Microsoft.VisualStudio.Code");let i=e.capabilities.extensionQuery.flags?.find(g=>g.name==="Unpublished");i&&(t=t.withFilter("ExcludeWithFlags",String(i.value)));let s=JSON.stringify({filters:[{criteria:t.criteria.reduce((g,h)=>{let v=e.capabilities.extensionQuery.filtering?.find(x=>x.name===h.filterType);return v&&g.push({filterType:v.value,value:h.value}),g},[]),pageNumber:t.pageNumber,pageSize:t.pageSize,sortBy:e.capabilities.extensionQuery.sorting?.find(g=>g.name===t.sortBy)?.value,sortOrder:t.sortOrder}],assetTypes:t.assetTypes,flags:t.flags.reduce((g,h)=>{let v=e.capabilities.extensionQuery.flags?.find(x=>x.name===h);return v&&(g|=v.value),g},0)}),l={...await this.commonHeadersPromise,"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":String(s.length)},c=new Yn,u,p,m=0;try{if(u=await this.requestService.request({type:"POST",url:r,data:s,headers:l,callSite:"extensionGalleryService.queryRawGalleryExtensions"},n),u.res.statusCode&&u.res.statusCode>=400&&u.res.statusCode<500)return{galleryExtensions:[],total:m};let g=await Ci(u);if(g){let h=g.results[0],v=h.extensions,x=h.resultMetadata&&h.resultMetadata.filter(T=>T.metadataType==="ResultCount")[0];return m=x&&x.metadataItems.filter(T=>T.name==="TotalCount")[0].count||0,{galleryExtensions:v,total:m,context:u.res.headers.activityid?{[bv]:u.res.headers.activityid}:{}}}return{galleryExtensions:[],total:m}}catch(g){if(Tn(g))throw p="Cancelled",g;{let h=fe(g);throw p=dE(g)?"Offline":h.startsWith("XHR timeout")?"Timeout":"Failed",new ho(h,p)}}finally{this.telemetryService.publicLog2("galleryService:query",{filterTypes:t.criteria.map(g=>g.filterType),flags:t.flags,sortBy:t.sortBy,sortOrder:String(t.sortOrder),pageNumber:String(t.pageNumber),source:t.source,searchTextLength:t.searchText.length,requestBodySize:String(s.length),duration:c.elapsed(),success:!!u&&Hh(u),responseBodySize:u?.res.headers["Content-Length"],statusCode:u?String(u.res.statusCode):void 0,errorCode:p,count:String(m),server:this.getHeaderValue(u?.res.headers,IE),activityId:this.getHeaderValue(u?.res.headers,bE),endToEndId:this.getHeaderValue(u?.res.headers,xE)})}}getHeaderValue(t,e){let n=t?.[e.toLowerCase()],r=Array.isArray(n)?n[0]:n;return r?new Oo(r):void 0}async getLatestRawGalleryExtensionWithFallback(t,e,n){let[r,i]=t.id.split("."),s;try{let a=I.parse(so(e.uri,{publisher:r,name:i}));return await this.getLatestRawGalleryExtension(t.id,a,n)}catch(a){if(a instanceof ho)switch(s=a.code,a.code){case"Offline":case"Cancelled":case"Timeout":case"ClientError":throw a}else s="Unknown";if(!e.fallback)throw a}finally{this.telemetryService.publicLog2("galleryService:getmarketplacelatest",{extension:t.id,errorCode:s})}this.logService.error(`Error while getting the latest version for the extension ${t.id} from ${e.uri}. Trying the fallback ${e.fallback}`,s);try{let a=I.parse(so(e.fallback,{publisher:r,name:i}));return await this.getLatestRawGalleryExtension(t.id,a,n)}catch(a){throw s=a instanceof ho?a.code:"Unknown",a}finally{this.telemetryService.publicLog2("galleryService:fallbacktounpkg",{extension:t.id,errorCode:s})}}async getLatestRawGalleryExtension(t,e,n){let r,i,s=new Yn;try{let l={...await this.commonHeadersPromise,"Content-Type":"application/json",Accept:"application/json;api-version=7.2-preview","Accept-Encoding":"gzip"};if(r=await this.requestService.request({type:"GET",url:e.toString(!0),headers:l,timeout:this.getRequestTimeout(),callSite:"extensionGalleryService.getLatestRawGalleryExtension"},n),r.res.statusCode===404)return i="NotFound",null;if(r.res.statusCode&&r.res.statusCode!==200)throw new Error("Unexpected HTTP response: "+r.res.statusCode);let c=await Ci(r);return c||(i="NoData"),c}catch(a){let l;throw Tn(a)?l="Cancelled":dE(a)?l="Offline":fe(a).startsWith("XHR timeout")?l="Timeout":r&&XD(r)?l="ClientError":r&&YD(r)?l="ServerError":l="Failed",i=l,new ho(a,l)}finally{this.telemetryService.publicLog2("galleryService:getLatest",{extension:t,host:e.authority,duration:s.elapsed(),errorCode:i,statusCode:r?.res.statusCode&&r?.res.statusCode!==200?`${r.res.statusCode}`:void 0,server:this.getHeaderValue(r?.res.headers,IE),activityId:this.getHeaderValue(r?.res.headers,bE),endToEndId:this.getHeaderValue(r?.res.headers,xE)})}}async reportStatistic(t,e,n,r){if(Yt){this.logService.info("ExtensionGalleryService#reportStatistic: Skipped in web");return}let i=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!i)return;let s=vl(i,"ExtensionStatisticsUriTemplate");if(!s)return;let a=so(s,{publisher:t,name:e,version:n,statTypeName:r}),u={...await this.commonHeadersPromise,Accept:"*/*;api-version=4.0-preview.1"};try{await this.requestService.request({type:"POST",url:a,headers:u,callSite:"extensionGalleryService.reportStatistic"},Ee.None)}catch{}}async download(t,e,n){this.logService.trace("ExtensionGalleryService#download",t.identifier.id);let r=dm(t),i=new Date().getTime(),s=n===2?"install":n===3?"update":"",a=s?{uri:`${t.assets.download.uri}${I.parse(t.assets.download.uri).query?"&":"?"}${s}=true`,fallbackUri:`${t.assets.download.fallbackUri}${I.parse(t.assets.download.fallbackUri).query?"&":"?"}${s}=true`}:t.assets.download,l=t.queryContext?.[bv],c=l&&typeof l=="string"?{[bv]:l}:void 0,u=await this.getAsset(t.identifier.id,a,Mn.VSIX,t.version,"extensionGalleryService.download",c?{headers:c}:void 0);try{await this.fileService.writeFile(e,u.stream)}catch(p){try{await this.fileService.del(e)}catch(m){this.logService.warn(`Error while deleting the file ${e.toString()}`,fe(m))}throw new ho(fe(p),"DownloadFailedWriting")}this.telemetryService.publicLog("galleryService:downloadVSIX",{...r,duration:new Date().getTime()-i})}async downloadSignatureArchive(t,e){if(!t.assets.signature)throw new Error("No signature asset found");this.logService.trace("ExtensionGalleryService#downloadSignatureArchive",t.identifier.id);let n=await this.getAsset(t.identifier.id,t.assets.signature,Mn.Signature,t.version,"extensionGalleryService.signature");try{await this.fileService.writeFile(e,n.stream)}catch(r){try{await this.fileService.del(e)}catch(i){this.logService.warn(`Error while deleting the file ${e.toString()}`,fe(i))}throw new ho(fe(r),"DownloadFailedWriting")}}async getReadme(t,e){if(t.assets.readme){let n=await this.getAsset(t.identifier.id,t.assets.readme,Mn.Details,t.version,"extensionGalleryService.readme",{},e);return await wi(n)||""}return""}async getManifest(t,e){if(t.assets.manifest){let n=await this.getAsset(t.identifier.id,t.assets.manifest,Mn.Manifest,t.version,"extensionGalleryService.manifest",{},e),r=await wi(n);return r?JSON.parse(r):null}return null}async getCoreTranslation(t,e){let n=t.assets.coreTranslations.filter(r=>r[0]===e.toUpperCase())[0];if(n){let r=await this.getAsset(t.identifier.id,n[1],n[0],t.version,"extensionGalleryService.coreTranslation"),i=await wi(r);return i?JSON.parse(i):null}return null}async getChangelog(t,e){if(t.assets.changelog){let n=await this.getAsset(t.identifier.id,t.assets.changelog,Mn.Changelog,t.version,"extensionGalleryService.changelog",{},e);return await wi(n)||""}return""}async getAllVersions(t){return this.getVersions(t)}async getAllCompatibleVersions(t,e,n){return this.getVersions(t,{version:e?2:0,targetPlatform:n})}async getVersions(t,e){let n=await this.extensionGalleryManifestService.getExtensionGalleryManifest();if(!n)throw new Error("No extension gallery service configured.");let r=new ld().withFlags("IncludeVersions","IncludeCategoryAndTags","IncludeFiles","IncludeVersionProperties").withPage(1,1);t.uuid?r=r.withFilter("ExtensionId",t.uuid):r=r.withFilter("ExtensionName",t.id);let{galleryExtensions:i}=await this.queryRawGalleryExtensions(r,n,Ee.None);if(!i.length)return[];let s=vv(i[0]);if(e&&Zc(s,e.targetPlatform))return[];let a=[],l={version:this.productService.version,date:this.productService.date};await Promise.all(i[0].versions.map(async p=>{try{await this.isValidVersion({id:t.id,version:p.version,isPreReleaseVersion:dd(p),targetPlatform:bl(p),engine:Iv(p),manifestAsset:ei(p,Mn.Manifest),enabledApiProposals:wE(p)},{compatible:!!e,productVersion:l,targetPlatform:e?.targetPlatform,version:e?.version??p.version},i[0].publisher.displayName,s)&&a.push(p)}catch{}}));let c=[],u=new Map;for(let p of p_(a,e?.targetPlatform??hv)){let m=u.get(p.version),g=m!==void 0?c[m]:void 0,h=bl(p);g?g.targetPlatforms.push(h):(u.set(p.version,c.length),c.push({version:p.version,date:p.lastUpdated,isPreReleaseVersion:dd(p),targetPlatforms:[h]}))}return c}async getAsset(t,e,n,r,i,s={},a=Ee.None){let l=await this.commonHeadersPromise,c={type:"GET"},u={...l,...s.headers||{}};s={...s,...c,headers:u};let p=e.uri,m=e.fallbackUri,g={...s,url:p,timeout:this.getRequestTimeout(),callSite:i},h;try{if(h=await this.requestService.request(g,a),h.res.statusCode===200)return h;let v=await wi(h);throw new Error(`Expected 200, got back ${h.res.statusCode} instead.
- ${v}`)}catch(v){if(Tn(v))throw v;let x=fe(v);this.telemetryService.publicLog2("galleryService:cdnFallback",{extension:t,assetType:n,message:x,extensionVersion:r,server:this.getHeaderValue(h?.res.headers,IE),activityId:this.getHeaderValue(h?.res.headers,bE),endToEndId:this.getHeaderValue(h?.res.headers,xE)});let T={...s,url:m,timeout:this.getRequestTimeout(),callSite:`${i}.fallback`};return this.requestService.request(T,a)}}async getExtensionsControlManifest(){if(!await this.extensionGalleryManifestService.getExtensionGalleryManifest())throw new Error("No extension gallery service configured.");if(!this.extensionsControlUrl)return{malicious:[],deprecated:{},search:[],autoUpdate:{}};let e=await this.requestService.request({type:"GET",url:this.extensionsControlUrl,timeout:this.getRequestTimeout(),callSite:"extensionGalleryService.getExtensionsControlManifest"},Ee.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");let n=await Ci(e),r=[],i={},s=[],a=n?.autoUpdate??{};if(n){for(let l of n.malicious){if(!ne(l))continue;let c=im.test(l)?{id:l}:l;r.push({extensionOrPublisher:c,learnMoreLink:n.learnMoreLinks?.[l]})}if(n.migrateToPreRelease)for(let[l,c]of Object.entries(n.migrateToPreRelease))(!c.engine||um(c.engine,this.productService.version,this.productService.date))&&(i[l.toLowerCase()]={disallowInstall:!0,extension:{id:c.id,displayName:c.displayName,autoMigrate:{storage:!!c.migrateStorage},preRelease:!0}});if(n.deprecated)for(let[l,c]of Object.entries(n.deprecated))c&&(i[l.toLowerCase()]=Pr(c)?{}:c);if(n.search)for(let l of n.search)s.push(l)}return i[this.productService.defaultChatAgent.extensionId.toLowerCase()]={disallowInstall:!0,extension:{id:this.productService.defaultChatAgent.chatExtensionId,displayName:"GitHub Copilot Chat",autoMigrate:{storage:!1,donotDisable:!0},preRelease:this.productService.quality!=="stable"}},{malicious:r,deprecated:i,search:s,autoUpdate:a}}getRequestTimeout(){let t=this.configurationService.getValue(V0);return Jn(t)&&t>=0?t:6e4}};cd=E([b(1,Rn),b(2,Q),b(3,It),b(4,Ft),b(5,Oe),b(6,Ve),b(7,xt),b(8,vo),b(9,Pi)],cd);yv=class extends cd{constructor(t,e,n,r,i,s,a,l,c,u){super(t,e,n,r,i,s,a,l,c,u)}};yv=E([b(0,na),b(1,Rn),b(2,Q),b(3,It),b(4,Ft),b(5,Oe),b(6,Ve),b(7,xt),b(8,vo),b(9,Pi)],yv);ra=class extends cd{constructor(t,e,n,r,i,s,a,l,c){super(void 0,t,e,n,r,i,s,a,l,c)}};ra=E([b(0,Rn),b(1,Q),b(2,It),b(3,Ft),b(4,Oe),b(5,Ve),b(6,xt),b(7,vo),b(8,Pi)],ra)});import{createWriteStream as h_,promises as v_}from"fs";function GV(o){let t=o.externalFileAttributes>>16||33188;return[448,56,7].map(e=>t&e).reduce((e,n)=>e+n,t&61440)}function y_(o){if(o instanceof Il)return o;let t;return zV.test(o.message)&&(t="CorruptZip"),new Il(t,o)}function qV(o,t,e,n,r,i){let s=Ct(t),a=H(n,s);if(!a.startsWith(n))return Promise.reject(new Error(d(86,null,t)));let l=H(n,t),c;return i.onCancellationRequested(()=>{c?.destroy()}),Promise.resolve(v_.mkdir(a,{recursive:!0})).then(()=>new Promise((u,p)=>{if(!i.isCancellationRequested)try{c=h_(l,{mode:e}),c.once("close",()=>u()),c.once("error",p),o.once("error",p),o.pipe(c)}catch(m){p(m)}}))}function KV(o,t,e,n){let r=Rr(()=>Promise.resolve()),i=0,s=n.onCancellationRequested(()=>{r.cancel(),o.close()});return new Promise((a,l)=>{let c=new rh,u=p=>{p.isCancellationRequested||(i++,o.readEntry())};o.once("error",l),o.once("close",()=>r.then(()=>{n.isCancellationRequested||o.entryCount===i?a():l(new Il("Incomplete",new Error(d(85,null,i,o.entryCount))))},l)),o.readEntry(),o.on("entry",p=>{if(n.isCancellationRequested)return;if(!e.sourcePathRegex.test(p.fileName)){u(n);return}let m=p.fileName.replace(e.sourcePathRegex,"");if(/\/$/.test(m)){let v=H(t,m);r=Rr(x=>v_.mkdir(v,{recursive:!0}).then(()=>u(x)).then(void 0,l));return}let g=I_(o,p),h=GV(p);r=Rr(v=>c.queue(()=>g.then(x=>qV(x,m,h,t,e,v).then(()=>u(v)))).then(null,l))})}).finally(()=>s.dispose())}async function b_(o,t=!1){let{open:e}=await import("yauzl");return new Promise((n,r)=>{e(o,t?{lazyEntries:!0}:void 0,(i,s)=>{i?r(y_(i)):n(gp(s))})})}function I_(o,t){return new Promise((e,n)=>{o.openReadStream(t,(r,i)=>{r?n(y_(r)):e(gp(i))})})}async function x_(o,t){let{ZipFile:e}=await import("yazl");return new Promise((n,r)=>{let i=new e;t.forEach(a=>{a.contents?i.addBuffer(typeof a.contents=="string"?Buffer.from(a.contents,"utf8"):a.contents,a.path):a.localPath&&i.addFile(a.localPath,a.path)}),i.end();let s=h_(o);i.outputStream.pipe(s),i.outputStream.once("error",r),s.once("error",r),s.once("finish",()=>n(o))})}function S_(o,t,e={},n){let r=new RegExp(e.sourcePath?`^${e.sourcePath}`:""),i=b_(o,!0);return e.overwrite&&(i=i.then(s=>Te.rm(t).then(()=>s))),i.then(s=>KV(s,t,{sourcePathRegex:r},n))}function jV(o,t){return b_(o).then(e=>new Promise((n,r)=>{e.on("entry",i=>{i.fileName===t&&I_(e,i).then(s=>n(s),s=>r(s))}),e.once("close",()=>r(new Error(d(87,null,t))))}))}function xv(o,t){return jV(o,t).then(e=>new Promise((n,r)=>{let i=[];e.once("error",r),e.on("data",s=>i.push(s)),e.on("end",()=>n(Buffer.concat(i)))}))}var PE,zV,Il,Sv=y(()=>{ze();Le();Me();fr();pe();PE="end of central directory record signature not found",zV=new RegExp(PE),Il=class extends Error{constructor(t,e){let n=e.message;t==="CorruptZip"&&(n=`Corrupt ZIP: ${n}`),super(n),this.type=t,this.cause=e}}});var ud,Ev=y(()=>{re();ud=_("downloadService")});var _ee,Lee,Mee,Oee,Aee,E_=y(()=>{_ee=new Uint32Array(10),Lee=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),Mee=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),Oee=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Aee=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});function C_(...o){return function(t,e){for(let n=0,r=o.length;n<r;n++){let i=o[n](t,e);if(i)return i}return null}}function P_(o,t,e){if(!e||e.length<t.length)return null;let n;return o?n=Us(e,t):n=e.indexOf(t)===0,n?t.length>0?[{start:0,end:t.length}]:[]:null}function QV(o,t){if(o.length>t.length)return null;let e=t.toLowerCase().indexOf(o.toLowerCase());return e===-1?null:[{start:e,end:e+o.length}]}function JV(o,t){return o.length>t.length?null:kE(o.toLowerCase(),t.toLowerCase(),0,0)}function kE(o,t,e,n){if(e===o.length)return[];if(n===t.length)return null;if(o[e]===t[n]){let r=null;return(r=kE(o,t,e+1,n+1))?R_({start:n,end:n+1},r):null}return kE(o,t,e,n+1)}function DE(o){return 97<=o&&o<=122}function Cv(o){return 65<=o&&o<=90}function _E(o){return 48<=o&&o<=57}function XV(o){return o===32||o===9||o===10||o===13}function k_(o){return DE(o)||Cv(o)||_E(o)}function R_(o,t){return t.length===0?t=[o]:o.end===t[0].start?t[0].start=o.start:t.unshift(o),t}function D_(o,t){for(let e=t;e<o.length;e++){let n=o.charCodeAt(e);if(Cv(n)||_E(n)||e>0&&!k_(o.charCodeAt(e-1)))return e}return o.length}function RE(o,t,e,n){if(e===o.length)return[];if(n===t.length)return null;if(o[e]!==t[n].toLowerCase())return null;{let r=null,i=n+1;for(r=RE(o,t,e+1,n+1);!r&&(i=D_(t,i))<t.length;)r=RE(o,t,e+1,i),i++;return r===null?null:R_({start:n,end:n+1},r)}}function ZV(o){let t=0,e=0,n=0,r=0,i=0;for(let u=0;u<o.length;u++)i=o.charCodeAt(u),Cv(i)&&t++,DE(i)&&e++,k_(i)&&n++,_E(i)&&r++;let s=t/o.length,a=e/o.length,l=n/o.length,c=r/o.length;return{upperPercent:s,lowerPercent:a,alphaPercent:l,numericPercent:c}}function e9(o){let{upperPercent:t,lowerPercent:e}=o;return e===0&&t>.6}function t9(o){let{upperPercent:t,lowerPercent:e,alphaPercent:n,numericPercent:r}=o;return e>.2&&t<.8&&n>.6&&r<.2}function n9(o){let t=0,e=0,n=0,r=0;for(let i=0;i<o.length;i++)n=o.charCodeAt(i),Cv(n)&&t++,DE(n)&&e++,XV(n)&&r++;return(t===0||e===0)&&r===0?o.length<=30:t<=5}function __(o,t){if(!t||(t=t.trim(),t.length===0)||!n9(o))return null;t.length>60&&(t=t.substring(0,60));let e=ZV(t);if(!t9(e)){if(!e9(e))return null;t=t.toLowerCase()}let n=null,r=0;for(o=o.toLowerCase();r<t.length&&(n=RE(o,t,0,r))===null;)r=D_(t,r+1);return n}function LE(){let o=[],t=[];for(let e=0;e<=wv;e++)t[e]=0;for(let e=0;e<=wv;e++)o.push(t.slice(0));return o}function L_(o){let t=[];for(let e=0;e<=o;e++)t[e]=0;return t}var zee,T_,YV,Gee,qee,Kee,wv,jee,Qee,Jee,Xee,Yee,r9,w_,M_=y(()=>{Ro();Hn();E_();sh();Qt();zee=P_.bind(void 0,!1),T_=P_.bind(void 0,!0);YV=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(o=>YV.add(o.charCodeAt(0)));Gee=C_(T_,__,QV),qee=C_(T_,__,JV),Kee=new gi(1e4),wv=128;jee=L_(2*wv),Qee=L_(2*wv),Jee=LE(),Xee=LE(),Yee=LE();(e=>{e.Default=[-100,0];function t(n){return!n||n.length===2&&n[0]===-100&&n[1]===0}e.isDefault=t})(r9||={});w_=class{constructor(t,e){this.firstMatchCanBeWeak=t;this.boostFullMatch=e}static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}}});function f(o,t){if(ne(t)){let e=O_[t];if(e===void 0)throw new Error(`${o} references an unknown codicon: ${t}`);t=e}return O_[o]=t,{id:o}}var O_,ME=y(()=>{Me();O_=Object.create(null)});var A_,N_=y(()=>{ME();A_={add:f("add",6e4),plus:f("plus",6e4),gistNew:f("gist-new",6e4),repoCreate:f("repo-create",6e4),lightbulb:f("lightbulb",60001),lightBulb:f("light-bulb",60001),repo:f("repo",60002),repoDelete:f("repo-delete",60002),gistFork:f("gist-fork",60003),repoForked:f("repo-forked",60003),gitPullRequest:f("git-pull-request",60004),gitPullRequestAbandoned:f("git-pull-request-abandoned",60004),recordKeys:f("record-keys",60005),keyboard:f("keyboard",60005),tag:f("tag",60006),gitPullRequestLabel:f("git-pull-request-label",60006),tagAdd:f("tag-add",60006),tagRemove:f("tag-remove",60006),person:f("person",60007),personFollow:f("person-follow",60007),personOutline:f("person-outline",60007),personFilled:f("person-filled",60007),sourceControl:f("source-control",60008),mirror:f("mirror",60009),mirrorPublic:f("mirror-public",60009),star:f("star",60010),starAdd:f("star-add",60010),starDelete:f("star-delete",60010),starEmpty:f("star-empty",60010),comment:f("comment",60011),commentAdd:f("comment-add",60011),alert:f("alert",60012),warning:f("warning",60012),search:f("search",60013),searchSave:f("search-save",60013),logOut:f("log-out",60014),signOut:f("sign-out",60014),logIn:f("log-in",60015),signIn:f("sign-in",60015),eye:f("eye",60016),eyeUnwatch:f("eye-unwatch",60016),eyeWatch:f("eye-watch",60016),circleFilled:f("circle-filled",60017),primitiveDot:f("primitive-dot",60017),closeDirty:f("close-dirty",60017),debugBreakpoint:f("debug-breakpoint",60017),debugBreakpointDisabled:f("debug-breakpoint-disabled",60017),debugHint:f("debug-hint",60017),terminalDecorationSuccess:f("terminal-decoration-success",60017),primitiveSquare:f("primitive-square",60018),edit:f("edit",60019),pencil:f("pencil",60019),info:f("info",60020),issueOpened:f("issue-opened",60020),gistPrivate:f("gist-private",60021),gitForkPrivate:f("git-fork-private",60021),lock:f("lock",60021),mirrorPrivate:f("mirror-private",60021),close:f("close",60022),removeClose:f("remove-close",60022),x:f("x",60022),repoSync:f("repo-sync",60023),sync:f("sync",60023),clone:f("clone",60024),desktopDownload:f("desktop-download",60024),beaker:f("beaker",60025),microscope:f("microscope",60025),vm:f("vm",60026),deviceDesktop:f("device-desktop",60026),file:f("file",60027),more:f("more",60028),ellipsis:f("ellipsis",60028),kebabHorizontal:f("kebab-horizontal",60028),mailReply:f("mail-reply",60029),reply:f("reply",60029),organization:f("organization",60030),organizationFilled:f("organization-filled",60030),organizationOutline:f("organization-outline",60030),newFile:f("new-file",60031),fileAdd:f("file-add",60031),newFolder:f("new-folder",60032),fileDirectoryCreate:f("file-directory-create",60032),trash:f("trash",60033),trashcan:f("trashcan",60033),history:f("history",60034),clock:f("clock",60034),folder:f("folder",60035),fileDirectory:f("file-directory",60035),symbolFolder:f("symbol-folder",60035),logoGithub:f("logo-github",60036),markGithub:f("mark-github",60036),github:f("github",60036),terminal:f("terminal",60037),console:f("console",60037),repl:f("repl",60037),zap:f("zap",60038),symbolEvent:f("symbol-event",60038),error:f("error",60039),stop:f("stop",60039),variable:f("variable",60040),symbolVariable:f("symbol-variable",60040),array:f("array",60042),symbolArray:f("symbol-array",60042),symbolModule:f("symbol-module",60043),symbolPackage:f("symbol-package",60043),symbolNamespace:f("symbol-namespace",60043),symbolObject:f("symbol-object",60043),symbolMethod:f("symbol-method",60044),symbolFunction:f("symbol-function",60044),symbolConstructor:f("symbol-constructor",60044),symbolBoolean:f("symbol-boolean",60047),symbolNull:f("symbol-null",60047),symbolNumeric:f("symbol-numeric",60048),symbolNumber:f("symbol-number",60048),symbolStructure:f("symbol-structure",60049),symbolStruct:f("symbol-struct",60049),symbolParameter:f("symbol-parameter",60050),symbolTypeParameter:f("symbol-type-parameter",60050),symbolKey:f("symbol-key",60051),symbolText:f("symbol-text",60051),symbolReference:f("symbol-reference",60052),goToFile:f("go-to-file",60052),symbolEnum:f("symbol-enum",60053),symbolValue:f("symbol-value",60053),symbolRuler:f("symbol-ruler",60054),symbolUnit:f("symbol-unit",60054),activateBreakpoints:f("activate-breakpoints",60055),archive:f("archive",60056),arrowBoth:f("arrow-both",60057),arrowDown:f("arrow-down",60058),arrowLeft:f("arrow-left",60059),arrowRight:f("arrow-right",60060),arrowSmallDown:f("arrow-small-down",60061),arrowSmallLeft:f("arrow-small-left",60062),arrowSmallRight:f("arrow-small-right",60063),arrowSmallUp:f("arrow-small-up",60064),arrowUp:f("arrow-up",60065),bell:f("bell",60066),bold:f("bold",60067),book:f("book",60068),bookmark:f("bookmark",60069),debugBreakpointConditionalUnverified:f("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:f("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:f("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:f("debug-breakpoint-data-unverified",60072),debugBreakpointData:f("debug-breakpoint-data",60073),debugBreakpointDataDisabled:f("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:f("debug-breakpoint-log-unverified",60074),debugBreakpointLog:f("debug-breakpoint-log",60075),debugBreakpointLogDisabled:f("debug-breakpoint-log-disabled",60075),briefcase:f("briefcase",60076),broadcast:f("broadcast",60077),browser:f("browser",60078),bug:f("bug",60079),calendar:f("calendar",60080),caseSensitive:f("case-sensitive",60081),check:f("check",60082),checklist:f("checklist",60083),chevronDown:f("chevron-down",60084),chevronLeft:f("chevron-left",60085),chevronRight:f("chevron-right",60086),chevronUp:f("chevron-up",60087),chromeClose:f("chrome-close",60088),chromeMaximize:f("chrome-maximize",60089),chromeMinimize:f("chrome-minimize",60090),chromeRestore:f("chrome-restore",60091),circleOutline:f("circle-outline",60092),circle:f("circle",60092),debugBreakpointUnverified:f("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:f("terminal-decoration-incomplete",60092),circleSlash:f("circle-slash",60093),circuitBoard:f("circuit-board",60094),clearAll:f("clear-all",60095),clippy:f("clippy",60096),closeAll:f("close-all",60097),cloudDownload:f("cloud-download",60098),cloudUpload:f("cloud-upload",60099),code:f("code",60100),collapseAll:f("collapse-all",60101),colorMode:f("color-mode",60102),commentDiscussion:f("comment-discussion",60103),creditCard:f("credit-card",60105),dash:f("dash",60108),dashboard:f("dashboard",60109),database:f("database",60110),debugContinue:f("debug-continue",60111),debugDisconnect:f("debug-disconnect",60112),debugPause:f("debug-pause",60113),debugRestart:f("debug-restart",60114),debugStart:f("debug-start",60115),debugStepInto:f("debug-step-into",60116),debugStepOut:f("debug-step-out",60117),debugStepOver:f("debug-step-over",60118),debugStop:f("debug-stop",60119),debug:f("debug",60120),deviceCameraVideo:f("device-camera-video",60121),deviceCamera:f("device-camera",60122),deviceMobile:f("device-mobile",60123),diffAdded:f("diff-added",60124),diffIgnored:f("diff-ignored",60125),diffModified:f("diff-modified",60126),diffRemoved:f("diff-removed",60127),diffRenamed:f("diff-renamed",60128),diff:f("diff",60129),diffSidebyside:f("diff-sidebyside",60129),discard:f("discard",60130),editorLayout:f("editor-layout",60131),emptyWindow:f("empty-window",60132),exclude:f("exclude",60133),extensions:f("extensions",60134),eyeClosed:f("eye-closed",60135),fileBinary:f("file-binary",60136),fileCode:f("file-code",60137),fileMedia:f("file-media",60138),filePdf:f("file-pdf",60139),fileSubmodule:f("file-submodule",60140),fileSymlinkDirectory:f("file-symlink-directory",60141),fileSymlinkFile:f("file-symlink-file",60142),fileZip:f("file-zip",60143),files:f("files",60144),filter:f("filter",60145),flame:f("flame",60146),foldDown:f("fold-down",60147),foldUp:f("fold-up",60148),fold:f("fold",60149),folderActive:f("folder-active",60150),folderOpened:f("folder-opened",60151),gear:f("gear",60152),gift:f("gift",60153),gistSecret:f("gist-secret",60154),gist:f("gist",60155),gitCommit:f("git-commit",60156),gitCompare:f("git-compare",60157),compareChanges:f("compare-changes",60157),gitMerge:f("git-merge",60158),githubAction:f("github-action",60159),githubAlt:f("github-alt",60160),globe:f("globe",60161),grabber:f("grabber",60162),graph:f("graph",60163),gripper:f("gripper",60164),heart:f("heart",60165),home:f("home",60166),horizontalRule:f("horizontal-rule",60167),hubot:f("hubot",60168),inbox:f("inbox",60169),issueReopened:f("issue-reopened",60171),issues:f("issues",60172),italic:f("italic",60173),jersey:f("jersey",60174),json:f("json",60175),bracket:f("bracket",60175),kebabVertical:f("kebab-vertical",60176),key:f("key",60177),law:f("law",60178),lightbulbAutofix:f("lightbulb-autofix",60179),linkExternal:f("link-external",60180),link:f("link",60181),listOrdered:f("list-ordered",60182),listUnordered:f("list-unordered",60183),liveShare:f("live-share",60184),loading:f("loading",60185),location:f("location",60186),mailRead:f("mail-read",60187),mail:f("mail",60188),markdown:f("markdown",60189),megaphone:f("megaphone",60190),mention:f("mention",60191),milestone:f("milestone",60192),gitPullRequestMilestone:f("git-pull-request-milestone",60192),mortarBoard:f("mortar-board",60193),move:f("move",60194),multipleWindows:f("multiple-windows",60195),mute:f("mute",60196),noNewline:f("no-newline",60197),note:f("note",60198),octoface:f("octoface",60199),openPreview:f("open-preview",60200),package:f("package",60201),paintcan:f("paintcan",60202),pin:f("pin",60203),play:f("play",60204),run:f("run",60204),plug:f("plug",60205),preserveCase:f("preserve-case",60206),preview:f("preview",60207),project:f("project",60208),pulse:f("pulse",60209),question:f("question",60210),quote:f("quote",60211),radioTower:f("radio-tower",60212),reactions:f("reactions",60213),references:f("references",60214),refresh:f("refresh",60215),regex:f("regex",60216),remoteExplorer:f("remote-explorer",60217),remote:f("remote",60218),remove:f("remove",60219),replaceAll:f("replace-all",60220),replace:f("replace",60221),repoClone:f("repo-clone",60222),repoForcePush:f("repo-force-push",60223),repoPull:f("repo-pull",60224),repoPush:f("repo-push",60225),report:f("report",60226),requestChanges:f("request-changes",60227),rocket:f("rocket",60228),rootFolderOpened:f("root-folder-opened",60229),rootFolder:f("root-folder",60230),rss:f("rss",60231),ruby:f("ruby",60232),saveAll:f("save-all",60233),saveAs:f("save-as",60234),save:f("save",60235),screenFull:f("screen-full",60236),screenNormal:f("screen-normal",60237),searchStop:f("search-stop",60238),server:f("server",60240),settingsGear:f("settings-gear",60241),settings:f("settings",60242),shield:f("shield",60243),smiley:f("smiley",60244),sortPrecedence:f("sort-precedence",60245),splitHorizontal:f("split-horizontal",60246),splitVertical:f("split-vertical",60247),squirrel:f("squirrel",60248),starFull:f("star-full",60249),starHalf:f("star-half",60250),symbolClass:f("symbol-class",60251),symbolColor:f("symbol-color",60252),symbolConstant:f("symbol-constant",60253),symbolEnumMember:f("symbol-enum-member",60254),symbolField:f("symbol-field",60255),symbolFile:f("symbol-file",60256),symbolInterface:f("symbol-interface",60257),symbolKeyword:f("symbol-keyword",60258),symbolMisc:f("symbol-misc",60259),symbolOperator:f("symbol-operator",60260),symbolProperty:f("symbol-property",60261),wrench:f("wrench",60261),wrenchSubaction:f("wrench-subaction",60261),symbolSnippet:f("symbol-snippet",60262),tasklist:f("tasklist",60263),telescope:f("telescope",60264),textSize:f("text-size",60265),threeBars:f("three-bars",60266),thumbsdown:f("thumbsdown",60267),thumbsup:f("thumbsup",60268),tools:f("tools",60269),triangleDown:f("triangle-down",60270),triangleLeft:f("triangle-left",60271),triangleRight:f("triangle-right",60272),triangleUp:f("triangle-up",60273),twitter:f("twitter",60274),unfold:f("unfold",60275),unlock:f("unlock",60276),unmute:f("unmute",60277),unverified:f("unverified",60278),verified:f("verified",60279),versions:f("versions",60280),vmActive:f("vm-active",60281),vmOutline:f("vm-outline",60282),vmRunning:f("vm-running",60283),watch:f("watch",60284),whitespace:f("whitespace",60285),wholeWord:f("whole-word",60286),window:f("window",60287),wordWrap:f("word-wrap",60288),zoomIn:f("zoom-in",60289),zoomOut:f("zoom-out",60290),listFilter:f("list-filter",60291),listFlat:f("list-flat",60292),listSelection:f("list-selection",60293),selection:f("selection",60293),listTree:f("list-tree",60294),debugBreakpointFunctionUnverified:f("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:f("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:f("debug-breakpoint-function-disabled",60296),debugStackframeActive:f("debug-stackframe-active",60297),circleSmallFilled:f("circle-small-filled",60298),debugStackframeDot:f("debug-stackframe-dot",60298),terminalDecorationMark:f("terminal-decoration-mark",60298),debugStackframe:f("debug-stackframe",60299),debugStackframeFocused:f("debug-stackframe-focused",60299),debugBreakpointUnsupported:f("debug-breakpoint-unsupported",60300),symbolString:f("symbol-string",60301),debugReverseContinue:f("debug-reverse-continue",60302),debugStepBack:f("debug-step-back",60303),debugRestartFrame:f("debug-restart-frame",60304),debugAlt:f("debug-alt",60305),callIncoming:f("call-incoming",60306),callOutgoing:f("call-outgoing",60307),menu:f("menu",60308),expandAll:f("expand-all",60309),feedback:f("feedback",60310),gitPullRequestReviewer:f("git-pull-request-reviewer",60310),groupByRefType:f("group-by-ref-type",60311),ungroupByRefType:f("ungroup-by-ref-type",60312),account:f("account",60313),gitPullRequestAssignee:f("git-pull-request-assignee",60313),bellDot:f("bell-dot",60314),debugConsole:f("debug-console",60315),library:f("library",60316),output:f("output",60317),runAll:f("run-all",60318),syncIgnored:f("sync-ignored",60319),pinned:f("pinned",60320),githubInverted:f("github-inverted",60321),serverProcess:f("server-process",60322),serverEnvironment:f("server-environment",60323),pass:f("pass",60324),issueClosed:f("issue-closed",60324),stopCircle:f("stop-circle",60325),playCircle:f("play-circle",60326),record:f("record",60327),debugAltSmall:f("debug-alt-small",60328),vmConnect:f("vm-connect",60329),cloud:f("cloud",60330),merge:f("merge",60331),export:f("export",60332),graphLeft:f("graph-left",60333),magnet:f("magnet",60334),notebook:f("notebook",60335),redo:f("redo",60336),checkAll:f("check-all",60337),pinnedDirty:f("pinned-dirty",60338),passFilled:f("pass-filled",60339),circleLargeFilled:f("circle-large-filled",60340),circleLarge:f("circle-large",60341),circleLargeOutline:f("circle-large-outline",60341),combine:f("combine",60342),gather:f("gather",60342),table:f("table",60343),variableGroup:f("variable-group",60344),typeHierarchy:f("type-hierarchy",60345),typeHierarchySub:f("type-hierarchy-sub",60346),typeHierarchySuper:f("type-hierarchy-super",60347),gitPullRequestCreate:f("git-pull-request-create",60348),runAbove:f("run-above",60349),runBelow:f("run-below",60350),notebookTemplate:f("notebook-template",60351),debugRerun:f("debug-rerun",60352),workspaceTrusted:f("workspace-trusted",60353),workspaceUntrusted:f("workspace-untrusted",60354),workspaceUnknown:f("workspace-unknown",60355),terminalCmd:f("terminal-cmd",60356),terminalDebian:f("terminal-debian",60357),terminalLinux:f("terminal-linux",60358),terminalPowershell:f("terminal-powershell",60359),terminalTmux:f("terminal-tmux",60360),terminalUbuntu:f("terminal-ubuntu",60361),terminalBash:f("terminal-bash",60362),arrowSwap:f("arrow-swap",60363),copy:f("copy",60364),personAdd:f("person-add",60365),filterFilled:f("filter-filled",60366),wand:f("wand",60367),debugLineByLine:f("debug-line-by-line",60368),inspect:f("inspect",60369),layers:f("layers",60370),layersDot:f("layers-dot",60371),layersActive:f("layers-active",60372),compass:f("compass",60373),compassDot:f("compass-dot",60374),compassActive:f("compass-active",60375),azure:f("azure",60376),issueDraft:f("issue-draft",60377),gitPullRequestClosed:f("git-pull-request-closed",60378),gitPullRequestDraft:f("git-pull-request-draft",60379),debugAll:f("debug-all",60380),debugCoverage:f("debug-coverage",60381),runErrors:f("run-errors",60382),folderLibrary:f("folder-library",60383),debugContinueSmall:f("debug-continue-small",60384),beakerStop:f("beaker-stop",60385),graphLine:f("graph-line",60386),graphScatter:f("graph-scatter",60387),pieChart:f("pie-chart",60388),bracketDot:f("bracket-dot",60389),bracketError:f("bracket-error",60390),lockSmall:f("lock-small",60391),azureDevops:f("azure-devops",60392),verifiedFilled:f("verified-filled",60393),newline:f("newline",60394),layout:f("layout",60395),layoutActivitybarLeft:f("layout-activitybar-left",60396),layoutActivitybarRight:f("layout-activitybar-right",60397),layoutPanelLeft:f("layout-panel-left",60398),layoutPanelCenter:f("layout-panel-center",60399),layoutPanelJustify:f("layout-panel-justify",60400),layoutPanelRight:f("layout-panel-right",60401),layoutPanel:f("layout-panel",60402),layoutSidebarLeft:f("layout-sidebar-left",60403),layoutSidebarRight:f("layout-sidebar-right",60404),layoutStatusbar:f("layout-statusbar",60405),layoutMenubar:f("layout-menubar",60406),layoutCentered:f("layout-centered",60407),target:f("target",60408),indent:f("indent",60409),recordSmall:f("record-small",60410),errorSmall:f("error-small",60411),terminalDecorationError:f("terminal-decoration-error",60411),arrowCircleDown:f("arrow-circle-down",60412),arrowCircleLeft:f("arrow-circle-left",60413),arrowCircleRight:f("arrow-circle-right",60414),arrowCircleUp:f("arrow-circle-up",60415),layoutSidebarRightOff:f("layout-sidebar-right-off",60416),layoutPanelOff:f("layout-panel-off",60417),layoutSidebarLeftOff:f("layout-sidebar-left-off",60418),blank:f("blank",60419),heartFilled:f("heart-filled",60420),map:f("map",60421),mapHorizontal:f("map-horizontal",60421),foldHorizontal:f("fold-horizontal",60421),mapFilled:f("map-filled",60422),mapHorizontalFilled:f("map-horizontal-filled",60422),foldHorizontalFilled:f("fold-horizontal-filled",60422),circleSmall:f("circle-small",60423),bellSlash:f("bell-slash",60424),bellSlashDot:f("bell-slash-dot",60425),commentUnresolved:f("comment-unresolved",60426),gitPullRequestGoToChanges:f("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:f("git-pull-request-new-changes",60428),searchFuzzy:f("search-fuzzy",60429),commentDraft:f("comment-draft",60430),send:f("send",60431),sparkle:f("sparkle",60432),insert:f("insert",60433),mic:f("mic",60434),thumbsdownFilled:f("thumbsdown-filled",60435),thumbsupFilled:f("thumbsup-filled",60436),coffee:f("coffee",60437),snake:f("snake",60438),game:f("game",60439),vr:f("vr",60440),chip:f("chip",60441),piano:f("piano",60442),music:f("music",60443),micFilled:f("mic-filled",60444),repoFetch:f("repo-fetch",60445),copilot:f("copilot",60446),lightbulbSparkle:f("lightbulb-sparkle",60447),robot:f("robot",60448),sparkleFilled:f("sparkle-filled",60449),diffSingle:f("diff-single",60450),diffMultiple:f("diff-multiple",60451),surroundWith:f("surround-with",60452),share:f("share",60453),gitStash:f("git-stash",60454),gitStashApply:f("git-stash-apply",60455),gitStashPop:f("git-stash-pop",60456),vscode:f("vscode",60457),vscodeInsiders:f("vscode-insiders",60458),codeOss:f("code-oss",60459),runCoverage:f("run-coverage",60460),runAllCoverage:f("run-all-coverage",60461),coverage:f("coverage",60462),githubProject:f("github-project",60463),mapVertical:f("map-vertical",60464),foldVertical:f("fold-vertical",60464),mapVerticalFilled:f("map-vertical-filled",60465),foldVerticalFilled:f("fold-vertical-filled",60465),goToSearch:f("go-to-search",60466),percentage:f("percentage",60467),sortPercentage:f("sort-percentage",60467),attach:f("attach",60468),goToEditingSession:f("go-to-editing-session",60469),editSession:f("edit-session",60470),codeReview:f("code-review",60471),copilotWarning:f("copilot-warning",60472),python:f("python",60473),copilotLarge:f("copilot-large",60474),copilotWarningLarge:f("copilot-warning-large",60475),keyboardTab:f("keyboard-tab",60476),copilotBlocked:f("copilot-blocked",60477),copilotNotConnected:f("copilot-not-connected",60478),flag:f("flag",60479),lightbulbEmpty:f("lightbulb-empty",60480),symbolMethodArrow:f("symbol-method-arrow",60481),copilotUnavailable:f("copilot-unavailable",60482),repoPinned:f("repo-pinned",60483),keyboardTabAbove:f("keyboard-tab-above",60484),keyboardTabBelow:f("keyboard-tab-below",60485),gitPullRequestDone:f("git-pull-request-done",60486),mcp:f("mcp",60487),extensionsLarge:f("extensions-large",60488),layoutPanelDock:f("layout-panel-dock",60489),layoutSidebarLeftDock:f("layout-sidebar-left-dock",60490),layoutSidebarRightDock:f("layout-sidebar-right-dock",60491),copilotInProgress:f("copilot-in-progress",60492),copilotError:f("copilot-error",60493),copilotSuccess:f("copilot-success",60494),chatSparkle:f("chat-sparkle",60495),searchSparkle:f("search-sparkle",60496),editSparkle:f("edit-sparkle",60497),copilotSnooze:f("copilot-snooze",60498),sendToRemoteAgent:f("send-to-remote-agent",60499),commentDiscussionSparkle:f("comment-discussion-sparkle",60500),chatSparkleWarning:f("chat-sparkle-warning",60501),chatSparkleError:f("chat-sparkle-error",60502),collection:f("collection",60503),newCollection:f("new-collection",60504),thinking:f("thinking",60505),build:f("build",60506),commentDiscussionQuote:f("comment-discussion-quote",60507),cursor:f("cursor",60508),eraser:f("eraser",60509),fileText:f("file-text",60510),quotes:f("quotes",60512),rename:f("rename",60513),runWithDeps:f("run-with-deps",60514),debugConnected:f("debug-connected",60515),strikethrough:f("strikethrough",60516),openInProduct:f("open-in-product",60517),indexZero:f("index-zero",60518),agent:f("agent",60519),editCode:f("edit-code",60520),repoSelected:f("repo-selected",60521),skip:f("skip",60522),mergeInto:f("merge-into",60523),gitBranchChanges:f("git-branch-changes",60524),gitBranchStagedChanges:f("git-branch-staged-changes",60525),gitBranchConflicts:f("git-branch-conflicts",60526),gitBranch:f("git-branch",60527),gitBranchCreate:f("git-branch-create",60527),gitBranchDelete:f("git-branch-delete",60527),searchLarge:f("search-large",60528),terminalGitBash:f("terminal-git-bash",60529),windowActive:f("window-active",60530),forward:f("forward",60531),download:f("download",60532),clockface:f("clockface",60533),unarchive:f("unarchive",60534),sessionInProgress:f("session-in-progress",60535),collectionSmall:f("collection-small",60536),vmSmall:f("vm-small",60537),cloudSmall:f("cloud-small",60538),addSmall:f("add-small",60539),removeSmall:f("remove-small",60540),worktreeSmall:f("worktree-small",60541),worktree:f("worktree",60542),screenCut:f("screen-cut",60543),ask:f("ask",60544),openai:f("openai",60545),claude:f("claude",60546),openInWindow:f("open-in-window",60547),newSession:f("new-session",60548),terminalSecure:f("terminal-secure",60549)}});function OE(){return Object.values(J)}var o9,J,xl=y(()=>{ME();N_();o9={dialogError:f("dialog-error","error"),dialogWarning:f("dialog-warning","warning"),dialogInfo:f("dialog-info","info"),dialogClose:f("dialog-close","close"),treeItemExpanded:f("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:f("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:f("tree-filter-on-type-off","list-selection"),treeFilterClear:f("tree-filter-clear","close"),treeItemLoading:f("tree-item-loading","loading"),menuSelection:f("menu-selection","check"),menuSubmenu:f("menu-submenu","chevron-right"),menuBarMore:f("menubar-more","more"),scrollbarButtonLeft:f("scrollbar-button-left","triangle-left"),scrollbarButtonRight:f("scrollbar-button-right","triangle-right"),scrollbarButtonUp:f("scrollbar-button-up","triangle-up"),scrollbarButtonDown:f("scrollbar-button-down","triangle-down"),toolBarMore:f("toolbar-more","more"),quickInputBack:f("quick-input-back","arrow-left"),dropDownButton:f("drop-down-button",60084),symbolCustomColor:f("symbol-customcolor",60252),exportIcon:f("export",60332),workspaceUnspecified:f("workspace-unspecified",60355),newLine:f("newline",60394),thumbsDownFilled:f("thumbsdown-filled",60435),thumbsUpFilled:f("thumbsup-filled",60436),gitFetch:f("git-fetch",60445),lightbulbSparkleAutofix:f("lightbulb-sparkle-autofix",60447),debugBreakpointPending:f("debug-breakpoint-pending",60377),chatImport:f("chat-import",60550),chatExport:f("chat-export",60551)},J={...A_,...o9}});var U_,yo,fm=y(()=>{xl();(t=>{function o(e){return!!e&&typeof e=="object"&&typeof e.id=="string"}t.isThemeColor=o})(U_||={});(T=>{T.iconNameSegment="[A-Za-z0-9]+",T.iconNameExpression="[A-Za-z0-9-]+",T.iconModifierExpression="~[A-Za-z]+",T.iconNameCharacter="[A-Za-z0-9~-]";let r=new RegExp(`^(${T.iconNameExpression})(${T.iconModifierExpression})?$`);function i(w){let k=r.exec(w.id);if(!k)return i(J.error);let[,M,B]=k,He=["codicon","codicon-"+M];return B&&He.push("codicon-modifier-"+B.substring(1)),He}T.asClassNameArray=i;function s(w){return i(w).join(" ")}T.asClassName=s;function a(w){return"."+i(w).join(".")}T.asCSSSelector=a;function l(w){return!!w&&typeof w=="object"&&typeof w.id=="string"&&(typeof w.color>"u"||U_.isThemeColor(w.color))}T.isThemeIcon=l;let c=new RegExp(`^\\$\\((${T.iconNameExpression}(?:${T.iconModifierExpression})?)\\)$`);function u(w){let k=c.exec(w);if(!k)return;let[,M]=k;return{id:M}}T.fromString=u;function p(w){return{id:w}}T.fromId=p;function m(w,k){let M=w.id,B=M.lastIndexOf("~");return B!==-1&&(M=M.substring(0,B)),k&&(M=`${M}~${k}`),{id:M}}T.modify=m;function g(w){let k=w.id.lastIndexOf("~");if(k!==-1)return w.id.substring(k+1)}T.getModifier=g;function h(w,k){return w.id===k.id&&w.color?.id===k.color?.id}T.isEqual=h;function v(w){return w?.id===J.file.id}T.isFile=v;function x(w){return w?.id===J.folder.id}T.isFolder=x})(yo||={})});function F_(o){return o.replace(i9,(t,e)=>e?t:`\\${t}`)}var AE,i9,fte,gte,hte,V_=y(()=>{M_();Qt();fm();AE=new RegExp(`\\$\\(${yo.iconNameExpression}(?:${yo.iconModifierExpression})?\\)`,"g"),i9=new RegExp(`(\\\\)?${AE.source}`,"g");fte=new RegExp(`\\\\${AE.source}`,"g"),gte=new RegExp(`(\\s)?(\\\\)?${AE.source}(\\s)?`,"g"),hte=new RegExp(`\\$\\(${yo.iconNameCharacter}+\\)`,"g")});function pd(o){return o instanceof Sn?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0)&&(typeof o.supportAlertSyntax=="boolean"||o.supportAlertSyntax===void 0):!1}function s9(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function a9(o,t){let e=o.match(/^`+/gm)?.reduce((r,i)=>r.length>i.length?r:i).length??0,n=e>=3?e+1:3;return[`${"`".repeat(n)}${t}`,o,`${"`".repeat(n)}`].join(`
- `)}function W_(o){let t=[],e=o.split("|").map(r=>r.trim());o=e[0];let n=e[1];if(n){let r=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=r?r[1]:"",a=i?i[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&t.push(`width="${a}"`),c&&t.push(`height="${s}"`)}return{href:o,dimensions:t}}function Tv(o,...t){return I.from({scheme:z.command,path:o,query:t.length?encodeURIComponent(JSON.stringify(t)):void 0})}var Sn,oa=y(()=>{Se();V_();$e();Nt();Qt();ce();Sn=class o{static lift(t){let e=new o(t.value,t);return e.uris=t.uris,e.baseUri=t.baseUri?I.revive(t.baseUri):void 0,e}constructor(t="",e=!1){if(this.value=t,typeof this.value!="string")throw Je("value");typeof e=="boolean"?(this.isTrusted=e,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=e.isTrusted??void 0,this.supportThemeIcons=e.supportThemeIcons??!1,this.supportHtml=e.supportHtml??!1,this.supportAlertSyntax=e.supportAlertSyntax??!1)}appendText(t,e=0){return this.value+=s9(this.supportThemeIcons?F_(t):t).replace(/([ \t]+)/g,(n,r)=>" ".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,e===1?`\\
- `:`
- `),this}appendMarkdown(t){return this.value+=t,this}appendCodeblock(t,e){return this.value+=`
- ${a9(e,t)}
- `,this}appendLink(t,e,n){return this.value+="[",this.value+=this._escape(e,"]"),this.value+="](",this.value+=this._escape(String(t),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(t,e){let n=new RegExp(ao(e),"g");return t.replace(n,(r,i)=>t.charAt(i-1)!=="\\"?`\\${r}`:r)}}});function Xt(o,t){if(o instanceof Et)return o;let e;return o instanceof ho?e=new Et(o.message,o.code==="DownloadFailedWriting"?"DownloadFailedWriting":"Gallery"):e=new Et(o.message,Tn(o)?"Cancelled":t??"Internal"),e.stack=o.stack,e}function NE(o,t,{extensionData:e,verificationStatus:n,duration:r,error:i,source:s,durationSinceUpdate:a}){o.publicLog(t,{...e,source:s,duration:r,durationSinceUpdate:a,success:!i,errorcode:i?.code,verificationStatus:n==="Success"?"Verified":n??"Unverified"})}var md,fd,gm,hm=y(()=>{At();ze();Wt();Se();de();q();Hn();me();ce();pe();rr();No();_n();mm();Fe();yn();nr();br();zr();oa();md=class extends D{constructor(e,n){super();this.productService=e;this.allowedExtensionsService=n;this.preferPreReleases=this.productService.quality!=="stable"}async canInstall(e){let n=this.allowedExtensionsService.isAllowed({id:e.identifier.id,publisherDisplayName:e.publisherDisplayName});if(n!==!0)return new Sn(d(728,null,n.value));if(!await this.isExtensionPlatformCompatible(e)){let r=Yt?"https://aka.ms/vscode-web-extensions-guide":"https://aka.ms/vscode-platform-specific-extensions";return new Sn(`${d(721,null,e.displayName??e.identifier.id,this.productService.nameLong,aE(await this.getTargetPlatform()))} [${d(723,null)}](${r})`)}return!0}async isExtensionPlatformCompatible(e){let n=await this.getTargetPlatform();return e.allTargetPlatforms.some(r=>sm(r,e.allTargetPlatforms,n))}};md=E([b(0,Ve),b(1,vo)],md);fd=class extends md{constructor(e,n,r,i,s,a,l){super(s,a);this.galleryService=e;this.telemetryService=n;this.uriIdentityService=r;this.logService=i;this.userDataProfilesService=l;this.lastReportTimestamp=0;this.installingExtensions=new Map;this.uninstallingExtensions=new Map;this._onInstallExtension=this._register(new P);this._onDidInstallExtensions=this._register(new P);this._onUninstallExtension=this._register(new P);this._onDidUninstallExtension=this._register(new P);this._onDidUpdateExtensionMetadata=this._register(new P);this.participants=[];this._register(ie(()=>{this.installingExtensions.forEach(({task:c})=>c.cancel()),this.uninstallingExtensions.forEach(c=>c.cancel()),this.installingExtensions.clear(),this.uninstallingExtensions.clear()}))}get onInstallExtension(){return this._onInstallExtension.event}get onDidInstallExtensions(){return this._onDidInstallExtensions.event}get onUninstallExtension(){return this._onUninstallExtension.event}get onDidUninstallExtension(){return this._onDidUninstallExtension.event}get onDidUpdateExtensionMetadata(){return this._onDidUpdateExtensionMetadata.event}async installFromGallery(e,n={}){try{let r=await this.installGalleryExtensions([{extension:e,options:n}]),i=r.find(({identifier:a})=>we(a,e.identifier));if(i?.local)return i.local;if(i?.error)throw i.error;let s=r[0];if(s?.local)return s.local;throw s?.error?s.error:new Et(`Unknown error while installing extension ${e.identifier.id}`,"Unknown")}catch(r){throw Xt(r)}}async installGalleryExtensions(e){if(!this.galleryService.isEnabled())throw new Et(d(725,null),"NotAllowed");let n=[],r=[];return await Promise.allSettled(e.map(async({extension:i,options:s})=>{try{let a=await this.checkAndGetCompatibleVersion(i,!!s?.installGivenVersion,!!s?.installPreReleaseVersion,s.productVersion??{version:this.productService.version,date:this.productService.date});r.push({...a,options:s})}catch(a){n.push({identifier:i.identifier,operation:2,source:i,error:a,profileLocation:s.profileLocation??this.getCurrentExtensionsManifestLocation()})}})),r.length&&n.push(...await this.installExtensions(r)),n}async uninstall(e,n){return this.logService.trace("ExtensionManagementService#uninstall",e.identifier.id),this.uninstallExtensions([{extension:e,options:n}])}async toggleApplicationScope(e,n){if(iE(e.manifest)||e.isBuiltin)return e;if(e.isApplicationScoped){let r=await this.updateMetadata(e,{isApplicationScoped:!1},this.userDataProfilesService.defaultProfile.extensionsResource);this.uriIdentityService.extUri.isEqual(n,this.userDataProfilesService.defaultProfile.extensionsResource)||(r=await this.copyExtension(e,this.userDataProfilesService.defaultProfile.extensionsResource,n));for(let i of this.userDataProfilesService.profiles){let s=(await this.getInstalled(1,i.extensionsResource)).find(a=>we(a.identifier,e.identifier));s?this._onDidUpdateExtensionMetadata.fire({local:s,profileLocation:i.extensionsResource}):this._onDidUninstallExtension.fire({identifier:e.identifier,profileLocation:i.extensionsResource})}return r}else{let r=this.uriIdentityService.extUri.isEqual(n,this.userDataProfilesService.defaultProfile.extensionsResource)?await this.updateMetadata(e,{isApplicationScoped:!0},this.userDataProfilesService.defaultProfile.extensionsResource):await this.copyExtension(e,n,this.userDataProfilesService.defaultProfile.extensionsResource,{isApplicationScoped:!0});return this._onDidInstallExtensions.fire([{identifier:r.identifier,operation:2,local:r,profileLocation:this.userDataProfilesService.defaultProfile.extensionsResource,applicationScoped:!0}]),r}}getExtensionsControlManifest(){let e=new Date().getTime();return(!this.extensionsControlManifest||e-this.lastReportTimestamp>1e3*60*5)&&(this.extensionsControlManifest=this.updateControlCache(),this.lastReportTimestamp=e),this.extensionsControlManifest}registerParticipant(e){this.participants.push(e)}async resetPinnedStateForAllUserExtensions(e){try{await this.joinAllSettled(this.userDataProfilesService.profiles.map(async n=>{let r=await this.getInstalled(1,n.extensionsResource);await this.joinAllSettled(r.map(async i=>{i.pinned!==e&&await this.updateMetadata(i,{pinned:e},n.extensionsResource)}))}))}catch(n){throw this.logService.error("Error while resetting pinned state for all user extensions",fe(n)),n}}async installExtensions(e){let n=new Map,r=new Map,i=[],s=(c,u)=>`${Ln.create(c).toString()}-${u.toString()}`,a=(c,u,p,m)=>{let g;if(!I.isUri(u)){if(r.has(`${u.identifier.id.toLowerCase()}-${p.profileLocation.toString()}`))return;let x=this.installingExtensions.get(s(u,p.profileLocation));if(x){if(m&&this.canWaitForTask(m,x.task)){let T=x.task.identifier;this.logService.info("Waiting for already requested installing extension",T.id,m.identifier.id,p.profileLocation.toString()),x.waitingTasks.push(m),i.push(F.toPromise(F.filter(this.onDidInstallExtensions,w=>w.some(k=>we(k.identifier,T)))).then(w=>{this.logService.info("Finished waiting for already requested installing extension",T.id,m.identifier.id,p.profileLocation.toString());let k=w.find(M=>we(M.identifier,T));if(!k?.local)throw new Error(`Extension ${T.id} is not installed`);return k.local}))}return}g=this.uninstallingExtensions.get(this.getUninstallExtensionTaskKey(u.identifier,p.profileLocation))}let h=this.createInstallExtensionTask(c,u,p),v=`${or(c.publisher,c.name)}-${p.profileLocation.toString()}`;r.set(v,{task:h,root:m,uninstallTaskToWaitFor:g}),this._onInstallExtension.fire({identifier:h.identifier,source:u,profileLocation:p.profileLocation}),this.logService.info("Installing extension:",h.identifier.id,p),I.isUri(u)||this.installingExtensions.set(s(u,p.profileLocation),{task:h,waitingTasks:[]})};try{let c=await this.getInstalled(0);for(let{manifest:p,extension:m,options:g}of e){let h=or(p.publisher,p.name),v=c.some(M=>we(M.identifier,{id:h})),x=g.isBuiltin||v,T=g.isApplicationScoped||x||iE(p),w={...g,isBuiltin:x,isApplicationScoped:T,profileLocation:T?this.userDataProfilesService.defaultProfile.extensionsResource:g.profileLocation??this.getCurrentExtensionsManifestLocation(),productVersion:g.productVersion??{version:this.productService.version,date:this.productService.date}},k=I.isUri(m)?void 0:this.installingExtensions.get(s(m,w.profileLocation));k?(this.logService.info("Extension is already requested to install",k.task.identifier.id,w.profileLocation.toString()),i.push(k.task.waitUntilTaskIsFinished())):a(p,m,w,void 0)}await Promise.all([...r.values()].map(async({task:p})=>{if(p.options.donotIncludePackAndDependencies)this.logService.info("Installing the extension without checking dependencies and pack",p.identifier.id);else try{let m=this.preferPreReleases;p.options.installPreReleaseVersion?m=!0:!I.isUri(p.source)&&p.source.hasPreReleaseVersion&&(m=!1);let g=await this.getInstalled(void 0,p.options.profileLocation,p.options.productVersion),h=await this.getAllDepsAndPackExtensions(p.identifier,p.manifest,m,p.options.productVersion,g),v={...p.options,pinned:!1,installGivenVersion:!1,context:{...p.options.context,[O0]:!0}};for(let{gallery:x,manifest:T}of pr(h,({gallery:w})=>w.identifier.id)){let w=g.find(k=>we(k.identifier,x.identifier));w&&w.isApplicationScoped===!!v.isApplicationScoped||a(T,x,v,p)}}catch(m){if(I.isUri(p.source))ja(p.manifest.extensionDependencies)&&this.logService.warn("Cannot install dependencies of extension:",p.identifier.id,m.message),ja(p.manifest.extensionPack)&&this.logService.warn("Cannot install packed extensions of extension:",p.identifier.id,m.message);else throw this.logService.error("Error while preparing to install dependencies and extension packs of the extension:",p.identifier.id),m}}));let u=await this.getOtherProfilesToUpdateExtension([...r.values()].map(({task:p})=>p));for(let[p,m]of u)a(m.manifest,m.source,{...m.options,profileLocation:p},void 0);await this.joinAllSettled([...r.entries()].map(async([p,{task:m,uninstallTaskToWaitFor:g}])=>{let h=new Date().getTime(),v;try{if(g){this.logService.info("Waiting for existing uninstall task to complete before installing",m.identifier.id);try{await g.waitUntilTaskIsFinished(),this.logService.info("Finished waiting for uninstall task, proceeding with install",m.identifier.id)}catch(x){this.logService.info("Uninstall task failed, proceeding with install anyway",m.identifier.id,fe(x))}}v=await m.run(),await this.joinAllSettled(this.participants.map(x=>x.postInstall(v,m.source,m.options,Ee.None)),"PostInstall")}catch(x){let T=Xt(x);throw I.isUri(m.source)||NE(this.telemetryService,m.operation===3?"extensionGallery:update":"extensionGallery:install",{extensionData:dm(m.source),error:T,source:m.options.context?.[sE]}),n.set(p,{error:T,identifier:m.identifier,operation:m.operation,source:m.source,context:m.options.context,profileLocation:m.options.profileLocation,applicationScoped:m.options.isApplicationScoped}),this.logService.error("Error while installing the extension",m.identifier.id,fe(T),m.options.profileLocation.toString()),T}if(!I.isUri(m.source)){let x=m.operation===3,T=x?void 0:(new Date().getTime()-m.source.lastUpdated)/1e3;NE(this.telemetryService,x?"extensionGallery:update":"extensionGallery:install",{extensionData:dm(m.source),verificationStatus:m.verificationStatus,duration:new Date().getTime()-h,durationSinceUpdate:T,source:m.options.context?.[sE]})}n.set(p,{local:v,identifier:m.identifier,operation:m.operation,source:m.source,context:m.options.context,profileLocation:m.options.profileLocation,applicationScoped:v.isApplicationScoped})})),i.length&&await this.joinAllSettled(i)}catch(c){let u=(g,h,v)=>{let x=[];g.manifest.extensionDependencies?.length&&x.push(...g.manifest.extensionDependencies),g.manifest.extensionPack?.length&&x.push(...g.manifest.extensionPack);for(let T of x){if(v.includes(T.toLowerCase()))continue;v.push(T.toLowerCase());let w=n.get(`${T.toLowerCase()}-${h.toString()}`);w?.local&&(v=u(w.local,h,v))}return v},p=g=>({identifier:g.identifier,operation:2,source:g.source,context:g.options.context,profileLocation:g.options.profileLocation,error:c}),m=[];for(let[g,{task:h,root:v}]of r){let x=n.get(g);x?x.local&&v&&!n.get(`${v.identifier.id.toLowerCase()}-${h.options.profileLocation.toString()}`)?.local&&(m.push(this.createUninstallExtensionTask(x.local,{versionOnly:!0,profileLocation:h.options.profileLocation})),n.set(g,p(h))):(h.cancel(),n.set(g,p(h)))}for(let[g,{task:h}]of r){let v=n.get(g);if(!v?.local||h.options.donotIncludePackAndDependencies)continue;u(v.local,h.options.profileLocation,[v.local.identifier.id.toLowerCase()]).slice(1).some(T=>r.has(`${T.toLowerCase()}-${h.options.profileLocation.toString()}`)&&!n.get(`${T.toLowerCase()}-${h.options.profileLocation.toString()}`)?.local)&&(m.push(this.createUninstallExtensionTask(v.local,{versionOnly:!0,profileLocation:h.options.profileLocation})),n.set(g,p(h)))}m.length&&await Promise.allSettled(m.map(async g=>{try{await g.run(),this.logService.info("Rollback: Uninstalled extension",g.extension.identifier.id)}catch(h){this.logService.warn("Rollback: Error while uninstalling extension",g.extension.identifier.id,fe(h))}}))}finally{for(let{task:c}of r.values())c.source&&!I.isUri(c.source)&&this.installingExtensions.delete(s(c.source,c.options.profileLocation))}let l=[...n.values()];for(let c of l)c.local&&this.logService.info("Extension installed successfully:",c.identifier.id,c.profileLocation.toString());return this._onDidInstallExtensions.fire(l),l}async getOtherProfilesToUpdateExtension(e){let n=[],r=new lt;for(let i of e)if(!(i.operation!==3||i.options.isApplicationScoped||i.options.pinned||i.options.installGivenVersion||I.isUri(i.source)))for(let s of this.userDataProfilesService.profiles){if(this.uriIdentityService.extUri.isEqual(s.extensionsResource,i.options.profileLocation))continue;let a=r.get(s.extensionsResource);a||(a=await this.getInstalled(1,s.extensionsResource),r.set(s.extensionsResource,a));let l=a.find(c=>we(c.identifier,i.identifier));l&&!l.pinned&&n.push([s.extensionsResource,i])}return n}canWaitForTask(e,n){for(let[,{task:r,waitingTasks:i}]of this.installingExtensions.entries())if(r===e&&(i.includes(n)||i.some(s=>this.canWaitForTask(s,n)))||r===n&&i[0]&&!this.canWaitForTask(e,i[0]))return!1;return!0}async joinAllSettled(e,n){let r=[],i=[],s=await Promise.allSettled(e);for(let l of s)l.status==="fulfilled"?r.push(l.value):i.push(Xt(l.reason,n));if(!i.length)return r;if(i.length===1)throw i[0];let a=new Et("","Unknown");for(let l of i)a=new Et(a.message?`${a.message}, ${l.message}`:l.message,l.code!=="Unknown"&&l.code!=="Internal"?l.code:a.code);throw a}async getAllDepsAndPackExtensions(e,n,r,i,s){if(!this.galleryService.isEnabled())return[];let a=[],l=[],c=async(u,p)=>{a.push(u);let m=p.extensionDependencies?p.extensionDependencies.filter(h=>!s.some(v=>we(v.identifier,{id:h}))):[],g=[...m];if(p.extensionPack){let h=s.find(v=>we(v.identifier,u));for(let v of p.extensionPack)h&&h.manifest.extensionPack&&h.manifest.extensionPack.some(x=>we({id:x},{id:v}))||g.every(x=>!we({id:x},{id:v}))&&g.push(v)}if(g.length){let h=g.filter(v=>a.every(x=>!we(x,{id:v})));if(h.length){let v=await this.galleryService.getExtensions(h.map(x=>({id:x,preRelease:r})),Ee.None);for(let x of v){if(a.find(k=>we(k,x.identifier)))continue;let T=m.some(k=>we({id:k},x.identifier)),w;try{w=await this.checkAndGetCompatibleVersion(x,!1,r,i)}catch(k){if(T)throw k;this.logService.info("Skipping the packed extension as it cannot be installed",x.identifier.id,fe(k));continue}l.push({gallery:w.extension,manifest:w.manifest}),await c(w.extension.identifier,w.manifest)}}}};return await c(e,n),l}async checkAndGetCompatibleVersion(e,n,r,i){let s,a=await this.getExtensionsControlManifest();if(K0(e.identifier,a.malicious))throw new Et(d(724,null,e.identifier.id),"Malicious");let l=a.deprecated[e.identifier.id.toLowerCase()];if(l?.extension?.autoMigrate){if(this.logService.info(`The '${e.identifier.id}' extension is deprecated, fetching the compatible '${l.extension.id}' extension instead.`),s=(await this.galleryService.getExtensions([{id:l.extension.id,preRelease:l.extension.preRelease}],{targetPlatform:await this.getTargetPlatform(),compatible:!0,productVersion:i},Ee.None))[0],!s)throw new Et(d(730,null,e.identifier.id,l.extension.id),"Deprecated")}else{if(await this.canInstall(e)!==!0){let u=await this.getTargetPlatform();throw new Et(d(721,null,e.identifier.id,this.productService.nameLong,aE(u)),"IncompatibleTargetPlatform")}if(s=await this.getCompatibleVersion(e,n,r,i),!s){let u=[];throw pm(e.properties.enabledApiProposals??[],u)?!r&&e.hasPreReleaseVersion&&e.properties.isPreReleaseVersion&&(await this.galleryService.getExtensions([e.identifier],Ee.None))[0]?new Et(d(731,null,e.displayName??e.identifier.id),"ReleaseVersionNotFound"):new Et(d(729,null,e.identifier.id,this.productService.nameLong,this.productService.version),"Incompatible"):new Et(d(722,null,e.displayName??e.identifier.id,u[0]),"IncompatibleApi")}}this.logService.info("Getting Manifest...",s.identifier.id);let c=await this.galleryService.getManifest(s,Ee.None);if(c===null)throw new Et(`Missing manifest for extension ${s.identifier.id}`,"Invalid");if(c.version!==s.version)throw new Et(`Cannot install '${s.identifier.id}' extension because of version mismatch in Marketplace`,"Invalid");return{extension:s,manifest:c}}async getCompatibleVersion(e,n,r,i){let s=await this.getTargetPlatform(),a=null;return!n&&e.hasPreReleaseVersion&&e.properties.isPreReleaseVersion!==r&&(a=(await this.galleryService.getExtensions([{...e.identifier,preRelease:r}],{targetPlatform:s,compatible:!0,productVersion:i},Ee.None))[0]||null),!a&&await this.galleryService.isExtensionCompatible(e,r,s,i)&&(a=e),a||(n?a=(await this.galleryService.getExtensions([{...e.identifier,version:e.version}],{targetPlatform:s,compatible:!0,productVersion:i},Ee.None))[0]||null:a=await this.galleryService.getCompatibleExtension(e,r,s,i)),a}getUninstallExtensionTaskKey(e,n,r){return`${e.id.toLowerCase()}${r?`-${r}`:""}@${n.toString()}`}async uninstallExtensions(e){let n=(m,g)=>this.getUninstallExtensionTaskKey(m.identifier,g.profileLocation,g.versionOnly?m.manifest.version:void 0),r=(m,g)=>{let h;for(let{task:x}of this.installingExtensions.values())if(!(x.source instanceof I)&&we(x.identifier,m.identifier)&&this.uriIdentityService.extUri.isEqual(x.options.profileLocation,g.profileLocation)){h=x;break}let v=this.createUninstallExtensionTask(m,g);this.uninstallingExtensions.set(n(v.extension,g),v),this.logService.info("Uninstalling extension from the profile:",`${m.identifier.id}@${m.manifest.version}`,g.profileLocation.toString()),this._onUninstallExtension.fire({identifier:m.identifier,profileLocation:g.profileLocation,applicationScoped:m.isApplicationScoped}),s.push({task:v,installTaskToWaitFor:h})},i=(m,g,h)=>{h?this.logService.error("Failed to uninstall extension from the profile:",`${m.identifier.id}@${m.manifest.version}`,g.profileLocation.toString(),h.message):this.logService.info("Successfully uninstalled extension from the profile",`${m.identifier.id}@${m.manifest.version}`,g.profileLocation.toString()),NE(this.telemetryService,"extensionGallery:uninstall",{extensionData:q0(m),error:h}),this._onDidUninstallExtension.fire({identifier:m.identifier,error:h?.code,profileLocation:g.profileLocation,applicationScoped:m.isApplicationScoped})},s=[],a=[],l=[],c=[],u=new lt,p=async m=>{let g=u.get(m);return g||u.set(m,g=await this.getInstalled(1,m)),g};for(let{extension:m,options:g}of e){let h={...g,profileLocation:m.isApplicationScoped?this.userDataProfilesService.defaultProfile.extensionsResource:g?.profileLocation??this.getCurrentExtensionsManifestLocation()},v=this.uninstallingExtensions.get(n(m,h));if(v?(this.logService.info("Extensions is already requested to uninstall",m.identifier.id),l.push(v.waitUntilTaskIsFinished())):r(m,h),h.remove||m.isApplicationScoped){h.remove&&c.push(m);for(let x of this.userDataProfilesService.profiles){if(this.uriIdentityService.extUri.isEqual(x.extensionsResource,h.profileLocation))continue;let w=(await p(x.extensionsResource)).find(k=>we(k.identifier,m.identifier));if(w){let k={...h,profileLocation:x.extensionsResource},M=this.uninstallingExtensions.get(n(w,k));M?(this.logService.info("Extensions is already requested to uninstall",w.identifier.id),l.push(M.waitUntilTaskIsFinished())):r(w,k)}}}}try{for(let{task:m}of s.slice(0)){let g=await p(m.options.profileLocation);if(m.options.donotIncludePack)this.logService.info("Uninstalling the extension without including packed extension",`${m.extension.identifier.id}@${m.extension.manifest.version}`);else{let h=this.getAllPackExtensionsToUninstall(m.extension,g);for(let v of h)this.uninstallingExtensions.has(n(v,m.options))?this.logService.info("Extensions is already requested to uninstall",v.identifier.id):r(v,m.options)}m.options.donotCheckDependents?this.logService.info("Uninstalling the extension without checking dependents",`${m.extension.identifier.id}@${m.extension.manifest.version}`):this.checkForDependents(s.map(({task:h})=>h.extension),g,m.extension)}await this.joinAllSettled(s.map(async({task:m,installTaskToWaitFor:g})=>{try{if(g){this.logService.info("Waiting for existing install task to complete before uninstalling",m.extension.identifier.id);try{await g.waitUntilTaskIsFinished(),this.logService.info("Finished waiting for install task, proceeding with uninstall",m.extension.identifier.id)}catch(h){this.logService.info("Install task failed, proceeding with uninstall anyway",m.extension.identifier.id,fe(h))}}if(await m.run(),await this.joinAllSettled(this.participants.map(h=>h.postUninstall(m.extension,m.options,Ee.None))),m.extension.identifier.uuid&&!Yt)try{await this.galleryService.reportStatistic(m.extension.manifest.publisher,m.extension.manifest.name,m.extension.manifest.version,"uninstall")}catch{}}catch(h){let v=Xt(h);throw i(m.extension,m.options,v),v}finally{a.push(m)}})),l.length&&await this.joinAllSettled(l);for(let{task:m}of s)i(m.extension,m.options);c.length&&await this.joinAllSettled(c.map(m=>this.deleteExtension(m)))}catch(m){let g=Xt(m);for(let{task:h}of s){try{h.cancel()}catch{}a.includes(h)||i(h.extension,h.options,g)}throw g}finally{for(let{task:m}of s)this.uninstallingExtensions.delete(n(m.extension,m.options))||this.logService.warn("Uninstallation task is not found in the cache",m.extension.identifier.id)}}checkForDependents(e,n,r){for(let i of e){let s=this.getDependents(i,n);if(s.length){let a=s.filter(l=>!e.some(c=>we(c.identifier,l.identifier)));if(a.length)throw new Error(this.getDependentsErrorMessage(i,a,r))}}}getDependentsErrorMessage(e,n,r){return r===e?n.length===1?d(732,null,r.manifest.displayName||r.manifest.name,n[0].manifest.displayName||n[0].manifest.name):n.length===2?d(734,null,r.manifest.displayName||r.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name):d(726,null,r.manifest.displayName||r.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name):n.length===1?d(733,null,r.manifest.displayName||r.manifest.name,e.manifest.displayName||e.manifest.name,n[0].manifest.displayName||n[0].manifest.name):n.length===2?d(735,null,r.manifest.displayName||r.manifest.name,e.manifest.displayName||e.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name):d(727,null,r.manifest.displayName||r.manifest.name,e.manifest.displayName||e.manifest.name,n[0].manifest.displayName||n[0].manifest.name,n[1].manifest.displayName||n[1].manifest.name)}getAllPackExtensionsToUninstall(e,n,r=[]){if(r.indexOf(e)!==-1)return[];if(we(e.identifier,{id:this.productService.defaultChatAgent.extensionId}))return[];r.push(e);let i=e.manifest.extensionPack?e.manifest.extensionPack:[];if(i.length){let s=n.filter(l=>!l.isBuiltin&&i.some(c=>we({id:c},l.identifier))),a=[];for(let l of s)a.push(...this.getAllPackExtensionsToUninstall(l,n,r));return[...s,...a]}return[]}getDependents(e,n){return n.filter(r=>r.manifest.extensionDependencies&&r.manifest.extensionDependencies.some(i=>we({id:i},e.identifier)))}async updateControlCache(){try{return this.logService.trace("ExtensionManagementService.updateControlCache"),await this.galleryService.getExtensionsControlManifest()}catch(e){return this.logService.trace("ExtensionManagementService.refreshControlCache - failed to get extension control manifest",fe(e)),{malicious:[],deprecated:{},search:[]}}}};fd=E([b(0,$n),b(1,Ft),b(2,ot),b(3,Q),b(4,Ve),b(5,vo),b(6,an)],fd);gm=class{constructor(){this.barrier=new lo}async waitUntilTaskIsFinished(){return await this.barrier.wait(),this.cancellablePromise}run(){return this.cancellablePromise||(this.cancellablePromise=Rr(t=>this.doRun(t))),this.barrier.open(),this.cancellablePromise}cancel(){this.cancellablePromise||(this.cancellablePromise=Rr(t=>new Promise((e,n)=>{let r=t.onCancellationRequested(()=>{r.dispose(),n(new Ye)})})),this.barrier.open()),this.cancellablePromise.cancel()}}});function B_(o){let t=o;return Ue(t)&&U0(t.identifier)&&(c9(t.location)||ne(t.location)&&!!t.location)&&(Xn(t.relativeLocation)||ne(t.relativeLocation))&&!!t.version&&ne(t.version)}function c9(o){if(!o)return!1;let t=o;return typeof t?.path=="string"&&typeof t?.scheme=="string"}var Sl,Gr,hd,El=y(()=>{ze();et();q();de();Hn();ce();rr();No();nt();re();Fe();zr();br();Me();Se();Sl=class extends Error{constructor(e,n){super(e);this.code=n}},Gr=_("IExtensionsProfileScannerService"),hd=class extends D{constructor(e,n,r,i,s){super();this.extensionsLocation=e;this.fileService=n;this.userDataProfilesService=r;this.uriIdentityService=i;this.logService=s;this._onAddExtensions=this._register(new P);this.onAddExtensions=this._onAddExtensions.event;this._onDidAddExtensions=this._register(new P);this.onDidAddExtensions=this._onDidAddExtensions.event;this._onRemoveExtensions=this._register(new P);this.onRemoveExtensions=this._onRemoveExtensions.event;this._onDidRemoveExtensions=this._register(new P);this.onDidRemoveExtensions=this._onDidRemoveExtensions.event;this.resourcesAccessQueueMap=new lt}scanProfileExtensions(e,n){return this.withProfileExtensions(e,void 0,n)}async addExtensionsToProfile(e,n,r){let i=[],s=[];try{return await this.withProfileExtensions(n,a=>{let l=[];if(r)l.push(...a);else for(let c of a)e.some(([u])=>we(u.identifier,c.identifier)&&u.manifest.version!==c.version)?i.push(c):l.push(c);for(let[c,u]of e){let p=l.findIndex(g=>we(g.identifier,c.identifier)&&g.version===c.manifest.version),m={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:u};p===-1?(s.push(m),l.push(m)):l.splice(p,1,m)}return s.length&&this._onAddExtensions.fire({extensions:s,profileLocation:n}),i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:n}),l}),s.length&&this._onDidAddExtensions.fire({extensions:s,profileLocation:n}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:n}),s}catch(a){throw s.length&&this._onDidAddExtensions.fire({extensions:s,error:a,profileLocation:n}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:a,profileLocation:n}),a}}async updateMetadata(e,n){let r=[];return await this.withProfileExtensions(n,i=>{let s=[];for(let a of i){let l=e.find(([c])=>we({id:c.identifier.id},{id:a.identifier.id})&&c.manifest.version===a.version);l&&(a.metadata={...a.metadata,...l[1]},r.push(a)),s.push(a)}return s}),r}async removeExtensionsFromProfile(e,n){let r=[];try{await this.withProfileExtensions(n,i=>{let s=[];for(let a of i)e.some(l=>we(a.identifier,l))?r.push(a):s.push(a);return r.length&&this._onRemoveExtensions.fire({extensions:r,profileLocation:n}),s}),r.length&&this._onDidRemoveExtensions.fire({extensions:r,profileLocation:n})}catch(i){throw r.length&&this._onDidRemoveExtensions.fire({extensions:r,error:i,profileLocation:n}),i}}async withProfileExtensions(e,n,r){return this.getResourceAccessQueue(e).queue(async()=>{let i=[],s;try{let a=await this.fileService.readFile(e);s=JSON.parse(a.value.toString().trim()||"[]")}catch(a){if(kt(a)!==1)throw a;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(s=await this.migrateFromOldDefaultProfileExtensionsLocation()),!s&&r?.bailOutWhenFileNotFound)throw new Sl(fe(a),"ERROR_PROFILE_NOT_FOUND")}if(s){Array.isArray(s)||this.throwInvalidConentError(e);let a=!1;for(let l of s){B_(l)||this.throwInvalidConentError(e);let c;if(ne(l.relativeLocation)&&l.relativeLocation)c=this.resolveExtensionLocation(l.relativeLocation);else if(ne(l.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${l.location}`);continue}else{c=I.revive(l.location);let p=this.toRelativePath(c);p&&(a=!0,l.relativeLocation=p)}Xn(l.metadata?.hasPreReleaseVersion)&&l.metadata?.preRelease&&(a=!0,l.metadata.hasPreReleaseVersion=!0);let u=l.metadata?.id??l.identifier.uuid;i.push({identifier:u?{id:l.identifier.id,uuid:u}:{id:l.identifier.id},location:c,version:l.version,metadata:l.metadata})}a&&await this.fileService.writeFile(e,A.fromString(JSON.stringify(s)))}if(n){i=n(i);let a=i.map(l=>({identifier:l.identifier,version:l.version,location:l.location.toJSON(),relativeLocation:this.toRelativePath(l.location),metadata:l.metadata}));await this.fileService.writeFile(e,A.fromString(JSON.stringify(a)))}return i})}throwInvalidConentError(e){throw new Sl(`Invalid extensions content in ${e.toString()}`,"ERROR_INVALID_CONTENT")}toRelativePath(e){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(e),this.extensionsLocation)?this.uriIdentityService.extUri.basename(e):void 0}resolveExtensionLocation(e){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,e)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{let e=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),n=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions"),r;try{r=(await this.fileService.readFile(e)).value.toString()}catch(s){if(kt(s)===1)return;throw s}this.logService.info("Migrating extensions from old default profile location",e.toString());let i;try{let s=JSON.parse(r);Array.isArray(s)&&s.every(a=>B_(a))?i=s:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",s)}catch(s){this.logService.error(s)}if(i)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,A.fromString(JSON.stringify(i)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",e.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(s){if(kt(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){kt(s)!==1&&this.logService.error(s)}try{await this.fileService.del(n)}catch(s){kt(s)!==1&&this.logService.error(s)}return i})()),this._migrationPromise}getResourceAccessQueue(e){let n=this.resourcesAccessQueueMap.get(e);return n||(n=new co,this.resourcesAccessQueueMap.set(e,n)),n}};hd=E([b(1,Oe),b(2,an),b(3,ot),b(4,Q)],hd)});function Pv(o){switch(o){case 1:return d(77,null);case 2:return d(76,null);case 3:return d(78,null);case 4:return d(79,null);case 5:return d(73,null);case 6:return d(74,null);case 7:return d(71,null);case 8:return d(72,null);case 9:return d(75,null);default:return""}}var H_=y(()=>{pe();Ii()});function $_(o,t,e,n){try{d9(o,t,e,n)}catch(r){o.error(r?.message??r)}return t}function d9(o,t,e,n){let r=(i,s,a)=>{let l=i[s];if(ne(l)){let c=l,u=c.length;if(u>1&&c[0]==="%"&&c[u-1]==="%"){let p=c.substr(1,u-2),m=e[p];m===void 0&&n&&(m=n[p]);let g=typeof m=="string"?m:m?.message,h=n?.[p],v=typeof h=="string"?h:h?.message;if(!g){v||o.warn(`[${t.name}]: ${d(792,null,p)}`);return}if(a&&(s==="title"||s==="category")&&v&&v!==g){let x={value:g,original:v};i[s]=x}else i[s]=g}}else if(Ue(l))for(let c in l)l.hasOwnProperty(c)&&(c==="commands"?r(l,c,!0):r(l,c,a));else if(Array.isArray(l))for(let c=0;c<l.length;c++)r(l,c,a)};for(let i in t)t.hasOwnProperty(i)&&r(t,i)}var z_=y(()=>{Me();pe()});function q_(o,t){let e=new Set;for(let n of o.builtInExtensionsEnabledWithAutoUpdates){let r=n.toLowerCase();t.skipBuiltinExtensions?.some(i=>i.toLowerCase()===r)||e.add(r)}return e}function vm(o,t){let e=nd(o.manifest.publisher,o.manifest.name);return{id:e,identifier:new un(e),isBuiltin:o.type===0,isUserBuiltin:o.type===1&&o.isBuiltin,isUnderDevelopment:t,extensionLocation:o.location,uuid:o.identifier.uuid,targetPlatform:o.targetPlatform,publisherDisplayName:o.publisherDisplayName,preRelease:o.preRelease,...o.manifest}}var G_,ls,vd,wl,yd,bd,Id=y(()=>{At();ze();on();et();Se();Ii();H_();q();$e();Le();me();Nt();ta();as();ce();pe();vn();No();_n();mm();nt();re();Fe();yn();de();rd();El();zr();br();z_();(t=>{function o(e,n){if(e===n)return!0;let r=Object.keys(e),i=new Set;for(let s of Object.keys(n))i.add(s);if(r.length!==i.size)return!1;for(let s of r){if(e[s]!==n[s])return!1;i.delete(s)}return i.size===0}t.equals=o})(G_||={});ls=_("IExtensionsScannerService"),vd=class extends D{constructor(e,n,r,i,s,a,l,c,u,p,m,g){super();this.systemExtensionsLocation=e;this.userExtensionsLocation=n;this.extensionsControlLocation=r;this.userDataProfilesService=s;this.extensionsProfileScannerService=a;this.fileService=l;this.logService=c;this.environmentService=u;this.productService=p;this.uriIdentityService=m;this.instantiationService=g;this._onDidChangeCache=this._register(new P);this.onDidChangeCache=this._onDidChangeCache.event;this.initializeDefaultProfileExtensionsPromise=void 0;this.systemExtensionsCachedScanner=this._register(this.instantiationService.createInstance(bd,i)),this.userExtensionsCachedScanner=this._register(this.instantiationService.createInstance(bd,i)),this.extensionsScanner=this._register(this.instantiationService.createInstance(yd)),this._register(this.systemExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(0))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(1)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=cv(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,n){let[r,i]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(n)]);return this.dedupExtensions(r,i,[],await this.getTargetPlatform(),!0)}async scanSystemExtensions(e){let n=[];n.push(this.scanDefaultSystemExtensions(e.language)),n.push(this.scanDevSystemExtensions(e.language,!!e.checkControlFile));let[r,i]=await Promise.all(n),s=[...r,...i];if(this.environmentService.skipBuiltinExtensions?.length){let a=new Set(this.environmentService.skipBuiltinExtensions.map(l=>l.toLowerCase()));s=s.filter(l=>!a.has(l.identifier.id.toLowerCase()))}return this.applyScanOptions(s,0,{pickLatest:!1})}async scanUserExtensions(e){this.logService.trace("Started scanning user extensions",e.profileLocation);let n=this.uriIdentityService.extUri.isEqual(e.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,r=await this.createExtensionScannerInput(e.profileLocation,!0,1,e.language,!0,n,e.productVersion??this.getProductVersion()),i=e.useCache&&!r.devMode?this.userExtensionsCachedScanner:this.extensionsScanner,s;try{s=await i.scanExtensions(r)}catch(a){if(a instanceof Sl&&a.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions(),s=await i.scanExtensions(r);else throw a}return s=await this.applyScanOptions(s,1,{includeInvalid:e.includeInvalid,pickLatest:!0}),this.logService.trace("Scanned user extensions:",s.length),s}async scanAllUserExtensions(e={includeInvalid:!0,includeAllVersions:!0}){let n=await this.createExtensionScannerInput(this.userExtensionsLocation,!1,1,void 0,!0,void 0,this.getProductVersion()),r=await this.extensionsScanner.scanExtensions(n);return this.applyScanOptions(r,1,{includeAllVersions:e.includeAllVersions,includeInvalid:e.includeInvalid})}async scanExtensionsUnderDevelopment(e,n){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){let r=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(i=>i.scheme===z.file).map(async i=>{let s=await this.createExtensionScannerInput(i,!1,1,n.language,!1,void 0,this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(s)).map(l=>(l.type=e.find(c=>we(c.identifier,l.identifier))?.type??l.type,this.extensionsScanner.validate(l,s)))}))).flat();return this.applyScanOptions(r,"development",{includeInvalid:n.includeInvalid,pickLatest:!0})}return[]}async scanExistingExtension(e,n,r){let i=await this.createExtensionScannerInput(e,!1,n,r.language,!0,void 0,this.getProductVersion()),s=await this.extensionsScanner.scanExtension(i);return!s||!r.includeInvalid&&!s.isValid?null:s}async scanOneOrMultipleExtensions(e,n,r){let i=await this.createExtensionScannerInput(e,!1,n,r.language,!0,void 0,this.getProductVersion()),s=await this.extensionsScanner.scanOneOrMultipleExtensions(i);return this.applyScanOptions(s,n,{includeInvalid:r.includeInvalid,pickLatest:!0})}async scanMultipleExtensions(e,n,r){let i=[];return await Promise.all(e.map(async s=>{let a=await this.scanOneOrMultipleExtensions(s,n,r);i.push(...a)})),this.applyScanOptions(i,n,{includeInvalid:r.includeInvalid,pickLatest:!0})}async updateManifestMetadata(e,n){let r=ye(e,"package.json"),i=(await this.fileService.readFile(r)).value.toString(),s=JSON.parse(i);s.__metadata={...s.__metadata,...n},await this.fileService.writeFile(ye(e,"package.json"),A.fromString(JSON.stringify(s,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Sl&&e.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions();else throw e}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());let e=await this.scanAllUserExtensions({includeInvalid:!0});if(e.length)await this.extensionsProfileScannerService.addExtensionsToProfile(e.map(n=>[n,n.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,A.fromString(JSON.stringify([])))}catch(n){kt(n)!==1&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),fe(n))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.logService.error(e)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(e,n,r={}){return r.includeAllVersions||(e=this.dedupExtensions(n===0?e:void 0,n===1?e:void 0,n==="development"?e:void 0,await this.getTargetPlatform(),!!r.pickLatest)),r.includeInvalid||(e=e.filter(i=>i.isValid)),e.sort((i,s)=>{let a=at(i.location.fsPath),l=at(s.location.fsPath);return a<l?-1:a>l?1:0})}dedupExtensions(e,n,r,i,s){let a=(u,p,m)=>{if(!m&&!(u.isBuiltin||p.isBuiltin)){if(u.metadata?.isApplicationScoped&&!p.metadata?.isApplicationScoped)return!1;if(!u.metadata?.isApplicationScoped&&p.metadata?.isApplicationScoped)return!0}if(u.isValid&&!p.isValid)return!1;if(u.isValid===p.isValid){if(s&&Ti(u.manifest.version,p.manifest.version))return this.logService.debug(`Skipping extension ${p.location.path} with lower version ${p.manifest.version} in favour of ${u.location.path} with version ${u.manifest.version}`),!1;if($0(u.manifest.version,p.manifest.version)){if(u.type===0)return this.logService.debug(`Skipping extension ${p.location.path} in favour of system extension ${u.location.path} with same version`),!1;if(u.targetPlatform===i)return this.logService.debug(`Skipping extension ${p.location.path} from different target platform ${p.targetPlatform}`),!1}}return m?this.logService.warn(`Overwriting user extension ${u.location.path} with ${p.location.path}.`):this.logService.debug(`Overwriting user extension ${u.location.path} with ${p.location.path}.`),!0},l=new gl;e?.forEach(u=>{let p=l.get(u.identifier.id);(!p||a(p,u,!1))&&l.set(u.identifier.id,u)});let c=q_(this.productService,this.environmentService);return n?.forEach(u=>{let p=l.get(u.identifier.id);if(!p&&e&&u.type===0){this.logService.debug(`Skipping obsolete system extension ${u.location.path}.`);return}if(c.has(u.identifier.id.toLowerCase())&&!u.forceAutoUpdate){this.logService.info(`Skipping user installed builtin extension ${u.identifier.id} with version ${u.manifest.version} because it is not allowed to in the current product quality ${this.productService.quality}`);return}(!p||a(p,u,!1))&&l.set(u.identifier.id,u)}),r?.forEach(u=>{let p=l.get(u.identifier.id);(!p||a(p,u,!0))&&l.set(u.identifier.id,u),l.set(u.identifier.id,u)}),[...l.values()]}async scanDefaultSystemExtensions(e){this.logService.trace("Started scanning system extensions");let n=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,0,e,!0,void 0,this.getProductVersion()),i=await(n.devMode?this.extensionsScanner:this.systemExtensionsCachedScanner).scanExtensions(n);return this.logService.trace("Scanned system extensions:",i.length),i}async scanDevSystemExtensions(e,n){let r=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!r?.length)return[];this.logService.trace("Started scanning dev system extensions");let i=n?await this.getBuiltInExtensionControl():{},s=[],a=I.file(In(H(yt.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(let c of r){let u=i[c.name]||"marketplace";switch(u){case"disabled":break;case"marketplace":s.push(ye(a,c.name));break;default:s.push(I.file(u));break}}let l=await Promise.all(s.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",l.length),Qn(l)}async getBuiltInExtensionControl(){try{let e=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(e.value.toString())}catch{return{}}}async createExtensionScannerInput(e,n,r,i,s,a,l){let c=await this.getTranslations(i??Cn),u=await this.getMtime(e),p=n&&!this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,m=p?await this.getMtime(p):void 0;return new wl(e,u,p,m,n,a,r,s,l.version,l.date,this.productService.commit,!this.environmentService.isBuilt,i,c)}async getMtime(e){try{let n=await this.fileService.stat(e);if(typeof n.mtime=="number")return n.mtime}catch{}}getProductVersion(){return{version:this.productService.version,date:this.productService.date}}};vd=E([b(4,an),b(5,Gr),b(6,Oe),b(7,Q),b(8,It),b(9,Ve),b(10,ot),b(11,gr)],vd);wl=class{constructor(t,e,n,r,i,s,a,l,c,u,p,m,g,h){this.location=t;this.mtime=e;this.applicationExtensionslocation=n;this.applicationExtensionslocationMtime=r;this.profile=i;this.profileScanOptions=s;this.type=a;this.validate=l;this.productVersion=c;this.productDate=u;this.productCommit=p;this.devMode=m;this.language=g;this.translations=h}static createNlsConfiguration(t){return{language:t.language,pseudo:t.language==="pseudo",devMode:t.devMode,translations:t.translations}}static equals(t,e){return bi(t.location,e.location)&&t.mtime===e.mtime&&bi(t.applicationExtensionslocation,e.applicationExtensionslocation)&&t.applicationExtensionslocationMtime===e.applicationExtensionslocationMtime&&t.profile===e.profile&&Ut(t.profileScanOptions,e.profileScanOptions)&&t.type===e.type&&t.validate===e.validate&&t.productVersion===e.productVersion&&t.productDate===e.productDate&&t.productCommit===e.productCommit&&t.devMode===e.devMode&&t.language===e.language&&G_.equals(t.translations,e.translations)}},yd=class extends D{constructor(e,n,r,i,s,a){super();this.extensionsProfileScannerService=e;this.uriIdentityService=n;this.fileService=r;this.environmentService=s;this.logService=a;this.extensionsEnabledWithApiProposalVersion=i.extensionsEnabledWithApiProposalVersion?.map(l=>l.toLowerCase())??[],this.productQuality=i.quality,this.productBuiltInExtensionsEnabledWithAutoUpdates=q_(i,s)}async scanExtensions(e){return e.profile?this.scanExtensionsFromProfile(e):this.scanExtensionsFromLocation(e)}async scanExtensionsFromLocation(e){let n=await this.fileService.resolve(e.location);if(!n.children?.length)return[];let r=await Promise.all(n.children.map(async i=>{if(!i.isDirectory||e.type===1&&Zn(i.resource).indexOf(".")===0)return null;let s=new wl(i.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(s)}));return Qn(r).sort((i,s)=>i.location.path<s.location.path?-1:1)}async scanExtensionsFromProfile(e){let n=await this.scanExtensionsFromProfileResource(e.location,()=>!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){n=n.filter(i=>!i.metadata?.isApplicationScoped);let r=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,i=>!!i.metadata?.isBuiltin||!!i.metadata?.isApplicationScoped,e);n.push(...r)}return n}async scanExtensionsFromProfileResource(e,n,r){let i=await this.extensionsProfileScannerService.scanProfileExtensions(e,r.profileScanOptions);if(!i.length)return[];let s=await Promise.all(i.map(async a=>{if(n(a)){let l=new wl(a.location,r.mtime,r.applicationExtensionslocation,r.applicationExtensionslocationMtime,r.profile,r.profileScanOptions,r.type,r.validate,r.productVersion,r.productDate,r.productCommit,r.devMode,r.language,r.translations);return this.scanExtension(l,a)}return null}));return Qn(s)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(ye(e.location,"package.json"))){let n=await this.scanExtension(e);return n?[n]:[]}else return await this.scanExtensions(e)}catch(n){return this.logService.error(`Error scanning extensions at ${e.location.path}:`,fe(n)),[]}}async scanExtension(e,n){let r=[],i=!0,s;try{s=await this.scanExtensionManifest(e.location)}catch(g){if(n){r.push([Ae.Error,fe(g)]),i=!1;let[h,v]=n.identifier.id.split(".");s={name:v,publisher:h,version:n.version,engines:{vscode:""}}}else return e.type!==0&&this.logService.error(g),null}s.publisher||(s.publisher=tv);let a;n?a={...n.metadata,size:s.__metadata?.size}:s.__metadata&&(a={installedTimestamp:s.__metadata.installedTimestamp,size:s.__metadata.size,targetPlatform:s.__metadata.targetPlatform}),delete s.__metadata;let l=or(s.publisher,s.name),c=a?.id?{id:l,uuid:a.id}:{id:l},u=a?.isSystem?0:e.type,p=u===0||!!a?.isBuiltin;try{s=await this.translateManifest(e.location,s,wl.createNlsConfiguration(e))}catch(g){this.logService.warn("Failed to translate manifest",fe(g))}let m={type:u,identifier:c,manifest:s,location:e.location,isBuiltin:p,targetPlatform:a?.targetPlatform??"undefined",publisherDisplayName:a?.publisherDisplayName,metadata:a,isValid:i,validations:r,preRelease:!!a?.preRelease,forceAutoUpdate:this.productBuiltInExtensionsEnabledWithAutoUpdates.has(l.toLowerCase())&&this.productQuality==="stable"};return e.validate&&(m=this.validate(m,e)),s.enabledApiProposals&&(!this.environmentService.isBuilt||this.extensionsEnabledWithApiProposalVersion.includes(l.toLowerCase()))&&(s.originalEnabledApiProposals=s.enabledApiProposals,s.enabledApiProposals=L0([...s.enabledApiProposals])),m}validate(e,n){let r=e.isValid,i=this.environmentService.isBuilt&&this.extensionsEnabledWithApiProposalVersion.includes(e.identifier.id.toLowerCase()),s=Q0(n.productVersion,n.productDate,n.location,e.manifest,e.isBuiltin,i);for(let[a,l]of s)a===Ae.Error&&(r=!1,this.logService.error(this.formatMessage(n.location,l)));return e.isValid=r,e.validations=[...e.validations,...s],e}async scanExtensionManifest(e){let n=ye(e,"package.json"),r;try{r=(await this.fileService.readFile(n)).value.toString()}catch(s){throw kt(s)!==1&&this.logService.error(this.formatMessage(e,d(793,null,n.path,s.message))),s}let i;try{i=JSON.parse(r)}catch(s){let a=[];Lo(r,a);for(let l of a)this.logService.error(this.formatMessage(e,d(795,null,n.path,l.offset,l.length,Pv(l.error))));throw s}if(Qs(i)!=="object"){let s=this.formatMessage(e,d(796,null,n.path));throw this.logService.error(s),new Error(s)}return i}async translateManifest(e,n,r){let i=await this.getLocalizedMessages(e,n,r);if(i)try{let s=[],a=await this.resolveOriginalMessageBundle(i.default,s);if(s.length>0)return s.forEach(c=>{this.logService.error(this.formatMessage(e,d(797,null,i.default?.path,Pv(c.error))))}),n;if(Qs(i)!=="object")return this.logService.error(this.formatMessage(e,d(794,null,i.default?.path))),n;let l=i.values||Object.create(null);return $_(this.logService,n,l,a)}catch{}return n}async getLocalizedMessages(e,n,r){let i=ye(e,"package.nls.json"),s=(u,p)=>{p.forEach(m=>{this.logService.error(this.formatMessage(e,d(797,null,u?.path,Pv(m.error))))})},a=u=>{this.logService.error(this.formatMessage(e,d(794,null,u?.path)))},l=`${n.publisher}.${n.name}`,c=r.translations[l];if(c)try{let u=I.file(c),p=(await this.fileService.readFile(u)).value.toString(),m=[],g=Lo(p,m);return m.length>0?(s(u,m),{values:void 0,default:i}):Qs(g)!=="object"?(a(u),{values:void 0,default:i}):{values:g.contents?g.contents.package:void 0,default:i}}catch{return{values:void 0,default:i}}else{if(!await this.fileService.exists(i))return;let p;try{p=await this.findMessageBundles(e,r)}catch{return}if(!p.localized)return{values:void 0,default:p.original};try{let m=(await this.fileService.readFile(p.localized)).value.toString(),g=[],h=Lo(m,g);return g.length>0?(s(p.localized,g),{values:void 0,default:p.original}):Qs(h)!=="object"?(a(p.localized),{values:void 0,default:p.original}):{values:h,default:p.original}}catch{return{values:void 0,default:p.original}}}}async resolveOriginalMessageBundle(e,n){if(e)try{let r=(await this.fileService.readFile(e)).value.toString();return Lo(r,n)}catch{}}findMessageBundles(e,n){return new Promise((r,i)=>{let s=a=>{let l=ye(e,`package.nls.${a}.json`);this.fileService.exists(l).then(c=>{c&&r({localized:l,original:ye(e,"package.nls.json")});let u=a.lastIndexOf("-");u===-1?r({localized:ye(e,"package.nls.json"),original:null}):(a=a.substring(0,u),s(a))})};if(n.devMode||n.pseudo||!n.language)return r({localized:ye(e,"package.nls.json"),original:null});s(n.language)})}formatMessage(e,n){return`[${e.path}]: ${n}`}};yd=E([b(0,Gr),b(1,ot),b(2,Oe),b(3,Ve),b(4,It),b(5,Q)],yd);bd=class extends yd{constructor(e,n,r,i,s,a,l,c){super(r,i,s,a,l,c);this.currentProfile=e;this.userDataProfilesService=n;this.cacheValidatorThrottler=this._register(new kr(3e3));this._onDidChangeCache=this._register(new P);this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(e){let n=this.getCacheFile(e),r=await this.readExtensionCache(n);if(this.input=e,r&&r.input&&wl.equals(r.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()),r.result.map(s=>(s.location=I.revive(s.location),s));let i=await super.scanExtensions(e);return await this.writeExtensionCache(n,{input:e,result:i}),i}async readExtensionCache(e){try{let n=await this.fileService.readFile(e),r=JSON.parse(n.value.toString());return{result:r.result,input:ir(r.input)}}catch(n){kt(n)!==1&&this.logService.debug("Error while reading the extension cache file:",e.path,fe(n))}return null}async writeExtensionCache(e,n){try{await this.fileService.writeFile(e,A.fromString(JSON.stringify(n)))}catch(r){this.logService.debug("Error while writing the extension cache file:",e.path,fe(r))}}async validateCache(){if(!this.input)return;let e=this.getCacheFile(this.input),n=await this.readExtensionCache(e);if(!n)return;let r=n.result,i=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Ut(i,r))try{this.logService.info("Invalidating Cache",r,i),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(s){this.logService.error(s)}}getCacheFile(e){let n=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(n.cacheHome,e.type===0?D0:ev)}getProfile(e){return e.type===0?this.userDataProfilesService.defaultProfile:e.profile?this.uriIdentityService.extUri.isEqual(e.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(n=>this.uriIdentityService.extUri.isEqual(e.location,n.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};bd=E([b(1,an),b(2,Gr),b(3,ot),b(4,Oe),b(5,Ve),b(6,It),b(7,Q)],bd)});function ym(o){let t="Extract";return o instanceof Il&&(o.type==="CorruptZip"?t="CorruptZip":o.type==="Incomplete"&&(t="IncompleteZip")),Xt(o,t)}async function kv(o){let t;try{t=await xv(o,"extension/package.json")}catch(e){throw ym(e)}try{return JSON.parse(t.toString("utf8"))}catch{throw new Et(d(808,null),"Invalid")}}var VE=y(()=>{Sv();pe();hm();rr()});var xd,ia,Rv=y(()=>{Se();Me();re();Fe();nr();rr();xd=_("IExtensionSignatureVerificationService"),ia=class{constructor(t,e){this.logService=t;this.telemetryService=e}vsceSign(){return this.moduleLoadingPromise||(this.moduleLoadingPromise=this.resolveVsceSign()),this.moduleLoadingPromise}async resolveVsceSign(){return import("@vscode/vsce-sign")}async verify(t,e,n,r,i){let s;try{s=await this.vsceSign()}catch(u){this.logService.error("Could not load vsce-sign module",fe(u)),this.logService.info(`Extension signature verification is not done: ${t}`);return}let a=new Date().getTime(),l;try{this.logService.trace(`Verifying extension signature for ${t}...`),l=await s.verify(n,r,this.logService.getLevel()===1)}catch(u){l={code:"UnknownError",didExecute:!1,output:fe(u)}}let c=new Date().getTime()-a;return this.logService.info(`Extension signature verification result for ${t}: ${l.code}. ${io(l.internalCode)?`Internal Code: ${l.internalCode}. `:""}Executed: ${l.didExecute}. Duration: ${c}ms.`),this.logService.trace(`Extension signature verification output for ${t}:
- ${l.output}`),this.telemetryService.publicLog2("extensionsignature:verification",{extensionId:t,extensionVersion:e,code:l.code,internalCode:l.internalCode,duration:c,didExecute:l.didExecute,clientTargetPlatform:i}),{code:l.code}}};ia=E([b(0,Q),b(1,Ft)],ia)});var cs,K_=y(()=>{ze();Se();q();$e();Nt();ta();sn();fr();Sv();vn();hm();rr();No();VE();Rv();nt();Fe();nr();br();cs=class extends D{constructor(e,n,r,i,s,a,l){super();this.fileService=n;this.extensionGalleryService=r;this.extensionSignatureVerificationService=i;this.telemetryService=s;this.uriIdentityService=a;this.logService=l;this.extensionsDownloadDir=e.extensionsDownloadLocation,this.extensionsTrashDir=a.extUri.joinPath(e.extensionsDownloadLocation,".trash"),this.cache=20,this.cleanUpPromise=this.cleanUp()}static{this.SignatureArchiveExtension=".sigzip"}async download(e,n,r,i){await this.cleanUpPromise;let s=await this.downloadVSIX(e,n);if(!r)return{location:s,verificationStatus:void 0};if(!e.isSigned)return{location:s,verificationStatus:"NotSigned"};let a;try{a=await this.downloadSignatureArchive(e);let l=(await this.extensionSignatureVerificationService.verify(e.identifier.id,e.version,s.fsPath,a.fsPath,i))?.code;if(l==="PackageIsInvalidZip"||l==="SignatureArchiveIsInvalidZip"){try{await this.delete(s)}catch(c){this.logService.error(c)}throw new Et(PE,"CorruptZip")}return{location:s,verificationStatus:l}}catch(l){try{await this.delete(s)}catch(c){this.logService.error(c)}throw l}finally{if(a)try{await this.delete(a)}catch(l){this.logService.error(l)}}}async downloadVSIX(e,n){try{let r=ye(this.extensionsDownloadDir,this.getName(e)),i=await this.doDownload(e,"vsix",async()=>{await this.downloadFile(e,r,s=>this.extensionGalleryService.download(e,s,n));try{await this.validate(r.fsPath,"extension/package.json")}catch(s){try{await this.fileService.del(r)}catch(a){this.logService.warn(`Error while deleting: ${r.path}`,fe(a))}throw s}},2);return i>1&&this.telemetryService.publicLog2("extensiongallery:downloadvsix:retry",{extensionId:e.identifier.id,attempts:i}),r}catch(r){throw Xt(r,"Download")}}async downloadSignatureArchive(e){try{let n=ye(this.extensionsDownloadDir,`${this.getName(e)}${cs.SignatureArchiveExtension}`),r=await this.doDownload(e,"sigzip",async()=>{await this.extensionGalleryService.downloadSignatureArchive(e,n);try{await this.validate(n.fsPath,".signature.p7s")}catch(i){try{await this.fileService.del(n)}catch(s){this.logService.warn(`Error while deleting: ${n.path}`,fe(s))}throw i}},2);return r>1&&this.telemetryService.publicLog2("extensiongallery:downloadsigzip:retry",{extensionId:e.identifier.id,attempts:r}),n}catch(n){throw Xt(n,"DownloadSignature")}}async downloadFile(e,n,r){if(await this.fileService.exists(n))return;if(n.scheme!==z.file){await r(n);return}let i=ye(this.extensionsDownloadDir,`.${Ce()}`);try{await r(i)}catch(s){try{await this.fileService.del(i)}catch{}throw s}try{await Te.rename(i.fsPath,n.fsPath,120*1e3)}catch(s){try{await this.fileService.del(i)}catch{}let a=!1;try{a=await this.fileService.exists(n)}catch{}if(a)this.logService.info("Rename failed because the file was downloaded by another source. So ignoring renaming.",e.identifier.id,n.path);else throw this.logService.info(`Rename failed because of ${fe(s)}. Deleted the file from downloaded location`,i.path),s}}async doDownload(e,n,r,i){let s=1;for(;;)try{return await r(),s}catch(a){if(s++>i)throw a;this.logService.warn(`Failed downloading ${n}. ${fe(a)}. Retry again...`,e.identifier.id)}}async validate(e,n){try{await xv(e,n)}catch(r){throw ym(r)}}async delete(e){await this.cleanUpPromise;let n=this.uriIdentityService.extUri.relativePath(this.extensionsDownloadDir,e);n?await this.fileService.move(e,this.uriIdentityService.extUri.joinPath(this.extensionsTrashDir,n),!0):await this.fileService.del(e)}async cleanUp(){try{if(!await this.fileService.exists(this.extensionsDownloadDir)){this.logService.trace("Extension VSIX downloads cache dir does not exist");return}try{await this.fileService.del(this.extensionsTrashDir,{recursive:!0})}catch(n){kt(n)!==1&&this.logService.error(n)}let e=await this.fileService.resolve(this.extensionsDownloadDir,{resolveMetadata:!0});if(e.children){let n=[],r=[],i=[];for(let l of e.children)if(l.name.endsWith(cs.SignatureArchiveExtension))i.push(l.resource);else{let c=Ln.parse(l.name);c&&r.push([c,l])}let s=lv(r,([l])=>l),a=[];for(let l of s)l.sort((c,u)=>av(c[0].version,u[0].version)),n.push(...l.slice(1).map(c=>c[1].resource)),a.push(l[0][1]);a.sort((l,c)=>l.mtime-c.mtime),n.push(...a.slice(0,Math.max(0,a.length-this.cache)).map(l=>l.resource)),n.push(...i),await rn.settled(n.map(l=>(this.logService.trace("Deleting from cache",l.path),this.fileService.del(l))))}}catch(e){this.logService.error(e)}}getName(e){return Ln.create(e).toString().toLowerCase()}};cs=E([b(0,Dn),b(1,Oe),b(2,$n),b(3,xd),b(4,Ft),b(5,ot),b(6,Q)],cs)});import{fork as u9}from"child_process";var Sd,j_=y(()=>{ze();rl();de();q();$e();Le();fr();Fe();zr();Sd=class extends D{constructor(e,n){super();this.userDataProfilesService=e;this.logService=n;this.processesLimiter=new Sp(5)}async postUninstall(e){let n=this.parseScript(e,"uninstall");n&&(this.logService.info(e.identifier.id,e.manifest.version,"Running post uninstall script"),await this.processesLimiter.queue(async()=>{try{await this.runLifecycleHook(n.script,"uninstall",n.args,!0,e),this.logService.info("Finished running post uninstall script",e.identifier.id,e.manifest.version)}catch(r){this.logService.error("Failed to run post uninstall script",e.identifier.id,e.manifest.version),this.logService.error(r)}}));try{await Te.rm(this.getExtensionStoragePath(e))}catch(r){this.logService.error("Error while removing extension storage path",e.identifier.id),this.logService.error(r)}}parseScript(e,n){let r=`vscode:${n}`;if(e.location.scheme===z.file&&e.manifest&&e.manifest.scripts&&typeof e.manifest.scripts[r]=="string"){let i=e.manifest.scripts[r].split(" ");return i.length<2||i[0]!=="node"||!i[1]?(this.logService.warn(e.identifier.id,e.manifest.version,`${r} should be a node script`),null):{script:H(e.location.fsPath,i[1]),args:i.slice(2)||[]}}return null}runLifecycleHook(e,n,r,i,s){return new Promise((a,l)=>{let c=this.start(e,n,r,s),u,p=m=>{u&&(clearTimeout(u),u=null),m?l(m):a(void 0)};c.on("error",m=>{p(Do(m)||"Unknown")}),c.on("exit",(m,g)=>{p(m?`post-${n} process exited with code ${m}`:void 0)}),i&&(u=setTimeout(()=>{u=null,c.kill(),l("timed out")},5e3))})}start(e,n,r,i){let s={silent:!0,execArgv:void 0},a=u9(e,[`--type=extension-post-${n}`,...r],s);a.stdout.setEncoding("utf8"),a.stderr.setEncoding("utf8");let l=F.fromNodeEventEmitter(a.stdout,"data"),c=F.fromNodeEventEmitter(a.stderr,"data");this._register(l(m=>this.logService.info(i.identifier.id,i.manifest.version,`post-${n}`,m))),this._register(c(m=>this.logService.error(i.identifier.id,i.manifest.version,`post-${n}`,m)));let u=F.any(F.map(l,m=>({data:`%c${m}`,format:[""]}),this._store),F.map(c,m=>({data:`%c${m}`,format:["color: red"]}),this._store));return F.debounce(u,(m,g)=>m?{data:m.data+g.data,format:[...m.format,...g.format]}:{data:g.data,format:g.format},100,void 0,void 0,void 0,this._store)(m=>{console.group(i.identifier.id),console.log(m.data,...m.format),console.groupEnd()}),a}getExtensionStoragePath(e){return H(this.userDataProfilesService.defaultProfile.globalStorageHome.fsPath,e.identifier.id.toLowerCase())}};Sd=E([b(0,an),b(1,Q)],Sd)});var Dv,Q_=y(()=>{q();_n();nt();Dv=class extends D{constructor(e,n,r,i,s){super();this.userDataProfilesService=e;this.fileService=n;this.uriIdentityService=r;this.logService=s;this._register(i.onDidInstallExtensions(a=>this.onDidInstallExtensions(a))),this._register(i.onDidUninstallExtension(a=>this.onDidUnInstallExtension(a)))}onDidInstallExtensions(e){for(let n of e)n.local&&this.invalidate(n.profileLocation)}onDidUnInstallExtension(e){e.error||this.invalidate(e.profileLocation)}async invalidate(e){if(e)for(let n of this.userDataProfilesService.profiles)this.uriIdentityService.extUri.isEqual(n.extensionsResource,e)&&await this.deleteUserCacheFile(n);else await this.deleteUserCacheFile(this.userDataProfilesService.defaultProfile)}async deleteUserCacheFile(e){try{await this.fileService.del(this.uriIdentityService.extUri.joinPath(e.cacheHome,ev))}catch(n){kt(n)!==1&&this.logService.error(n)}}}});var _v,J_=y(()=>{Se();de();q();Hn();No();_n();nt();_v=class extends D{constructor(e,n,r,i,s,a,l){super();this.extensionManagementService=e;this.extensionsScannerService=n;this.userDataProfilesService=r;this.extensionsProfileScannerService=i;this.uriIdentityService=s;this.fileService=a;this.logService=l;this._onDidChangeExtensionsByAnotherSource=this._register(new P);this.onDidChangeExtensionsByAnotherSource=this._onDidChangeExtensionsByAnotherSource.event;this.allExtensions=new Map;this.extensionsProfileWatchDisposables=this._register(new Ur);this.initialize().then(null,c=>l.error("Error while initializing Extensions Watcher",fe(c)))}async initialize(){await this.extensionsScannerService.initializeDefaultProfileExtensions(),await this.onDidChangeProfiles(this.userDataProfilesService.profiles),this.registerListeners(),await this.deleteExtensionsNotInProfiles()}registerListeners(){this._register(this.userDataProfilesService.onDidChangeProfiles(e=>this.onDidChangeProfiles(e.added))),this._register(this.extensionsProfileScannerService.onAddExtensions(e=>this.onAddExtensions(e))),this._register(this.extensionsProfileScannerService.onDidAddExtensions(e=>this.onDidAddExtensions(e))),this._register(this.extensionsProfileScannerService.onRemoveExtensions(e=>this.onRemoveExtensions(e))),this._register(this.extensionsProfileScannerService.onDidRemoveExtensions(e=>this.onDidRemoveExtensions(e))),this._register(this.fileService.onDidFilesChange(e=>this.onDidFilesChange(e)))}async onDidChangeProfiles(e){try{e.length&&await Promise.all(e.map(n=>(this.extensionsProfileWatchDisposables.set(n.id,qg(this.fileService.watch(this.uriIdentityService.extUri.dirname(n.extensionsResource)),this.fileService.watch(n.extensionsResource))),this.populateExtensionsFromProfile(n.extensionsResource))))}catch(n){throw this.logService.error(n),n}}async onAddExtensions(e){for(let n of e.extensions)this.addExtensionWithKey(this.getKey(n.identifier,n.version),e.profileLocation)}async onDidAddExtensions(e){for(let n of e.extensions){let r=this.getKey(n.identifier,n.version);e.error?this.removeExtensionWithKey(r,e.profileLocation):this.addExtensionWithKey(r,e.profileLocation)}}async onRemoveExtensions(e){for(let n of e.extensions)this.removeExtensionWithKey(this.getKey(n.identifier,n.version),e.profileLocation)}async onDidRemoveExtensions(e){let n=[],r=[];for(let i of e.extensions){let s=this.getKey(i.identifier,i.version);e.error?this.addExtensionWithKey(s,e.profileLocation):(this.removeExtensionWithKey(s,e.profileLocation),this.allExtensions.has(s)||(this.logService.debug("Extension is removed from all profiles",i.identifier.id,i.version),r.push(this.extensionManagementService.scanInstalledExtensionAtLocation(i.location).then(a=>{a?n.push(a):this.logService.info("Extension not found at the location",i.location.toString())},a=>this.logService.error(a)))))}try{await Promise.all(r),n.length&&await this.deleteExtensionsNotInProfiles(n)}catch(i){this.logService.error(i)}}onDidFilesChange(e){for(let n of this.userDataProfilesService.profiles)e.contains(n.extensionsResource,0,1)&&this.onDidExtensionsProfileChange(n.extensionsResource)}async onDidExtensionsProfileChange(e){let n=[],r=[],i=await this.extensionsProfileScannerService.scanProfileExtensions(e),s=new Set,a=new Set;for(let[l,c]of this.allExtensions)c.has(e)&&a.add(l);for(let l of i){let c=this.getKey(l.identifier,l.version);s.add(c),a.has(c)||(n.push(l.identifier),this.addExtensionWithKey(c,e))}for(let l of a)if(!s.has(l)){let c=this.fromKey(l);c&&(r.push(c.identifier),this.removeExtensionWithKey(l,e))}(n.length||r.length)&&this._onDidChangeExtensionsByAnotherSource.fire({added:n.length?{extensions:n,profileLocation:e}:void 0,removed:r.length?{extensions:r,profileLocation:e}:void 0})}async populateExtensionsFromProfile(e){let n=await this.extensionsProfileScannerService.scanProfileExtensions(e);for(let r of n)this.addExtensionWithKey(this.getKey(r.identifier,r.version),e)}async deleteExtensionsNotInProfiles(e){e||(e=(await this.extensionManagementService.scanAllUserInstalledExtensions()).filter(r=>!this.allExtensions.has(this.getKey(r.identifier,r.manifest.version)))),e.length&&await this.extensionManagementService.deleteExtensions(...e)}addExtensionWithKey(e,n){let r=this.allExtensions.get(e);r||this.allExtensions.set(e,r=new Ls(i=>this.uriIdentityService.extUri.getComparisonKey(i))),r.add(n)}removeExtensionWithKey(e,n){let r=this.allExtensions.get(e);r&&r.delete(n),r?.size||this.allExtensions.delete(e)}getKey(e,n){return`${un.toKey(e.id)}@${n}`}fromKey(e){let[n,r]=cm(e);return r?{identifier:{id:n},version:r}:void 0}}});import*as X_ from"fs";var Sm,WE,sa,Im,xm,BE,HE=y(()=>{ze();et();Se();de();ol();q();Hn();$e();Le();Nt();ta();Me();ce();sn();fr();Sv();pe();Ev();vn();hm();rr();No();El();Id();K_();j_();VE();Q_();J_();_n();mm();nt();re();Fe();yn();nr();br();zr();xn();yl();Sm=ed,WE=".vsctmp",sa=class extends fd{constructor(e,n,r,i,s,a,l,c,u,p,m,g,h,v,x){super(e,n,v,r,g,h,x);this.environmentService=i;this.extensionsScannerService=s;this.extensionsProfileScannerService=a;this.downloadService=l;this.instantiationService=c;this.fileService=u;this.configurationService=p;this.extensionGalleryManifestService=m;this.extractingGalleryExtensions=new Map;this.knownDirectories=new Ls;let T=this._register(c.createInstance(Sd));this.extensionsScanner=this._register(c.createInstance(Im,k=>T.postUninstall(k))),this.manifestCache=this._register(new Dv(x,u,v,this,this.logService)),this.extensionsDownloader=this._register(c.createInstance(cs));let w=this._register(new _v(this,this.extensionsScannerService,x,a,v,u,r));this._register(w.onDidChangeExtensionsByAnotherSource(k=>this.onDidChangeExtensionsFromAnotherSource(k))),this.watchForExtensionsNotInstalledBySystem()}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=cv(this.fileService,this.logService)),this._targetPlatformPromise}async zip(e){this.logService.trace("ExtensionManagementService#zip",e.identifier.id);let n=await this.collectFiles(e),r=await x_(ye(this.extensionsDownloader.extensionsDownloadDir,Ce()).fsPath,n);return I.file(r)}async getManifest(e){let{location:n,cleanup:r}=await this.downloadVsix(e),i=Bn(n.fsPath);try{return await kv(i)}finally{await r()}}getInstalled(e,n=this.userDataProfilesService.defaultProfile.extensionsResource,r={version:this.productService.version,date:this.productService.date},i){return this.extensionsScanner.scanExtensions(e??null,n,r,i)}scanAllUserInstalledExtensions(){return this.extensionsScanner.scanAllUserExtensions()}scanInstalledExtensionAtLocation(e){return this.extensionsScanner.scanUserExtensionAtLocation(e)}async install(e,n={}){this.logService.trace("ExtensionManagementService#install",e.toString());let{location:r,cleanup:i}=await this.downloadVsix(e);try{let s=await kv(Bn(r.fsPath)),a=or(s.publisher,s.name);if(s.engines&&s.engines.vscode&&!um(s.engines.vscode,this.productService.version,this.productService.date))throw new Error(d(802,null,a,this.productService.version));let l=this.allowedExtensionsService.isAllowed({id:a,version:s.version,publisherDisplayName:void 0});if(l!==!0)throw new Error(d(804,null,l.value));let u=(await this.installExtensions([{manifest:s,extension:r,options:n}])).find(({identifier:p})=>we(p,{id:a}));if(u?.local)return u.local;throw u?.error?u.error:Xt(new Error(`Unknown error while installing extension ${a}`))}finally{await i()}}async installFromLocation(e,n){this.logService.trace("ExtensionManagementService#installFromLocation",e.toString());let r=await this.extensionsScanner.scanUserExtensionAtLocation(e);if(!r||!r.manifest.name||!r.manifest.version)throw new Error(`Cannot find a valid extension from the location ${e.toString()}`);return await this.addExtensionsToProfile([[r,{source:"resource"}]],n),this.logService.info("Successfully installed extension",r.identifier.id,n.toString()),r}async installExtensionsFromProfile(e,n,r){this.logService.trace("ExtensionManagementService#installExtensionsFromProfile",e,n.toString(),r.toString());let i=(await this.getInstalled(1,n)).filter(s=>e.some(a=>we(a,s.identifier)));if(i.length){let s=await Promise.all(i.map(a=>this.extensionsScanner.scanMetadata(a,n)));await this.addExtensionsToProfile(i.map((a,l)=>[a,s[l]]),r),this.logService.info("Successfully installed extensions",i.map(a=>a.identifier.id),r.toString())}return i}async updateMetadata(e,n,r){return this.logService.trace("ExtensionManagementService#updateMetadata",e.identifier.id),n.isPreReleaseVersion&&(n.preRelease=!0,n.hasPreReleaseVersion=!0),n.isMachineScoped===!1&&(n.isMachineScoped=void 0),n.isBuiltin===!1&&(n.isBuiltin=void 0),n.pinned===!1&&(n.pinned=void 0),e=await this.extensionsScanner.updateMetadata(e,n,r),this.manifestCache.invalidate(r),this._onDidUpdateExtensionMetadata.fire({local:e,profileLocation:r}),e}deleteExtension(e){return this.extensionsScanner.deleteExtension(e,"remove")}copyExtension(e,n,r,i){return this.extensionsScanner.copyExtension(e,n,r,i)}moveExtension(e,n,r,i){return this.extensionsScanner.moveExtension(e,n,r,i)}removeExtension(e,n){return this.extensionsScanner.removeExtension(e.identifier,n)}copyExtensions(e,n){return this.extensionsScanner.copyExtensions(e,n,{version:this.productService.version,date:this.productService.date})}deleteExtensions(...e){return this.extensionsScanner.setExtensionsForRemoval(...e)}async cleanUp(){this.logService.trace("ExtensionManagementService#cleanUp");try{await this.extensionsScanner.cleanUp()}catch(e){this.logService.error(e)}}async download(e,n,r){let{location:i}=await this.downloadExtension(e,n,!r);return i}async downloadVsix(e){if(e.scheme===z.file)return{location:e,async cleanup(){}};this.logService.trace("Downloading extension from",e.toString());let n=ye(this.extensionsDownloader.extensionsDownloadDir,Ce());return await this.downloadService.download(e,n,"extensionManagement.downloadVsix"),this.logService.info("Downloaded extension to",n.toString()),{location:n,cleanup:async()=>{try{await this.fileService.del(n)}catch(i){this.logService.error(i)}}}}getCurrentExtensionsManifestLocation(){return this.userDataProfilesService.defaultProfile.extensionsResource}createInstallExtensionTask(e,n,r){let i=n instanceof I?new Ln({id:or(e.publisher,e.name)},e.version):Ln.create(n);return this.instantiationService.createInstance(xm,i,e,n,r,(s,a)=>{if(n instanceof I)return this.extractVSIX(i,n,r,a);let l=this.extractingGalleryExtensions.get(i.toString());return l||(this.extractingGalleryExtensions.set(i.toString(),l=this.downloadAndExtractGalleryExtension(i,n,s,r,a)),l.finally(()=>this.extractingGalleryExtensions.delete(i.toString()))),l},this.extensionsScanner)}createUninstallExtensionTask(e,n){return new BE(e,n,this.extensionsProfileScannerService)}async downloadAndExtractGalleryExtension(e,n,r,i,s){let{verificationStatus:a,location:l}=await this.downloadExtension(n,r,!i.donotVerifySignature,i.context?.[A0]);try{if(s.isCancellationRequested)throw new Ye;let c=await kv(l.fsPath);if(!new Ln(n.identifier,n.version).equals(new Ln({id:or(c.publisher,c.name)},c.version)))throw new Et(d(803,null,n.identifier.id),"Invalid");let u=await this.extensionsScanner.extractUserExtension(e,l.fsPath,!1,s);if(a!=="Success"&&this.environmentService.isBuilt)try{await this.extensionsDownloader.delete(l)}catch(p){this.logService.warn("Error while deleting the downloaded file",l.toString(),fe(p))}return{local:u,verificationStatus:a}}catch(c){try{await this.extensionsDownloader.delete(l)}catch(u){this.logService.warn("Error while deleting the downloaded file",l.toString(),fe(u))}throw Xt(c)}}async downloadExtension(e,n,r,i){if(r){let c=this.configurationService.getValue(F0);r=Pr(c)?c:!0}let{location:s,verificationStatus:a}=await this.extensionsDownloader.download(e,n,r,i),l=W0(e.private,await this.extensionGalleryManifestService.getExtensionGalleryManifest());if(a!=="Success"&&!(a==="NotSigned"&&!l)&&r&&this.environmentService.isBuilt&&await this.getTargetPlatform()!=="linux-armhf"){try{await this.extensionsDownloader.delete(s)}catch(c){this.logService.warn("Error while deleting the downloaded file",s.toString(),fe(c))}if(!a)throw new Et(d(807,null),"SignatureVerificationInternal");switch(a){case"PackageIntegrityCheckFailed":case"SignatureIsInvalid":case"SignatureManifestIsInvalid":case"SignatureIntegrityCheckFailed":case"EntryIsMissing":case"EntryIsTampered":case"Untrusted":case"CertificateRevoked":case"SignatureIsNotValid":case"SignatureArchiveHasTooManyEntries":case"NotSigned":throw new Et(d(806,null,a),"SignatureVerificationFailed")}throw new Et(d(806,null,a),"SignatureVerificationInternal")}return{location:s,verificationStatus:a}}async extractVSIX(e,n,r,i){return{local:await this.extensionsScanner.extractUserExtension(e,Bn(n.fsPath),Pr(r.keepExisting)?!r.keepExisting:!0,i)}}async collectFiles(e){let n=async i=>{let s=await Te.readdir(i);s=s.map(c=>H(i,c));let a=await Promise.all(s.map(c=>X_.promises.stat(c))),l=Promise.resolve([]);return a.forEach((c,u)=>{let p=s[u];c.isFile()&&(l=l.then(m=>[...m,p])),c.isDirectory()&&(l=l.then(m=>n(p).then(g=>[...m,...g])))}),l};return(await n(e.location.fsPath)).map(i=>({path:`extension/${ji(e.location.fsPath,i)}`,localPath:i}))}async onDidChangeExtensionsFromAnotherSource({added:e,removed:n}){if(n){let r=e&&this.uriIdentityService.extUri.isEqual(n.profileLocation,e.profileLocation)?n.extensions.filter(i=>e.extensions.every(s=>!we(s,i))):n.extensions;for(let i of r)this.logService.info("Extensions removed from another source",i.id,n.profileLocation.toString()),this._onDidUninstallExtension.fire({identifier:i,profileLocation:n.profileLocation})}if(e){let i=(await this.getInstalled(1,e.profileLocation)).filter(s=>e.extensions.some(a=>we(a,s.identifier)));this._onDidInstallExtensions.fire(i.map(s=>(this.logService.info("Extensions added from another source",s.identifier.id,e.profileLocation.toString()),{identifier:s.identifier,local:s,profileLocation:e.profileLocation,operation:1})))}}async watchForExtensionsNotInstalledBySystem(){this._register(this.extensionsScanner.onExtract(n=>this.knownDirectories.add(n)));let e=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation);for(let n of e.children??[])n.isDirectory&&this.knownDirectories.add(n.resource);this._register(this.fileService.watch(this.extensionsScannerService.userExtensionsLocation)),this._register(this.fileService.onDidFilesChange(n=>this.onDidFilesChange(n)))}async onDidFilesChange(e){if(!e.affects(this.extensionsScannerService.userExtensionsLocation,1))return;let n=[];for(let r of e.rawAdded){if(this.knownDirectories.has(r)||!this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(r),this.extensionsScannerService.userExtensionsLocation)||this.uriIdentityService.extUri.isEqual(r,this.uriIdentityService.extUri.joinPath(this.extensionsScannerService.userExtensionsLocation,".obsolete"))||this.uriIdentityService.extUri.basename(r).startsWith(".")||this.uriIdentityService.extUri.basename(r).endsWith(WE))continue;try{if(!(await this.fileService.stat(r)).isDirectory)continue}catch(s){kt(s)!==1&&this.logService.error(s);continue}let i=await this.extensionsScanner.scanUserExtensionAtLocation(r);i&&i.installedTimestamp===void 0&&(this.knownDirectories.add(r),n.push(i))}n.length&&(await this.addExtensionsToProfile(n.map(r=>[r,void 0]),this.userDataProfilesService.defaultProfile.extensionsResource),this.logService.info("Added extensions to default profile from external source",n.map(r=>r.identifier.id)))}async addExtensionsToProfile(e,n){let r=e.map(i=>i[0]);await this.extensionsScanner.unsetExtensionsForRemoval(...r.map(i=>Ln.create(i))),await this.extensionsProfileScannerService.addExtensionsToProfile(e,n),this._onDidInstallExtensions.fire(r.map(i=>({local:i,identifier:i.identifier,operation:1,profileLocation:n})))}};sa=E([b(0,$n),b(1,Ft),b(2,Q),b(3,Dn),b(4,ls),b(5,Gr),b(6,ud),b(7,gr),b(8,Oe),b(9,xt),b(10,Pi),b(11,Ve),b(12,vo),b(13,ot),b(14,an)],sa);Im=class extends D{constructor(e,n,r,i,s,a,l,c,u,p){super();this.beforeRemovingExtension=e;this.environmentService=n;this.fileService=r;this.extensionsScannerService=i;this.extensionsProfileScannerService=s;this.uriIdentityService=a;this.telemetryService=l;this.productService=c;this.userDataProfilesService=u;this.logService=p;this._onExtract=this._register(new P);this.onExtract=this._onExtract.event;this.scanAllExtensionPromise=new lt;this.scanUserExtensionsPromise=new lt;this.obsoletedResource=ye(this.extensionsScannerService.userExtensionsLocation,".obsolete"),this.obsoleteFileLimiter=new co}async cleanUp(){await this.removeTemporarilyDeletedFolders(),await this.removeStaleAutoUpdateBuiltinExtensions(),await this.deleteExtensionsMarkedForRemoval(),await this.initializeExtensionSize()}async scanExtensions(e,n,r,i){try{let s=n.with({query:i}),a={includeInvalid:!0,profileLocation:n,productVersion:r,language:i},l=[];if(e===null||e===0){let c=this.scanAllExtensionPromise.get(s);c||(c=this.extensionsScannerService.scanAllExtensions({language:i},a).finally(()=>this.scanAllExtensionPromise.delete(s)),this.scanAllExtensionPromise.set(s,c)),l.push(...await c)}else if(e===1){let c=this.scanUserExtensionsPromise.get(s);c||(c=this.extensionsScannerService.scanUserExtensions(a).finally(()=>this.scanUserExtensionsPromise.delete(s)),this.scanUserExtensionsPromise.set(s,c)),l.push(...await c)}return l=e!==null?l.filter(c=>c.type===e):l,await Promise.all(l.map(c=>this.toLocalExtension(c)))}catch(s){throw Xt(s,"Scanning")}}async scanAllUserExtensions(){try{let e=await this.extensionsScannerService.scanAllUserExtensions();return await Promise.all(e.map(n=>this.toLocalExtension(n)))}catch(e){throw Xt(e,"Scanning")}}async scanUserExtensionAtLocation(e){try{let n=await this.extensionsScannerService.scanExistingExtension(e,1,{includeInvalid:!0});if(n)return await this.toLocalExtension(n)}catch(n){this.logService.error(n)}return null}async extractUserExtension(e,n,r,i){let s=e.toString(),a=I.file(H(this.extensionsScannerService.userExtensionsLocation.fsPath,`.${Ce()}`)),l=I.file(H(this.extensionsScannerService.userExtensionsLocation.fsPath,s));if(await this.fileService.exists(l)){if(!r)try{return await this.scanLocalExtension(l,1)}catch(c){this.logService.warn(`Error while scanning the existing extension at ${l.path}. Deleting the existing extension and extracting it.`,fe(c))}try{await this.deleteExtensionFromLocation(e.id,l,"removeExisting")}catch{throw new Et(d(801,null,l.fsPath,e.id),"Delete")}}try{if(i.isCancellationRequested)throw new Ye;try{this.logService.trace(`Started extracting the extension from ${n} to ${l.fsPath}`),await S_(n,a.fsPath,{sourcePath:"extension",overwrite:!0},i),this.logService.info(`Extracted extension to ${l}:`,e.id)}catch(u){throw ym(u)}let c={installedTimestamp:Date.now(),targetPlatform:e.targetPlatform};try{c.size=await ov(a,this.fileService)}catch(u){this.logService.warn(`Error while getting the size of the extracted extension : ${a.fsPath}`,fe(u))}try{await this.extensionsScannerService.updateManifestMetadata(a,c)}catch(u){throw this.telemetryService.publicLog2("extension:extract",{extensionId:e.id,code:`${kt(u)}`}),Xt(u,"UpdateMetadata")}if(i.isCancellationRequested)throw new Ye;try{this.logService.trace(`Started renaming the extension from ${a.fsPath} to ${l.fsPath}`),await this.rename(a.fsPath,l.fsPath),this.logService.info("Renamed to",l.fsPath)}catch(u){if(u.code==="ENOTEMPTY"){this.logService.info("Rename failed because extension was installed by another source. So ignoring renaming.",e.id);try{await this.fileService.del(a,{recursive:!0})}catch{}}else throw this.logService.info(`Rename failed because of ${fe(u)}. Deleted from extracted location`,a),u}this._onExtract.fire(l)}catch(c){try{await this.fileService.del(a,{recursive:!0})}catch{}throw c}return this.scanLocalExtension(l,1)}async scanMetadata(e,n){return(await this.getScannedExtension(e,n))?.metadata}async getScannedExtension(e,n){return(await this.extensionsProfileScannerService.scanProfileExtensions(n)).find(i=>we(i.identifier,e.identifier))}async updateMetadata(e,n,r){try{await this.extensionsProfileScannerService.updateMetadata([[e,n]],r)}catch(i){throw this.telemetryService.publicLog2("extension:extract",{extensionId:e.identifier.id,code:`${kt(i)}`,isProfile:!!r}),Xt(i,"UpdateMetadata")}return this.scanLocalExtension(e.location,e.type,r)}async setExtensionsForRemoval(...e){let n=[];for(let i of e)await this.fileService.exists(i.location)&&n.push(i);let r=n.map(i=>Ln.create(i));await this.withRemovedExtensions(i=>r.forEach(s=>{i[s.toString()]=!0,this.logService.info("Marked extension as removed",s.toString())}))}async unsetExtensionsForRemoval(...e){try{let n=[];return await this.withRemovedExtensions(r=>e.forEach(i=>{r[i.toString()]?(n.push(!0),delete r[i.toString()]):n.push(!1)})),n}catch(n){throw Xt(n,"UnsetRemoved")}}async deleteExtension(e,n){this.uriIdentityService.extUri.isEqualOrParent(e.location,this.extensionsScannerService.userExtensionsLocation)&&(await this.deleteExtensionFromLocation(e.identifier.id,e.location,n),await this.unsetExtensionsForRemoval(Ln.create(e)))}async copyExtension(e,n,r,i){let s=await this.getScannedExtension(e,n),a=await this.getScannedExtension(e,r);if(i={...s?.metadata,...i},a)if(this.uriIdentityService.extUri.isEqual(a.location,e.location))await this.extensionsProfileScannerService.updateMetadata([[e,{...a.metadata,...i}]],r);else{let l=await this.scanLocalExtension(a.location,e.type,r);await this.extensionsProfileScannerService.removeExtensionsFromProfile([l.identifier],r),await this.extensionsProfileScannerService.addExtensionsToProfile([[e,{...a.metadata,...i}]],r)}else await this.extensionsProfileScannerService.addExtensionsToProfile([[e,i]],r);return this.scanLocalExtension(e.location,e.type,r)}async moveExtension(e,n,r,i){let s=await this.getScannedExtension(e,n),a=await this.getScannedExtension(e,r);if(i={...s?.metadata,...i},a)if(this.uriIdentityService.extUri.isEqual(a.location,e.location))await this.extensionsProfileScannerService.updateMetadata([[e,{...a.metadata,...i}]],r);else{let l=await this.scanLocalExtension(a.location,e.type,r);await this.removeExtension(l.identifier,r),await this.extensionsProfileScannerService.addExtensionsToProfile([[e,{...a.metadata,...i}]],r)}else await this.extensionsProfileScannerService.addExtensionsToProfile([[e,i]],r),s&&await this.removeExtension(s.identifier,n);return this.scanLocalExtension(e.location,e.type,r)}async removeExtension(e,n){await this.extensionsProfileScannerService.removeExtensionsFromProfile([e],n)}async copyExtensions(e,n,r){let i=await this.scanExtensions(1,e,r),s=await Promise.all(i.filter(a=>!a.isApplicationScoped).map(async a=>[a,await this.scanMetadata(a,e)]));await this.extensionsProfileScannerService.addExtensionsToProfile(s,n)}async deleteExtensionFromLocation(e,n,r){this.logService.trace(`Deleting ${r} extension from disk`,e,n.fsPath);let i=this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(n),`${this.uriIdentityService.extUri.basename(n)}.${po(Ce()).toString(16)}${WE}`);await this.rename(n.fsPath,i.fsPath),await this.fileService.del(i,{recursive:!0}),this.logService.info(`Deleted ${r} extension from disk`,e,n.fsPath)}withRemovedExtensions(e){return this.obsoleteFileLimiter.queue(async()=>{let n;try{n=(await this.fileService.readFile(this.obsoletedResource,"utf8")).value.toString()}catch(i){if(kt(i)!==1)throw i}let r={};if(n)try{r=JSON.parse(n)}catch{}if(e)if(e(r),Object.keys(r).length)await this.fileService.writeFile(this.obsoletedResource,A.fromString(JSON.stringify(r)));else try{await this.fileService.del(this.obsoletedResource)}catch(i){if(kt(i)!==1)throw i}return r})}async rename(e,n){try{await Te.rename(e,n,120*1e3)}catch(r){throw Xt(r,"Rename")}}async scanLocalExtension(e,n,r){try{if(r){let s=(await this.extensionsScannerService.scanUserExtensions({profileLocation:r})).find(a=>this.uriIdentityService.extUri.isEqual(a.location,e));if(s)return await this.toLocalExtension(s)}else{let i=await this.extensionsScannerService.scanExistingExtension(e,n,{includeInvalid:!0});if(i)return await this.toLocalExtension(i)}throw new Et(d(800,null,e.path),"ScanningExtension")}catch(i){throw Xt(i,"ScanningExtension")}}async toLocalExtension(e){let n;try{n=await this.fileService.resolve(e.location)}catch{}let r,i;return n?.children&&(r=n.children.find(({name:s})=>/^readme(\.txt|\.md|)$/i.test(s))?.resource,i=n.children.find(({name:s})=>/^changelog(\.txt|\.md|)$/i.test(s))?.resource),{identifier:e.identifier,type:e.type,isBuiltin:e.isBuiltin||!!e.metadata?.isBuiltin,location:e.location,manifest:e.manifest,targetPlatform:e.targetPlatform,validations:e.validations,isValid:e.isValid,readmeUrl:r,changelogUrl:i,publisherDisplayName:e.metadata?.publisherDisplayName,publisherId:e.metadata?.publisherId||null,isApplicationScoped:!!e.metadata?.isApplicationScoped,isMachineScoped:!!e.metadata?.isMachineScoped,isPreReleaseVersion:!!e.metadata?.isPreReleaseVersion,hasPreReleaseVersion:!!e.metadata?.hasPreReleaseVersion,preRelease:e.preRelease,installedTimestamp:e.metadata?.installedTimestamp,updated:!!e.metadata?.updated,pinned:!!e.metadata?.pinned,forceAutoUpdate:e.forceAutoUpdate,private:!!e.metadata?.private,isWorkspaceScoped:!1,source:e.metadata?.source??(e.identifier.uuid?"gallery":"vsix"),size:e.metadata?.size??0}}async initializeExtensionSize(){let e=await this.extensionsScannerService.scanAllUserExtensions();await Promise.all(e.map(async n=>{if(io(n.metadata?.installedTimestamp)&&Xn(n.metadata?.size)){let r=await ov(n.location,this.fileService);await this.extensionsScannerService.updateManifestMetadata(n.location,{size:r})}}))}async removeStaleAutoUpdateBuiltinExtensions(){if(this.environmentService.extensionTestsLocationURI)return;let e=await this.extensionsScannerService.scanSystemExtensions({}),r=(await this.extensionsScannerService.scanAllUserExtensions()).filter(i=>{if(!this.productService.builtInExtensionsEnabledWithAutoUpdates.some(a=>a.toLowerCase()===i.identifier.id.toLowerCase()))return!1;let s=e.find(a=>we(a.identifier,i.identifier));return s&&sv(i.manifest.version,s.manifest.version)});r.length&&(this.logService.info("Removing stale auto-update builtin extensions:",r.map(i=>`${i.identifier.id}@${i.manifest.version}`).join(", ")),await this.extensionsProfileScannerService.removeExtensionsFromProfile(r.map(i=>i.identifier),this.userDataProfilesService.defaultProfile.extensionsResource),await Promise.allSettled(r.map(i=>this.deleteExtension(i,"stale auto-update builtin"))))}async deleteExtensionsMarkedForRemoval(){let e;try{e=await this.withRemovedExtensions()}catch(s){throw Xt(s,"ReadRemoved")}if(Object.keys(e).length===0){this.logService.debug("No extensions are marked as removed.");return}this.logService.debug("Deleting extensions marked as removed:",Object.keys(e));let n=await this.scanAllUserExtensions(),r=new Set;for(let s of n)e[Ln.create(s).toString()]||r.add(s.identifier.id.toLowerCase());try{let s=lv(n,a=>a.identifier);await rn.settled(s.map(async a=>{let l=a.sort((c,u)=>av(c.manifest.version,u.manifest.version))[0];r.has(l.identifier.id.toLowerCase())||await this.beforeRemovingExtension(l)}))}catch(s){this.logService.error(s)}let i=n.filter(s=>s.installedTimestamp&&e[Ln.create(s).toString()]);await Promise.allSettled(i.map(s=>this.deleteExtension(s,"marked for removal")))}async removeTemporarilyDeletedFolders(){this.logService.trace("ExtensionManagementService#removeTempDeleteFolders");let e;try{e=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation)}catch(n){kt(n)!==1&&this.logService.error(n);return}if(e?.children)try{await Promise.allSettled(e.children.map(async n=>{if(!(!n.isDirectory||!n.name.endsWith(WE))){this.logService.trace("Deleting the temporarily deleted folder",n.resource.toString());try{await this.fileService.del(n.resource,{recursive:!0}),this.logService.trace("Deleted the temporarily deleted folder",n.resource.toString())}catch(r){kt(r)!==1&&this.logService.error(r)}}}))}catch{}}};Im=E([b(1,It),b(2,Oe),b(3,ls),b(4,Gr),b(5,ot),b(6,Ft),b(7,Ve),b(8,an),b(9,Q)],Im);xm=class extends gm{constructor(e,n,r,i,s,a,l,c,u,p,m,g,h){super();this.extensionKey=e;this.manifest=n;this.source=r;this.options=i;this.extractExtensionFn=s;this.extensionsScanner=a;this.uriIdentityService=l;this.galleryService=c;this.userDataProfilesService=u;this.extensionsScannerService=p;this.extensionsProfileScannerService=m;this.productService=g;this.logService=h;this._operation=2;this.identifier=this.extensionKey.identifier}get operation(){return this.options.operation??this._operation}get verificationStatus(){return this._verificationStatus}async doRun(e){let r=(await this.extensionsScanner.scanExtensions(1,this.options.profileLocation,this.options.productVersion)).find(u=>we(u.identifier,this.identifier));r&&(this._operation=3);let s=(await this.extensionsScanner.scanExtensions(0,this.options.profileLocation,this.options.productVersion)).find(u=>we(u.identifier,this.identifier));if(s){if(!s.forceAutoUpdate)throw new Et(d(798,null,s.identifier.id,this.productService.quality),"Incompatible");if(Ti(s.manifest.version,this.manifest.version))throw new Et(d(799,null,s.identifier.id,s.manifest.version,this.manifest.version),"Incompatible")}let a={isApplicationScoped:this.options.isApplicationScoped||r?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||r?.isMachineScoped,isBuiltin:this.options.isBuiltin||r?.isBuiltin,isSystem:r?.type===0?!0:void 0,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:this.options.pinned??r?.pinned,source:this.source instanceof I?"vsix":"gallery"},l;if(this.source instanceof I){if(r&&this.extensionKey.equals(new Ln(r.identifier,r.manifest.version)))try{await this.extensionsScanner.deleteExtension(r,"existing")}catch{throw new Error(d(805,null,this.manifest.displayName||this.manifest.name))}let u=await this.unsetIfRemoved(this.extensionKey);if(u)try{await this.extensionsScanner.deleteExtension(u,"existing")}catch{throw new Error(d(805,null,this.manifest.displayName||this.manifest.name))}}else{if(a.id=this.source.identifier.uuid,a.publisherId=this.source.publisherId,a.publisherDisplayName=this.source.publisherDisplayName,a.targetPlatform=this.source.properties.targetPlatform,a.updated=!!r,a.private=this.source.private,a.isPreReleaseVersion=this.source.properties.isPreReleaseVersion,a.hasPreReleaseVersion=r?.hasPreReleaseVersion||this.source.properties.isPreReleaseVersion,a.preRelease=Pr(this.options.preRelease)?this.options.preRelease:this.options.installPreReleaseVersion||this.source.properties.isPreReleaseVersion||r?.preRelease,r&&r.type!==0&&r.manifest.version===this.source.version)return this.extensionsScanner.updateMetadata(r,a,this.options.profileLocation);l=await this.unsetIfRemoved(this.extensionKey)}if(e.isCancellationRequested)throw Xt(new Ye);if(!l){let u=await this.extractExtensionFn(this.operation,e);l=u.local,this._verificationStatus=u.verificationStatus}if(this.uriIdentityService.extUri.isEqual(this.userDataProfilesService.defaultProfile.extensionsResource,this.options.profileLocation))try{await this.extensionsScannerService.initializeDefaultProfileExtensions()}catch(u){throw Xt(u,"IntializeDefaultProfile")}if(e.isCancellationRequested)throw Xt(new Ye);try{await this.extensionsProfileScannerService.addExtensionsToProfile([[l,a]],this.options.profileLocation,!l.isValid)}catch(u){throw Xt(u,"AddToProfile")}let c=await this.extensionsScanner.scanLocalExtension(l.location,1,this.options.profileLocation);if(!c)throw new Et("Cannot find the installed extension","InstalledExtensionNotFound");return this.source instanceof I&&this.updateMetadata(l,e),c}async unsetIfRemoved(e){let[n]=await this.extensionsScanner.unsetExtensionsForRemoval(e);if(n)return this.logService.info("Removed the extension from removed list:",e.id),(await this.extensionsScanner.scanAllUserExtensions()).find(i=>Ln.create(i).equals(e))}async updateMetadata(e,n){try{let[r]=await this.galleryService.getExtensions([{id:e.identifier.id,version:e.manifest.version}],n);if(r||([r]=await this.galleryService.getExtensions([{id:e.identifier.id}],n)),r){let i={id:r.identifier.uuid,publisherDisplayName:r.publisherDisplayName,publisherId:r.publisherId,isPreReleaseVersion:r.properties.isPreReleaseVersion,hasPreReleaseVersion:e.hasPreReleaseVersion||r.properties.isPreReleaseVersion,preRelease:r.properties.isPreReleaseVersion||this.options.installPreReleaseVersion};await this.extensionsScanner.updateMetadata(e,i,this.options.profileLocation)}}catch{}}};xm=E([b(6,ot),b(7,$n),b(8,an),b(9,ls),b(10,Gr),b(11,Ve),b(12,Q)],xm);BE=class extends gm{constructor(e,n,r){super();this.extension=e;this.options=n;this.extensionsProfileScannerService=r}doRun(e){return this.extensionsProfileScannerService.removeExtensionsFromProfile([this.extension.identifier],this.options.profileLocation)}}});var $E,Em,Y_=y(()=>{$E=class{constructor(t,e){this.key=t;this.data=e;this.incoming=new Map;this.outgoing=new Map}},Em=class{constructor(t){this._hashFn=t;this._nodes=new Map}roots(){let t=[];for(let e of this._nodes.values())e.outgoing.size===0&&t.push(e);return t}insertEdge(t,e){let n=this.lookupOrInsertNode(t),r=this.lookupOrInsertNode(e);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(t){let e=this._hashFn(t);this._nodes.delete(e);for(let n of this._nodes.values())n.outgoing.delete(e),n.incoming.delete(e)}lookupOrInsertNode(t){let e=this._hashFn(t),n=this._nodes.get(e);return n||(n=new $E(e,t),this._nodes.set(e,n)),n}lookup(t){return this._nodes.get(this._hashFn(t))}isEmpty(){return this._nodes.size===0}toString(){let t=[];for(let[e,n]of this._nodes)t.push(`${e}
- (-> incoming)[${[...n.incoming.keys()].join(", ")}]
- (outgoing ->)[${[...n.outgoing.keys()].join(",")}]
- `);return t.join(`
- `)}findCycleSlow(){for(let[t,e]of this._nodes){let n=new Set([t]),r=this._findCycle(e,n);if(r)return r}}_findCycle(t,e){for(let[n,r]of t.outgoing){if(e.has(n))return[...e,n].join(" -> ");e.add(n);let i=this._findCycle(r,e);if(i)return i;e.delete(n)}}}});var p9,Mv,Ed,wm,zE=y(()=>{ze();Se();q();Fp();Y_();re();dh();Kg();p9=!1,Mv=class extends Error{constructor(t){super("cyclic dependency between services"),this.message=t.findCycleSlow()??`UNABLE to detect cycle, dumping graph:
- ${t.toString()}`}},Ed=class o{constructor(t=new Bs,e=!1,n,r=p9){this._services=t;this._strict=e;this._parent=n;this._enableTracing=r;this._isDisposed=!1;this._servicesToMaybeDispose=new Set;this._children=new Set;this._activeInstantiations=new Set;this._services.set(gr,this),this._globalGraph=r?n?._globalGraph??new Em(i=>i):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,jt(this._children),this._children.clear();for(let t of this._servicesToMaybeDispose)Gg(t)&&t.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(t,e){this._throwIfDisposed();let n=this,r=new class extends o{dispose(){n._children.delete(r),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(r),e?.add(r),r}invokeFunction(t,...e){this._throwIfDisposed();let n=wm.traceInvocation(this._enableTracing,t),r=!1;try{return t({get:s=>{if(r)throw Vg("service accessor is only valid during the invocation of its target method");let a=this._getOrCreateServiceInstance(s,n);return a||this._throwIfStrict(`[invokeFunction] unknown service '${s}'`,!1),a}},...e)}finally{r=!0,n.stop()}}createInstance(t,...e){this._throwIfDisposed();let n,r;return t instanceof tt?(n=wm.traceCreation(this._enableTracing,t.ctor),r=this._createInstance(t.ctor,t.staticArguments.concat(e),n)):(n=wm.traceCreation(this._enableTracing,t),r=this._createInstance(t,e,n)),n.stop(),r}_createInstance(t,e=[],n){let r=Jo.getServiceDependencies(t).sort((a,l)=>a.index-l.index),i=[];for(let a of r){let l=this._getOrCreateServiceInstance(a.id,n);l||this._throwIfStrict(`[createInstance] ${t.name} depends on UNKNOWN service ${a.id}.`,!1),i.push(l)}let s=r.length>0?r[0].index:e.length;if(e.length!==s){console.trace(`[createInstance] First service dependency of ${t.name} at position ${s+1} conflicts with ${e.length} static arguments`);let a=s-e.length;a>0?e=e.concat(new Array(a)):e=e.slice(0,s)}return Reflect.construct(t,e.concat(i))}_setCreatedServiceInstance(t,e){if(this._services.get(t)instanceof tt)this._services.set(t,e);else if(this._parent)this._parent._setCreatedServiceInstance(t,e);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(t){let e=this._services.get(t);return!e&&this._parent?this._parent._getServiceInstanceOrDescriptor(t):e}_getOrCreateServiceInstance(t,e){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(t));let n=this._getServiceInstanceOrDescriptor(t);return n instanceof tt?this._safeCreateAndCacheServiceInstance(t,n,e.branch(t,!0)):(e.branch(t,!1),n)}_safeCreateAndCacheServiceInstance(t,e,n){if(this._activeInstantiations.has(t))throw new Error(`illegal state - RECURSIVELY instantiating service '${t}'`);this._activeInstantiations.add(t);try{return this._createAndCacheServiceInstance(t,e,n)}finally{this._activeInstantiations.delete(t)}}_createAndCacheServiceInstance(t,e,n){let r=new Em(l=>l.id.toString()),i=0,s=[{id:t,desc:e,_trace:n}],a=new Set;for(;s.length;){let l=s.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),r.lookupOrInsertNode(l),i++>1e3)throw new Mv(r);for(let c of Jo.getServiceDependencies(l.desc.ctor)){let u=this._getServiceInstanceOrDescriptor(c.id);if(u||this._throwIfStrict(`[createInstance] ${t} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),u instanceof tt){let p={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};r.insertEdge(l,p),s.push(p)}}}}for(;;){let l=r.roots();if(l.length===0){if(!r.isEmpty())throw new Mv(r);break}for(let{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof tt){let p=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,p)}r.removeNode(c)}}return this._getServiceInstanceOrDescriptor(t)}_createServiceInstanceWithOwner(t,e,n=[],r,i){if(this._services.get(t)instanceof tt)return this._createServiceInstance(t,e,n,r,i,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(t,e,n,r,i);throw new Error(`illegalState - creating UNKNOWN service instance ${e.name}`)}_createServiceInstance(t,e,n=[],r,i,s){if(r){let a=new o(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(t);let l=new Map,c=new ih(()=>{let u=a._createInstance(e,n,i);for(let[p,m]of l){let g=u[p];if(typeof g=="function")for(let h of m)h.disposable=g.apply(u,h.listener)}return l.clear(),s.add(u),u});return new Proxy(Object.create(null),{get(u,p){if(!c.isInitialized&&typeof p=="string"&&(p.startsWith("onDid")||p.startsWith("onWill"))){let h=l.get(p);return h||(h=new As,l.set(p,h)),(x,T,w)=>{if(c.isInitialized)return c.value[p](x,T,w);{let k={listener:[x,T,w],disposable:void 0},M=h.push(k);return ie(()=>{M(),k.disposable?.dispose()})}}}if(p in u)return u[p];let m=c.value,g=m[p];return typeof g!="function"||(g=g.bind(m),u[p]=g),g},set(u,p,m){return c.value[p]=m,!0},getPrototypeOf(u){return e.prototype}})}else{let a=this._createInstance(e,n,i);return s.add(a),a}}_throwIfStrict(t,e){if(e&&console.warn(t),this._strict)throw new Error(t)}},wm=class o{constructor(t,e){this.type=t;this.name=e;this._start=Date.now();this._dep=[]}static{this.all=new Set}static{this._None=new class extends o{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(t,e){return t?new o(2,e.name||new Error().stack.split(`
- `).slice(3,4).join(`
- `)):o._None}static traceCreation(t,e){return t?new o(1,e.name):o._None}static{this._totals=0}branch(t,e){let n=new o(3,t.toString());return this._dep.push([t,e,n]),n}stop(){let t=Date.now()-this._start;o._totals+=t;let e=!1;function n(i,s){let a=[],l=new Array(i+1).join(" ");for(let[c,u,p]of s._dep)if(u&&p){e=!0,a.push(`${l}CREATES -> ${c}`);let m=n(i+1,p);m&&a.push(m)}else a.push(`${l}uses -> ${c}`);return a.join(`
- `)}let r=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${o._totals.toFixed(2)}ms)`];(t>2||e)&&o.all.add(r.join(`
- `))}}});async function Av(o,t,e,n,r,i){let s;try{await m9(o,t,e,n,r,i)}catch(a){s=a}finally{s&&r.errorTransformer&&(s=r.errorTransformer(s)),typeof s<"u"&&e.error(s),e.end()}}async function m9(o,t,e,n,r,i){GE(i);let s=await o.open(t,{create:!1});try{GE(i);let a=0,l=0,c=r&&typeof r.length=="number"?r.length:void 0,u=A.alloc(Math.min(r.bufferSize,typeof c=="number"?c:r.bufferSize)),p=r&&typeof r.position=="number"?r.position:0,m=0;do l=await o.read(s,p,u.buffer,m,u.byteLength-m),p+=l,m+=l,a+=l,typeof c=="number"&&(c-=l),m===u.byteLength&&(await e.write(n(u)),u=A.alloc(Math.min(r.bufferSize,typeof c=="number"?c:r.bufferSize)),m=0);while(l>0&&(typeof c!="number"||c>0)&&GE(i)&&f9(a,r));if(m>0){let g=m;typeof c=="number"&&(g=Math.min(m,c)),e.write(n(u.slice(0,g)))}}catch(a){throw ss(a)}finally{await o.close(s)}}function GE(o){if(o.isCancellationRequested)throw pp();return!0}function f9(o,t){if(typeof t?.limits?.size=="number"&&o>t.limits.size)throw Mo(d(868,null),"EntryTooLarge");return!0}var qE=y(()=>{et();Se();pe();nt()});var ki,jE=y(()=>{At();ze();et();Wt();de();ol();Ko();q();$p();$e();zo();Nt();_c();pe();nt();qE();Fe();Se();ki=class extends D{constructor(e){super();this.logService=e;this.BUFFER_SIZE=256*1024;this._onDidChangeFileSystemProviderRegistrations=this._register(new P);this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event;this._onWillActivateFileSystemProvider=this._register(new P);this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event;this._onDidChangeFileSystemProviderCapabilities=this._register(new P);this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event;this.provider=new Map;this._onDidRunOperation=this._register(new P);this.onDidRunOperation=this._onDidRunOperation.event;this.internalOnDidFilesChange=this._register(new P);this._onDidUncorrelatedFilesChange=this._register(new P);this.onDidFilesChange=this._onDidUncorrelatedFilesChange.event;this._onDidWatchError=this._register(new P);this.onDidWatchError=this._onDidWatchError.event;this.activeWatchers=new Map;this.writeQueue=this._register(new kc)}registerProvider(e,n){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);Ot(`code/registerFilesystem/${e}`);let r=new le;return this.provider.set(e,n),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:e,provider:n}),r.add(n.onDidChangeFile(i=>{let s=new Lh(i,!this.isPathCaseSensitive(n));this.internalOnDidFilesChange.fire(s),s.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(s)})),typeof n.onDidWatchError=="function"&&r.add(n.onDidWatchError(i=>this._onDidWatchError.fire(new Error(i)))),r.add(n.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:n,scheme:e}))),ie(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:e,provider:n}),this.provider.delete(e),jt(r)})}getProvider(e){return this.provider.get(e)}async activateProvider(e){let n=[];this._onWillActivateFileSystemProvider.fire({scheme:e,join(r){n.push(r)}}),!this.provider.has(e)&&await rn.settled(n)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.provider.has(e.scheme)}hasCapability(e,n){let r=this.provider.get(e.scheme);return!!(r&&r.capabilities&n)}listCapabilities(){return fn.map(this.provider,([e,n])=>({scheme:e,capabilities:n.capabilities}))}async withProvider(e){if(!U1(e))throw new hn(d(857,null,this.resourceForError(e)),8);await this.activateProvider(e.scheme);let n=this.provider.get(e.scheme);if(!n){let r=new ur;throw r.message=d(859,null,e.toString()),r}return n}async withReadProvider(e){let n=await this.withProvider(e);if(is(n)||go(n)||Mh(n))return n;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(e){let n=await this.withProvider(e);if(is(n)||go(n))return n;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,n){try{return await this.doResolveFile(e,n)}catch(r){throw zp(r)==="EntryNotFound"?new hn(d(854,null,this.resourceForError(e)),1):ss(r)}}async doResolveFile(e,n){let r=await this.withProvider(e),i=this.isPathCaseSensitive(r),s=n?.resolveTo,a=n?.resolveSingleChildDescendants,l=n?.resolveMetadata,c=await r.stat(e),u;return this.toFileStat(r,e,c,void 0,!!l,(p,m)=>(u||(u=Xo.forUris(()=>!i),u.set(e,!0),s&&u.fill(!0,s)),u.get(p.resource)||u.findSuperstr(p.resource.with({query:null,fragment:null}))?!0:p.isDirectory&&a?m===1:!1))}async toFileStat(e,n,r,i,s,a){let{providerExtUri:l}=this.getExtUri(e),c={resource:n,name:l.basename(n),isFile:(r.type&1)!==0,isDirectory:(r.type&2)!==0,isSymbolicLink:(r.type&64)!==0,mtime:r.mtime,ctime:r.ctime,size:r.size,readonly:!!((r.permissions??0)&1)||!!(e.capabilities&2048),locked:!!((r.permissions??0)&2),executable:!!((r.permissions??0)&4),etag:NS({mtime:r.mtime,size:r.size}),children:void 0};if(c.isDirectory&&a(c,i)){try{let u=await e.readdir(n),p=await rn.settled(u.map(async([m,g])=>{try{let h=l.joinPath(n,m),v=s?await e.stat(h):{type:g};return await this.toFileStat(e,h,v,u.length,s,a)}catch(h){return this.logService.trace(h),null}}));c.children=Qn(p)}catch(u){this.logService.trace(u),c.children=[]}return c}return c}async resolveAll(e){return rn.settled(e.map(async n=>{try{return{stat:await this.doResolveFile(n.resource,n.options),success:!0}}catch(r){return this.logService.trace(r),{stat:void 0,success:!1}}}))}async stat(e){let n=await this.withProvider(e),r=await n.stat(e);return this.toFileStat(n,e,r,void 0,!0,()=>!1)}async realpath(e){let n=await this.withProvider(e);if(BD(n)){let r=await n.realpath(e);return e.with({path:r})}}async exists(e){let n=await this.withProvider(e);try{return!!await n.stat(e)}catch{return!1}}async canCreateFile(e,n){try{await this.doValidateCreateFile(e,n)}catch(r){return r}return!0}async doValidateCreateFile(e,n){if(!n?.overwrite&&await this.exists(e))throw new hn(d(850,null,this.resourceForError(e)),3,n)}async createFile(e,n=A.fromString(""),r){await this.doValidateCreateFile(e,r);let i=await this.writeFile(e,n);return this._onDidRunOperation.fire(new os(e,0,i)),i}async writeFile(e,n,r){let i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:s}=this.getExtUri(i),a=r;if(OS(i)&&!a?.atomic){let l=i.enforceAtomicWriteFile?.(e);l&&(a={...r,atomic:l})}try{let{stat:l,buffer:c}=await this.validateWriteFile(i,e,n,a);l||await this.mkdirp(i,s.dirname(e)),c||(c=await this.peekBufferForWriting(i,n)),!is(i)||go(i)&&c instanceof A||go(i)&&OS(i)&&a?.atomic?await this.doWriteUnbuffered(i,e,a,c):await this.doWriteBuffered(i,e,a,c instanceof A?sD(c):c),this._onDidRunOperation.fire(new os(e,4))}catch(l){throw new hn(d(849,null,this.resourceForError(e),ss(l).toString()),kt(l),a)}return this.resolve(e,{resolveMetadata:!0})}async peekBufferForWriting(e,n){let r;if(go(e)&&!(n instanceof A))if(kp(n)){let i=await tD(n,3);i.ended?r=A.concat(i.buffer):r=i}else r=eD(n,i=>A.concat(i),3);else r=n;return r}async validateWriteFile(e,n,r,i){let s=!!i?.unlock;if(s&&!(e.capabilities&8192))throw new Error(d(867,null,this.resourceForError(n)));if(i?.append&&!VD(e))throw new hn(d(846,null,this.resourceForError(n)),6);if(!!i?.atomic){if(!(e.capabilities&32768))throw new Error(d(865,null,this.resourceForError(n)));if(!(e.capabilities&2))throw new Error(d(866,null,this.resourceForError(n)));if(s)throw new Error(d(864,null,this.resourceForError(n)))}let l;try{l=await e.stat(n)}catch{return Object.create(null)}if((l.type&2)!==0)throw new hn(d(852,null,this.resourceForError(n)),0,i);this.throwIfFileIsReadonly(n,l);let c;if(typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==Ah&&typeof l.mtime=="number"&&typeof l.size=="number"&&i.mtime<l.mtime&&i.etag!==NS({mtime:i.mtime,size:l.size})){if(c=await this.peekBufferForWriting(e,r),c instanceof A&&c.byteLength===l.size)try{let{value:u}=await this.readFile(n,{limits:{size:l.size}});if(c.equals(u))return{stat:l,buffer:c}}catch{}throw new hn(d(853,null),3,i)}return{stat:l,buffer:c}}async readFile(e,n,r){let i=await this.withReadProvider(e);return n?.atomic?this.doReadFileAtomic(i,e,n,r):this.doReadFile(i,e,n,r)}async doReadFileAtomic(e,n,r,i){return new Promise((s,a)=>{this.writeQueue.queueFor(n,async()=>{try{let l=await this.doReadFile(e,n,r,i);s(l)}catch(l){a(l)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,n,r,i){let s=await this.doReadFileStream(e,n,{...r,preferUnbuffered:!0},i);return{...s,value:await Br(s.value)}}async readFileStream(e,n,r){let i=await this.withReadProvider(e);return this.doReadFileStream(i,e,n,r)}async doReadFileStream(e,n,r,i){let s=new gt(i),a=r;Oh(e)&&e.enforceAtomicReadFile?.(n)&&(a={...r,atomic:!0});let l=this.validateReadFile(n,a).then(u=>u,u=>{throw s.dispose(!0),u}),c;try{return typeof a?.etag=="string"&&a.etag!==Ah&&await l,a?.atomic&&Oh(e)||!(is(e)||Mh(e))||go(e)&&a?.preferUnbuffered?c=this.readFileUnbuffered(e,n,a):Mh(e)?c=this.readFileStreamed(e,n,s.token,a):c=this.readFileBuffered(e,n,s.token,a),c.on("end",()=>s.dispose()),c.on("error",()=>s.dispose()),{...await l,value:c}}catch(u){throw c&&await ph(c),this.restoreReadError(u,n,a)}}restoreReadError(e,n,r){let i=d(847,null,this.resourceForError(n),ss(e).toString());return e instanceof zc?new zc(i,e.stat,r):e instanceof $c?new $c(i,e.fileOperationResult,e.size,e.options):new hn(i,kt(e),r)}readFileStreamed(e,n,r,i=Object.create(null)){let s=e.readFileStream(n,i,r);return mh(s,{data:a=>a instanceof A?a:A.wrap(a),error:a=>this.restoreReadError(a,n,i)},a=>A.concat(a))}readFileBuffered(e,n,r,i=Object.create(null)){let s=cD();return Av(e,n,s,a=>a,{...i,bufferSize:this.BUFFER_SIZE,errorTransformer:a=>this.restoreReadError(a,n,i)},r),s}readFileUnbuffered(e,n,r){let i=Hs(s=>A.concat(s));return(async()=>{try{let s;r?.atomic&&Oh(e)?s=await e.readFile(n,{atomic:!0}):s=await e.readFile(n),typeof r?.position=="number"&&(s=s.slice(r.position)),typeof r?.length=="number"&&(s=s.slice(0,r.length)),this.validateReadFileLimits(n,s.byteLength,r),i.end(A.wrap(s))}catch(s){i.error(s),i.end()}})(),i}async validateReadFile(e,n){let r=await this.resolve(e,{resolveMetadata:!0});if(r.isDirectory)throw new hn(d(851,null,this.resourceForError(e)),0,n);if(typeof n?.etag=="string"&&n.etag!==Ah&&n.etag===r.etag)throw new zc(d(855,null),r,n);return this.validateReadFileLimits(e,r.size,n),r}validateReadFileLimits(e,n,r){if(typeof r?.limits?.size=="number"&&n>r.limits.size)throw new $c(d(856,null,this.resourceForError(e)),7,n,r)}async canMove(e,n,r){return this.doCanMoveCopy(e,n,"move",r)}async canCopy(e,n,r){return this.doCanMoveCopy(e,n,"copy",r)}async doCanMoveCopy(e,n,r,i){if(e.toString()!==n.toString())try{let s=r==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),a=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n);await this.doValidateMoveCopy(s,e,a,n,r,i)}catch(s){return s}return!0}async move(e,n,r){let i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n),a=await this.doMoveCopy(i,e,s,n,"move",!!r),l=await this.resolve(n,{resolveMetadata:!0});return this._onDidRunOperation.fire(new os(e,a==="move"?2:3,l)),l}async copy(e,n,r){let i=await this.withReadProvider(e),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n),a=await this.doMoveCopy(i,e,s,n,"copy",!!r),l=await this.resolve(n,{resolveMetadata:!0});return this._onDidRunOperation.fire(new os(e,a==="copy"?3:2,l)),l}async doMoveCopy(e,n,r,i,s,a){if(n.toString()===i.toString())return s;let{exists:l,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,n,r,i,s,a);if(l&&!c&&a&&await this.del(i,{recursive:!0}),await this.mkdirp(r,this.getExtUri(r).providerExtUri.dirname(i)),s==="copy"){if(e===r&&MS(e))await e.copy(n,i,{overwrite:a});else{let u=await this.resolve(n);u.isDirectory?await this.doCopyFolder(e,u,r,i):await this.doCopyFile(e,n,r,i)}return s}else return e===r?(await e.rename(n,i,{overwrite:a}),s):(await this.doMoveCopy(e,n,r,i,"copy",a),await this.del(n,{recursive:!0}),"copy")}async doCopyFile(e,n,r,i){if(is(e)&&is(r))return this.doPipeBuffered(e,n,r,i);if(is(e)&&go(r))return this.doPipeBufferedToUnbuffered(e,n,r,i);if(go(e)&&is(r))return this.doPipeUnbufferedToBuffered(e,n,r,i);if(go(e)&&go(r))return this.doPipeUnbuffered(e,n,r,i)}async doCopyFolder(e,n,r,i){await r.mkdir(i),Array.isArray(n.children)&&await rn.settled(n.children.map(async s=>{let a=this.getExtUri(r).providerExtUri.joinPath(i,s.name);return s.isDirectory?this.doCopyFolder(e,await this.resolve(s.resource),r,a):this.doCopyFile(e,s.resource,r,a)}))}async doValidateMoveCopy(e,n,r,i,s,a){let l=!1;if(e===r){let{providerExtUri:u,isPathCaseSensitive:p}=this.getExtUri(e);if(p||(l=u.isEqual(n,i)),l&&s==="copy")throw new Error(d(860,null,this.resourceForError(n),this.resourceForError(i)));if(!l&&u.isEqualOrParent(i,n))throw new Error(d(861,null,this.resourceForError(n),this.resourceForError(i)))}let c=await this.exists(i);if(c&&!l){if(!a)throw new hn(d(862,null,this.resourceForError(n),this.resourceForError(i)),4);if(e===r){let{providerExtUri:u}=this.getExtUri(e);if(u.isEqualOrParent(n,i))throw new Error(d(863,null,this.resourceForError(n),this.resourceForError(i)))}}return{exists:c,isSameResourceWithDifferentPathCase:l}}getExtUri(e){let n=this.isPathCaseSensitive(e);return{providerExtUri:n?Ze:Qx,isPathCaseSensitive:n}}isPathCaseSensitive(e){return!!(e.capabilities&1024)}async createFolder(e){let n=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e);await this.mkdirp(n,e);let r=await this.resolve(e,{resolveMetadata:!0});return this._onDidRunOperation.fire(new os(e,0,r)),r}async mkdirp(e,n){let r=[],{providerExtUri:i}=this.getExtUri(e);for(;!i.isEqual(n,i.dirname(n));)try{if(((await e.stat(n)).type&2)===0)throw new Error(d(858,null,this.resourceForError(n)));break}catch(s){if(zp(s)!=="EntryNotFound")throw s;r.push(i.basename(n)),n=i.dirname(n)}for(let s=r.length-1;s>=0;s--){n=i.joinPath(n,r[s]);try{await e.mkdir(n)}catch(a){if(zp(a)!=="EntryExists")throw a}}}async canDelete(e,n){try{await this.doValidateDelete(e,n)}catch(r){return r}return!0}async doValidateDelete(e,n){let r=this.throwIfFileSystemIsReadonly(await this.withProvider(e),e),i=!!n?.useTrash;if(i&&!(r.capabilities&4096))throw new Error(d(845,null,this.resourceForError(e)));let s=n?.atomic;if(s&&!(r.capabilities&65536))throw new Error(d(841,null,this.resourceForError(e)));if(i&&s)throw new Error(d(844,null,this.resourceForError(e)));let a;try{a=await r.stat(e)}catch{}if(a)this.throwIfFileIsReadonly(e,a);else throw new hn(d(843,null,this.resourceForError(e)),1);if(!!!n?.recursive){let c=await this.resolve(e);if(c.isDirectory&&Array.isArray(c.children)&&c.children.length>0)throw new Error(d(842,null,this.resourceForError(e)))}return r}async del(e,n){let r=await this.doValidateDelete(e,n),i=n;if(HD(r)&&!i?.atomic){let c=r.enforceAtomicDelete?.(e);c&&(i={...n,atomic:c})}let s=!!i?.useTrash,a=!!i?.recursive,l=i?.atomic??!1;await r.delete(e,{recursive:a,useTrash:s,atomic:l}),this._onDidRunOperation.fire(new os(e,1))}async cloneFile(e,n){let r=await this.withProvider(e),i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(n),n);if(!(r===i&&this.getExtUri(r).providerExtUri.isEqual(e,n)))return r===i&&WD(r)?r.cloneFile(e,n):(await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),r===i&&MS(r)?this.writeQueue.queueFor(e,()=>r.copy(e,n,{overwrite:!0}),this.getExtUri(r).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(r,e,i,n),this.getExtUri(r).providerExtUri))}static{this.WATCHER_CORRELATION_IDS=0}createWatcher(e,n){return this.watch(e,{...n,correlationId:ki.WATCHER_CORRELATION_IDS++})}watch(e,n={recursive:!1,excludes:[]}){let r=new le,i=!1,s=()=>{i=!0};r.add(ie(()=>s())),(async()=>{try{let l=await this.doWatch(e,n);i?jt(l):s=()=>jt(l)}catch(l){this.logService.error(l)}})();let a=n.correlationId;if(typeof a=="number"){let l=r.add(new P);return r.add(this.internalOnDidFilesChange.event(u=>{u.correlates(a)&&l.fire(u)})),{onDidChange:l.event,dispose:()=>r.dispose()}}return r}async doWatch(e,n){let r=await this.withProvider(e),i=po([this.getExtUri(r).providerExtUri.getComparisonKey(e),n]),s=this.activeWatchers.get(i);return s||(s={count:0,disposable:r.watch(e,n)},this.activeWatchers.set(i,s)),s.count+=1,ie(()=>{s&&(s.count--,s.count===0&&(jt(s.disposable),this.activeWatchers.delete(i)))})}dispose(){super.dispose();for(let[,e]of this.activeWatchers)jt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,n,r,i){return this.writeQueue.queueFor(n,async()=>{let s=await e.open(n,{create:!0,unlock:r?.unlock??!1,append:r?.append??!1});try{kp(i)||uh(i)?await this.doWriteStreamBufferedQueued(e,s,i):await this.doWriteReadableBufferedQueued(e,s,i)}catch(a){throw ss(a)}finally{await e.close(s)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,n,r){let i=0,s;if(uh(r)){if(r.buffer.length>0){let a=A.concat(r.buffer);await this.doWriteBuffer(e,n,a,a.byteLength,i,0),i+=a.byteLength}if(r.ended)return;s=r.stream}else s=r;return new Promise((a,l)=>{Dc(s,{onData:async c=>{s.pause();try{await this.doWriteBuffer(e,n,c,c.byteLength,i,0)}catch(u){return l(u)}i+=c.byteLength,setTimeout(()=>s.resume())},onError:c=>l(c),onEnd:()=>a()})})}async doWriteReadableBufferedQueued(e,n,r){let i=0,s;for(;(s=r.read())!==null;)await this.doWriteBuffer(e,n,s,s.byteLength,i,0),i+=s.byteLength}async doWriteBuffer(e,n,r,i,s,a){let l=0;for(;l<i;){let c=await e.write(n,s+l,r.buffer,a+l,i-l);l+=c}}async doWriteUnbuffered(e,n,r,i){return this.writeQueue.queueFor(n,()=>this.doWriteUnbufferedQueued(e,n,r,i),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,n,r,i){let s;i instanceof A?s=i:kp(i)?s=await Br(i):uh(i)?s=await aD(i):s=iD(i),await e.writeFile(n,s.buffer,{create:!0,overwrite:!0,unlock:r?.unlock??!1,atomic:r?.atomic??!1,append:r?.append??!1})}async doPipeBuffered(e,n,r,i){return this.writeQueue.queueFor(i,()=>this.doPipeBufferedQueued(e,n,r,i),this.getExtUri(r).providerExtUri)}async doPipeBufferedQueued(e,n,r,i){let s,a;try{s=await e.open(n,{create:!1}),a=await r.open(i,{create:!0,unlock:!1});let l=A.alloc(this.BUFFER_SIZE),c=0,u=0,p=0;do p=await e.read(s,c,l.buffer,u,l.byteLength-u),await this.doWriteBuffer(r,a,l,p,c,u),c+=p,u+=p,u===l.byteLength&&(u=0);while(p>0)}catch(l){throw ss(l)}finally{await rn.settled([typeof s=="number"?e.close(s):Promise.resolve(),typeof a=="number"?r.close(a):Promise.resolve()])}}async doPipeUnbuffered(e,n,r,i){return this.writeQueue.queueFor(i,()=>this.doPipeUnbufferedQueued(e,n,r,i),this.getExtUri(r).providerExtUri)}async doPipeUnbufferedQueued(e,n,r,i){return r.writeFile(i,await e.readFile(n),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,n,r,i){return this.writeQueue.queueFor(i,()=>this.doPipeUnbufferedToBufferedQueued(e,n,r,i),this.getExtUri(r).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,n,r,i){let s=await r.open(i,{create:!0,unlock:!1});try{let a=await e.readFile(n);await this.doWriteBuffer(r,s,A.wrap(a),a.byteLength,0,0)}catch(a){throw ss(a)}finally{await r.close(s)}}async doPipeBufferedToUnbuffered(e,n,r,i){let s=await Br(this.readFileBuffered(e,n,Ee.None));await this.doWriteUnbuffered(r,i,void 0,s)}throwIfFileSystemIsReadonly(e,n){if(e.capabilities&2048)throw new hn(d(848,null,this.resourceForError(n)),6);return e}throwIfFileIsReadonly(e,n){if((n.permissions??0)&1)throw new hn(d(848,null,this.resourceForError(e)),6)}resourceForError(e){return e.scheme===z.file?e.fsPath:e.toString(!0)}};ki=E([b(0,Q)],ki)});function tL(o,t){switch(o){case 0:return"";case 1:return`${Uv}*?`;default:return`(?:${Nv}|${Uv}+${Nv}${t?`|${Nv}${Uv}+`:""})*?`}}function nL(o,t){if(!o)return[];let e=[],n=!1,r=!1,i="";for(let s of o){switch(s){case t:if(!n&&!r){e.push(i),i="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":r=!0;break;case"]":r=!1;break}i+=s}return i&&e.push(i),e}function aL(o){if(!o)return"";let t="",e=nL(o,eL);if(e.every(n=>n===wd))t=".*";else{let n=!1;e.forEach((r,i)=>{if(r===wd){if(n)return;t+=tL(2,i===e.length-1)}else{let s=!1,a="",l=!1,c="";for(let u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let p;u==="-"?p=u:(u==="^"||u==="!")&&!c?p="^":u===eL?p="":p=ao(u),c+=p;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{let m=`(?:${nL(a,",").map(g=>aL(g)).join("|")})`;t+=m,s=!1,a="";break}case"]":{t+="["+c+"]",l=!1,c="";break}case"?":t+=Uv;continue;case"*":t+=tL(1);continue;default:t+=ao(u)}}i<e.length-1&&(e[i+1]!==wd||i+2<e.length)&&(t+=Nv)}n=r===wd})}return t}function JE(o,t){if(!o)return Ri;let e;typeof o!="string"?e=o.pattern:e=o,e=e.trim();let n=t.ignoreCase??!1,r={...t,equals:n?Fr:(l,c)=>l===c,endsWith:n?y1:(l,c)=>l.endsWith(c),isEqualOrParent:(l,c)=>Vr(l,c,t.ignoreCase??!_e)},i=`${n?e.toLowerCase():e}_${!!t.trimForExclusions}_${n}`,s=rL.get(i);if(s)return iL(s,o,r);let a;return v9.test(e)?s=E9(e.substring(4),e,r):(a=y9.exec(QE(e,r)))?s=w9(a[1],e,r):(t.trimForExclusions?I9:b9).test(e)?s=C9(e,r):(a=x9.exec(QE(e,r)))?s=sL(a[1].substring(1),e,!0,r):(a=S9.exec(QE(e,r)))?s=sL(a[1],e,!1,r):s=T9(e,r),rL.set(i,s),iL(s,o,r)}function iL(o,t,e){if(typeof t=="string")return o;let n=function(r,i){return e.isEqualOrParent(r,t.base)?o(Ux(r.substring(t.base.length),Zt),i):null};return n.allBasenames=o.allBasenames,n.allPaths=o.allPaths,n.basenames=o.basenames,n.patterns=o.patterns,n}function QE(o,t){return t.trimForExclusions&&o.endsWith("/**")?o.substring(0,o.length-2):o}function E9(o,t,e){return function(n,r){return typeof n=="string"&&e.endsWith(n,o)?t:null}}function w9(o,t,e){let n=`/${o}`,r=`\\${o}`,i=function(a,l){return typeof a!="string"?null:l?e.equals(l,o)?t:null:e.equals(a,o)||e.endsWith(a,n)||e.endsWith(a,r)?t:null},s=[o];return i.basenames=s,i.patterns=[t],i.allBasenames=s,i}function C9(o,t){let e=cL(o.slice(1,-1).split(",").map(a=>JE(a,t)).filter(a=>a!==Ri),o),n=e.length;if(!n)return Ri;if(n===1)return e[0];let r=function(a,l){for(let c=0,u=e.length;c<u;c++)if(e[c](a,l))return o;return null},i=e.find(a=>!!a.allBasenames);i&&(r.allBasenames=i.allBasenames);let s=e.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function sL(o,t,e,n){let r=Zt===We.sep,i=r?o:o.replace(h9,Zt),s=Zt+i,a=We.sep+o,l;return e?l=function(c,u){return typeof c=="string"&&(n.equals(c,i)||n.endsWith(c,s)||!r&&(n.equals(c,o)||n.endsWith(c,a)))?t:null}:l=function(c,u){return typeof c=="string"&&(n.equals(c,i)||!r&&n.equals(c,o))?t:null},l.allPaths=[(e?"*/":"./")+o],l}function T9(o,t){try{let e=new RegExp(`^${aL(o)}$`,t.ignoreCase?"i":void 0);return function(n){return e.lastIndex=0,typeof n=="string"&&e.test(n)?o:null}}catch{return Ri}}function XE(o,t={}){if(!o)return oL;if(typeof o=="string"||lL(o)){let e=JE(o,t);if(e===Ri)return oL;let n=function(r,i){return!!e(r,i)};return e.allBasenames&&(n.allBasenames=e.allBasenames),e.allPaths&&(n.allPaths=e.allPaths),n}return P9(o,t)}function lL(o){let t=o;return t?typeof t.base=="string"&&typeof t.pattern=="string":!1}function P9(o,t){let e=cL(Object.getOwnPropertyNames(o).map(a=>k9(a,o[a],t)).filter(a=>a!==Ri)),n=e.length;if(!n)return Ri;if(!e.some(a=>!!a.requiresSiblings)){if(n===1)return e[0];let a=function(u,p){let m;for(let g=0,h=e.length;g<h;g++){let v=e[g](u,p);if(typeof v=="string")return v;wp(v)&&(m||(m=[]),m.push(v))}return m?(async()=>{for(let g of m){let h=await g;if(typeof h=="string")return h}return null})():null},l=e.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);let c=e.reduce((u,p)=>p.allPaths?u.concat(p.allPaths):u,[]);return c.length&&(a.allPaths=c),a}let r=function(a,l,c){let u,p;for(let m=0,g=e.length;m<g;m++){let h=e[m];h.requiresSiblings&&c&&(l||(l=at(a)),u||(u=l.substring(0,l.length-qo(a).length)));let v=h(a,l,u,c);if(typeof v=="string")return v;wp(v)&&(p||(p=[]),p.push(v))}return p?(async()=>{for(let m of p){let g=await m;if(typeof g=="string")return g}return null})():null},i=e.find(a=>!!a.allBasenames);i&&(r.allBasenames=i.allBasenames);let s=e.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function k9(o,t,e){if(t===!1)return Ri;let n=JE(o,e);if(n===Ri)return Ri;if(typeof t=="boolean")return n;if(t){let r=t.when;if(typeof r=="string"){let i=(s,a,l,c)=>{if(!c||!n(s,a))return null;let u=r.replace("$(basename)",()=>l),p=c(u);return wp(p)?p.then(m=>m?o:null):p?o:null};return i.requiresSiblings=!0,i}}return n}function cL(o,t){let e=o.filter(a=>!!a.basenames);if(e.length<2)return o;let n=e.reduce((a,l)=>{let c=l.basenames;return c?a.concat(c):a},[]),r;if(t){r=[];for(let a=0,l=n.length;a<l;a++)r.push(t)}else r=e.reduce((a,l)=>{let c=l.patterns;return c?a.concat(c):a},[]);let i=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){let p=a.charCodeAt(u-1);if(p===47||p===92)break}l=a.substring(u)}let c=n.indexOf(l);return c!==-1?r[c]:null};i.basenames=n,i.patterns=r,i.allBasenames=n;let s=o.filter(a=>!a.basenames);return s.push(i),s}function YE(o,t){return mn(o,t,(e,n)=>typeof e=="string"&&typeof n=="string"?e===n:typeof e!="string"&&typeof n!="string"?e.base===n.base&&e.pattern===n.pattern:!1)}var wd,eL,Nv,Uv,h9,v9,y9,b9,I9,x9,S9,rL,oL,Ri,Fv=y(()=>{At();ze();Ro();yi();Hn();Le();me();Qt();wd="**",eL="/",Nv="[/\\\\]",Uv="[^/\\\\]",h9=/\//g;v9=/^\*\*\/\*\.[\w\.-]+$/,y9=/^\*\*\/([\w\.-]+)\/?$/,b9=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,I9=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,x9=/^\*\*((\/[\w\.-]+)+)\/?$/,S9=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,rL=new gi(1e4),oL=function(){return!1},Ri=function(){return null}});function Hv(o){return typeof o.correlationId=="number"}function dL(o){return o.recursive===!0}function $v(o){return o.map(t=>({type:t.type,resource:I.revive(t.resource),cId:t.cId}))}function uL(o){let t=new ZE;for(let e of o)t.processEvent(e);return t.coalesce()}function D9(o,t){return typeof t=="string"&&!t.startsWith(wd)&&!ro(t)?{base:o,pattern:t}:t}function ew(o,t,e){let n=[];for(let r of t)n.push(XE(D9(o,r),{ignoreCase:e}));return n}function pL(o,t){if(typeof t=="number")switch(o.type){case 1:return(t&4)===0;case 2:return(t&8)===0;case 0:return(t&2)===0}return!1}function mL(o){if(typeof o=="number"){let t=[];return o&4&&t.push("Added"),o&8&&t.push("Deleted"),o&2&&t.push("Updated"),t.length===0?"<all>":`[${t.join(", ")}]`}return"<none>"}var Vv,Wv,Bv,ZE,Cl=y(()=>{Fv();q();Le();me();ce();nt();Vv=class o extends D{constructor(e,n,r,i){super();this.onFileChanges=e;this.onLogMessage=n;this.verboseLogging=r;this.options=i;this.watcherDisposables=this._register(new mr);this.requests=void 0;this.restartCounter=0}static{this.MAX_RESTARTS=5}init(){let e=new le;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(n=>this.onFileChanges(n))),e.add(this.watcher.onDidLogMessage(n=>this.onLogMessage(n))),e.add(this.watcher.onDidError(n=>this.onError(n.error,n.request)))}onError(e,n){this.canRestart(e,n)?this.restartCounter<o.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${e}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${e}`):this.error(e)}canRestart(e,n){return!(!this.options.restartOnError||n||e.indexOf("No space left on device")!==-1||e.indexOf("EMFILE")!==-1)}restart(e){this.restartCounter++,this.init(),this.watch(e)}async watch(e){this.requests=e,await this.watcher?.watch(e)}async setVerboseLogging(e){this.verboseLogging=e,await this.watcher?.setVerboseLogging(e)}error(e){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${e}`})}trace(e){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${e}`})}dispose(){return this.watcher=void 0,super.dispose()}},Wv=class extends Vv{constructor(t,e,n){super(t,e,n,{type:"node.js",restartOnError:!1})}},Bv=class extends Vv{constructor(t,e,n){super(t,e,n,{type:"universal",restartOnError:!0})}};ZE=class{constructor(){this.coalesced=new Set;this.mapPathToChange=new Map}toKey(t){return _e?t.resource.fsPath:t.resource.fsPath.toLowerCase()}processEvent(t){let e=this.mapPathToChange.get(this.toKey(t)),n=!1;if(e){let r=e.type,i=t.type;e.resource.fsPath!==t.resource.fsPath&&(t.type===2||t.type===1)?n=!0:r===1&&i===2?(this.mapPathToChange.delete(this.toKey(t)),this.coalesced.delete(e)):r===2&&i===1?e.type=0:r===1&&i===0||(e.type=i)}else n=!0;n&&(this.coalesced.add(t),this.mapPathToChange.set(this.toKey(t),t))}coalesce(){let t=[],e=[];return Array.from(this.coalesced).filter(n=>n.type!==2?(t.push(n),!1):!0).sort((n,r)=>n.resource.fsPath.length-r.resource.fsPath.length).filter(n=>e.some(r=>$D(n.resource.fsPath,r,!_e))?!1:(e.push(n.resource.fsPath),!0)).concat(t)}}});var zv,fL=y(()=>{At();ze();Se();de();yi();q();Le();Cl();Fe();zv=class extends D{constructor(e,n){super();this.logService=e;this.options=n;this._onDidChangeFile=this._register(new P);this.onDidChangeFile=this._onDidChangeFile.event;this._onDidWatchError=this._register(new P);this.onDidWatchError=this._onDidWatchError.event;this.universalWatchRequests=[];this.universalWatchRequestDelayer=this._register(new kr(this.getRefreshWatchersDelay(this.universalWatchRequests.length)));this.nonRecursiveWatchRequests=[];this.nonRecursiveWatchRequestDelayer=this._register(new kr(this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)))}watch(e,n){return n.recursive||this.options?.watcher?.forceUniversal?this.watchUniversal(e,n):this.watchNonRecursive(e,n)}getRefreshWatchersDelay(e){return e>200?500:0}watchUniversal(e,n){let r=this.toWatchRequest(e,n),i=wx(this.universalWatchRequests,r);return this.refreshUniversalWatchers(),ie(()=>{i(),this.refreshUniversalWatchers()})}toWatchRequest(e,n){let r={path:this.toWatchPath(e),excludes:n.excludes,includes:n.includes,recursive:n.recursive,filter:n.filter,correlationId:n.correlationId};if(dL(r)){let i=this.options?.watcher?.recursive?.usePolling;i===!0?r.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3:Array.isArray(i)&&i.includes(r.path)&&(r.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3)}return r}refreshUniversalWatchers(){this.universalWatchRequestDelayer.trigger(()=>this.doRefreshUniversalWatchers(),this.getRefreshWatchersDelay(this.universalWatchRequests.length)).catch(e=>Ke(e))}doRefreshUniversalWatchers(){return this.universalWatcher||(this.universalWatcher=this._register(this.createUniversalWatcher(e=>this._onDidChangeFile.fire($v(e)),e=>this.onWatcherLogMessage(e),this.logService.getLevel()===1)),this._register(this.logService.onDidChangeLogLevel(()=>{this.universalWatcher?.setVerboseLogging(this.logService.getLevel()===1)}))),this.universalWatcher.watch(this.universalWatchRequests)}watchNonRecursive(e,n){let r={path:this.toWatchPath(e),excludes:n.excludes,includes:n.includes,recursive:!1,filter:n.filter,correlationId:n.correlationId},i=wx(this.nonRecursiveWatchRequests,r);return this.refreshNonRecursiveWatchers(),ie(()=>{i(),this.refreshNonRecursiveWatchers()})}refreshNonRecursiveWatchers(){this.nonRecursiveWatchRequestDelayer.trigger(()=>this.doRefreshNonRecursiveWatchers(),this.getRefreshWatchersDelay(this.nonRecursiveWatchRequests.length)).catch(e=>Ke(e))}doRefreshNonRecursiveWatchers(){return this.nonRecursiveWatcher||(this.nonRecursiveWatcher=this._register(this.createNonRecursiveWatcher(e=>this._onDidChangeFile.fire($v(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 In(e.fsPath)}toWatchPath(e){let n=this.toFilePath(e);return E1(n)}}});var gL=y(()=>{Me();q();Wt()});function je(o,t,e){let n=null,r=null;if(typeof e.value=="function"?(n="value",r=e.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof e.get=="function"&&(n="get",r=e.get),!r)throw new Error("not supported");let i=`$memoize$${t}`;e[n]=function(...s){return this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,s)}),this[i]}}var Gv=y(()=>{gL()});function Pd(o){switch(o){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}function qv(o){switch(o){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}function Cd(o){let t=0;for(let e=0;;e+=7){let n=o.read(1);if(t|=(n.buffer[0]&127)<<e,!(n.buffer[0]&128))return t}}function Td(o,t){if(t===0){o.write(_9);return}let e=0;for(let r=t;r!==0;r=r>>>7)e++;let n=A.alloc(e);for(let r=0;t!==0;r++)n.buffer[r]=t&127,t=t>>>7,t>0&&(n.buffer[r]|=128);o.write(n)}function aa(o){let t=A.alloc(1);return t.writeUInt8(o,0),t}function Tm(o,t){if(typeof t>"u")o.write(Tl.Undefined);else if(typeof t=="string"){let e=A.fromString(t);o.write(Tl.String),Td(o,e.byteLength),o.write(e)}else if(A.isNativeBuffer(t)){let e=A.wrap(t);o.write(Tl.Buffer),Td(o,e.byteLength),o.write(e)}else if(t instanceof A)o.write(Tl.VSBuffer),Td(o,t.byteLength),o.write(t);else if(Array.isArray(t)){o.write(Tl.Array),Td(o,t.length);for(let e of t)Tm(o,e)}else if(typeof t=="number"&&(t|0)===t)o.write(Tl.Uint),Td(o,t);else{let e=A.fromString(JSON.stringify(t));o.write(Tl.Object),Td(o,e.byteLength),o.write(e)}}function Rd(o){switch(o.read(1).readUInt8(0)){case 0:return;case 1:return o.read(Cd(o)).toString();case 2:return o.read(Cd(o)).buffer;case 3:return o.read(Cd(o));case 4:{let e=Cd(o),n=[];for(let r=0;r<e;r++)n.push(Rd(o));return n}case 5:return JSON.parse(o.read(Cd(o)).toString());case 6:return Cd(o)}}function hL(o){return{call(t,e,n){return o.then(r=>r.call(t,e,n))},listen(t,e){let n=new hp;return o.then(r=>n.input=r.listen(t,e)),n.event}}}function vL(o){let t=!1;return{call(e,n,r){return t?o.call(e,n,r):uo(0).then(()=>t=!0).then(()=>o.call(e,n,r))},listen(e,n){if(t)return o.listen(e,n);let r=new hp;return uo(0).then(()=>t=!0).then(()=>r.input=o.listen(e,n)),r.event}}}var _9,Cm,Kv,Tl,jv,kd,Pm,Qv,ds,la=y(()=>{At();ze();et();Wt();Gv();Se();de();mp();q();rd();Qt();Me();_9=aa(0);Cm=class{constructor(t){this.buffer=t;this.pos=0}read(t){let e=this.buffer.slice(this.pos,this.pos+t);return this.pos+=e.byteLength,e}},Kv=class{constructor(){this.buffers=[]}get buffer(){return A.concat(this.buffers)}write(t){this.buffers.push(t)}};Tl={Undefined:aa(0),String:aa(1),Buffer:aa(2),VSBuffer:aa(3),Array:aa(4),Object:aa(5),Uint:aa(6)};jv=class{constructor(t,e,n=null,r=1e3){this.protocol=t;this.ctx=e;this.logger=n;this.timeoutDelay=r;this.channels=new Map;this.activeRequests=new Map;this.pendingRequests=new Map;this.protocolListener=this.protocol.onMessage(i=>this.onRawMessage(i)),this.sendResponse({type:200})}registerChannel(t,e){this.channels.set(t,e),setTimeout(()=>this.flushPendingRequests(t),0)}sendResponse(t){switch(t.type){case 200:{let e=this.send([t.type]);this.logger?.logOutgoing(e,0,1,qv(t.type));return}case 201:case 202:case 204:case 203:{let e=this.send([t.type,t.id],t.data);this.logger?.logOutgoing(e,t.id,1,qv(t.type),t.data);return}}}send(t,e=void 0){let n=new Kv;return Tm(n,t),Tm(n,e),this.sendBuffer(n.buffer)}sendBuffer(t){try{return this.protocol.send(t),t.byteLength}catch{return 0}}onRawMessage(t){let e=new Cm(t),n=Rd(e),r=Rd(e),i=n[0];switch(i){case 100:return this.logger?.logIncoming(t.byteLength,n[1],1,`${Pd(i)}: ${n[2]}.${n[3]}`,r),this.onPromise({type:i,id:n[1],channelName:n[2],name:n[3],arg:r});case 102:return this.logger?.logIncoming(t.byteLength,n[1],1,`${Pd(i)}: ${n[2]}.${n[3]}`,r),this.onEventListen({type:i,id:n[1],channelName:n[2],name:n[3],arg:r});case 101:return this.logger?.logIncoming(t.byteLength,n[1],1,`${Pd(i)}`),this.disposeActiveRequest({type:i,id:n[1]});case 103:return this.logger?.logIncoming(t.byteLength,n[1],1,`${Pd(i)}`),this.disposeActiveRequest({type:i,id:n[1]})}}onPromise(t){let e=this.channels.get(t.channelName);if(!e){this.collectPendingRequest(t);return}let n=new gt,r;try{r=e.call(this.ctx,t.name,t.arg,n.token)}catch(a){r=Promise.reject(a)}let i=t.id;r.then(a=>{this.sendResponse({id:i,data:a,type:201})},a=>{a instanceof Error?this.sendResponse({id:i,data:{message:a.message,name:a.name,stack:a.stack?a.stack.split(`
- `):void 0},type:202}):this.sendResponse({id:i,data:a,type:203})}).finally(()=>{s.dispose(),this.activeRequests.delete(t.id)});let s=ie(()=>n.cancel());this.activeRequests.set(t.id,s)}onEventListen(t){let e=this.channels.get(t.channelName);if(!e){this.collectPendingRequest(t);return}let n=t.id,i=e.listen(this.ctx,t.name,t.arg)(s=>this.sendResponse({id:n,data:s,type:204}));this.activeRequests.set(t.id,i)}disposeActiveRequest(t){let e=this.activeRequests.get(t.id);e&&(e.dispose(),this.activeRequests.delete(t.id))}collectPendingRequest(t){let e=this.pendingRequests.get(t.channelName);e||(e=[],this.pendingRequests.set(t.channelName,e));let n=setTimeout(()=>{console.error(`Unknown channel: ${t.channelName}`),t.type===100&&this.sendResponse({id:t.id,data:{name:"Unknown channel",message:`Channel name '${t.channelName}' timed out after ${this.timeoutDelay}ms`,stack:void 0},type:202})},this.timeoutDelay);e.push({request:t,timeoutTimer:n})}flushPendingRequests(t){let e=this.pendingRequests.get(t);if(e){for(let n of e)switch(clearTimeout(n.timeoutTimer),n.request.type){case 100:this.onPromise(n.request);break;case 102:this.onEventListen(n.request);break}this.pendingRequests.delete(t)}}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),jt(this.activeRequests.values()),this.activeRequests.clear()}},kd=class{constructor(t,e=null){this.protocol=t;this.isDisposed=!1;this.state=0;this.activeRequests=new Set;this.handlers=new Map;this.lastRequestId=0;this._onDidInitialize=new P;this.onDidInitialize=this._onDidInitialize.event;this.protocolListener=this.protocol.onMessage(n=>this.onBuffer(n)),this.logger=e}getChannel(t){let e=this;return{call(n,r,i){return e.isDisposed?Promise.reject(new Ye):e.requestPromise(t,n,r,i)},listen(n,r){return e.isDisposed?F.None:e.requestEvent(t,n,r)}}}requestPromise(t,e,n,r=Ee.None){let i=this.lastRequestId++,a={id:i,type:100,channelName:t,name:e,arg:n};if(r.isCancellationRequested)return Promise.reject(new Ye);let l,c;return new Promise((p,m)=>{if(r.isCancellationRequested)return m(new Ye);let g=()=>{let x=T=>{switch(T.type){case 201:this.handlers.delete(i),p(T.data);break;case 202:{this.handlers.delete(i);let w=new Error(T.data.message);w.stack=Array.isArray(T.data.stack)?T.data.stack.join(`
- `):T.data.stack,w.name=T.data.name,m(w);break}case 203:this.handlers.delete(i),m(T.data);break}};this.handlers.set(i,x),this.sendRequest(a)},h=null;this.state===1?g():(h=Rr(x=>this.whenInitialized()),h.then(()=>{h=null,g()}));let v=()=>{h?(h.cancel(),h=null):this.sendRequest({id:i,type:101}),m(new Ye)};l=r.onCancellationRequested(v),c={dispose:Ka(()=>{v(),l.dispose()})},this.activeRequests.add(c)}).finally(()=>{l?.dispose(),this.activeRequests.delete(c)})}requestEvent(t,e,n){let r=this.lastRequestId++,s={id:r,type:102,channelName:t,name:e,arg:n},a=null,l=new P({onWillAddFirstListener:()=>{let u=()=>{this.activeRequests.add(l),this.sendRequest(s)};this.state===1?u():(a=Rr(p=>this.whenInitialized()),a.then(()=>{a=null,u()}))},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(l),this.sendRequest({id:r,type:103})),this.handlers.delete(r)}}),c=u=>l.fire(u.data);return this.handlers.set(r,c),l.event}sendRequest(t){switch(t.type){case 100:case 102:{let e=this.send([t.type,t.id,t.channelName,t.name],t.arg);this.logger?.logOutgoing(e,t.id,0,`${Pd(t.type)}: ${t.channelName}.${t.name}`,t.arg);return}case 101:case 103:{let e=this.send([t.type,t.id]);this.logger?.logOutgoing(e,t.id,0,Pd(t.type));return}}}send(t,e=void 0){let n=new Kv;return Tm(n,t),Tm(n,e),this.sendBuffer(n.buffer)}sendBuffer(t){try{return this.protocol.send(t),t.byteLength}catch{return 0}}onBuffer(t){let e=new Cm(t),n=Rd(e),r=Rd(e),i=n[0];switch(i){case 200:return this.logger?.logIncoming(t.byteLength,0,0,qv(i)),this.onResponse({type:n[0]});case 201:case 202:case 204:case 203:return this.logger?.logIncoming(t.byteLength,n[1],0,qv(i),r),this.onResponse({type:n[0],id:n[1],data:r})}}onResponse(t){if(t.type===200){this.state=1,this._onDidInitialize.fire();return}this.handlers.get(t.id)?.(t)}get onDidInitializePromise(){return F.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===1?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),jt(this.activeRequests.values()),this.activeRequests.clear(),this._onDidInitialize.dispose()}};E([je],kd.prototype,"onDidInitializePromise",1);Pm=class{constructor(t,e,n){this.channels=new Map;this._connections=new Set;this._onDidAddConnection=new P;this.onDidAddConnection=this._onDidAddConnection.event;this._onDidRemoveConnection=new P;this.onDidRemoveConnection=this._onDidRemoveConnection.event;this.disposables=new le;this.disposables.add(t(({protocol:r,onDidClientDisconnect:i})=>{let s=F.once(r.onMessage);this.disposables.add(s(a=>{let l=new Cm(a),c=Rd(l),u=new jv(r,c,e,n),p=new kd(r,e);this.channels.forEach((g,h)=>u.registerChannel(h,g));let m={channelServer:u,channelClient:p,ctx:c};this._connections.add(m),this._onDidAddConnection.fire(m),this.disposables.add(i(()=>{u.dispose(),p.dispose(),this._connections.delete(m),this._onDidRemoveConnection.fire(m)}))}))}))}get connections(){let t=[];return this._connections.forEach(e=>t.push(e)),t}getChannel(t,e){let n=this;return{call(r,i,s){let a;if(vc(e)){let c=KR(n.connections.filter(e));a=c?Promise.resolve(c):F.toPromise(F.filter(n.onDidAddConnection,e))}else a=e.routeCall(n,r,i);let l=a.then(c=>c.channelClient.getChannel(t));return hL(l).call(r,i,s)},listen(r,i){if(vc(e))return n.getMulticastEvent(t,e,r,i);let s=e.routeEvent(n,r,i).then(a=>a.channelClient.getChannel(t));return hL(s).listen(r,i)}}}getMulticastEvent(t,e,n,r){let i=this,s,a=new P({onWillAddFirstListener:()=>{s=new le;let l=new jg,c=new Map,u=m=>{let h=m.channelClient.getChannel(t).listen(n,r),v=l.add(h);c.set(m,v)},p=m=>{let g=c.get(m);g&&(g.dispose(),c.delete(m))};i.connections.filter(e).forEach(u),F.filter(i.onDidAddConnection,e)(u,void 0,s),i.onDidRemoveConnection(p,void 0,s),l.event(a.fire,a,s),s.add(l)},onDidRemoveLastListener:()=>{s?.dispose(),s=void 0}});return i.disposables.add(a),a.event}registerChannel(t,e){this.channels.set(t,e);for(let n of this._connections)n.channelServer.registerChannel(t,e)}dispose(){this.disposables.dispose();for(let t of this._connections)t.channelClient.dispose(),t.channelServer.dispose();this._connections.clear(),this.channels.clear(),this._onDidAddConnection.dispose(),this._onDidRemoveConnection.dispose()}};Qv=class{constructor(t){this.fn=t}routeCall(t){return this.route(t)}routeEvent(t){return this.route(t)}async route(t){for(let e of t.connections)if(await Promise.resolve(this.fn(e.ctx)))return Promise.resolve(e);return await F.toPromise(t.onDidAddConnection),await this.route(t)}};(r=>{function o(i,s,a){let l=i,c=a?.disableMarshalling,u=new Map;for(let p in l)e(p)&&u.set(p,F.buffer(l[p],p,!0,void 0,s));return new class{listen(p,m,g){let h=u.get(m);if(h)return h;let v=l[m];if(typeof v=="function"){if(n(m))return v.call(l,g);if(e(m))return u.set(m,F.buffer(l[m],m,!0,void 0,s)),u.get(m)}throw new ur(`Event not found: ${m}`)}call(p,m,g){let h=l[m];if(typeof h=="function"){if(!c&&Array.isArray(g))for(let x=0;x<g.length;x++)g[x]=ir(g[x]);let v=h.apply(l,g);return v instanceof Promise||(v=Promise.resolve(v)),v}throw new ur(`Method not found: ${m}`)}}}r.fromService=o;function t(i,s){let a=s?.disableMarshalling;return new Proxy({},{get(l,c){if(typeof c=="string")return s?.properties?.has(c)?s.properties.get(c):n(c)?function(u){return i.listen(c,u)}:e(c)?i.listen(c):async function(...u){let p;s&&!_t(s.context)?p=[s.context,...u]:p=u;let m=await i.call(c,p);return a?m:ir(m)};throw new ur(`Property not found: ${String(c)}`)}})}r.toService=t;function e(i){return i[0]==="o"&&i[1]==="n"&&Fx(i.charCodeAt(2))}function n(i){return/^onDynamic/.test(i)&&Fx(i.charCodeAt(9))}})(ds||={})});function yL(o){let t=o;return t&&typeof t.type=="string"&&typeof t.severity=="string"}function L9(o){let t=[],e;try{let n=JSON.parse(o.arguments),r=n[n.length-1];r&&r.__$stack&&(n.pop(),e=r.__$stack),t.push(...n)}catch{t.push("Unable to log remote console arguments",o.arguments)}return{args:t,stack:e}}function M9(o){if(!o)return o;let t=o.indexOf(`
- `);return t===-1?o:o.substring(0,t)}function bL(o,t){let{args:e,stack:n}=L9(o),r=typeof e[0]=="string"&&e.length===1,i=M9(n);i&&(i=`(${i.trim()})`);let s=[];if(typeof e[0]=="string"?i&&r?s=[`%c[${t}] %c${e[0]} %c${i}`,Dd("blue"),Dd(""),Dd("grey")]:s=[`%c[${t}] %c${e[0]}`,Dd("blue"),Dd(""),...e.slice(1)]:s=[`%c[${t}]%`,Dd("blue"),...e],i&&!r&&s.push(i),typeof console[o.severity]!="function")throw new Error("Unknown console method");console[o.severity].apply(console,s)}function Dd(o){return`color: ${o}`}var IL=y(()=>{ce()});import{fork as O9}from"child_process";var ca,Jv=y(()=>{ze();et();Wt();IL();Se();de();q();on();Yp();Jp();la();ca=class{constructor(t,e){this.modulePath=t;this.options=e;this.activeRequests=new Set;this.channels=new Map;this._onDidProcessExit=new P;this.onDidProcessExit=this._onDidProcessExit.event;let n=e.timeout||6e4;this.disposeDelayer=new xp(n),this.child=null,this._client=null}getChannel(t){let e=this;return{call(n,r,i){return e.requestPromise(t,n,r,i)},listen(n,r){return e.requestEvent(t,n,r)}}}requestPromise(t,e,n,r=Ee.None){if(!this.disposeDelayer)return Promise.reject(new Error("disposed"));if(r.isCancellationRequested)return Promise.reject(pp());this.disposeDelayer.cancel();let i=this.getCachedChannel(t),s=Rr(c=>i.call(e,n,c)),a=r.onCancellationRequested(()=>s.cancel()),l=ie(()=>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(t,e,n){if(!this.disposeDelayer)return F.None;this.disposeDelayer.cancel();let r,i=new P({onWillAddFirstListener:()=>{r=this.getCachedChannel(t).listen(e,n)(i.fire,i),this.activeRequests.add(r)},onDidRemoveLastListener:()=>{this.activeRequests.delete(r),r.dispose(),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}});return i.event}get client(){if(!this._client){let t=this.options.args||[],e=Object.create(null);e.env={...fo(process.env),VSCODE_PARENT_PID:String(process.pid)},this.options.env&&(e.env={...e.env,...this.options.env}),this.options.freshExecArgv&&(e.execArgv=[]),typeof this.options.debug=="number"&&(e.execArgv=["--nolazy","--inspect="+this.options.debug]),typeof this.options.debugBrk=="number"&&(e.execArgv=["--nolazy","--inspect-brk="+this.options.debugBrk]),e.execArgv===void 0&&(e.execArgv=process.execArgv.filter(p=>!/^--inspect(-brk)?=/.test(p)).filter(p=>!p.startsWith("--vscode-"))),zh(e.env),this.child=O9(this.modulePath,t,e);let n=new P,i=F.fromNodeEventEmitter(this.child,"message",p=>p)(p=>{if(yL(p)){bL(p,`IPC Library: ${this.options.serverName}`);return}n.fire(A.wrap(Buffer.from(p,"base64")))}),s=this.options.useQueue?a0(this.child):this.child,a=p=>this.child?.connected&&s.send(p.buffer.toString("base64")),l=n.event,c={send:a,onMessage:l};this._client=new kd(c);let u=()=>this.disposeClient();process.once("exit",u),this.child.on("error",p=>console.warn('IPC "'+this.options.serverName+'" errored with '+p)),this.child.on("exit",(p,m)=>{process.removeListener("exit",u),i.dispose(),this.activeRequests.forEach(g=>jt(g)),this.activeRequests.clear(),p!==0&&m!=="SIGTERM"&&console.warn('IPC "'+this.options.serverName+'" crashed with exit code '+p+" and signal "+m),this.disposeDelayer?.cancel(),this.disposeClient(),this._onDidProcessExit.fire({code:p,signal:m})})}return this._client}getCachedChannel(t){let e=this.channels.get(t);return e||(e=this.client.getChannel(t),this.channels.set(t,e)),e}disposeClient(){this._client&&(this.child&&(this.child.kill(),this.child=null),this._client=null,this.channels.clear())}dispose(){this._onDidProcessExit.dispose(),this.disposeDelayer?.cancel(),this.disposeDelayer=void 0,this.disposeClient(),this.activeRequests.clear()}}});var Xv,xL=y(()=>{$e();la();Jv();Cl();Xv=class extends Bv{constructor(t,e,n){super(t,e,n),this.init()}createWatcher(t){let e=t.add(new ca(yt.asFileUri("bootstrap-fork").fsPath,{serverName:"File Watcher",args:["--type=fileWatcher"],env:{VSCODE_ESM_ENTRYPOINT:"vs/platform/files/node/watcher/watcherMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"}}));return t.add(e.onDidProcessExit(({code:n,signal:r})=>this.onError(`terminated by itself with code ${n}, signal: ${r} (ETERM)`))),ds.toService(vL(e.getChannel("watcher")))}}});import{watchFile as A9,unwatchFile as N9}from"fs";var Yv,SL=y(()=>{q();Cl();de();nt();ce();ze();ol();Se();Yv=class extends D{constructor(){super();this._onDidChangeFile=this._register(new P);this.onDidChangeFile=this._onDidChangeFile.event;this._onDidLogMessage=this._register(new P);this.onDidLogMessage=this._onDidLogMessage.event;this._onDidWatchFail=this._register(new P);this.onDidWatchFail=this._onDidWatchFail.event;this.correlatedWatchRequests=new Map;this.nonCorrelatedWatchRequests=new Map;this.suspendedWatchRequests=this._register(new Ur);this.suspendedWatchRequestsWithPolling=new Set;this.updateWatchersDelayer=this._register(new kr(this.getUpdateWatchersDelay()));this.suspendedWatchRequestPollingInterval=5007;this.joinWatch=new Wr;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 Hv(e)}computeId(e){return this.isCorrelated(e)?e.correlationId:po(e)}async watch(e){this.joinWatch.isSettled||this.joinWatch.complete(),this.joinWatch=new Wr;try{this.correlatedWatchRequests.clear(),this.nonCorrelatedWatchRequests.clear();for(let n of e)this.isCorrelated(n)?this.correlatedWatchRequests.set(n.correlationId,n):this.nonCorrelatedWatchRequests.set(this.computeId(n),n);for(let[n]of this.suspendedWatchRequests)!this.nonCorrelatedWatchRequests.has(n)&&!this.correlatedWatchRequests.has(n)&&(this.suspendedWatchRequests.deleteAndDispose(n),this.suspendedWatchRequestsWithPolling.delete(n));return await this.updateWatchers(!1)}finally{this.joinWatch.complete()}}updateWatchers(e){let n=[];for(let[r,i]of[...this.nonCorrelatedWatchRequests,...this.correlatedWatchRequests])this.suspendedWatchRequests.has(r)||n.push(i);return this.updateWatchersDelayer.trigger(()=>this.doWatch(n),e?this.getUpdateWatchersDelay():0).catch(r=>Ke(r))}getUpdateWatchersDelay(){return 800}isSuspended(e){let n=this.computeId(e);return this.suspendedWatchRequestsWithPolling.has(n)?"polling":this.suspendedWatchRequests.has(n)}async suspendWatchRequest(e){if(this.suspendedWatchRequests.has(e.id))return;let n=new le;this.suspendedWatchRequests.set(e.id,n),await this.joinWatch.p,!n.isDisposed&&(this.monitorSuspendedWatchRequest(e,n),this.updateWatchers(!0))}resumeWatchRequest(e){this.suspendedWatchRequests.deleteAndDispose(e.id),this.suspendedWatchRequestsWithPolling.delete(e.id),this.updateWatchers(!1)}monitorSuspendedWatchRequest(e,n){this.doMonitorWithExistingWatcher(e,n)?(this.trace(`reusing an existing recursive watcher to monitor ${e.path}`),this.suspendedWatchRequestsWithPolling.delete(e.id)):(this.doMonitorWithNodeJS(e,n),this.suspendedWatchRequestsWithPolling.add(e.id))}doMonitorWithExistingWatcher(e,n){let r=this.recursiveWatcher?.subscribe(e.path,(i,s)=>{n.isDisposed||(i?this.monitorSuspendedWatchRequest(e,n):s?.type===1&&this.onMonitoredPathAdded(e))});return r?(n.add(r),!0):!1}doMonitorWithNodeJS(e,n){let r=!1,i=(s,a)=>{if(n.isDisposed)return;let l=this.isPathNotFound(s),c=this.isPathNotFound(a),u=r;r=l,!l&&(c||u)&&this.onMonitoredPathAdded(e)};this.trace(`starting fs.watchFile() on ${e.path} (correlationId: ${e.correlationId})`);try{A9(e.path,{persistent:!1,interval:this.suspendedWatchRequestPollingInterval},i)}catch(s){this.warn(`fs.watchFile() failed with error ${s} on path ${e.path} (correlationId: ${e.correlationId})`)}n.add(ie(()=>{this.trace(`stopping fs.watchFile() on ${e.path} (correlationId: ${e.correlationId})`);try{N9(e.path,i)}catch(s){this.warn(`fs.unwatchFile() failed with error ${s} on path ${e.path} (correlationId: ${e.correlationId})`)}}))}onMonitoredPathAdded(e){this.trace(`detected ${e.path} exists again, resuming watcher (correlationId: ${e.correlationId})`);let n={resource:I.file(e.path),type:1,cId:e.correlationId};this._onDidChangeFile.fire([n]),this.traceEvent(n,e),this.resumeWatchRequest(e)}isPathNotFound(e){return e.ctimeMs===0&&e.ino===0}async stop(){this.suspendedWatchRequests.clearAndDisposeAll(),this.suspendedWatchRequestsWithPolling.clear()}traceEvent(e,n){if(this.verboseLogging){let r=` >> normalized ${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`;this.traceWithCorrelation(r,n)}}traceWithCorrelation(e,n){this.verboseLogging&&this.trace(`${e}${typeof n.correlationId=="number"?` <${n.correlationId}> `:""}`)}requestToString(e){return`${e.path} (excludes: ${e.excludes.length>0?e.excludes:"<none>"}, includes: ${e.includes&&e.includes.length>0?JSON.stringify(e.includes):"<all>"}, filter: ${mL(e.filter)}, correlationId: ${typeof e.correlationId=="number"?e.correlationId:"<none>"})`}async setVerboseLogging(e){this.verboseLogging=e}}});import{watch as U9,promises as F9}from"fs";var Zv,EL=y(()=>{ze();Wt();yi();q();sh();Le();me();Nt();ce();fr();nt();Cl();Qi();Zv=class o extends D{constructor(e,n,r,i,s,a){super();this.request=e;this.recursiveWatcher=n;this.onDidFilesChange=r;this.onDidWatchFail=i;this.onLogMessage=s;this.verboseLogging=a;this.throttledFileChangesEmitter=this._register(new Rc({maxWorkChunkSize:100,throttleDelay:200,maxBufferedWork:1e4},e=>this.onDidFilesChange(e)));this.fileChangesAggregator=this._register(new oh(e=>this.handleFileChanges(e),o.FILE_CHANGES_HANDLER_DELAY));this.cts=new gt;this.realPath=new gn(async()=>{let e=this.request.path;try{e=await Te.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=!_e;this.excludes=ew(this.request.path,this.request.excludes,l),this.includes=this.request.includes?ew(this.request.path,this.request.includes,l):void 0,this.filter=Hv(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 F9.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 n=new le;return this.doWatchWithExistingWatcher(e,n)?(this.trace(`reusing an existing recursive watcher for ${this.request.path}`),this._isReusingRecursiveWatcher=!0):(this._isReusingRecursiveWatcher=!1,await this.doWatchWithNodeJS(e,n)),n}doWatchWithExistingWatcher(e,n){if(e)return!1;let r=I.file(this.request.path),i=this.recursiveWatcher?.subscribe(this.request.path,async(s,a)=>{n.isDisposed||(s?await o1(this.doWatch(e),n):a&&(typeof a.cId=="number"||typeof this.request.correlationId=="number")&&this.onFileChange({resource:r,type:a.type,cId:this.request.correlationId},!0))});return i?(n.add(i),!0):!1}async doWatchWithNodeJS(e,n){let r=await this.realPath.value;if(this.cts.token.isCancellationRequested)return;if(rt&&Vr(r,"/Volumes/",!0)){this.error(`Refusing to watch ${r} for changes using fs.watch() for possibly being a network share where watching is unreliable and unstable.`);return}let i=new gt(this.cts.token);n.add(ie(()=>i.dispose(!0)));let s=new le;n.add(s);try{let a=I.file(this.request.path),l=at(r),c=U9(r);s.add(ie(()=>{c.removeAllListeners(),c.close()})),this.trace(`Started watching: '${r}'`);let u=new Set;if(e)try{for(let m of await Te.readdir(r))u.add(m)}catch(m){this.error(m)}if(i.token.isCancellationRequested)return;let p=new Map;s.add(ie(()=>{for(let[,m]of p)m.dispose();p.clear()})),c.on("error",(m,g)=>{i.token.isCancellationRequested||(this.error(`Failed to watch ${r} for changes using fs.watch() (${m}, ${g})`),this.notifyWatchFailed())}),c.on("change",(m,g)=>{if(i.token.isCancellationRequested)return;this.verboseLogging&&this.traceWithCorrelation(`[raw] ["${m}"] ${g}`);let h="";if(g&&(h=g.toString(),rt&&(h=Cp(h))),!(!h||m!=="change"&&m!=="rename"))if(e)if(m==="rename"){p.get(h)?.dispose();let v=setTimeout(async()=>{if(p.delete(h),wc(h,l,!_e)&&!await Te.exists(r)){this.onWatchedPathDeleted(a);return}if(i.token.isCancellationRequested)return;let x=await this.existsChildStrictCase(H(r,h));if(i.token.isCancellationRequested)return;let T;x?u.has(h)?T=0:(T=1,u.add(h)):(u.delete(h),T=2),this.onFileChange({resource:ye(a,h),type:T,cId:this.request.correlationId})},o.FILE_DELETE_HANDLER_DELAY);p.set(h,ie(()=>clearTimeout(v)))}else{let v;u.has(h)?v=0:(v=1,u.add(h)),this.onFileChange({resource:ye(a,h),type:v,cId:this.request.correlationId})}else if(m==="rename"||!wc(h,l,!_e)){let v=setTimeout(async()=>{let x=await Te.exists(r);i.token.isCancellationRequested||(x?(this.onFileChange({resource:a,type:0,cId:this.request.correlationId},!0),s.add(await this.doWatch(!1))):this.onWatchedPathDeleted(a))},o.FILE_DELETE_HANDLER_DELAY);s.clear(),s.add(ie(()=>clearTimeout(v)))}else this.onFileChange({resource:a,type:0,cId:this.request.correlationId},!0)})}catch(a){if(i.token.isCancellationRequested)return;this.error(`Failed to watch ${r} 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,n=!1){this.cts.token.isCancellationRequested||(this.verboseLogging&&this.traceWithCorrelation(`${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`),!n&&this.excludes.some(r=>r(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (excluded) ${e.resource.fsPath}`):!n&&this.includes&&this.includes.length>0&&!this.includes.some(r=>r(e.resource.fsPath))?this.verboseLogging&&this.traceWithCorrelation(` >> ignored (not included) ${e.resource.fsPath}`):this.fileChangesAggregator.work(e))}handleFileChanges(e){let n=uL(e),r=[];for(let s of n){if(pL(s,this.filter)){this.verboseLogging&&this.traceWithCorrelation(` >> ignored (filtered) ${s.resource.fsPath}`);continue}r.push(s)}if(r.length===0)return;if(this.verboseLogging)for(let s of r)this.traceWithCorrelation(` >> normalized ${s.type===1?"[ADDED]":s.type===2?"[DELETED]":"[CHANGED]"} ${s.resource.fsPath}`);this.throttledFileChangesEmitter.work(r)?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: ${r[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: ${r.length}, most recent change: ${r[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`)}async existsChildStrictCase(e){if(_e)return Te.exists(e);try{let n=at(e);return(await Te.readdir(Ct(e))).some(i=>i===n)}catch(n){return this.trace(n),!1}}setVerboseLogging(e){this.verboseLogging=e}error(e){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"error",message:`[File Watcher (node.js)] ${e}`})}warn(e){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"warn",message:`[File Watcher (node.js)] ${e}`})}trace(e){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.onLogMessage?.({type:"trace",message:`[File Watcher (node.js)] ${e}`})}traceWithCorrelation(e){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.trace(`${e}${typeof this.request.correlationId=="number"?` <${this.request.correlationId}> `:""}`)}dispose(){this.cts.dispose(!0),super.dispose()}}});var ey,wL=y(()=>{de();Fv();SL();me();EL();ze();q();ey=class extends Yv{constructor(e){super();this.recursiveWatcher=e;this.onDidError=F.None;this._watchers=new Map;this.worker=this._register(new mr)}get watchers(){return this._watchers.values()}async doWatch(e){e=this.removeDuplicateRequests(e);let n=[],r=new Set(Array.from(this.watchers));for(let i of e){let s=this._watchers.get(this.requestToWatcherKey(i));s&&YE(s.request.excludes,i.excludes)&&YE(s.request.includes,i.includes)?r.delete(s):n.push(i)}n.length&&this.trace(`Request to start watching: ${n.map(i=>this.requestToString(i)).join(",")}`),r.size&&this.trace(`Request to stop watching: ${Array.from(r).map(i=>this.requestToString(i.request)).join(",")}`),this.worker.clear();for(let i of r)this.stopWatching(i);this.createWatchWorker().work(n)}createWatchWorker(){return this.worker.value=new Rc({maxWorkChunkSize:100,throttleDelay:100,maxBufferedWork:Number.MAX_VALUE},e=>{for(let n of e)this.startWatching(n)}),this.worker.value}requestToWatcherKey(e){return typeof e.correlationId=="number"?e.correlationId:this.pathToWatcherKey(e.path)}pathToWatcherKey(e){return _e?e:e.toLowerCase()}startWatching(e){let n=new Zv(e,this.recursiveWatcher,i=>this._onDidChangeFile.fire(i),()=>this._onDidWatchFail.fire(e),i=>this._onDidLogMessage.fire(i),this.verboseLogging),r={request:e,instance:n};this._watchers.set(this.requestToWatcherKey(e),r)}async stop(){await super.stop();for(let e of this.watchers)this.stopWatching(e)}stopWatching(e){this.trace("stopping file watcher",e),this._watchers.delete(this.requestToWatcherKey(e.request)),e.instance.dispose()}removeDuplicateRequests(e){let n=new Map;for(let r of e){let i=n.get(r.correlationId);i||(i=new Map,n.set(r.correlationId,i));let s=this.pathToWatcherKey(r.path);i.has(s)&&this.trace(`ignoring a request for watching who's path is already watched: ${this.requestToString(r)}`),i.set(s,r)}return Array.from(n.values()).flatMap(r=>Array.from(r.values()))}async setVerboseLogging(e){super.setVerboseLogging(e);for(let n of this.watchers)n.instance.setVerboseLogging(e)}trace(e,n){this.verboseLogging&&this._onDidLogMessage.fire({type:"trace",message:this.toMessage(e,n)})}warn(e){this._onDidLogMessage.fire({type:"warn",message:this.toMessage(e)})}toMessage(e,n){return n?`[File Watcher (node.js)] ${e} (${this.requestToString(n.request)})`:`[File Watcher (node.js)] ${e}`}}});var ty,CL=y(()=>{Cl();wL();ty=class extends Wv{constructor(t,e,n){super(t,e,n),this.init()}createWatcher(t){return t.add(new ey(void 0))}}});import{constants as tw,promises as Pl}from"fs";var Di,km=y(()=>{ze();Hn();et();de();yi();q();Le();me();Nt();_c();fr();pe();nt();qE();fL();xL();CL();Di=class o extends zv{constructor(){super(...arguments);this.onDidChangeCapabilities=F.None;this.resourceLocks=new lt(e=>nl.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,_e&&(this._capabilities|=1024)),this._capabilities}async stat(e){try{let{stat:n,symbolicLink:r}=await er.stat(this.toFilePath(e)),i;return(n.mode&128)===0&&(i=2),(n.mode&tw.S_IXUSR||n.mode&tw.S_IXGRP||n.mode&tw.S_IXOTH)&&(i=(i??0)|4),{type:this.toType(n,r),ctime:n.birthtime.getTime(),mtime:n.mtime.getTime(),size:n.size,permissions:i}}catch(n){throw this.toFileSystemProviderError(n)}}async statIgnoreError(e){try{return await this.stat(e)}catch{return}}async realpath(e){let n=this.toFilePath(e);return Te.realpath(n)}async readdir(e){try{let n=await Te.readdir(this.toFilePath(e),{withFileTypes:!0}),r=[];return await Promise.all(n.map(async i=>{try{let s;i.isSymbolicLink()?s=(await this.stat(ye(e,i.name))).type:s=this.toType(i),r.push([i.name,s])}catch(s){this.logService.trace(s)}})),r}catch(n){throw this.toFileSystemProviderError(n)}}toType(e,n){let r;return n?.dangling?r=0:e.isFile()?r=1:e.isDirectory()?r=2:r=0,n&&(r|=64),r}async createResourceLock(e){let n=this.toFilePath(e);this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${n})`);let r;for(;r=this.resourceLocks.get(e);)this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${n})`),await r.wait();let i=new lo;return this.resourceLocks.set(e,i),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${n})`),ie(()=>{this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${n})`),this.resourceLocks.get(e)===i&&(this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${n})`),this.resourceLocks.delete(e)),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${n})`),i.open()})}async readFile(e,n){let r;try{n?.atomic&&(this.traceLock(`[Disk FileSystemProvider]: atomic read operation started (${this.toFilePath(e)})`),r=await this.createResourceLock(e));let i=this.toFilePath(e);return await Pl.readFile(i)}catch(i){throw this.toFileSystemProviderError(i)}finally{r?.dispose()}}traceLock(e){o.TRACE_LOG_RESOURCE_LOCKS&&this.logService.trace(e)}readFileStream(e,n,r){let i=Hs(s=>A.concat(s.map(a=>A.wrap(a))).buffer);return Av(this,e,i,s=>s.buffer,{...n,bufferSize:256*1024},r),i}async writeFile(e,n,r){return r?.atomic!==!1&&r?.atomic?.postfix&&await this.canWriteFileAtomic(e)?this.doWriteFileAtomic(e,ye(th(e),`${Zn(e)}${r.atomic.postfix}`),n,r):this.doWriteFile(e,n,r)}async canWriteFileAtomic(e){try{let n=this.toFilePath(e),{symbolicLink:r}=await er.stat(n);if(r)return!1}catch{}return!0}async doWriteFileAtomic(e,n,r,i){let s=new le;try{s.add(await this.createResourceLock(e)),s.add(await this.createResourceLock(n)),await this.doWriteFile(n,r,{...i,create:!0,overwrite:!0},!0);try{await this.rename(n,e,{overwrite:!0})}catch(a){try{await this.delete(n,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw a}}finally{s.dispose()}}async doWriteFile(e,n,r,i){let s;try{let a=this.toFilePath(e);if(!r.create||!r.overwrite){if(await Te.exists(a)){if(!r.overwrite)throw Mo(d(871,null),"EntryExists")}else if(!r.create)throw Mo(d(874,null),"EntryNotFound")}s=await this.open(e,{create:!0,append:r.append,unlock:r.unlock},i),await this.write(s,0,n,0,n.byteLength)}catch(a){throw await this.toFileSystemProviderWriteError(e,a)}finally{typeof s=="number"&&await this.close(s)}}static{this.canFlush=!0}static configureFlushOnWrite(e){o.canFlush=e}async open(e,n,r){let i=this.toFilePath(e),s;ul(n)&&!r&&(s=await this.createResourceLock(e));let a;try{if(ul(n)&&n.unlock)try{let{stat:l}=await er.stat(i);l.mode&128||await Pl.chmod(i,l.mode|128)}catch(l){l.code!=="ENOENT"&&this.logService.trace(l)}if(te&&ul(n)&&!n.append)try{a=await Te.open(i,"r+"),await Te.ftruncate(a,0)}catch(l){if(l.code!=="ENOENT"&&this.logService.trace(l),typeof a=="number"){try{await Te.close(a)}catch(c){this.logService.trace(c)}a=void 0}}typeof a!="number"&&(a=await Te.open(i,ul(n)?n.append?"a":"w":"r"))}catch(l){throw s?.dispose(),ul(n)?await this.toFileSystemProviderWriteError(e,l):this.toFileSystemProviderError(l)}if(this.mapHandleToPos.set(a,0),ul(n)&&this.writeHandles.set(a,e),s){let l=this.mapHandleToLock.get(a);this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${a} (${i})`),this.mapHandleToLock.set(a,s),l&&(this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${a} (${i})`),l.dispose())}return a}async close(e){let n=this.mapHandleToLock.get(e);try{if(this.mapHandleToPos.delete(e),this.writeHandles.delete(e)&&o.canFlush)try{await Te.fdatasync(e)}catch(r){o.configureFlushOnWrite(!1),this.logService.error(r)}return await Te.close(e)}catch(r){throw this.toFileSystemProviderError(r)}finally{n&&(this.mapHandleToLock.get(e)===n&&(this.traceLock(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${e}`),this.mapHandleToLock.delete(e)),this.traceLock(`[Disk FileSystemProvider]: close() - disposing lock for handle ${e}`),n.dispose())}}async read(e,n,r,i,s){let a=this.normalizePos(e,n),l=null;try{l=(await Te.read(e,r,i,s,a)).bytesRead}catch(c){throw this.toFileSystemProviderError(c)}finally{this.updatePos(e,a,l)}return l}normalizePos(e,n){return n===this.mapHandleToPos.get(e)?null:n}updatePos(e,n,r){let i=this.mapHandleToPos.get(e);typeof i=="number"&&(typeof n=="number"||(typeof r=="number"?this.mapHandleToPos.set(e,i+r):this.mapHandleToPos.delete(e)))}async write(e,n,r,i,s){return H1(()=>this.doWrite(e,n,r,i,s),100,3)}async doWrite(e,n,r,i,s){let a=this.normalizePos(e,n),l=null;try{l=(await Te.write(e,r,i,s,a)).bytesWritten}catch(c){throw await this.toFileSystemProviderWriteError(this.writeHandles.get(e),c)}finally{this.updatePos(e,a,l)}return l}async mkdir(e){try{await Pl.mkdir(this.toFilePath(e))}catch(n){throw this.toFileSystemProviderError(n)}}async delete(e,n){try{let r=this.toFilePath(e);if(n.recursive){let i;n?.atomic!==!1&&n.atomic.postfix&&(i=H(Ct(r),`${at(r)}${n.atomic.postfix}`)),await Te.rm(r,1,i)}else try{await Pl.unlink(r)}catch(i){if(i.code==="EPERM"||i.code==="EISDIR"){let s=!1;try{let{stat:a,symbolicLink:l}=await er.stat(r);s=a.isDirectory()&&!l}catch{}if(s)await Pl.rmdir(r);else throw i}else throw i}}catch(r){throw this.toFileSystemProviderError(r)}}async rename(e,n,r){let i=this.toFilePath(e),s=this.toFilePath(n);if(i!==s)try{await this.validateMoveCopy(e,n,"move",r.overwrite),await Te.rename(i,s)}catch(a){throw(a.code==="EINVAL"||a.code==="EBUSY"||a.code==="ENAMETOOLONG")&&(a=new Error(d(875,null,at(i),at(Ct(s)),a.toString()))),this.toFileSystemProviderError(a)}}async copy(e,n,r){let i=this.toFilePath(e),s=this.toFilePath(n);if(i!==s)try{await this.validateMoveCopy(e,n,"copy",r.overwrite),await Te.copy(i,s,{preserveSymlinks:!0})}catch(a){throw(a.code==="EINVAL"||a.code==="EBUSY"||a.code==="ENAMETOOLONG")&&(a=new Error(d(869,null,at(i),at(Ct(s)),a.toString()))),this.toFileSystemProviderError(a)}}async validateMoveCopy(e,n,r,i){let s=this.toFilePath(e),a=this.toFilePath(n),l=!1;if(this.capabilities&1024||(l=wc(s,a,!0)),l){if(r==="copy")throw Mo(d(870,null),"EntryExists");if(r==="move")return}let u=await this.statIgnoreError(e);if(!u)throw Mo(d(873,null),"EntryNotFound");let p=await this.statIgnoreError(n);if(p){if(!i)throw Mo(d(872,null),"EntryExists");(u.type&1)!==0&&(p.type&1)!==0||await this.delete(n,{recursive:!0,useTrash:!1,atomic:!1})}}async cloneFile(e,n){return this.doCloneFile(e,n,!1)}async doCloneFile(e,n,r){let i=this.toFilePath(e),s=this.toFilePath(n),a=!!(this.capabilities&1024);if(wc(i,s,!a))return;let l=new le;try{l.add(await this.createResourceLock(e)),l.add(await this.createResourceLock(n)),r&&await Pl.mkdir(Ct(s),{recursive:!0}),await Pl.copyFile(i,s)}catch(c){if(c.code==="ENOENT"&&!r)return this.doCloneFile(e,n,!0);throw this.toFileSystemProviderError(c)}finally{l.dispose()}}createUniversalWatcher(e,n,r){return new Xv(i=>e(i),i=>n(i),r)}createNonRecursiveWatcher(e,n,r){return new ty(i=>e(i),i=>n(i),r)}toFileSystemProviderError(e){if(e instanceof Hc)return e;let n=e,r;switch(e.code){case"ENOENT":r="EntryNotFound";break;case"EISDIR":r="EntryIsADirectory";break;case"ENOTDIR":r="EntryNotADirectory";break;case"EEXIST":r="EntryExists";break;case"EPERM":case"EACCES":r="NoPermissions";break;case"ERR_UNC_HOST_NOT_ALLOWED":n=`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,r="Unknown";break;default:r="Unknown"}return Mo(n,r)}async toFileSystemProviderWriteError(e,n){let r=this.toFileSystemProviderError(n);if(e&&r.code==="NoPermissions")try{let{stat:i}=await er.stat(this.toFilePath(e));i.mode&128||(r=Mo(n,"EntryWriteLocked"))}catch(i){this.logService.trace(i)}return r}}});function TL(o){return o.getFullYear()+"-"+String(o.getMonth()+1).padStart(2,"0")+"-"+String(o.getDate()).padStart(2,"0")+"T"+String(o.getHours()).padStart(2,"0")+":"+String(o.getMinutes()).padStart(2,"0")+":"+String(o.getSeconds()).padStart(2,"0")+"."+(o.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}var V9,W9,nw,Fde,Vde,Wde,PL=y(()=>{pe();Qi();me();V9=60,W9=V9*60,nw=W9*24,Fde=nw*7,Vde=nw*30,Wde=nw*365});function B9(o,t){return ny(o["inspect-extensions"],o["inspect-brk-extensions"],5870,t,o.debugId,o.extensionEnvironment)}function ny(o,t,e,n,r,i){let a=Number(t||o)||(n?null:e),l=a?!!t:!1,c;if(i)try{c=JSON.parse(i)}catch{}return{port:a,break:l,debugId:r,env:c}}var kL,it,RL=y(()=>{PL();Gv();$e();Le();no();Nt();ce();kL=/^([^.]+\..+)[:=](.+)$/,it=class{constructor(t,e,n){this._args=t;this.paths=e;this.productService=n}get appRoot(){return Ct(yt.asFileUri("").fsPath)}get userHome(){return I.file(this.paths.homeDir)}get userDataPath(){return this.paths.userDataDir}get appSettingsHome(){return I.file(H(this.userDataPath,"User"))}get tmpDir(){return I.file(this.paths.tmpDir)}get cacheHome(){return I.file(this.userDataPath)}get stateResource(){return ye(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:z.vscodeUserData})}get userDataSyncHome(){return ye(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){let t=TL(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=H(this.userDataPath,"logs",t)}return I.file(this.args.logsPath)}get sync(){return this.args.sync}get workspaceStorageHome(){return ye(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return ye(this.appSettingsHome,"History")}get keyboardLayoutResource(){return ye(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){let t=tn.VSCODE_PORTABLE;return t?I.file(H(t,"argv.json")):ye(this.userHome,this.productService.dataFolderName,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return I.file(H(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){let t=this.args["builtin-extensions-dir"];return t?Bn(t):In(H(yt.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){let t=this.args["extensions-download-dir"];return t?I.file(Bn(t)):I.file(H(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){let t=this.args["extensions-dir"];if(t)return Bn(t);let e=tn.VSCODE_EXTENSIONS;if(e)return e;let n=tn.VSCODE_PORTABLE;return n?H(n,"extensions"):ye(this.userHome,this.productService.dataFolderName,"extensions").fsPath}get agentPluginsPath(){let t=this.args["agent-plugins-dir"];if(t)return Bn(t);let e=tn.VSCODE_AGENT_PLUGINS;if(e)return e;let n=tn.VSCODE_PORTABLE;return n?H(n,"agent-plugins"):ye(this.userHome,this.productService.dataFolderName,"agent-plugins").fsPath}get extensionDevelopmentLocationURI(){let t=this.args.extensionDevelopmentPath;if(Array.isArray(t))return t.map(e=>/^[^:/?#]+?:\/\//.test(e)?I.parse(e):I.file(In(e)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(t=>t==="ui"||t==="workspace"||t==="web"?t:"workspace")}get extensionTestsLocationURI(){let t=this.args.extensionTestsPath;if(t)return/^[^:/?#]+?:\/\//.test(t)?I.parse(t):I.file(In(t))}get disableExtensions(){if(this.args["disable-extensions"])return!0;let t=this.args["disable-extension"];if(t){if(typeof t=="string")return[t];if(Array.isArray(t)&&t.length>0)return t}return!1}get skipBuiltinExtensions(){let t=tn.VSCODE_SKIP_BUILTIN_EXTENSIONS;return t?t.split(",").map(e=>e.trim()).filter(e=>e):[]}get debugExtensionHost(){return B9(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!tn.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(t=>!kL.test(t))}get extensionLogLevel(){let t=[];for(let e of this.args.log||[]){let n=kL.exec(e);n?.[1]&&n[2]&&t.push([n[1],n[2]])}return t.length?t:void 0}get serviceMachineIdResource(){return ye(I.file(this.userDataPath),"machineid")}get crashReporterId(){return this.args["crash-reporter-id"]}get crashReporterDirectory(){return this.args["crash-reporter-directory"]}get disableTelemetry(){return!!this.args["disable-telemetry"]}get disableExperiments(){return!!this.args["disable-experiments"]}get disableWorkspaceTrust(){return!!this.args["disable-workspace-trust"]}get useInMemorySecretStorage(){return!!this.args["use-inmemory-secretstorage"]}get policyFile(){if(this.args["__enable-file-policy"]){let t=tn.VSCODE_PORTABLE;return t?I.file(H(t,"policy.json")):ye(this.userHome,this.productService.dataFolderName,"policy.json")}}get agentSessionsWorkspace(){return ye(this.appSettingsHome,"agent-sessions.code-workspace")}get editSessionId(){return this.args.editSessionId}get exportPolicyData(){return this.args["export-policy-data"]}get exportDefaultKeybindings(){return this.args["export-default-keybindings"]}get continueOn(){return this.args.continueOn}set continueOn(t){this.args.continueOn=t}get args(){return this._args}};E([je],it.prototype,"appRoot",1),E([je],it.prototype,"userHome",1),E([je],it.prototype,"userDataPath",1),E([je],it.prototype,"appSettingsHome",1),E([je],it.prototype,"tmpDir",1),E([je],it.prototype,"cacheHome",1),E([je],it.prototype,"stateResource",1),E([je],it.prototype,"userRoamingDataHome",1),E([je],it.prototype,"userDataSyncHome",1),E([je],it.prototype,"sync",1),E([je],it.prototype,"workspaceStorageHome",1),E([je],it.prototype,"localHistoryHome",1),E([je],it.prototype,"keyboardLayoutResource",1),E([je],it.prototype,"argvResource",1),E([je],it.prototype,"isExtensionDevelopment",1),E([je],it.prototype,"untitledWorkspacesHome",1),E([je],it.prototype,"builtinExtensionsPath",1),E([je],it.prototype,"extensionsDownloadLocation",1),E([je],it.prototype,"extensionsPath",1),E([je],it.prototype,"agentPluginsPath",1),E([je],it.prototype,"extensionDevelopmentLocationURI",1),E([je],it.prototype,"extensionDevelopmentKind",1),E([je],it.prototype,"extensionTestsLocationURI",1),E([je],it.prototype,"debugExtensionHost",1),E([je],it.prototype,"logLevel",1),E([je],it.prototype,"extensionLogLevel",1),E([je],it.prototype,"serviceMachineIdResource",1),E([je],it.prototype,"disableTelemetry",1),E([je],it.prototype,"disableExperiments",1),E([je],it.prototype,"disableWorkspaceTrust",1),E([je],it.prototype,"useInMemorySecretStorage",1),E([je],it.prototype,"policyFile",1),E([je],it.prototype,"agentSessionsWorkspace",1)});import{homedir as DL}from"os";import{resolve as H9,isAbsolute as $9,join as _d}from"path";function _L(o,t){let e=G9(o,t),n=[e];return $9(e)||n.unshift(z9),H9(...n)}function G9(o,t){process.env.VSCODE_DEV&&(process.isEmbeddedApp?t="agents-oss-dev":t="code-oss-dev");let e=process.env.VSCODE_PORTABLE;if(e)return _d(e,"user-data");let n=process.env.VSCODE_APPDATA;if(n)return _d(n,t);let r=o["user-data-dir"];if(r)return r;switch(process.platform){case"win32":if(n=process.env.APPDATA,!n){let i=process.env.USERPROFILE;if(typeof i!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");n=_d(i,"AppData","Roaming")}break;case"darwin":n=_d(DL(),"Library","Application Support");break;case"linux":n=process.env.XDG_CONFIG_HOME||_d(DL(),".config");break;default:throw new Error("Platform not supported")}return _d(n,t)}var z9,LL=y(()=>{z9=process.env.VSCODE_CWD||process.cwd()});import{homedir as q9,tmpdir as K9}from"os";function ML(o,t){return ny(o["inspect-ptyhost"],o["inspect-brk-ptyhost"],5877,t,o.extensionEnvironment)}function OL(o,t){return ny(o["inspect-agenthost"],o["inspect-brk-agenthost"],5878,t,o.extensionEnvironment)}var ry,oy=y(()=>{RL();LL();ry=class extends it{constructor(t,e){super(t,{homeDir:q9(),tmpDir:K9(),userDataDir:_L(t,e.nameShort)},e)}}});function da(){return rw||(rw=A.alloc(0)),rw}function AL(o){switch(o){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 aw,rw,Rm,Uo,iy,sy,kl,ow,iw,sw,Dm,Rl=y(()=>{et();de();q();la();(s=>{s.enableDiagnostics=!1,s.records=[];let e=new WeakMap,n=0;function r(a,l){if(!e.has(a)){let c=String(++n);e.set(a,c)}return e.get(a)}function i(a,l,c,u){}s.traceSocketEvent=i})(aw||={});rw=null;Rm=class{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(t){this._chunks.push(t),this._totalLength+=t.byteLength}read(t){return this._read(t,!0)}peek(t){return this._read(t,!1)}_read(t,e){if(t===0)return da();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let s=this._chunks[0];return e&&(this._chunks.shift(),this._totalLength-=t),s}if(this._chunks[0].byteLength>t){let s=this._chunks[0].slice(0,t);return e&&(this._chunks[0]=this._chunks[0].slice(t),this._totalLength-=t),s}let n=A.alloc(t),r=0,i=0;for(;t>0;){let s=this._chunks[i];if(s.byteLength>t){let a=s.slice(0,t);n.set(a,r),r+=t,e&&(this._chunks[i]=s.slice(t),this._totalLength-=t),t-=t}else n.set(s,r),r+=s.byteLength,e?(this._chunks.shift(),this._totalLength-=s.byteLength):i++,t-=s.byteLength}return n}};Uo=class{constructor(t,e,n,r){this.type=t;this.id=e;this.ack=n;this.data=r;this.writtenTime=0}get size(){return this.data.byteLength}},iy=class extends D{constructor(e){super();this._onMessage=this._register(new P);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 Rm,this._register(this._socket.onData(n=>this.acceptChunk(n))),this.lastReadTime=Date.now()}acceptChunk(e){if(!(!e||e.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){let n=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=n.readUInt32BE(9),this._state.messageType=n.readUInt8(0),this._state.id=n.readUInt32BE(1),this._state.ack=n.readUInt32BE(5),this._socket.traceSocketEvent("protocolHeaderRead",{messageType:AL(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{let r=this._state.messageType,i=this._state.id,s=this._state.ack;if(this._state.readHead=!0,this._state.readLen=13,this._state.messageType=0,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent("protocolMessageRead",n),this._onMessage.fire(new Uo(r,i,s,n)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}},sy=class{constructor(t){this._writeNowTimeout=null;this._isDisposed=!1,this._isPaused=!1,this._socket=t,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){try{this.flush()}catch{}this._isDisposed=!0}drain(){return this.flush(),this._socket.drain()}flush(){this._writeNow()}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this._scheduleWriting()}write(t){if(this._isDisposed)return;t.writtenTime=Date.now(),this.lastWriteTime=Date.now();let e=A.alloc(13);e.writeUInt8(t.type,0),e.writeUInt32BE(t.id,1),e.writeUInt32BE(t.ack,5),e.writeUInt32BE(t.data.byteLength,9),this._socket.traceSocketEvent("protocolHeaderWrite",{messageType:AL(t.type),id:t.id,ack:t.ack,messageSize:t.data.byteLength}),this._socket.traceSocketEvent("protocolMessageWrite",t.data),this._writeSoon(e,t.data)}_bufferAdd(t,e){let n=this._totalLength===0;return this._data.push(t,e),this._totalLength+=t.byteLength+e.byteLength,n}_bufferTake(){let t=A.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,t}_writeSoon(t,e){this._bufferAdd(t,e)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;let t=this._bufferTake();this._socket.traceSocketEvent("protocolWrite",{byteLength:t.byteLength}),this._socket.write(t)}},kl=class{constructor(){this._hasListeners=!1;this._isDeliveringMessages=!1;this._bufferedMessages=[];this._emitter=new P({onWillAddFirstListener:()=>{this._hasListeners=!0,queueMicrotask(()=>this._deliverMessages())},onDidRemoveLastListener:()=>{this._hasListeners=!1}}),this.event=this._emitter.event}_deliverMessages(){if(!this._isDeliveringMessages){for(this._isDeliveringMessages=!0;this._hasListeners&&this._bufferedMessages.length>0;)this._emitter.fire(this._bufferedMessages.shift());this._isDeliveringMessages=!1}}fire(t){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(t):this._emitter.fire(t):this._bufferedMessages.push(t)}flushBuffer(){this._bufferedMessages=[]}},ow=class{constructor(t){this.data=t,this.next=null}},iw=class{constructor(){this._first=null,this._last=null}length(){let t=0,e=this._first;for(;e;)e=e.next,t++;return t}peek(){return this._first?this._first.data:null}toArray(){let t=[],e=0,n=this._first;for(;n;)t[e++]=n.data,n=n.next;return t}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(t){let e=new ow(t);if(!this._first){this._first=e,this._last=e;return}this._last.next=e,this._last=e}},sw=class o{static{this._HISTORY_LENGTH=10}static{this._INSTANCE=null}static getInstance(){return o._INSTANCE||(o._INSTANCE=new o),o._INSTANCE}constructor(){this.lastRuns=[];let t=Date.now();for(let e=0;e<o._HISTORY_LENGTH;e++)this.lastRuns[e]=t-1e3*e;setInterval(()=>{for(let e=o._HISTORY_LENGTH;e>=1;e--)this.lastRuns[e]=this.lastRuns[e-1];this.lastRuns[0]=Date.now()},1e3)}load(){let t=Date.now(),e=(1+o._HISTORY_LENGTH)*1e3,n=0;for(let r=0;r<o._HISTORY_LENGTH;r++)t-this.lastRuns[r]<=e&&n++;return 1-n/o._HISTORY_LENGTH}hasHighLoad(){return this.load()>=.5}},Dm=class{constructor(t){this._onControlMessage=new kl;this.onControlMessage=this._onControlMessage.event;this._onMessage=new kl;this.onMessage=this._onMessage.event;this._onDidDispose=new kl;this.onDidDispose=this._onDidDispose.event;this._onSocketClose=new kl;this.onSocketClose=this._onSocketClose.event;this._onSocketTimeout=new kl;this.onSocketTimeout=this._onSocketTimeout.event;this._loadEstimator=t.loadEstimator??sw.getInstance(),this._shouldSendKeepAlive=t.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new iw,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 le,this._socket=t.socket,this._socketWriter=this._socketDisposables.add(new sy(this._socket)),this._socketReader=this._socketDisposables.add(new iy(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(e=>this._receiveMessage(e))),this._socketDisposables.add(this._socket.onClose(e=>this._onSocketClose.fire(e))),t.initialChunk&&this._socketReader.acceptChunk(t.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},5e3):this._keepAliveInterval=null}get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._socketDisposables.dispose()}drain(){return this._socketWriter.drain()}sendDisconnect(){if(!this._didSendDisconnect){this._didSendDisconnect=!0;let t=new Uo(5,0,0,da());this._socketWriter.write(t),this._socketWriter.flush()}}sendPause(){let t=new Uo(7,0,0,da());this._socketWriter.write(t)}sendResume(){let t=new Uo(8,0,0,da());this._socketWriter.write(t)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(t,e){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new le,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=t,this._socketWriter=this._socketDisposables.add(new sy(this._socket)),this._socketReader=this._socketDisposables.add(new iy(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(n=>this._receiveMessage(n))),this._socketDisposables.add(this._socket.onClose(n=>this._onSocketClose.fire(n))),this._socketReader.acceptChunk(e)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;let t=new Uo(3,0,this._incomingAckId,da());this._socketWriter.write(t);let e=this._outgoingUnackMsg.toArray();for(let n=0,r=e.length;n<r;n++)this._socketWriter.write(e[n]);this._recvAckCheck()}acceptDisconnect(){this._onDidDispose.fire()}_receiveMessage(t){if(t.ack>this._outgoingAckId){this._outgoingAckId=t.ack;do{let e=this._outgoingUnackMsg.peek();if(e&&e.id<=t.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(t.type){case 0:break;case 1:{if(t.id>this._incomingMsgId)if(t.id!==this._incomingMsgId+1){let e=Date.now();e-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=e,this._socketWriter.write(new Uo(6,0,0,da())))}else this._incomingMsgId=t.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(t.data);break}case 2:{this._onControlMessage.fire(t.data);break}case 3:break;case 5:{this._onDidDispose.fire();break}case 6:{let e=this._outgoingUnackMsg.toArray();for(let n=0,r=e.length;n<r;n++)this._socketWriter.write(e[n]);this._recvAckCheck();break}case 7:{this._socketWriter.pause();break}case 8:{this._socketWriter.resume();break}case 9:break}}readEntireBuffer(){return this._socketReader.readEntireBuffer()}flush(){this._socketWriter.flush()}send(t){let e=++this._outgoingMsgId;this._incomingAckId=this._incomingMsgId;let n=new Uo(1,e,this._incomingAckId,t);this._outgoingUnackMsg.push(n),this._isReconnecting||(this._socketWriter.write(n),this._recvAckCheck())}sendControl(t){let e=new Uo(2,0,0,t);this._socketWriter.write(e)}_sendAckCheck(){if(this._incomingMsgId<=this._incomingAckId||this._incomingAckTimeout)return;let t=Date.now()-this._incomingMsgLastTime;if(t>=2e3){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},2e3-t+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;let t=this._outgoingUnackMsg.peek(),e=Date.now()-t.writtenTime,n=Date.now()-this._socketReader.lastReadTime,r=Date.now()-this._lastSocketTimeoutTime;if(e>=2e4&&n>=2e4&&r>=2e4&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:e,timeSinceLastReceivedSomeData:n});return}let i=Math.max(2e4-e,2e4-n,2e4-r,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},i)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;let t=new Uo(3,0,this._incomingAckId,da());this._socketWriter.write(t)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;let t=new Uo(9,0,this._incomingAckId,da());this._socketWriter.write(t)}}});function j9(o,t){if(typeof o!="string"||o.trim().length===0)return console.log(`[reconnection-grace-time] No CLI argument provided, using default: ${t}ms (${Math.floor(t/1e3)}s)`),t;let e=Number(o);if(!isFinite(e)||e<0)return console.log(`[reconnection-grace-time] Invalid value '${o}', using default: ${t}ms (${Math.floor(t/1e3)}s)`),t;let n=Math.floor(e*1e3);return!isFinite(n)||n>Number.MAX_SAFE_INTEGER?(console.log(`[reconnection-grace-time] Value too large '${o}', using default: ${t}ms (${Math.floor(t/1e3)}s)`),t):(console.log(`[reconnection-grace-time] Parsed CLI argument: ${e}s -> ${n}ms`),n)}var cw,ua,_i,Dl=y(()=>{pe();oy();Zp();re();vn();Gv();ce();Nt();Le();Rl();cw={host:{type:"string",cat:"o",args:"ip-address",description:d(993,null)},port:{type:"string",cat:"o",args:"port | port range",description:d(994,null)},"socket-path":{type:"string",cat:"o",args:"path",description:d(998,null)},"server-base-path":{type:"string",cat:"o",args:"path",description:d(996,null)},"connection-token":{type:"string",cat:"o",args:"token",deprecates:["connectionToken"],description:d(989,null)},"connection-token-file":{type:"string",cat:"o",args:"path",deprecates:["connection-secret","connectionTokenFile"],description:d(990,null)},"without-connection-token":{type:"boolean",cat:"o",description:d(1001,null)},"disable-websocket-compression":{type:"boolean"},"print-startup-performance":{type:"boolean"},"print-ip-address":{type:"boolean"},"accept-server-license-terms":{type:"boolean",cat:"o",description:d(986,null)},"server-data-dir":{type:"string",cat:"o",description:d(997,null)},"telemetry-level":{type:"string",cat:"o",args:"level",description:d(1000,null)},"user-data-dir":Rt["user-data-dir"],"enable-smoke-test-driver":Rt["enable-smoke-test-driver"],"disable-telemetry":Rt["disable-telemetry"],"disable-experiments":Rt["disable-experiments"],"disable-workspace-trust":Rt["disable-workspace-trust"],"file-watcher-polling":{type:"string",deprecates:["fileWatcherPolling"]},log:Rt.log,logsPath:Rt.logsPath,"force-disable-user-env":Rt["force-disable-user-env"],"enable-proposed-api":Rt["enable-proposed-api"],folder:{type:"string",deprecationMessage:"No longer supported. Folder needs to be provided in the browser URL or with `default-folder`."},workspace:{type:"string",deprecationMessage:"No longer supported. Workspace needs to be provided in the browser URL or with `default-workspace`."},"default-folder":{type:"string",description:d(991,null)},"default-workspace":{type:"string",description:d(992,null)},"enable-sync":{type:"boolean"},"github-auth":{type:"string"},"use-test-resolver":{type:"boolean"},"extensions-dir":Rt["extensions-dir"],"extensions-download-dir":Rt["extensions-download-dir"],"builtin-extensions-dir":Rt["builtin-extensions-dir"],"install-extension":Rt["install-extension"],"install-builtin-extension":Rt["install-builtin-extension"],"update-extensions":Rt["update-extensions"],"uninstall-extension":Rt["uninstall-extension"],"list-extensions":Rt["list-extensions"],"locate-extension":Rt["locate-extension"],"show-versions":Rt["show-versions"],category:Rt.category,force:Rt.force,"do-not-sync":Rt["do-not-sync"],"do-not-include-pack-dependencies":Rt["do-not-include-pack-dependencies"],"pre-release":Rt["pre-release"],"start-server":{type:"boolean",cat:"e",description:d(999,null)},"enable-remote-auto-shutdown":{type:"boolean"},"remote-auto-shutdown-without-delay":{type:"boolean"},"inspect-ptyhost":{type:"string",allowEmptyValue:!0},"agent-host-port":{type:"string",cat:"o",args:"port",description:d(988,null)},"agent-host-path":{type:"string",cat:"o",args:"path",description:d(987,null)},"use-host-proxy":{type:"boolean"},"without-browser-env-var":{type:"boolean"},"reconnection-grace-time":{type:"string",cat:"o",args:"seconds",description:d(995,null)},help:Rt.help,version:Rt.version,"locate-shell-integration-path":Rt["locate-shell-integration-path"],compatibility:{type:"string"},_:Rt._},ua=It,_i=class extends ry{get userRoamingDataHome(){return this.appSettingsHome}get machineSettingsResource(){return ye(I.file(H(this.userDataPath,"Machine")),"settings.json")}get mcpResource(){return ye(I.file(H(this.userDataPath,"User")),"mcp.json")}get args(){return super.args}get reconnectionGraceTime(){return j9(this.args["reconnection-grace-time"],108e5)}};E([je],_i.prototype,"userRoamingDataHome",1),E([je],_i.prototype,"machineSettingsResource",1),E([je],_i.prototype,"mcpResource",1),E([je],_i.prototype,"reconnectionGraceTime",1)});var Q9,NL,pa,dw=y(()=>{Wt();Se();$e();Nt();ta();ce();pe();rr();No();_n();yn();Q9=o=>d(778,null,o),NL=d(791,null,"ms-dotnettools.csharp"),pa=class{constructor(t,e,n,r,i){this.extensionsForceVersionByQuality=t;this.logger=e;this.extensionManagementService=n;this.extensionGalleryService=r;this.productService=i;this.extensionsForceVersionByQuality=this.extensionsForceVersionByQuality.map(s=>s.toLowerCase())}get location(){}async listExtensions(t,e,n){let r=await this.extensionManagementService.getInstalled(1,n),i=nv.map(a=>a.toLowerCase());if(e&&e!==""){if(i.indexOf(e.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}r=r.filter(a=>a.manifest.categories?a.manifest.categories.map(c=>c.toLowerCase()).indexOf(e.toLowerCase())>-1:!1)}else if(e===""){this.logger.info("Possible Categories: "),i.forEach(a=>{this.logger.info(a)});return}this.location&&this.logger.info(d(777,null,this.location)),r=r.sort((a,l)=>a.identifier.id.localeCompare(l.identifier.id));let s;for(let a of r)s!==a.identifier.id&&(s=a.identifier.id,this.logger.info(t?`${s}@${a.manifest.version}`:s))}async installExtensions(t,e,n,r){let i=[];try{t.length&&this.logger.info(this.location?d(776,null,this.location):d(775,null));let s=[],a=[],l=(u,p,m)=>{this.extensionsForceVersionByQuality?.some(g=>g===u.toLowerCase())&&(p=this.productService.quality!=="stable"?"prerelease":void 0),a.push({id:u,version:p!=="prerelease"?p:void 0,installOptions:{...n,isBuiltin:m,installPreReleaseVersion:p==="prerelease"||n.installPreReleaseVersion}})};for(let u of t)if(u instanceof I)s.push({vsix:u,installOptions:n});else{let[p,m]=cm(u);l(p,m,!1)}for(let u of e)if(u instanceof I)s.push({vsix:u,installOptions:{...n,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{let[p,m]=cm(u);l(p,m,!0)}let c=await this.extensionManagementService.getInstalled(void 0,n.profileLocation);if(s.length&&await Promise.all(s.map(async({vsix:u,installOptions:p})=>{try{await this.installVSIX(u,p,r,c)}catch(m){this.logger.error(m),i.push(u.toString())}})),a.length){let u=await this.installGalleryExtensions(a,c,r);i.push(...u)}}catch(s){throw this.logger.error(d(765,null,fe(s))),s}if(i.length)throw new Error(d(770,null,i.join(", ")))}async updateExtensions(t){let e=await this.extensionManagementService.getInstalled(1,t),n=[];for(let a of e)a.identifier.uuid&&n.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(d(789,null,n.length));let r=await this.extensionGalleryService.getExtensions(n,{compatible:!0},Ee.None),i=[];for(let a of r)for(let l of e)we(l.identifier,a.identifier)&&Ti(a.version,l.manifest.version)&&i.push({extension:a,options:{operation:3,installPreReleaseVersion:l.preRelease,profileLocation:t,isApplicationScoped:l.isApplicationScoped}});if(!i.length){this.logger.info(d(788,null));return}this.logger.info(d(787,null,i.map(a=>a.extension.identifier.id).join(", ")));let s=await this.extensionManagementService.installGalleryExtensions(i);for(let a of s)a.error?this.logger.error(d(767,null,a.identifier.id,fe(a.error))):this.logger.info(d(784,null,a.identifier.id,a.local?.manifest.version))}async installGalleryExtensions(t,e,n){if(t=t.filter(a=>{let{id:l,version:c,installOptions:u}=a,p=e.find(m=>we(m.identifier,{id:l}));if(p){let m=this.validateBuiltinExtensionEnabledWithAutoUpdates(p);if(m)return this.logger.info(m),!1;if(!n&&(!c||c==="prerelease"&&p.preRelease))return this.logger.info(d(761,null,l,p.manifest.version,l)),!1;if(c&&p.manifest.version===c)return this.logger.info(d(760,null,`${l}@${c}`)),!1;p.preRelease&&c!=="prerelease"&&(u.preRelease=!1)}return!0}),!t.length)return[];let r=[],i=[],s=await this.getGalleryExtensions(t);if(await Promise.all(t.map(async({id:a,version:l,installOptions:c})=>{let u=s.get(a.toLowerCase());if(!u){this.logger.error(`${Q9(l?`${a}@${l}`:a)}
- ${NL}`),r.push(a);return}try{let m=await this.extensionGalleryService.getManifest(u,Ee.None);if(m&&!this.validateExtensionKind(m))return}catch(m){this.logger.error(m.message||m.stack||m),r.push(a);return}let p=e.find(m=>we(m.identifier,u.identifier));if(p){if(u.version===p.manifest.version){this.logger.info(d(760,null,l?`${a}@${l}`:a));return}this.logger.info(d(790,null,a,u.version))}c.isBuiltin?this.logger.info(l?d(773,null,a,l):d(772,null,a)):this.logger.info(l?d(774,null,a,l):d(771,null,a)),i.push({extension:u,options:{...c,installGivenVersion:!!l,isApplicationScoped:c.isApplicationScoped||p?.isApplicationScoped}})})),i.length){let a=await this.extensionManagementService.installGalleryExtensions(i);for(let l of a)l.error?(this.logger.error(d(766,null,l.identifier.id,fe(l.error))),r.push(l.identifier.id)):this.logger.info(d(781,null,l.identifier.id,l.local?.manifest.version))}return r}async installVSIX(t,e,n,r){let i=await this.extensionManagementService.getManifest(t);if(!i)throw new Error("Invalid vsix");if(await this.validateVSIX(i,n,e.profileLocation,r))try{await this.extensionManagementService.install(t,{...e,installGivenVersion:!0}),this.logger.info(d(785,null,Zn(t)))}catch(a){if(Tn(a))this.logger.info(d(764,null,Zn(t)));else throw a}}async getGalleryExtensions(t){let e=new Map,n=t.some(s=>s.installOptions.installPreReleaseVersion),r=await this.extensionManagementService.getTargetPlatform(),i=[];for(let s of t)im.test(s.id)&&i.push({...s,preRelease:n});if(i.length){let s=await this.extensionGalleryService.getExtensions(i,{targetPlatform:r},Ee.None);for(let a of s)e.set(a.identifier.id.toLowerCase(),a)}return e}validateExtensionKind(t){return!0}async validateVSIX(t,e,n,r){let i={id:or(t.publisher,t.name)},s=r.find(a=>we(i,a.identifier));if(s){let a=this.validateBuiltinExtensionEnabledWithAutoUpdates(s);if(a)return this.logger.info(a),!1;if(!e&&Ti(s.manifest.version,t.version))return this.logger.info(d(768,null,s.identifier.id,s.manifest.version,t.version)),!1}return this.validateExtensionKind(t)}async uninstallExtensions(t,e,n){let r=async s=>{if(s instanceof I){let a=await this.extensionManagementService.getManifest(s);return nd(a.publisher,a.name)}return s},i=[];for(let s of t){let a=await r(s),c=(await this.extensionManagementService.getInstalled(void 0,n)).filter(u=>we(u.identifier,{id:a}));if(!c.length)throw new Error(`${this.notInstalled(a)}
- ${NL}`);if(c.some(u=>u.type===0)){this.logger.info(d(762,null,a));return}if(!e&&c.some(u=>u.isBuiltin)){this.logger.info(d(769,null,a));return}this.logger.info(d(786,null,a));for(let u of c)await this.extensionManagementService.uninstall(u,{profileLocation:n}),i.push(u);this.location?this.logger.info(d(783,null,a,this.location)):this.logger.info(d(782,null,a))}}async locateExtension(t){let e=await this.extensionManagementService.getInstalled();t.forEach(n=>{e.forEach(r=>{if(r.identifier.id===n&&r.location.scheme===z.file){this.logger.info(r.location.fsPath);return}})})}notInstalled(t){return this.location?d(780,null,t,this.location):d(779,null,t)}validateBuiltinExtensionEnabledWithAutoUpdates(t){if(t.isBuiltin&&this.productService.builtInExtensionsEnabledWithAutoUpdates.some(e=>e.toLowerCase()===t.identifier.id.toLowerCase())&&!t.forceAutoUpdate)return d(763,null,t.identifier.id,this.productService.quality)}};pa=E([b(2,ed),b(3,$n),b(4,Ve)],pa)});function J9(o){return o.tags.find(t=>t.startsWith("lp-"))?.split("lp-")[1]}var _m,Ld,ay=y(()=>{Wt();q();me();pe();rr();re();_m=_("languagePackService"),Ld=class extends D{constructor(e){super();this.extensionGalleryService=e}async getAvailableLanguages(){let e=new gt;setTimeout(()=>e.cancel(),1e3);let n;try{n=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}let i=n.firstPage.filter(s=>s.properties.localizedLanguages?.length&&s.tags.some(a=>a.startsWith("lp-"))).map(s=>{let a=s.properties.localizedLanguages?.[0],l=J9(s);return{...this.createQuickPickItem(l,a,s),extensionId:s.identifier.id,galleryExtension:s}});return i.push(this.createQuickPickItem("en","English")),i}createQuickPickItem(e,n,r){let i=n??e,s;if(i!==e&&(s=`(${e})`),e.toLowerCase()===Cn.toLowerCase()&&(s??="",s+=d(876,null)),r?.installCount){s??="";let a=r.installCount,l;a>1e6?l=`${Math.floor(a/1e5)/10}M`:a>1e3?l=`${Math.floor(a/1e3)}K`:l=String(a),s+=` $(cloud-download) ${l}`}return{id:e,label:i,description:s}}};Ld=E([b(0,$n)],Ld)});import*as UL from"fs";import{createHash as X9}from"crypto";function Y9(o){if(typeof o.languageId!="string"||!Array.isArray(o.translations)||o.translations.length===0)return!1;for(let t of o.translations)if(typeof t.id!="string"||typeof t.path!="string")return!1;return!(o.languageName&&typeof o.languageName!="string"||o.localizedLanguageName&&typeof o.localizedLanguageName!="string")}var ma,Lm,uw=y(()=>{At();ze();q();$e();Le();fr();vn();rr();No();Fe();ay();ce();ma=class extends Ld{constructor(e,n,r,i){super(r);this.extensionManagementService=e;this.logService=i;this.cache=this._register(new Lm(n,i)),this.extensionManagementService.registerParticipant({postInstall:async s=>this.postInstallExtension(s),postUninstall:async s=>this.postUninstallExtension(s)})}async getBuiltInExtensionTranslationsUri(e,n){let i=(await this.cache.getLanguagePacks())[n];if(!i){this.logService.warn(`No language pack found for ${n}`);return}let s=i.translations[e];return s?I.file(s):void 0}async getInstalledLanguages(){let e=await this.cache.getLanguagePacks(),n=Object.keys(e).map(r=>{let i=e[r];return{...this.createQuickPickItem(r,i.label),extensionId:i.extensions[0].extensionIdentifier.id}});return n.push(this.createQuickPickItem("en","English")),n.sort((r,i)=>r.label.localeCompare(i.label)),n}async postInstallExtension(e){e&&e.manifest&&e.manifest.contributes&&e.manifest.contributes.localizations&&e.manifest.contributes.localizations.length&&(this.logService.info("Adding language packs from the extension",e.identifier.id),await this.update())}async postUninstallExtension(e){let n=await this.cache.getLanguagePacks();Object.keys(n).some(r=>n[r]&&n[r].extensions.some(i=>we(i.extensionIdentifier,e.identifier)))&&(this.logService.info("Removing language packs from the extension",e.identifier.id),await this.update())}async update(){let[e,n]=await Promise.all([this.cache.getLanguagePacks(),this.extensionManagementService.getInstalled()]),r=await this.cache.update(n);return!mn(Object.keys(e),Object.keys(r))}};ma=E([b(0,ed),b(1,Dn),b(2,$n),b(3,Q)],ma);Lm=class extends D{constructor(e,n){super();this.logService=n;this.languagePacks={};this.languagePacksFilePath=H(e.userDataPath,"languagepacks.json"),this.languagePacksFileLimiter=new co}getLanguagePacks(){return this.languagePacksFileLimiter.size||!this.initializedCache?this.withLanguagePacks().then(()=>this.languagePacks):Promise.resolve(this.languagePacks)}update(e){return this.withLanguagePacks(n=>{Object.keys(n).forEach(r=>delete n[r]),this.createLanguagePacksFromExtensions(n,...e)}).then(()=>this.languagePacks)}createLanguagePacksFromExtensions(e,...n){for(let r of n)r&&r.manifest&&r.manifest.contributes&&r.manifest.contributes.localizations&&r.manifest.contributes.localizations.length&&this.createLanguagePacksFromExtension(e,r);Object.keys(e).forEach(r=>this.updateHash(e[r]))}createLanguagePacksFromExtension(e,n){let r=n.identifier,i=n.manifest.contributes&&n.manifest.contributes.localizations?n.manifest.contributes.localizations:[];for(let s of i)if(n.location.scheme===z.file&&Y9(s)){let a=e[s.languageId];a||(a={hash:"",extensions:[],translations:{},label:s.localizedLanguageName??s.languageName},e[s.languageId]=a);let l=a.extensions.filter(c=>we(c.extensionIdentifier,r))[0];l?l.version=n.manifest.version:a.extensions.push({extensionIdentifier:r,version:n.manifest.version});for(let c of s.translations)a.translations[c.id]=H(n.location.fsPath,c.path)}}updateHash(e){if(e){let n=X9("md5");for(let r of e.extensions)n.update(r.extensionIdentifier.uuid||r.extensionIdentifier.id).update(r.version);e.hash=n.digest("hex")}}withLanguagePacks(e=()=>null){return this.languagePacksFileLimiter.queue(()=>{let n=null;return UL.promises.readFile(this.languagePacksFilePath,"utf8").then(void 0,r=>r.code==="ENOENT"?Promise.resolve("{}"):Promise.reject(r)).then(r=>{try{return JSON.parse(r)}catch{return{}}}).then(r=>(n=e(r),r)).then(r=>{for(let s of Object.keys(r))r[s]||delete r[s];this.languagePacks=r,this.initializedCache=!0;let i=JSON.stringify(this.languagePacks);return this.logService.debug("Writing language packs",i),Te.writeFile(this.languagePacksFilePath,i)}).then(()=>n,r=>this.logService.error(r))})}};Lm=E([b(0,Dn),b(1,Q)],Lm)});var Md,FL=y(()=>{Wt();$e();nt();Zo();Md=class{constructor(t,e){this.requestService=t;this.fileService=e}async download(t,e,n,r=Ee.None){if(t.scheme===z.file||t.scheme===z.vscodeRemote){await this.fileService.copy(t,e);return}let i={type:"GET",url:t.toString(!0),callSite:n},s=await this.requestService.request(i,r);if(s.res.statusCode===200)await this.fileService.writeFile(e,s.stream);else{let a=await wi(s);throw new Error(`Expected 200, got back ${s.res.statusCode} instead.
- ${a}`)}}};Md=E([b(0,Rn),b(1,Oe)],Md)});function fa(o,t,e){t instanceof tt||(t=new tt(t,[],!!e)),Z9.push([o,t])}var Z9,Mm=y(()=>{Fp();Z9=[]});var ly,us,mw=y(()=>{br();ce();Mm();nt();Nt();de();q();At();ly=class o{constructor(t){this.uri=t;this.time=o._clock++}static{this._clock=0}touch(){return this.time=o._clock++,this}},us=class{constructor(t){this._fileService=t;this._dispooables=new le;this._limit=2**16;let e=new Map,n=r=>{let i=e.get(r.scheme);return i===void 0&&(i=t.hasProvider(r)&&!this._fileService.hasCapability(r,1024),e.set(r.scheme,i)),i};this._dispooables.add(F.any(t.onDidChangeFileSystemProviderRegistrations,t.onDidChangeFileSystemProviderCapabilities)(r=>{if(e.get(r.scheme)===void 0)return;e.delete(r.scheme);let s=n(I.from({scheme:r.scheme}));if(s!==s)for(let[a,l]of this._canonicalUris.entries())l.uri.scheme===r.scheme&&this._canonicalUris.delete(a)})),this.extUri=new tl(n),this._canonicalUris=new Map}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(t){this._fileService.hasProvider(t)&&(t=N1(t));let e=this.extUri.getComparisonKey(t,!0),n=this._canonicalUris.get(e);return n?n.touch().uri.with({fragment:t.fragment}):(this._canonicalUris.set(e,new ly(t)),this._checkTrim(),t)}_checkTrim(){if(this._canonicalUris.size<this._limit)return;ly._clock=1;let t=[...this._canonicalUris.values()].map(n=>n.time),e=Wg(Math.floor(t.length/2),t,(n,r)=>n-r);for(let[n,r]of this._canonicalUris.entries())r.time<=e?this._canonicalUris.delete(n):r.time=0}};us=E([b(0,Oe)],us);fa(ot,us,1)});async function cy(o,t){if(!St.commit||!await Te.exists(VL))return{userLocale:"en",osLocale:"en",resolvedLanguage:"en",defaultMessagesFile:VL,locale:"en",availableLanguages:{}};let e=`${o}||${t}`,n=WL.get(e);return n||(n=ch({userLocale:o,osLocale:o,commit:St.commit,userDataPath:t,nlsMetadataPath:BL}),WL.set(e,n)),n}var BL,VL,WL,fw=y(()=>{$e();Le();rS();fr();Js();BL=H(yt.asFileUri("").fsPath),VL=H(BL,"nls.messages.json"),WL=new Map});var ga,gw=y(()=>{Nt();ce();vn();El();Id();nt();re();Fe();yn();br();zr();fw();ga=class extends vd{constructor(e,n,r,i,s,a,l,c){super(I.file(s.builtinExtensionsPath),I.file(s.extensionsPath),ye(s.userHome,".vscode-oss-dev","extensions","control.json"),e.defaultProfile,e,n,r,i,s,a,l,c);this.nativeEnvironmentService=s}async getTranslations(e){let n=await cy(e,this.nativeEnvironmentService.userDataPath);if(n.languagePack)try{let r=await this.fileService.readFile(I.file(n.languagePack.translationsConfigFile));return JSON.parse(r.value.toString())}catch{}return Object.create(null)}};ga=E([b(0,an),b(1,Gr),b(2,Oe),b(3,Q),b(4,Dn),b(5,Ve),b(6,ot),b(7,gr)],ga)});var HL,$L,zL=y(()=>{re();HL=_("stateReadService"),$L=_("stateService")});var hw,Om,dy,GL=y(()=>{ze();et();q();Me();vn();nt();Fe();hw=class extends D{constructor(e,n,r,i){super();this.storagePath=e;this.logService=r;this.fileService=i;this.storage=Object.create(null);this.lastSavedStorageContents="";this.initializing=void 0;this.closing=void 0;this.flushDelayer=this._register(new kr(n===0?0:100))}init(){return this.initializing||(this.initializing=this.doInit()),this.initializing}async doInit(){try{this.lastSavedStorageContents=(await this.fileService.readFile(this.storagePath)).value.toString(),this.storage=JSON.parse(this.lastSavedStorageContents)}catch(e){e.fileOperationResult!==1&&this.logService.error(e)}}getItem(e,n){let r=this.storage[e];return _t(r)?n:r}setItem(e,n){this.setItems([{key:e,data:n}])}setItems(e){let n=!1;for(let{key:r,data:i}of e)this.storage[r]!==i&&(_t(i)?Xn(this.storage[r])||(this.storage[r]=void 0,n=!0):(this.storage[r]=i,n=!0));n&&this.save()}removeItem(e){Xn(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,A.fromString(e),{atomic:{postfix:".vsctmp"}}),this.lastSavedStorageContents=e}catch(n){this.logService.error(n)}}async close(){return this.closing||(this.closing=this.flushDelayer.trigger(()=>this.doSave(),0)),this.closing}},Om=class extends D{constructor(t,e,n,r){super(),this.fileStorage=this._register(new hw(e.stateResource,t,n,r))}async init(){await this.fileStorage.init()}getItem(t,e){return this.fileStorage.getItem(t,e)}};Om=E([b(1,It),b(2,Q),b(3,Oe)],Om);dy=class extends Om{setItem(t,e){this.fileStorage.setItem(t,e)}setItems(t){this.fileStorage.setItems(t)}removeItem(t){this.fileStorage.removeItem(t)}close(){return this.fileStorage.close()}}});var ha,Li,va,vw=y(()=>{ce();vn();nt();Fe();zL();br();zr();Me();GL();ha=class extends sd{constructor(e,n,r,i,s){super(r,i,n,s);this.stateReadonlyService=e;this.nativeEnvironmentService=r}getStoredProfiles(){return this.stateReadonlyService.getItem(ha.PROFILES_KEY,[]).map(n=>({...n,location:ne(n.location)?this.uriIdentityService.extUri.joinPath(this.profilesHome,n.location):I.revive(n.location)}))}getStoredProfileAssociations(){return this.stateReadonlyService.getItem(ha.PROFILE_ASSOCIATIONS_KEY,{})}getDefaultProfileExtensionsLocation(){return this.uriIdentityService.extUri.joinPath(I.file(this.nativeEnvironmentService.extensionsPath).with({scheme:this.profilesHome.scheme}),"extensions.json")}};ha=E([b(0,HL),b(1,ot),b(2,Dn),b(3,Oe),b(4,Q)],ha);Li=class extends ha{constructor(e,n,r,i,s){super(e,n,r,i,s);this.stateService=e}saveStoredProfiles(e){e.length?this.stateService.setItem(Li.PROFILES_KEY,e.map(n=>({...n,location:this.uriIdentityService.extUri.relativePath(this.profilesHome,n.location)}))):this.stateService.removeItem(Li.PROFILES_KEY)}saveStoredProfileAssociations(e){e.emptyWindows||e.workspaces?this.stateService.setItem(Li.PROFILE_ASSOCIATIONS_KEY,e):this.stateService.removeItem(Li.PROFILE_ASSOCIATIONS_KEY)}};Li=E([b(0,$L),b(1,ot),b(2,Dn),b(3,Oe),b(4,Q)],Li);va=class extends Li{constructor(t,e,n,r){super(new dy(0,e,r,n),t,e,n,r)}async init(){return await this.stateService.init(),super.init()}};va=E([b(0,ot),b(1,Dn),b(2,Oe),b(3,Q)],va)});var ya,yw=y(()=>{Fe();zr();br();El();nt();vn();ce();ya=class extends hd{constructor(t,e,n,r,i){super(I.file(t.extensionsPath),e,n,r,i)}};ya=E([b(0,Dn),b(1,Oe),b(2,an),b(3,ot),b(4,Q)],ya)});var Od,bw=y(()=>{q();Fe();Od=class extends D{constructor(t,e=[]){super(),this.logger=new vh([t,...e]),this._register(t.onDidChangeLogLevel(n=>this.setLevel(n)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(t){this.logger.setLevel(t)}getLevel(){return this.logger.getLevel()}trace(t,...e){this.logger.trace(t,...e)}debug(t,...e){this.logger.debug(t,...e)}info(t,...e){this.logger.info(t,...e)}warn(t,...e){this.logger.warn(t,...e)}error(t,...e){this.logger.error(t,...e)}flush(){this.logger.flush()}}});async function eW(o,t,e,n,r){try{let i=await import("@vscode/spdlog");i.setFlushOn(0);let s=await i.createAsyncRotatingLogger(o,t,e,n);return r?s.clearFormatters():s.setPattern("%Y-%m-%d %H:%M:%S.%e [%l] %v"),s}catch(i){console.error(i)}return null}function qL(o,t,e){switch(t){case 1:o.trace(e);break;case 2:o.debug(e);break;case 3:o.info(e);break;case 4:o.warn(e);break;case 5:o.error(e);break;case 0:break;default:throw new Error(`Invalid log level ${t}`)}}function KL(o,t){switch(t){case 1:o.setLevel(0);break;case 2:o.setLevel(1);break;case 3:o.setLevel(2);break;case 4:o.setLevel(3);break;case 5:o.setLevel(4);break;case 0:o.setLevel(6);break;default:throw new Error(`Invalid log level ${t}`)}}var uy,jL=y(()=>{nt();Fe();uy=class extends Op{constructor(e,n,r,i,s){super();this.buffer=[];this.setLevel(s),this._loggerCreationPromise=this._createSpdLogLogger(e,n,r,i),this._register(this.onDidChangeLogLevel(a=>{this._logger&&KL(this._logger,a)}))}async _createSpdLogLogger(e,n,r,i){let s=r?6:1,a=30/s*Yo.MB,l=await eW(e,n,a,s,i);if(l){this._logger=l,KL(this._logger,this.getLevel());for(let{level:c,message:u}of this.buffer)qL(this._logger,c,u);this.buffer=[]}}log(e,n){this._logger?qL(this._logger,e,n):this.getLevel()<=e&&this.buffer.push({level:e,message:n})}flush(){this._logger?this.flushLogger():this._loggerCreationPromise.then(()=>this.flushLogger())}dispose(){this._logger?this.disposeLogger():this._loggerCreationPromise.then(()=>this.disposeLogger()),super.dispose()}flushLogger(){this._logger&&this._logger.flush()}disposeLogger(){this._logger&&(this._logger.drop(),this._logger=void 0)}}});var Ad,Iw=y(()=>{sn();Fe();jL();Ad=class extends Ap{doCreateLogger(t,e,n){return new uy(Ce(),t.fsPath,!n?.donotRotate,!!n?.donotUseFormatters,e)}}});function tW(){return process.uncHostAllowlist}function Am(o){if(process.platform!=="win32")return;let t=tW();if(t)if(typeof o=="string")t.add(o.toLowerCase());else for(let e of nW(o))Am(e)}function nW(o){let t=new Set;if(Array.isArray(o))for(let e of o)typeof e=="string"&&t.add(e);return Array.from(t)}function py(){process.platform==="win32"&&(process.restrictUNCAccess=!1)}var xw=y(()=>{});function rW(o){return o.type==="gallery"}function oW(o){return o.type===1||o.type===0}var iW,ba,Sw=y(()=>{q();pe();rr();_n();yn();oa();xn();Me();de();iW=/^(?<version>\d+\.\d+\.\d+(-.*)?)(@(?<platform>.+))?$/,ba=class extends D{constructor(e,n){super();this.configurationService=n;this._onDidChangeAllowedExtensions=this._register(new P);this.onDidChangeAllowedExtensionsConfigValue=this._onDidChangeAllowedExtensions.event;this.publisherOrgs=e.extensionPublisherOrgs?.map(r=>r.toLowerCase())??[],this._allowedExtensionsConfigValue=this.getAllowedExtensionsValue(),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(am)&&(this._allowedExtensionsConfigValue=this.getAllowedExtensionsValue(),this._onDidChangeAllowedExtensions.fire())}))}get allowedExtensionsConfigValue(){return this._allowedExtensionsConfigValue}getAllowedExtensionsValue(){let e=this.configurationService.getValue(am);if(!Ue(e)||Array.isArray(e))return;let n=Object.entries(e).map(([r,i])=>[r.toLowerCase(),i]);if(!(n.length===1&&n[0][0]==="*"&&n[0][1]===!0))return Object.fromEntries(n)}isAllowed(e){if(!this._allowedExtensionsConfigValue)return!0;let n,r,i,s,a,l;rW(e)?(n=e.identifier.id.toLowerCase(),r=e.version,s=e.properties.isPreReleaseVersion,a=e.publisher.toLowerCase(),l=e.publisherDisplayName.toLowerCase(),i=e.properties.targetPlatform):oW(e)?(n=e.identifier.id.toLowerCase(),r=e.manifest.version,s=e.preRelease,a=e.manifest.publisher.toLowerCase(),l=e.publisherDisplayName?.toLowerCase(),i=e.targetPlatform):(n=e.id.toLowerCase(),r=e.version??"*",i=e.targetPlatform??"universal",s=e.prerelease??!1,a=e.id.substring(0,e.id.indexOf(".")).toLowerCase(),l=e.publisherDisplayName?.toLowerCase());let c=Tv("workbench.action.openSettings",{query:`@id:${am}`}).toString(),u=this._allowedExtensionsConfigValue[n],p=new Sn(d(739,null,c));if(!Xn(u))return Pr(u)?u?!0:p:u==="stable"&&s?new Sn(d(736,null,c)):r!=="*"&&Array.isArray(u)&&!u.some(h=>{let v=iW.exec(h);if(v&&v.groups){let{platform:x,version:T}=v.groups;return!(T!==r||i!=="universal"&&x&&i!==x)}return!1})?new Sn(d(740,null,r,c)):!0;let m=l&&this.publisherOrgs.includes(l)?l:a,g=this._allowedExtensionsConfigValue[m];return Xn(g)?this._allowedExtensionsConfigValue["*"]===!0?!0:p:Pr(g)?g?!0:new Sn(d(738,null,m,c)):g==="stable"&&s?new Sn(d(737,null,m,c)):!0}};ba=E([b(0,Ve),b(1,xt)],ba)});var Ia,Ew=y(()=>{de();q();yn();yl();rr();Ia=class extends D{constructor(e){super();this.productService=e;this.onDidChangeExtensionGalleryManifest=F.None;this.onDidChangeExtensionGalleryManifestStatus=F.None}get extensionGalleryManifestStatus(){return this.productService.extensionsGallery?.serviceUrl?"available":"unavailable"}async getExtensionGalleryManifest(){let e=this.productService.extensionsGallery;if(!e?.serviceUrl)return null;let n=[{id:`${e.serviceUrl}/extensionquery`,type:"ExtensionQueryService"},{id:`${e.serviceUrl}/vscode/{publisher}/{name}/latest`,type:"ExtensionLatestVersionUriTemplate"},{id:`${e.serviceUrl}/publishers/{publisher}/extensions/{name}/{version}/stats?statType={statTypeName}`,type:"ExtensionStatisticsUriTemplate"}];e.publisherUrl&&n.push({id:`${e.publisherUrl}/{publisher}`,type:"PublisherViewUriTemplate"}),e.itemUrl&&(n.push({id:`${e.itemUrl}?itemName={publisher}.{name}`,type:"ExtensionDetailsViewUriTemplate"}),n.push({id:`${e.itemUrl}?itemName={publisher}.{name}&ssr=false#review-details`,type:"ExtensionRatingViewUriTemplate"})),e.resourceUrlTemplate&&n.push({id:e.resourceUrlTemplate,type:"ExtensionResourceUriTemplate"});let r=[{name:"Tag",value:1},{name:"ExtensionId",value:4},{name:"Category",value:5},{name:"ExtensionName",value:7},{name:"Target",value:8},{name:"Featured",value:9},{name:"SearchText",value:10},{name:"ExcludeWithFlags",value:12}],i=[{name:"NoneOrRelevance",value:0},{name:"LastUpdatedDate",value:1},{name:"Title",value:2},{name:"PublisherName",value:3},{name:"InstallCount",value:4},{name:"AverageRating",value:6},{name:"PublishedDate",value:10},{name:"WeightedRating",value:12}],s=[{name:"None",value:0},{name:"IncludeVersions",value:1},{name:"IncludeFiles",value:2},{name:"IncludeCategoryAndTags",value:4},{name:"IncludeSharedAccounts",value:8},{name:"IncludeVersionProperties",value:16},{name:"ExcludeNonValidated",value:32},{name:"IncludeInstallationTargets",value:64},{name:"IncludeAssetUri",value:128},{name:"IncludeStatistics",value:256},{name:"IncludeLatestVersionOnly",value:512},{name:"Unpublished",value:4096},{name:"IncludeNameConflictInfo",value:32768},{name:"IncludeLatestPrereleaseAndStableVersionOnly",value:65536}];return{version:"",resources:n,capabilities:{extensionQuery:{filtering:r,sorting:i,flags:s},signing:{allPublicRepositorySigned:!0}}}}};Ia=E([b(0,Ve)],Ia)});function QL(o){setTimeout(()=>process.exit(o),0)}async function JL(o,t,e){if(o.help){let r=St.serverApplicationName+(te?".cmd":"");console.log(u0(St.nameLong,r,St.version,e,{noInputFiles:!0,noPipe:!0}));return}if(o.version){console.log(p0(St.version,St.commit));return}let n=new ww(o,t);try{await n.run(),QL(0)}catch{QL(1)}finally{n.dispose()}}var ww,XL=y(()=>{dh();Fe();Fp();WS();xn();Zo();YS();Ao();nr();rr();TE();HE();Rv();zE();Js();q();jE();km();$e();nt();yn();Dl();dw();ay();uw();Se();ce();Le();no();FL();Ev();br();mw();Zp();me();Id();gw();zr();El();Kp();vw();yw();bw();Iw();pe();xw();Sw();yl();Ew();ww=class extends D{constructor(e,n){super();this.args=e;this.remoteDataFolder=n;this.registerListeners()}registerListeners(){process.once("exit",()=>this.dispose())}async run(){let e=await this.initServices();await e.invokeFunction(async n=>{let r=n.get(xt),i=n.get(Q),s=n.get(Ve);te&&(r.getValue("security.restrictUNCAccess")===!1?py():Am(r.getValue("security.allowedUNCHosts")));try{await this.doRun(e.createInstance(pa,s.extensionsForceVersionByQuality??[],new hh(i.getLevel(),!1)))}catch(a){throw i.error(a),console.error(fe(a)),a}})}async initServices(){let e=new Bs,n={_serviceBrand:void 0,...St};e.set(Ve,n);let r=new _i(this.args,n);e.set(ua,r);let i=new Ad(Up(r),r.logsHome);e.set(vr,i);let s=new Od(this._register(i.createLogger("remoteCLI",{name:d(985,null)})));e.set(Q,s),s.trace(`Remote configuration data at ${this.remoteDataFolder}`),s.trace("process arguments:",this.args);let a=this._register(new ki(s));e.set(Oe,a),a.registerProvider(z.file,this._register(new Di(s)));let l=new us(a);e.set(ot,l);let c=this._register(new va(l,r,a,s));e.set(an,c);let u=this._register(new Kc(c.defaultProfile.settingsResource,a,new Zs,s));return e.set(xt,u),await Promise.all([u.initialize(),c.init()]),e.set(Rn,new tt(ea,["remote"])),e.set(ud,new tt(Md)),e.set(Ft,w0),e.set(Pi,new tt(Ia)),e.set($n,new tt(ra)),e.set(Gr,new tt(ya)),e.set(ls,new tt(ga)),e.set(xd,new tt(ia)),e.set(vo,new tt(ba)),e.set(Sm,new tt(sa)),e.set(_m,new tt(ma)),new Ed(e)}async doRun(e){if(this.args["list-extensions"])return e.listExtensions(!!this.args["show-versions"],this.args.category);if(this.args["install-extension"]||this.args["install-builtin-extension"]){let n={isMachineScoped:!!this.args["do-not-sync"],installPreReleaseVersion:!!this.args["pre-release"],donotIncludePackAndDependencies:!!this.args["do-not-include-pack-dependencies"]};return e.installExtensions(this.asExtensionIdOrVSIX(this.args["install-extension"]||[]),this.asExtensionIdOrVSIX(this.args["install-builtin-extension"]||[]),n,!!this.args.force)}else{if(this.args["uninstall-extension"])return e.uninstallExtensions(this.asExtensionIdOrVSIX(this.args["uninstall-extension"]),!!this.args.force);if(this.args["update-extensions"])return e.updateExtensions();if(this.args["locate-extension"])return e.locateExtension(this.args["locate-extension"])}}asExtensionIdOrVSIX(e){return e.map(n=>/\.vsix$/i.test(n)?I.file(ro(n)?n:H(to(),n)):n)}}});import{constants as sW,promises as aW}from"fs";import{createInterface as lW}from"readline";async function YL(o){if(rt||te)return;let t;for(let e of["/etc/os-release","/usr/lib/os-release","/etc/lsb-release"])try{t=await aW.open(e,sW.R_OK);break}catch{}if(!t){o("Unable to retrieve release information from known identifier paths.");return}try{let e=new Set(["ID","DISTRIB_ID","ID_LIKE","VERSION_ID","DISTRIB_RELEASE"]),n={id:"unknown"};for await(let r of lW({input:t.createReadStream(),crlfDelay:1/0})){if(!r.includes("="))continue;let i=r.split("=")[0].toUpperCase().trim();if(e.has(i)){let s=r.split("=")[1].replace(/"/g,"").toLowerCase().trim();i==="ID"||i==="DISTRIB_ID"?n.id=s:i==="ID_LIKE"?n.id_like=s:(i==="VERSION_ID"||i==="DISTRIB_RELEASE")&&(n.version_id=s)}}return n}catch(e){o(e)}finally{await t.close()}}var ZL=y(()=>{me()});import*as Tw from"net";function tM(o,t,e,n=1){let r=!1;return new Promise(i=>{let s=setTimeout(()=>{if(!r)return r=!0,i(0)},e);Cw(o,t,n,a=>{if(!r)return r=!0,clearTimeout(s),i(a)})})}function Cw(o,t,e,n){if(t===0)return n(0);let r=new Tw.Socket;r.once("connect",()=>(eM(r),Cw(o+e,t-1,e,n))),r.once("data",()=>{}),r.once("error",i=>(eM(r),i.code!=="ECONNREFUSED"?Cw(o+e,t-1,e,n):n(o))),r.connect(o,"127.0.0.1")}function eM(o){try{o.removeAllListeners("connect"),o.removeAllListeners("error"),o.end(),o.destroy(),o.unref()}catch(t){console.error(t)}}var nM=y(()=>{});import{createHash as uW}from"crypto";import{tmpdir as pW}from"os";import{createDeflateRaw as mW,createInflateRaw as fW}from"zlib";function oM(o,t,{debugLabel:e,skipWebSocketFrames:n=!1,disableWebSocketCompression:r=!1,enableMessageSplitting:i=!0}){if(o.headers.upgrade===void 0||o.headers.upgrade.toLowerCase()!=="websocket"){t.end("HTTP/1.1 400 Bad Request");return}let s=o.headers["sec-websocket-key"],a=uW("sha1");a.update(s+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11");let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${a.digest("base64")}`],u=!1;if(!n&&!r&&o.headers["sec-websocket-extensions"]){let p=Array.isArray(o.headers["sec-websocket-extensions"])?o.headers["sec-websocket-extensions"]:[o.headers["sec-websocket-extensions"]];for(let m of p)if(!/\b((server_max_window_bits)|(server_no_context_takeover)|(client_no_context_takeover))\b/.test(m)){if(/\b(permessage-deflate)\b/.test(m)){u=!0,c.push("Sec-WebSocket-Extensions: permessage-deflate");break}if(/\b(x-webkit-deflate-frame)\b/.test(m)){u=!0,c.push("Sec-WebSocket-Extensions: x-webkit-deflate-frame");break}}}return t.write(c.join(`\r
- `)+`\r
- \r
- `),t.setTimeout(0),t.setNoDelay(!0),n?new ps(t,e):new ms(new ps(t,e),u,null,!0,i)}function hW(o,t){if(t===0)return;let e=o.byteLength>>>2;for(let l=0;l<e;l++){let c=o.readUInt32BE(l*4);o.writeUInt32BE(c^t,l*4)}let n=e*4,r=o.byteLength-n,i=t>>>24&255,s=t>>>16&255,a=t>>>8&255;r>=1&&o.writeUInt8(o.readUInt8(n)^i,n),r>=2&&o.writeUInt8(o.readUInt8(n+1)^s,n+1),r>=3&&o.writeUInt8(o.readUInt8(n+2)^a,n+2)}function Nd(){let o=Ce();if(process.platform==="win32")return`\\\\.\\pipe\\vscode-ipc-${o}-sock`;let t=process.platform!=="darwin"&&rM?rM:pW(),e=H(t,`vscode-ipc-${o}.sock`);return yW(e),e}function yW(o){let t=vW[Go];typeof t=="number"&&o.length>=t&&console.warn(`WARNING: IPC handle "${o}" is longer than ${t} chars, try a shorter --user-data-dir`)}var gW,ps,ms,Pw,kw,Rw,rM,vW,Nm=y(()=>{et();Se();de();q();Le();me();sn();la();Rl();gW=3e4,ps=class{constructor(t,e=""){this._canWrite=!0;this.debugLabel=e,this.socket=t,this.traceSocketEvent("created",{type:"NodeSocket"}),this._errorListener=r=>{if(this.traceSocketEvent("error",{code:r?.code,message:r?.message}),r){if(r.code==="EPIPE")return;Ke(r)}},this.socket.on("error",this._errorListener);let n;this._closeListener=r=>{this.traceSocketEvent("close",{hadError:r}),this._canWrite=!1,n&&clearTimeout(n)},this.socket.on("close",this._closeListener),this._endListener=()=>{this.traceSocketEvent("nodeEndReceived"),this._canWrite=!1,n=setTimeout(()=>t.destroy(),gW)},this.socket.on("end",this._endListener)}traceSocketEvent(t,e){aw.traceSocketEvent(this.socket,this.debugLabel,t,e)}dispose(){this.socket.off("error",this._errorListener),this.socket.off("close",this._closeListener),this.socket.off("end",this._endListener),this.socket.destroy()}onData(t){let e=n=>{this.traceSocketEvent("read",n),t(A.wrap(n))};return this.socket.on("data",e),{dispose:()=>this.socket.off("data",e)}}onClose(t){let e=n=>{t({type:0,hadError:n,error:void 0})};return this.socket.on("close",e),{dispose:()=>this.socket.off("close",e)}}onEnd(t){let e=()=>{t()};return this.socket.on("end",e),{dispose:()=>this.socket.off("end",e)}}write(t){if(!(this.socket.destroyed||!this._canWrite))try{this.traceSocketEvent("write",t),this.socket.write(t.buffer,e=>{if(e){if(e.code==="EPIPE")return;Ke(e)}})}catch(e){if(e.code==="EPIPE")return;Ke(e)}}end(){this.traceSocketEvent("nodeEndSent"),this.socket.end()}drain(){return this.traceSocketEvent("nodeDrainBegin"),new Promise((t,e)=>{if(this.socket.bufferSize===0){this.traceSocketEvent("nodeDrainEnd"),t();return}let n=()=>{this.socket.off("close",n),this.socket.off("end",n),this.socket.off("error",n),this.socket.off("timeout",n),this.socket.off("drain",n),this.traceSocketEvent("nodeDrainEnd"),t()};this.socket.on("close",n),this.socket.on("end",n),this.socket.on("error",n),this.socket.on("timeout",n),this.socket.on("drain",n)})}},ms=class extends D{constructor(e,n,r,i,s=!0){super();this._onData=this._register(new P);this._onClose=this._register(new P);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:n,inflateBytesLength:r?.byteLength||0,recordInflateBytes:i}),this._flowManager=this._register(new Pw(this,n,r,i,this._onData,(a,l)=>this._write(a,l))),this._register(this._flowManager.onError(a=>{console.error(a),Ke(a),this._onClose.fire({type:0,hadError:!0,error:a})})),this._incomingData=new Rm,this._register(this.socket.onData(a=>this._acceptChunk(a))),this._register(this.socket.onClose(async a=>{this._flowManager.isProcessingReadQueue()&&await F.toPromise(this._flowManager.onDidFinishProcessingReadQueue),this._onClose.fire(a)}))}get permessageDeflate(){return this._flowManager.permessageDeflate}get recordedInflateBytes(){return this._flowManager.recordedInflateBytes}setRecordInflateBytes(e){this._flowManager.setRecordInflateBytes(e)}traceSocketEvent(e,n){this.socket.traceSocketEvent(e,n)}dispose(){this._flowManager.isProcessingWriteQueue()?this._register(this._flowManager.onDidFinishProcessingWriteQueue(()=>{this.dispose()})):(this.socket.dispose(),super.dispose())}onData(e){return this._onData.event(e)}onClose(e){return this._onClose.event(e)}onEnd(e){return this.socket.onEnd(e)}write(e){let n=0;for(;n<e.byteLength;)this._flowManager.writeMessage(e.slice(n,Math.min(n+this._maxSocketMessageLength,e.byteLength)),{compressed:!0,opcode:2}),n+=this._maxSocketMessageLength}_write(e,{compressed:n,opcode:r}){if(this._isEnded)return;this.traceSocketEvent("webSocketNodeSocketWrite",e);let i=2;e.byteLength<126?i+=0:e.byteLength<2**16?i+=2:i+=8;let s=A.alloc(i),a=n?64:0,l=r&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(A.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 n=this._incomingData.peek(this._state.readLen),r=n.readUInt8(0),i=(r&128)>>>7,s=(r&64)>>>6,a=r&15,l=n.readUInt8(1),c=(l&128)>>>7,u=l&127;this._state.state=2,this._state.readLen=2+(c?4:0)+(u===126?2:0)+(u===127?8:0),this._state.fin=i,this._state.firstFrameOfMessage&&(this._state.compressed=!!s),this._state.firstFrameOfMessage=!!i,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 n=this._incomingData.read(this._state.readLen),r=n.readUInt8(1),i=(r&128)>>>7,s=r&127,a=1;s===126?s=n.readUInt8(++a)*2**8+n.readUInt8(++a):s===127&&(s=n.readUInt8(++a)*0+n.readUInt8(++a)*0+n.readUInt8(++a)*0+n.readUInt8(++a)*0+n.readUInt8(++a)*2**24+n.readUInt8(++a)*2**16+n.readUInt8(++a)*2**8+n.readUInt8(++a));let l=0;i&&(l=n.readUInt8(++a)*2**24+n.readUInt8(++a)*2**16+n.readUInt8(++a)*2**8+n.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 n=this._incomingData.read(this._state.readLen);this.traceSocketEvent("webSocketNodeSocketReadData",n),hW(n,this._state.mask),this.traceSocketEvent("webSocketNodeSocketUnmaskedData",n),this._state.state=1,this._state.readLen=2,this._state.mask=0,this._state.opcode<=2?this._flowManager.acceptFrame(n,this._state.compressed,!!this._state.fin):this._state.opcode===9&&this._flowManager.writeMessage(n,{compressed:!1,opcode:10})}}}async drain(){this.traceSocketEvent("webSocketNodeSocketDrainBegin"),this._flowManager.isProcessingWriteQueue()&&await F.toPromise(this._flowManager.onDidFinishProcessingWriteQueue),await this.socket.drain(),this.traceSocketEvent("webSocketNodeSocketDrainEnd")}},Pw=class extends D{constructor(e,n,r,i,s,a){super();this._tracer=e;this._onData=s;this._writeFn=a;this._onError=this._register(new P);this.onError=this._onError.event;this._writeQueue=[];this._readQueue=[];this._onDidFinishProcessingReadQueue=this._register(new P);this.onDidFinishProcessingReadQueue=this._onDidFinishProcessingReadQueue.event;this._onDidFinishProcessingWriteQueue=this._register(new P);this.onDidFinishProcessingWriteQueue=this._onDidFinishProcessingWriteQueue.event;this._isProcessingWriteQueue=!1;this._isProcessingReadQueue=!1;n?(this._zlibInflateStream=this._register(new kw(this._tracer,i,r,{windowBits:15})),this._zlibDeflateStream=this._register(new Rw(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:A.alloc(0)}setRecordInflateBytes(e){this._zlibInflateStream?.setRecordInflateBytes(e)}writeMessage(e,n){this._writeQueue.push({data:e,options:n}),this._processWriteQueue()}async _processWriteQueue(){if(!this._isProcessingWriteQueue){for(this._isProcessingWriteQueue=!0;this._writeQueue.length>0;){let{data:e,options:n}=this._writeQueue.shift();if(this._zlibDeflateStream&&n.compressed){let r=await this._deflateMessage(this._zlibDeflateStream,e);this._writeFn(r,n)}else this._writeFn(e,{...n,compressed:!1})}this._isProcessingWriteQueue=!1,this._onDidFinishProcessingWriteQueue.fire()}}isProcessingWriteQueue(){return this._isProcessingWriteQueue}_deflateMessage(e,n){return new Promise((r,i)=>{e.write(n),e.flush(s=>r(s))})}acceptFrame(e,n,r){this._readQueue.push({data:e,isCompressed:n,isLastFrameOfMessage:r}),this._processReadQueue()}async _processReadQueue(){if(!this._isProcessingReadQueue){for(this._isProcessingReadQueue=!0;this._readQueue.length>0;){let e=this._readQueue.shift();if(this._zlibInflateStream&&e.isCompressed){let n=await this._inflateFrame(this._zlibInflateStream,e.data,e.isLastFrameOfMessage);this._onData.fire(n)}else this._onData.fire(e.data)}this._isProcessingReadQueue=!1,this._onDidFinishProcessingReadQueue.fire()}}isProcessingReadQueue(){return this._isProcessingReadQueue}_inflateFrame(e,n,r){return new Promise((i,s)=>{e.write(n),r&&e.write(A.fromByteArray([0,0,255,255])),e.flush(a=>i(a))})}},kw=class extends D{constructor(e,n,r,i){super();this._tracer=e;this._onError=this._register(new P);this.onError=this._onError.event;this._recordedInflateBytes=[];this._pendingInflateData=[];this._recordInflateBytes=n,this._zlibInflate=fW(i),this._zlibInflate.on("error",s=>{this._tracer.traceSocketEvent("zlibInflateError",{message:s?.message,code:s?.code}),this._onError.fire(s)}),this._zlibInflate.on("data",s=>{this._tracer.traceSocketEvent("zlibInflateData",s),this._pendingInflateData.push(A.wrap(s))}),r&&(this._tracer.traceSocketEvent("zlibInflateInitialWrite",r.buffer),this._zlibInflate.write(r.buffer),this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateInitialFlushFired"),this._pendingInflateData.length=0}))}get recordedInflateBytes(){return this._recordInflateBytes?A.concat(this._recordedInflateBytes):A.alloc(0)}write(e){this._recordInflateBytes&&this._recordedInflateBytes.push(e.clone()),this._tracer.traceSocketEvent("zlibInflateWrite",e),this._zlibInflate.write(e.buffer)}setRecordInflateBytes(e){this._recordInflateBytes=e,e||(this._recordedInflateBytes.length=0)}flush(e){this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateFlushFired");let n=A.concat(this._pendingInflateData);this._pendingInflateData.length=0,e(n)})}dispose(){this._recordedInflateBytes.length=0,this._pendingInflateData.length=0;try{this._zlibInflate.close()}catch{}super.dispose()}},Rw=class extends D{constructor(e,n){super();this._tracer=e;this._onError=this._register(new P);this.onError=this._onError.event;this._pendingDeflateData=[];this._zlibDeflate=mW({windowBits:15}),this._zlibDeflate.on("error",r=>{this._tracer.traceSocketEvent("zlibDeflateError",{message:r?.message,code:r?.code}),this._onError.fire(r)}),this._zlibDeflate.on("data",r=>{this._tracer.traceSocketEvent("zlibDeflateData",r),this._pendingDeflateData.push(A.wrap(r))})}write(e){this._tracer.traceSocketEvent("zlibDeflateWrite",e.buffer),this._zlibDeflate.write(e.buffer)}flush(e){this._zlibDeflate.flush(2,()=>{this._tracer.traceSocketEvent("zlibDeflateFlushFired");let n=A.concat(this._pendingDeflateData);this._pendingDeflateData.length=0,n=n.slice(0,n.byteLength-4),e(n)})}dispose(){this._pendingDeflateData.length=0;try{this._zlibDeflate.close()}catch{}super.dispose()}};rM=process.env.XDG_RUNTIME_DIR,vW={2:107,1:103}});var iM,Ud,my=y(()=>{Se();re();iM=_("remoteAuthorityResolverService"),Ud=class o extends ur{static isNotAvailable(t){return t instanceof o&&t._code==="NotAvailable"}static isTemporarilyNotAvailable(t){return t instanceof o&&t._code==="TemporarilyNotAvailable"}static isNoResolverFound(t){return t instanceof o&&t._code==="NoResolverFound"}static isInvalidAuthority(t){return t instanceof o&&t._code==="InvalidAuthority"}static isHandled(t){return t instanceof o&&t.isHandled}constructor(t,e="Unknown",n){super(t),this._message=t,this._code=e,this._detail=n,this.isHandled=e==="NotAvailable"&&n===!0,Object.setPrototypeOf(this,o.prototype)}}});function IW(o){switch(o){case 1:return"Management";case 2:return"ExtensionHost";case 3:return"Tunnel"}}function xW(o){let t=new gt;return setTimeout(()=>t.cancel(),o),t.token}async function SW(o,t,e){let{connectTo:n,connectionToken:r}=await o.addressProvider.getAddress();return{commit:o.commit,quality:o.quality,connectTo:n,connectionToken:r,reconnectionToken:t,reconnectionProtocol:e,remoteSocketFactoryService:o.remoteSocketFactoryService,signService:o.signService,logService:o.logService}}function EW(o){return Rr(t=>new Promise((e,n)=>{let r=setTimeout(e,o*1e3);t.onCancellationRequested(()=>{clearTimeout(r),e()})}))}function wW(o){try{o.acceptDisconnect();let t=o.getSocket();o.dispose(),t.dispose()}catch(t){Ke(t)}}function CW(o,t){return typeof o!="number"||!isFinite(o)||o<0?t:o>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:Math.floor(o)}function TW(o,t){for(;o.length<t;)o+=" ";return o}function PW(o,t){return`[remote-connection][${TW(IW(o),13)}][${t.substr(0,5)}\u2026]`}function fy(o,t,e){return`${PW(o,t)}[${e?"reconnect":"initial"}]`}var bW,Dw,_w,Lw,gy,Mw,sM,aM=y(()=>{ze();et();Wt();Se();de();q();$e();zo();Ns();sn();Rl();my();bW=30*1e3;Dw=class{constructor(t,e){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.type=0}},_w=class{constructor(t,e,n,r){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.durationSeconds=n;this.cancellableTimer=r;this.type=1}skipWait(){this.cancellableTimer.cancel()}},Lw=class{constructor(t,e,n){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.attempt=n;this.type=2}},gy=class{constructor(t,e,n){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.attempt=n;this.type=4}},Mw=class{constructor(t,e,n,r){this.reconnectionToken=t;this.millisSinceLastIncomingData=e;this.attempt=n;this.handled=r;this.type=3}},sM=class o extends D{constructor(e,n,r,i,s){super();this._connectionType=e;this._options=n;this.reconnectionToken=r;this.protocol=i;this._reconnectionFailureIsFatal=s;this._onDidStateChange=this._register(new P);this.onDidStateChange=this._onDidStateChange.event;this._permanentFailure=!1;this._isReconnecting=!1;this._isDisposed=!1;this._reconnectionGraceTime=108e5;this._onDidStateChange.fire(new gy(this.reconnectionToken,0,0)),this._register(i.onSocketClose(a=>{let l=fy(this._connectionType,this.reconnectionToken,!0);a?a.type===0?(this._options.logService.info(`${l} received socket close event (hadError: ${a.hadError}).`),a.error&&this._options.logService.error(a.error)):(this._options.logService.info(`${l} received socket close event (wasClean: ${a.wasClean}, code: ${a.code}, reason: ${a.reason}).`),a.event&&this._options.logService.error(a.event)):this._options.logService.info(`${l} received socket close event.`),this._beginReconnecting()})),this._register(i.onSocketTimeout(a=>{let l=fy(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()})),o._instances.push(this),this._register(ie(()=>{let a=o._instances.indexOf(this);a>=0&&o._instances.splice(a,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(o._permanentFailureMillisSinceLastIncomingData,o._permanentFailureAttempt,o._permanentFailureHandled)}static triggerPermanentFailure(e,n,r){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=n,this._permanentFailureHandled=r,this._instances.forEach(i=>i._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(e=>e._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(e=>e._pauseSocketWriting())}static{this._permanentFailure=!1}static{this._permanentFailureMillisSinceLastIncomingData=0}static{this._permanentFailureAttempt=0}static{this._permanentFailureHandled=!1}static{this._instances=[]}get _isPermanentFailure(){return this._permanentFailure||o._permanentFailure}updateGraceTime(e){let n=CW(e,108e5),r=fy(this._connectionType,this.reconnectionToken,!1);this._options.logService.trace(`${r} Applying reconnection grace time: ${n}ms (${Math.floor(n/1e3)}s)`),this._reconnectionGraceTime=n}dispose(){super.dispose(),this._isDisposed=!0}async _beginReconnecting(){if(!this._isReconnecting)try{this._isReconnecting=!0,await this._runReconnectingLoop()}finally{this._isReconnecting=!1}}async _runReconnectingLoop(){if(this._isPermanentFailure||this._isDisposed)return;let e=fy(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 Dw(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));let n=[0,5,5,10,10,10,10,10,30],r=this._reconnectionGraceTime;if(this._options.logService.info(`${e} starting reconnection with grace time: ${r}ms (${Math.floor(r/1e3)}s)`),r<=0){this._options.logService.error(`${e} reconnection grace time is set to 0ms, will not attempt to reconnect.`),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),0,!1);return}let i=Date.now(),s=-1;do{s++;let a=s<n.length?n[s]:n[n.length-1];try{if(a>0){let c=EW(a);this._onDidStateChange.fire(new _w(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 Lw(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),s+1)),this._options.logService.info(`${e} resolving connection...`);let l=await SW(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${l.connectTo}...`),await this._reconnect(l,xW(bW)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new gy(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()-i>=r){let c=Math.round(r/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(Ud.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(Tn(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 Ud){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,Ud.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,n,r){this._reconnectionFailureIsFatal?o.triggerPermanentFailure(e,n,r):this._gotoPermanentFailure(e,n,r)}_gotoPermanentFailure(e,n,r){this._onDidStateChange.fire(new Mw(this.reconnectionToken,e,n,r)),wW(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}}});var vy,hy,Ow=y(()=>{re();vy=_("extensionHostStatusService"),hy=class{constructor(){this._exitInfo=new Map}setExitInfo(t,e){this._exitInfo.set(t,e)}getExitInfo(t){return this._exitInfo.get(t)||null}}});function kW(o){delete o[Um.ENV_KEY],delete o[Fm.ENV_KEY],delete o[Aw.ENV_KEY]}function Nw(o,t){kW(t),o.serialize(t)}var Um,Fm,Aw,lM=y(()=>{Um=class o{constructor(t){this.pipeName=t;this.type=1}static{this.ENV_KEY="VSCODE_EXTHOST_IPC_HOOK"}serialize(t){t[o.ENV_KEY]=this.pipeName}},Fm=class o{constructor(){this.type=2}static{this.ENV_KEY="VSCODE_EXTHOST_WILL_SEND_SOCKET"}serialize(t){t[o.ENV_KEY]="1"}},Aw=class o{constructor(){this.type=3}static{this.ENV_KEY="VSCODE_WILL_SEND_MESSAGE_PORT"}serialize(t){t[o.ENV_KEY]="1"}}});import*as cM from"child_process";import*as dM from"net";async function Uw(o={},t,e,n,r,i){let s=await cy(e,n.userDataPath),a={};if(t)try{a=await Jc(i,r,n.args,process.env)}catch(g){r.error("ExtensionHostConnection#buildUserEnvironment resolving shell environment failed",g)}let c={...process.env,...a,VSCODE_ESM_ENTRYPOINT:"vs/workbench/api/node/extensionHostProcess",VSCODE_HANDLES_UNCAUGHT_ERRORS:"true",VSCODE_NLS_CONFIG:JSON.stringify(s),...o},u=n.isBuilt?H(n.appRoot,"bin"):H(n.appRoot,"resources","server","bin-dev"),p=H(u,"remote-cli"),m=RW(c,"PATH");return m?m=p+Ds+m:m=p,DW(c,"PATH",m),n.args["without-browser-env-var"]||(c.BROWSER=H(u,"helpers",te?"browser.cmd":"browser.sh")),c.VSCODE_RECONNECTION_GRACE_TIME=String(n.reconnectionGraceTime),r.trace(`[reconnection-grace-time] Setting VSCODE_RECONNECTION_GRACE_TIME env var for extension host: ${n.reconnectionGraceTime}ms (${Math.floor(n.reconnectionGraceTime/1e3)}s)`),_W(c),c}function RW(o,t){let e=Object.keys(o).filter(r=>r.toLowerCase()===t.toLowerCase()),n=e.length>0?e[0]:t;return o[n]}function DW(o,t,e){let n=Object.keys(o).filter(i=>i.toLowerCase()===t.toLowerCase()),r=n.length>0?n[0]:t;o[r]=e}function _W(o){for(let t of Object.keys(o))o[t]===null&&delete o[t]}var yy,Fd,Fw=y(()=>{et();de();q();$e();Le();me();Jp();Nm();xn();Fe();Kh();Ow();fw();Dl();lM();yy=class{constructor(t,e){this.socket=t;this.initialDataChunk=e}socketDrain(){return this.socket.drain()}toIExtHostSocketMessage(){let t,e,n;return this.socket instanceof ps?(t=!0,e=!1,n=A.alloc(0)):(t=!1,e=this.socket.permessageDeflate,n=this.socket.recordedInflateBytes,this.socket.setRecordInflateBytes(!1)),{type:"VSCODE_EXTHOST_IPC_SOCKET",initialDataChunk:this.initialDataChunk.buffer.toString("base64"),skipWebSocketFrames:t,permessageDeflate:e,inflateBytes:n.buffer.toString("base64")}}},Fd=class extends D{constructor(e,n,r,i,s,a,l,c){super();this._reconnectionToken=e;this._environmentService=s;this._logService=a;this._extensionHostStatusService=l;this._configurationService=c;this._onClose=this._register(new P);this.onClose=this._onClose.event;this._canSendSocket=!te||!this._environmentService.args["socket-path"],this._disposed=!1,this._remoteAddress=n,this._extensionHostProcess=null,this._connectionData=new yy(r,i),!this._canSendSocket&&r instanceof ms&&r.setRecordInflateBytes(!1),this._log("New connection established.")}dispose(){this._cleanResources(),super.dispose()}get _logPrefix(){return`[${this._remoteAddress}][${this._reconnectionToken.substr(0,8)}][ExtensionHostConnection] `}_log(e){this._logService.info(`${this._logPrefix}${e}`)}_logError(e){this._logService.error(`${this._logPrefix}${e}`)}async _pipeSockets(e,n){let r=new le;r.add(n.socket),r.add(ie(()=>{e.destroy()}));let i=()=>{r.dispose()};r.add(n.socket.onEnd(i)),r.add(n.socket.onClose(i)),r.add(F.fromNodeEventEmitter(e,"end")(i)),r.add(F.fromNodeEventEmitter(e,"close")(i)),r.add(F.fromNodeEventEmitter(e,"error")(i)),r.add(n.socket.onData(s=>e.write(s.buffer))),r.add(F.fromNodeEventEmitter(e,"data")(s=>{n.socket.write(A.wrap(s))})),n.initialDataChunk.byteLength>0&&e.write(n.initialDataChunk.buffer)}async _sendSocketToExtensionHost(e,n){await n.socketDrain();let r=n.toIExtHostSocketMessage(),i;n.socket instanceof ps?i=n.socket.socket:i=n.socket.socket.socket,e.send(r,i)}shortenReconnectionGraceTimeIfNecessary(){if(!this._extensionHostProcess)return;let e={type:"VSCODE_EXTHOST_IPC_REDUCE_GRACE_TIME"};this._extensionHostProcess.send(e)}acceptReconnection(e,n,r){this._remoteAddress=e,this._log("The client has reconnected."),!this._canSendSocket&&n instanceof ms&&n.setRecordInflateBytes(!1);let i=new yy(n,r);if(!this._extensionHostProcess){this._connectionData=i;return}this._sendSocketToExtensionHost(this._extensionHostProcess,i)}_cleanResources(){this._disposed||(this._disposed=!0,this._connectionData&&(this._connectionData.socket.end(),this._connectionData=null),this._extensionHostProcess&&(this._extensionHostProcess.kill(),this._extensionHostProcess=null),this._onClose.fire(void 0))}async start(e){try{let n=process.execArgv?process.execArgv.filter(m=>!/^--inspect(-brk)?=/.test(m)):[];e.port&&!process.pkg&&(n=[`--inspect${e.break?"-brk":""}=${e.port}`,"--experimental-network-inspection"]);let r=await Uw(e.env,!0,e.language,this._environmentService,this._logService,this._configurationService);zh(r);let i;if(this._canSendSocket)Nw(new Fm,r),i=null;else{let{namedPipeServer:m,pipeName:g}=await this._listenOnPipe();Nw(new Um(g),r),i=m}let s={env:r,execArgv:n,silent:!0};s.execArgv.unshift("--dns-result-order=ipv4first");let a=["--type=extensionHost","--transformURIs"],l=this._environmentService.args["use-host-proxy"];a.push(`--useHostProxy=${l?"true":"false"}`),this._configurationService.getValue("extensions.supportNodeGlobalNavigator")&&a.push("--supportGlobalNavigator"),this._extensionHostProcess=cM.fork(yt.asFileUri("bootstrap-fork").fsPath,a,s);let c=this._extensionHostProcess.pid;this._log(`<${c}> Launched Extension Host Process.`),this._extensionHostProcess.stdout.setEncoding("utf8"),this._extensionHostProcess.stderr.setEncoding("utf8");let u=F.fromNodeEventEmitter(this._extensionHostProcess.stdout,"data"),p=F.fromNodeEventEmitter(this._extensionHostProcess.stderr,"data");if(this._register(u(m=>this._log(`<${c}> ${m}`))),this._register(p(m=>this._log(`<${c}><stderr> ${m}`))),this._extensionHostProcess.on("error",m=>{this._logError(`<${c}> Extension Host Process had an error`),this._logService.error(m),this._cleanResources()}),this._extensionHostProcess.on("exit",(m,g)=>{this._extensionHostStatusService.setExitInfo(this._reconnectionToken,{code:m,signal:g}),this._log(`<${c}> Extension Host Process exited with code: ${m}, signal: ${g}.`),this._cleanResources()}),i)i.on("connection",m=>{i.close(),this._pipeSockets(m,this._connectionData)});else{let m=g=>{g.type==="VSCODE_EXTHOST_IPC_READY"&&(this._extensionHostProcess.removeListener("message",m),this._sendSocketToExtensionHost(this._extensionHostProcess,this._connectionData),this._connectionData=null)};this._extensionHostProcess.on("message",m)}}catch(n){console.error("ExtensionHostConnection errored"),n&&console.error(n)}}_listenOnPipe(){return new Promise((e,n)=>{let r=Nd(),i=dM.createServer();i.on("error",n),i.listen(r,()=>{i?.removeListener("error",n),e({pipeName:r,namedPipeServer:i})})})}};Fd=E([b(4,ua),b(5,Q),b(6,vy),b(7,xt)],Fd)});function by(o){let t=0,e=0,n=0;o>=1e3&&(n=Math.floor(o/1e3),o-=n*1e3),n>=60&&(e=Math.floor(n/60),n-=e*60),e>=60&&(t=Math.floor(e/60),e-=t*60);let r=t?`${t}h`:"",i=e?`${e}m`:"",s=n?`${n}s`:"",a=o?`${o}ms`:"";return`${r}${i}${s}${a}`}var Iy,uM=y(()=>{Rl();de();ze();Iy=class{constructor(t,e,n,r,i){this._logService=t;this._reconnectionToken=e;this._onClose=new P;this.onClose=this._onClose.event;this._reconnectionGraceTime=i;let s=3e5;this._reconnectionShortGraceTime=i>0?Math.min(s,i):0,this._remoteAddress=n,this.protocol=r,this._disposed=!1,this._disconnectRunner1=new Ep(()=>{this._log(`The reconnection grace time of ${by(this._reconnectionGraceTime)} has expired, so the connection will be disposed.`),this._cleanResources()},this._reconnectionGraceTime),this._disconnectRunner2=new Ep(()=>{this._log(`The reconnection short grace time of ${by(this._reconnectionShortGraceTime)} has expired, so the connection will be disposed.`),this._cleanResources()},this._reconnectionShortGraceTime),F.once(this.protocol.onDidDispose)(()=>{this._log("The client has disconnected gracefully, so the connection will be disposed."),this._cleanResources()}),this._socketCloseListener=this.protocol.onSocketClose(()=>{this._log(`The client has disconnected, will wait for reconnection ${by(this._reconnectionGraceTime)} before disposing...`),this._disconnectRunner1.schedule()}),this._log("New connection established.")}_log(t){this._logService.info(`[${this._remoteAddress}][${this._reconnectionToken.substr(0,8)}][ManagementConnection] ${t}`)}shortenReconnectionGraceTimeIfNecessary(){this._disconnectRunner2.isScheduled()||this._disconnectRunner1.isScheduled()&&(this._log(`Another client has connected, will shorten the wait for reconnection ${by(this._reconnectionShortGraceTime)} before disposing...`),this._disconnectRunner2.schedule())}_cleanResources(){if(this._disposed)return;this._disposed=!0,this._disconnectRunner1.dispose(),this._disconnectRunner2.dispose(),this._socketCloseListener.dispose();let t=this.protocol.getSocket();this.protocol.sendDisconnect(),this.protocol.dispose(),t.end(),this._onClose.fire(void 0),this._onClose.dispose()}acceptReconnection(t,e,n){this._remoteAddress=t,this._log("The client has reconnected."),this._disconnectRunner1.cancel(),this._disconnectRunner2.cancel(),this.protocol.beginAcceptReconnection(e,n),this.protocol.endAcceptReconnection()}}});import*as pM from"cookie";import*as xy from"fs";async function LW(o,t){let e=o["without-connection-token"],n=o["connection-token"],r=o["connection-token-file"];if(e)return typeof n<"u"||typeof r<"u"?new fs("Please do not use the argument '--connection-token' or '--connection-token-file' at the same time as '--without-connection-token'."):new Ww;if(typeof r<"u"){if(typeof n<"u")return new fs("Please do not use the argument '--connection-token' at the same time as '--connection-token-file'.");let i;try{i=xy.readFileSync(r).toString().replace(/\r?\n$/,"")}catch{return new fs(`Unable to read the connection token file at '${r}'.`)}return Vw.test(i)?new Vm(i):new fs(`The connection token defined in '${r} does not adhere to the characters 0-9, a-z, A-Z, _, or -.`)}return typeof n<"u"?Vw.test(n)?new Vm(n):new fs(`The connection token '${n} does not adhere to the characters 0-9, a-z, A-Z or -.`):new Vm(await t())}async function mM(o){return LW(o,async()=>{if(!o["user-data-dir"])return Ce();let e=H(o["user-data-dir"],"token");try{let i=(await xy.promises.readFile(e)).toString().replace(/\r?\n$/,"");if(Vw.test(i))return i}catch{}let n=Ce();try{await Te.writeFile(e,n,{mode:384})}catch{}return n})}function fM(o,t,e){if(o.validate(e.query[Ws]))return!0;let n=pM.parse(t.headers.cookie||"");return o.validate(n[Ip])}var Vw,Ww,Vm,fs,Wm=y(()=>{Le();sn();$e();fr();Vw=/^[0-9A-Za-z_-]+$/,Ww=class{constructor(){this.type=0}validate(t){return!0}},Vm=class{constructor(t){this.value=t;this.type=2}validate(t){return t===this.value}},fs=class{constructor(t){this.message=t}}});var Wd,MW,Vd,Sy=y(()=>{q();re();Fe();Wd=_("serverLifetimeService"),MW=300*1e3,Vd=class extends D{constructor(e,n){super();this._options=e;this._logService=n;this._consumers=new Map;this._totalCount=0;this._options.enableAutoShutdown&&this._scheduleShutdown(!0)}get hasActiveConsumers(){return this._totalCount>0}active(e){let n=this._totalCount===0,r=this._consumers.get(e)??0;this._consumers.set(e,r+1),this._totalCount++,this._logService.debug(`ServerLifetime: consumer '${e}' active (total: ${this._totalCount})`),n&&this._cancelShutdown();let i=!1;return ie(()=>{if(i)return;i=!0;let s=this._consumers.get(e);s!==void 0&&(s<=1?this._consumers.delete(e):this._consumers.set(e,s-1)),this._totalCount--,this._logService.debug(`ServerLifetime: consumer '${e}' inactive (total: ${this._totalCount})`),this._totalCount===0&&this._options.enableAutoShutdown&&this._scheduleShutdown(!1)})}delay(){this._shutdownTimer&&(this._logService.debug("ServerLifetime: delay requested, resetting shutdown timer"),this._cancelShutdown(),this._scheduleShutdown(!1))}_scheduleShutdown(e){this._options.shutdownWithoutDelay&&!e?this._tryShutdown():(this._logService.debug("ServerLifetime: scheduling shutdown timer"),this._shutdownTimer=setTimeout(()=>{this._shutdownTimer=void 0,this._tryShutdown()},MW))}_tryShutdown(){if(this._totalCount>0){this._logService.debug("ServerLifetime: consumer became active, aborting shutdown");return}console.log("All consumers inactive, shutting down"),this._logService.info("ServerLifetime: all consumers inactive, shutting down"),this.dispose(),process.exit(0)}_cancelShutdown(){this._shutdownTimer&&(this._logService.debug("ServerLifetime: cancelling shutdown timer"),clearTimeout(this._shutdownTimer),this._shutdownTimer=void 0)}};Vd=E([b(1,Q)],Vd)});import{networkInterfaces as OW}from"os";function NW(o){let t=o.replace(/\-/g,":").toLowerCase();return!AW.has(t)}function gM(){let o=OW();for(let t in o){let e=o[t];if(e){for(let{mac:n}of e)if(NW(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}var AW,hM=y(()=>{AW=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"])});import{networkInterfaces as UW}from"os";async function vM(o){return Bw||(Bw=(async()=>await FW(o)||Ce())()),Bw}async function FW(o){try{let t=await import("crypto"),e=gM();return t.createHash("sha256").update(e,"utf8").digest("hex")}catch(t){o(t);return}}async function yM(o){if(te){let t=await import("@vscode/windows-registry");try{return t.GetStringRegKey("HKEY_LOCAL_MACHINE",VW,"MachineId")||""}catch(e){return o(e),""}}return""}async function bM(o){try{return await(await import("@vscode/deviceid")).getDeviceId()}catch(t){return o(t),Ce()}}var Hw,Bw,VW,$w=y(()=>{$p();sn();hM();me();Hw=new class{_isVirtualMachineMacAddress(o){return this._virtualMachineOUIs||(this._virtualMachineOUIs=Xo.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(o)}value(){if(this._value===void 0){let o=0,t=0,e=UW();for(let n in e){let r=e[n];if(r)for(let{mac:i,internal:s}of r)s||(t+=1,this._isVirtualMachineMacAddress(i.toUpperCase())&&(o+=1))}this._value=t>0?o/t:0}return this._value}};VW="Software\\Microsoft\\SQMClient"});var Bm,IM=y(()=>{de();q();Bm=class extends D{constructor(){super(...arguments);this._onCloseEmitter=this._register(new P);this._onReloadEmitter=this._register(new P);this._onTerminateEmitter=this._register(new P);this._onAttachEmitter=this._register(new P)}static{this.ChannelName="extensionhostdebugservice"}call(e,n,r){switch(n){case"close":return Promise.resolve(this._onCloseEmitter.fire({sessionId:r[0]}));case"reload":return Promise.resolve(this._onReloadEmitter.fire({sessionId:r[0]}));case"terminate":return Promise.resolve(this._onTerminateEmitter.fire({sessionId:r[0]}));case"attach":return Promise.resolve(this._onAttachEmitter.fire({sessionId:r[0],port:r[1],subId:r[2]}))}throw new Error("Method not implemented.")}listen(e,n,r){switch(n){case"close":return this._onCloseEmitter.event;case"reload":return this._onReloadEmitter.event;case"terminate":return this._onTerminateEmitter.event;case"attach":return this._onAttachEmitter.event}throw new Error("Method not implemented.")}}});var Ey,xM=y(()=>{ce();Ey=class{constructor(t,e){this.channel=t;this.getUriTransformer=e}async download(t,e,n){let r=this.getUriTransformer();r&&(t=r.transformOutgoingURI(t),e=r.transformOutgoingURI(e)),await this.channel.call("download",[t,e])}}});function SM(o){return o.toJSON()}function EM(o,t,e){if(!o||e>200)return null;if(typeof o=="object"){if(o instanceof I)return t.transformOutgoing(o);for(let n in o)if(Object.hasOwnProperty.call(o,n)){let r=EM(o[n],t,e+1);r!==null&&(o[n]=r)}}return null}function bo(o,t){let e=EM(o,t,0);return e===null?o:e}function zw(o,t,e,n){if(!o||n>200)return null;if(typeof o=="object"){if(o.$mid===1)return e?I.revive(t.transformIncoming(o)):t.transformIncoming(o);if(o instanceof A)return null;for(let r in o)if(Object.hasOwnProperty.call(o,r)){let i=zw(o[r],t,e,n+1);i!==null&&(o[r]=i)}}return null}function Gw(o,t){let e=zw(o,t,!1,0);return e===null?o:e}function Hd(o,t){let e=zw(o,t,!0,0);return e===null?o:e}var wy,Bd,xa=y(()=>{et();Cc();ce();wy=class{constructor(t){this._uriTransformer=t}transformIncoming(t){let e=this._uriTransformer.transformIncoming(t);return e===t?t:SM(I.from(e))}transformOutgoing(t){let e=this._uriTransformer.transformOutgoing(t);return e===t?t:SM(I.from(e))}transformOutgoingURI(t){let e=this._uriTransformer.transformOutgoing(t);return e===t?t:I.from(e)}transformOutgoingScheme(t){return this._uriTransformer.transformOutgoingScheme(t)}},Bd=new class{transformIncoming(o){return o}transformOutgoing(o){return o}transformOutgoingURI(o){return o}transformOutgoingScheme(o){return o}}});function ni(o,t){return o?I.revive(t?t.transformIncoming(o):o):void 0}function $d(o,t){return t?t.transformOutgoingURI(o):o}function Hm(o,t){t=t||Bd;let e=o.manifest;return{...Hd({...o,manifest:void 0},t),manifest:e}}function $m(o,t){return o?.profileLocation?Hd(o,t??Bd):o}function zm(o,t){return t?yr(o,e=>e instanceof I?t.transformOutgoingURI(e):void 0):o}var Cy,wM=y(()=>{de();on();ce();xa();hm();me();Cy=class{constructor(t,e){this.service=t;this.getUriTransformer=e;this.onInstallExtension=F.buffer(t.onInstallExtension,"onInstallExtension",!0),this.onDidInstallExtensions=F.buffer(t.onDidInstallExtensions,"onDidInstallExtensions",!0),this.onUninstallExtension=F.buffer(t.onUninstallExtension,"onUninstallExtension",!0),this.onDidUninstallExtension=F.buffer(t.onDidUninstallExtension,"onDidUninstallExtension",!0),this.onDidUpdateExtensionMetadata=F.buffer(t.onDidUpdateExtensionMetadata,"onDidUpdateExtensionMetadata",!0)}listen(t,e){let n=this.getUriTransformer(t);switch(e){case"onInstallExtension":return F.map(this.onInstallExtension,r=>({...r,profileLocation:r.profileLocation?$d(r.profileLocation,n):r.profileLocation}));case"onDidInstallExtensions":return F.map(this.onDidInstallExtensions,r=>r.map(i=>({...i,local:i.local?zm(i.local,n):i.local,profileLocation:i.profileLocation?$d(i.profileLocation,n):i.profileLocation})));case"onUninstallExtension":return F.map(this.onUninstallExtension,r=>({...r,profileLocation:r.profileLocation?$d(r.profileLocation,n):r.profileLocation}));case"onDidUninstallExtension":return F.map(this.onDidUninstallExtension,r=>({...r,profileLocation:r.profileLocation?$d(r.profileLocation,n):r.profileLocation}));case"onDidUpdateExtensionMetadata":return F.map(this.onDidUpdateExtensionMetadata,r=>({local:zm(r.local,n),profileLocation:$d(r.profileLocation,n)}))}throw new Error("Invalid listen")}async call(t,e,n){let r=this.getUriTransformer(t);switch(e){case"zip":{let i=Hm(n[0],r),s=await this.service.zip(i);return $d(s,r)}case"install":return this.service.install(ni(n[0],r),$m(n[1],r));case"installFromLocation":return this.service.installFromLocation(ni(n[0],r),ni(n[1],r));case"installExtensionsFromProfile":return this.service.installExtensionsFromProfile(n[0],ni(n[1],r),ni(n[2],r));case"getManifest":return this.service.getManifest(ni(n[0],r));case"getTargetPlatform":return this.service.getTargetPlatform();case"installFromGallery":return this.service.installFromGallery(n[0],$m(n[1],r));case"installGalleryExtensions":{let i=n[0];return this.service.installGalleryExtensions(i.map(({extension:s,options:a})=>({extension:s,options:$m(a,r)??{}})))}case"uninstall":return this.service.uninstall(Hm(n[0],r),$m(n[1],r));case"uninstallExtensions":{let i=n[0];return this.service.uninstallExtensions(i.map(({extension:s,options:a})=>({extension:Hm(s,r),options:$m(a,r)})))}case"getInstalled":return(await this.service.getInstalled(n[0],ni(n[1],r),n[2],n[3])).map(s=>zm(s,r));case"toggleApplicationScope":{let i=await this.service.toggleApplicationScope(Hm(n[0],r),ni(n[1],r));return zm(i,r)}case"copyExtensions":return this.service.copyExtensions(ni(n[0],r),ni(n[1],r));case"updateMetadata":{let i=await this.service.updateMetadata(Hm(n[0],r),n[1],ni(n[2],r));return zm(i,r)}case"resetPinnedStateForAllUserExtensions":return this.service.resetPinnedStateForAllUserExtensions(n[0]);case"getExtensionsControlManifest":return this.service.getExtensionsControlManifest();case"download":return this.service.download(n[0],n[1],n[2]);case"cleanUp":return this.service.cleanUp()}throw new Error("Invalid call")}}});var Ty,CM=y(()=>{et();Wt();de();Ty=class{constructor(t){this.service=t}listen(t,e){throw new Error("Invalid listen")}call(t,e,n,r=Ee.None){switch(e){case"request":return this.service.request(n[0],r).then(async({res:i,stream:s})=>{let a=await Br(s);return[{statusCode:i.statusCode,headers:i.headers},a]});case"resolveProxy":return this.service.resolveProxy(n[0]);case"lookupAuthorization":return this.service.lookupAuthorization(n[0]);case"lookupKerberosAuthorization":return this.service.lookupKerberosAuthorization(n[0]);case"loadCertificates":return this.service.loadCertificates()}throw new Error("Invalid call")}}});function WW(o){if(!o||typeof o!="object")return{callstack:void 0,msg:Fc(o)};let t=Array.isArray(o.stack)?o.stack.join(`
- `):o.stack,e=o.message?o.message:Fc(o);return{callstack:t,msg:e}}var TM,Gm,PM=y(()=>{At();Se();q();on();nt();(t=>{function o(e,n){return e.callstack<n.callstack?-1:e.callstack>n.callstack?1:0}t.compare=o})(TM||={});Gm=class o{constructor(t,e=o.ERROR_FLUSH_TIMEOUT){this._flushHandle=void 0;this._buffer=[];this._disposables=new le;this._telemetryService=t,this._flushDelay=e;let n=up.addListener(r=>this._onErrorEvent(r));this._disposables.add(ie(n)),this.installErrorListeners()}static{this.ERROR_FLUSH_TIMEOUT=5*1e3}dispose(){clearTimeout(this._flushHandle),this._flushBuffer(),this._disposables.dispose()}installErrorListeners(){}_onErrorEvent(t){if(!t||t.code||(t.detail&&t.detail.stack&&(t=t.detail),ur.isErrorNoTelemetry(t)||t instanceof hn||Ng.is(t)||typeof t?.message=="string"&&t.message.includes("Unable to read file")))return;let{callstack:e,msg:n}=WW(t);e&&this._enqueue({msg:n,callstack:e})}_enqueue(t){let e=GR(this._buffer,t,TM.compare);e<0?(t.count=1,this._buffer.splice(~e,0,t)):(this._buffer[e].count||(this._buffer[e].count=0),this._buffer[e].count+=1),this._flushHandle===void 0&&(this._flushHandle=setTimeout(()=>{this._flushBuffer(),this._flushHandle=void 0},this._flushDelay))}_flushBuffer(){for(let t of this._buffer)this._telemetryService.publicLogError2("UnhandledError",t);this._buffer.length=0}}});var qm,kM=y(()=>{Se();PM();qm=class extends Gm{installErrorListeners(){Ug(e=>console.error(e));let t=[];process.on("unhandledRejection",(e,n)=>{t.push(n),setTimeout(()=>{let r=t.indexOf(n);r>=0&&n.catch(i=>{t.splice(r,1),Tn(i)||(console.warn(`rejected promise not handled within 1 second: ${i}`),i.stack&&console.warn(`stack trace: ${i.stack}`),e&&Ke(e))})},1e3)}),process.on("rejectionHandled",e=>{let n=t.indexOf(e);n>=0&&t.splice(n,1)}),process.on("uncaughtException",e=>{Fg(e)||Ke(e)})}}});var RM,BW,qw,Zve,DM,Sa=y(()=>{re();Hr();RM=_("ptyService"),BW={Backend:"workbench.contributions.terminal.processBackend"},qw=class{constructor(){this._backends=new Map}get backends(){return this._backends}registerTerminalBackend(t){let e=this._sanitizeRemoteAuthority(t.remoteAuthority);if(this._backends.has(e))throw new Error(`A terminal backend with remote authority '${e}' was already registered.`);this._backends.set(e,t)}getTerminalBackend(t){return this._backends.get(this._sanitizeRemoteAuthority(t))}_sanitizeRemoteAuthority(t){return t?.toLowerCase()??""}};bt.add(BW.Backend,new qw);Zve=_("localPtyService"),DM=_("terminalLogService")});var Py,zd,ky=y(()=>{ce();de();Fe();q();Py=class{constructor(t,e){this.loggerService=t;this.getUriTransformer=e}listen(t,e){let n=this.getUriTransformer(t);switch(e){case"onDidChangeLoggers":return F.map(this.loggerService.onDidChangeLoggers,r=>({added:[...r.added].map(i=>this.transformLogger(i,n)),removed:[...r.removed].map(i=>this.transformLogger(i,n))}));case"onDidChangeVisibility":return F.map(this.loggerService.onDidChangeVisibility,r=>[n.transformOutgoingURI(r[0]),r[1]]);case"onDidChangeLogLevel":return F.map(this.loggerService.onDidChangeLogLevel,r=>fS(r)?r:[n.transformOutgoingURI(r[0]),r[1]])}throw new Error(`Event not found: ${e}`)}async call(t,e,n){let r=this.getUriTransformer(t);switch(e){case"setLogLevel":return fS(n[0])?this.loggerService.setLogLevel(n[0]):this.loggerService.setLogLevel(I.revive(r.transformIncoming(n[0][0])),n[0][1]);case"getRegisteredLoggers":return Promise.resolve([...this.loggerService.getRegisteredLoggers()].map(i=>this.transformLogger(i,r)))}throw new Error(`Call not found: ${e}`)}transformLogger(t,e){return{...t,resource:e.transformOutgoingURI(t.resource)}}},zd=class extends D{constructor(t,e){super(),e.call("setLogLevel",[t.getLogLevel()]),this._register(t.onDidChangeLogLevel(n=>e.call("setLogLevel",[n]))),e.call("getRegisteredLoggers").then(n=>{for(let r of n)t.registerLogger({...r,resource:I.revive(r.resource)})}),this._register(e.listen("onDidChangeVisibility")(([n,r])=>t.setVisibility(I.revive(n),r))),this._register(e.listen("onDidChangeLoggers")(({added:n,removed:r})=>{for(let i of n)t.registerLogger({...i,resource:I.revive(i.resource)});for(let i of r)t.deregisterLogger(i.resource)}))}}});var Gd,_M=y(()=>{ze();Wt();de();q();Fe();Gd=class extends D{constructor(e,n){super();this._logService=n;this._lastRequestId=0;this._pendingRequests=new Map;this._pendingRequestDisposables=new Map;this._onCreateRequest=this._register(new P);this.onCreateRequest=this._onCreateRequest.event;this._timeout=e===void 0?15e3:e,this._register(ie(()=>{for(let r of this._pendingRequestDisposables.values())jt(r)}))}createRequest(e){return new Promise((n,r)=>{let i=++this._lastRequestId;this._pendingRequests.set(i,n),this._onCreateRequest.fire({requestId:i,...e});let s=new gt;uo(this._timeout,s.token).then(()=>r(`Request ${i} timed out (${this._timeout}ms)`)),this._pendingRequestDisposables.set(i,[ie(()=>s.cancel())])})}acceptReply(e,n){let r=this._pendingRequests.get(e);r?(this._pendingRequests.delete(e),jt(this._pendingRequestDisposables.get(e)||[]),this._pendingRequestDisposables.delete(e),r(n)):this._logService.warn(`RequestStore#acceptReply was called without receiving a matching request ${e}`)}};Gd=E([b(1,Q)],Gd)});function LM(o,t){let e=[{name:null,description:d(969,null)}];return e.push(...o.map(n=>({name:n.profileName,description:HW(n)}))),t&&e.push(...t.map(n=>({name:n.title,description:$W(n)}))),{values:e.map(n=>n.name),markdownDescriptions:e.map(n=>n.description)}}function HW(o){let t=`$(${yo.isThemeIcon(o.icon)?o.icon.id:o.icon?o.icon:J.terminal.id}) ${o.profileName}
- - path: ${o.path}`;return o.args&&(ne(o.args)?t+=`
- - args: "${o.args}"`:t+=`
- - args: [${o.args.length===0?"":`'${o.args.join("','")}'`}]`),o.overrideName!==void 0&&(t+=`
- - overrideName: ${o.overrideName}`),o.color&&(t+=`
- - color: ${o.color}`),o.env&&(t+=`
- - env: ${JSON.stringify(o.env)}`),t}function $W(o){return`$(${yo.isThemeIcon(o.icon)?o.icon.id:o.icon?o.icon:J.terminal.id}) ${o.title}
- - extensionIdentifier: ${o.extensionIdentifier}`}var MM=y(()=>{xl();ce();pe();fm();Me()});function Qw(o){let t=o===2?"linux":o===1?"osx":"windows";return d(948,null,kg(o),'```json\n"terminal.integrated.profile.'+t+'": {\n "bash": null\n}\n```',"[","](https://code.visualstudio.com/docs/terminal/profiles)")}function OM(){bt.as(kn.Configuration).registerConfiguration(qW),KW()}function KW(o,t){let e=bt.as(kn.Configuration),n;o&&(n=LM(o?.profiles,t));let r=Jw;Jw={id:"terminal",order:100,title:d(952,null),type:"object",properties:{"terminal.integrated.defaultProfile.linux":{restricted:!0,markdownDescription:d(943,null),type:["string","null"],default:null,enum:o?.os===3?n?.values:void 0,markdownEnumDescriptions:o?.os===3?n?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.osx":{restricted:!0,markdownDescription:d(944,null),type:["string","null"],default:null,enum:o?.os===2?n?.values:void 0,markdownEnumDescriptions:o?.os===2?n?.markdownDescriptions:void 0},"terminal.integrated.defaultProfile.windows":{restricted:!0,markdownDescription:d(945,null),type:["string","null"],default:null,enum:o?.os===1?n?.values:void 0,markdownEnumDescriptions:o?.os===1?n?.markdownDescriptions:void 0}}},e.updateConfigurations({add:[Jw],remove:r?[r]:[]})}var zW,GW,qd,Kw,jw,qW,Jw,AM=y(()=>{xl();me();pe();Si();Hr();Sa();MM();zW={type:["string","null"],enum:["terminal.ansiBlack","terminal.ansiRed","terminal.ansiGreen","terminal.ansiYellow","terminal.ansiBlue","terminal.ansiMagenta","terminal.ansiCyan","terminal.ansiWhite"],default:null},GW={type:"string",enum:Array.from(OE(),o=>o.id),markdownEnumDescriptions:Array.from(OE(),o=>`$(${o.id})`)},qd={args:{description:d(953,null),type:"array",items:{type:"string"}},icon:{description:d(956,null),...GW},color:{description:d(954,null),...zW},env:{markdownDescription:d(955,null),type:"object",additionalProperties:{type:["string","null"]},default:{}}},Kw={type:"object",required:["path"],properties:{path:{description:d(964,null),type:["string","array"],items:{type:"string"}},overrideName:{description:d(963,null),type:"boolean"},...qd}},jw={type:"object",required:["path"],properties:{path:{description:d(951,null),type:["string"],items:{type:"string"}},...qd}};qW={id:"terminal",order:100,title:d(952,null),type:"object",properties:{"terminal.integrated.automationProfile.linux":{restricted:!0,markdownDescription:d(939,null),type:["object","null"],default:null,anyOf:[{type:"null"},jw],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.osx":{restricted:!0,markdownDescription:d(940,null),type:["object","null"],default:null,anyOf:[{type:"null"},jw],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.automationProfile.windows":{restricted:!0,markdownDescription:d(941,null,"`terminal.integrated.automationShell.windows`"),type:["object","null"],default:null,anyOf:[{type:"null"},jw],defaultSnippets:[{body:{path:"${1}",icon:"${2}"}}]},"terminal.integrated.profiles.windows":{restricted:!0,markdownDescription:Qw(3),type:"object",default:{PowerShell:{source:"PowerShell",icon:J.terminalPowershell.id},"Command Prompt":{path:["${env:windir}\\Sysnative\\cmd.exe","${env:windir}\\System32\\cmd.exe"],args:[],icon:J.terminalCmd.id},"Git Bash":{source:"Git Bash",icon:J.terminalGitBash.id}},additionalProperties:{anyOf:[{type:"object",required:["source"],properties:{source:{description:d(968,null),enum:["PowerShell","Git Bash"]},...qd}},{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:d(966,null),type:"string"},id:{description:d(965,null),type:"string"},title:{description:d(967,null),type:"string"},...qd}},{type:"null"},Kw]}},"terminal.integrated.profiles.osx":{restricted:!0,markdownDescription:Qw(1),type:"object",default:{bash:{path:"bash",args:["-l"],icon:J.terminalBash.id},zsh:{path:"zsh",args:["-l"]},fish:{path:"fish",args:["-l"]},tmux:{path:"tmux",icon:J.terminalTmux.id},pwsh:{path:"pwsh",icon:J.terminalPowershell.id}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:d(961,null),type:"string"},id:{description:d(960,null),type:"string"},title:{description:d(962,null),type:"string"},...qd}},{type:"null"},Kw]}},"terminal.integrated.profiles.linux":{restricted:!0,markdownDescription:Qw(2),type:"object",default:{bash:{path:"bash",icon:J.terminalBash.id},zsh:{path:"zsh"},fish:{path:"fish"},tmux:{path:"tmux",icon:J.terminalTmux.id},pwsh:{path:"pwsh",icon:J.terminalPowershell.id}},additionalProperties:{anyOf:[{type:"object",required:["extensionIdentifier","id","title"],properties:{extensionIdentifier:{description:d(958,null),type:"string"},id:{description:d(957,null),type:"string"},title:{description:d(959,null),type:"string"},...qd}},{type:"null"},Kw]}},"terminal.integrated.useWslProfiles":{description:d(950,null),type:"boolean",default:!0},"terminal.integrated.inheritEnv":{scope:1,description:d(946,null),type:"boolean",default:!0},"terminal.integrated.persistentSessionScrollback":{scope:1,markdownDescription:d(947,null),type:"number",default:100},"terminal.integrated.showLinkHover":{scope:1,description:d(949,null),type:"boolean",default:!0},"terminal.integrated.ignoreProcessNames":{markdownDescription:d(942,null,"`#terminal.integrated.confirmOnKill#`"),type:"array",items:{type:"string",uniqueItems:!0},default:["starship","oh-my-posh","bash","zsh"]}}}});import*as Dy from"os";async function jW(){if(Km)return;if(!te){Km={release:Dy.release(),buildNumber:0};return}let o,t;try{let e=await import("@vscode/windows-registry"),n="SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",r=e.GetStringRegKey("HKEY_LOCAL_MACHINE",n,"CurrentBuild");r!==void 0&&(o=parseInt(r,10),isNaN(o)&&(o=void 0));let i=e.GetDWORDRegKey("HKEY_LOCAL_MACHINE",n,"CurrentMajorVersionNumber"),s=e.GetDWORDRegKey("HKEY_LOCAL_MACHINE",n,"CurrentMinorVersionNumber");i!==void 0&&s!==void 0&&r!==void 0&&(t=`${i}.${s}.${r}`)}catch{}finally{Km={release:t||Dy.release(),buildNumber:o||QW()}}}async function NM(){return Km||await jW(),Km.buildNumber}function QW(){let o=/(\d+)\.(\d+)\.(\d+)/g.exec(Dy.release());return o&&o.length===4?parseInt(o[3],10):0}var Km,UM=y(()=>{me()});import*as WM from"fs";import*as BM from"child_process";function HM(o,t,e,n,r=process.env,i,s,a,l){return i=i||{existsFile:er.existsFile,readFile:WM.promises.readFile},te?JW(e,i,r,s,n.getValue("terminal.integrated.useWslProfiles")!==!1,o&&Ue(o)?{...o}:n.getValue("terminal.integrated.profiles.windows"),ne(t)?t:n.getValue("terminal.integrated.defaultProfile.windows"),l,a):r8(i,s,e,o&&Ue(o)?{...o}:n.getValue(_e?"terminal.integrated.profiles.linux":"terminal.integrated.profiles.osx"),ne(t)?t:n.getValue(_e?"terminal.integrated.defaultProfile.linux":"terminal.integrated.defaultProfile.osx"),l,a,r)}async function JW(o,t,e,n,r,i,s,a,l){let c=process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432"),u=`${process.env.windir}\\${c?"Sysnative":"System32"}`,p=await NM()>=19041;await YW(a);let m=new Map;if(o){m.set("PowerShell",{source:"PowerShell",icon:J.terminalPowershell,isAutoDetected:!0}),m.set("Windows PowerShell",{path:`${u}\\WindowsPowerShell\\v1.0\\powershell.exe`,icon:J.terminalPowershell,isAutoDetected:!0}),m.set("Git Bash",{source:"Git Bash",icon:J.terminalGitBash,isAutoDetected:!0}),m.set("Command Prompt",{path:`${u}\\cmd.exe`,icon:J.terminalCmd,isAutoDetected:!0}),m.set("Cygwin",{path:[{path:`${process.env.HOMEDRIVE}\\cygwin64\\bin\\bash.exe`,isUnsafe:!0},{path:`${process.env.HOMEDRIVE}\\cygwin\\bin\\bash.exe`,isUnsafe:!0}],args:["--login"],isAutoDetected:!0}),m.set("bash (MSYS2)",{path:[{path:`${process.env.HOMEDRIVE}\\msys64\\usr\\bin\\bash.exe`,isUnsafe:!0}],args:["--login","-i"],env:{CHERE_INVOKING:"1"},icon:J.terminalBash,isAutoDetected:!0});let h=`${process.env.CMDER_ROOT||`${process.env.HOMEDRIVE}\\cmder`}\\vendor\\bin\\vscode_init.cmd`;m.set("Cmder",{path:`${u}\\cmd.exe`,args:["/K",h],requiresPath:process.env.CMDER_ROOT?h:{path:h,isUnsafe:!0},isAutoDetected:!0})}zM(i,m);let g=await $M(m.entries(),s,t,e,n,l);if(o&&r&&p)try{let h=await t8(`${u}\\wsl.exe`,s);for(let v of h)(!i||!Object.prototype.hasOwnProperty.call(i,v.profileName))&&g.push(v)}catch{FM&&(n?.trace("WSL is not installed, so could not detect WSL profiles"),FM=!1)}return g}async function $M(o,t,e,n=process.env,r,i){let s=[];for(let[a,l]of o)s.push(XW(a,l,t,e,n,r,i));return(await Promise.all(s)).filter(a=>!!a)}async function XW(o,t,e,n,r=process.env,i,s){if(t===null)return;let a,l,c;if(ko(t,{source:!0})){let g=jm?.get(t.source);if(!g)return;a=g.paths,l=t.args||g.args,t.icon?c=VM(t.icon):g.icon&&(c=g.icon)}else a=Array.isArray(t.path)?t.path:[t.path],l=te||Array.isArray(t.args)?t.args:void 0,c=VM(t.icon);let u;if(s){let g=a.map(v=>ne(v)?v:v.path),h=await s(g);u=new Array(a.length);for(let v=0;v<a.length;v++)ne(a[v])?u[v]=h[v]:u[v]={path:h[v],isUnsafe:!0}}else u=a.slice();let p;if(t.requiresPath){let g;if(ne(t.requiresPath)?g=t.requiresPath:(g=t.requiresPath.path,t.requiresPath.isUnsafe&&(p=g)),!await n.existsFile(g))return}let m=await _y(o,e,u,n,r,l,t.env,t.overrideName,t.isAutoDetected,p);if(!m){i?.debug("Terminal profile not validated",o,a);return}return m.isAutoDetected=t.isAutoDetected,m.icon=c,m.color=t.color,m}function VM(o){return ne(o)?{id:o}:o}async function YW(o){if(jm&&!o)return;let[t,e]=await Promise.all([ZW(),o||e8()]);jm=new Map,jm.set("Git Bash",{profileName:"Git Bash",paths:t,args:["--login","-i"]}),jm.set("PowerShell",{profileName:"PowerShell",paths:e,icon:J.terminalPowershell})}async function ZW(){let o=new Set,t=await Xp("git.exe");if(t){let r=Ct(t);o.add(Bn(r,"../.."))}function e(r,i){i&&r.add(i)}e(o,process.env.ProgramW6432),e(o,process.env.ProgramFiles),e(o,process.env["ProgramFiles(X86)"]),e(o,`${process.env.LocalAppData}\\Program`);let n=[];for(let r of o)n.push(`${r}\\Git\\bin\\bash.exe`,`${r}\\Git\\usr\\bin\\bash.exe`,`${r}\\usr\\bin\\bash.exe`);return n.push(`${process.env.UserProfile}\\scoop\\apps\\git\\current\\bin\\bash.exe`),n.push(`${process.env.UserProfile}\\scoop\\apps\\git-with-openssh\\current\\bin\\bash.exe`),n}async function e8(){let o=[];for await(let t of GS())o.push(t.exePath);return o}async function t8(o,t){let e=[],n=await new Promise((i,s)=>{BM.exec("wsl.exe -l -q",{encoding:"utf16le",env:{...process.env,WSL_UTF8:"0"},timeout:1e3},(a,l)=>{if(a)return s("Problem occurred when getting wsl distros");i(l)})});if(!n)return[];let r=n.split(/\r?\n/).filter(i=>i.trim().length>0);for(let i of r){if(i===""||i.startsWith("docker-desktop"))continue;let s=`${i} (WSL)`,a={profileName:s,path:o,args:["-d",`${i}`],isDefault:s===t,icon:n8(i),isAutoDetected:!1};e.push(a)}return e}function n8(o){return o.includes("Ubuntu")?J.terminalUbuntu:o.includes("Debian")?J.terminalDebian:J.terminalLinux}async function r8(o,t,e,n,r,i,s,a){let l=new Map;if(e&&await o.existsFile("/etc/shells")){let c=(await o.readFile("/etc/shells")).toString(),u=(i||c.split(`
- `)).map(m=>{let g=m.indexOf("#");return g===-1?m:m.substring(0,g)}).filter(m=>m.trim().length>0),p=new Map;for(let m of u){let g=at(m),h=p.get(g)||0;h++,h>1&&(g=`${g} (${h})`),p.set(g,h),l.set(g,{path:m,isAutoDetected:!0})}}return zM(n,l),await $M(l.entries(),r,o,a,t,s)}function zM(o,t){if(o)for(let[e,n]of Object.entries(o))n===null||!Ue(n)||!ko(n,{path:!0})&&!ko(n,{source:!0})?t.delete(e):(n.icon=n.icon||t.get(e)?.icon,t.set(e,n))}async function _y(o,t,e,n,r,i,s,a,l,c){if(e.length===0)return Promise.resolve(void 0);let u=e.shift();if(u==="")return _y(o,t,e,n,r,i,s,a,l);let p=!ne(u)&&u.isUnsafe,m=ne(u)?u:u.path,g={profileName:o,path:m,args:i,env:s,overrideName:a,isAutoDetected:l,isDefault:o===t,isUnsafePath:p,requiresUnsafePath:c};if(at(m)===m){let v=r.PATH?r.PATH.split(Ds):void 0,x=await Xp(m,void 0,v,void 0,n.existsFile);return x?(g.path=x,g.isFromPath=!0,g):_y(o,t,e,n,r,i)}return await n.existsFile(In(m))?g:_y(o,t,e,n,r,i,s,a,l)}var jm,FM,GM=y(()=>{xl();Le();me();Yp();Me();fr();qS();Sa();UM();FM=!0});var Kd,qM=y(()=>{de();q();me();la();xn();Fe();ky();Kh();_M();Sa();AM();GM();QS();Ns();Kd=class extends D{constructor(e,n,r,i){super();this._ptyHostStarter=e;this._configurationService=n;this._logService=r;this._loggerService=i;this._wasQuitRequested=!1;this._restartCount=0;this._isResponsive=!0;this._onPtyHostExit=this._register(new P);this.onPtyHostExit=this._onPtyHostExit.event;this._onPtyHostStart=this._register(new P);this.onPtyHostStart=this._onPtyHostStart.event;this._onPtyHostUnresponsive=this._register(new P);this.onPtyHostUnresponsive=this._onPtyHostUnresponsive.event;this._onPtyHostResponsive=this._register(new P);this.onPtyHostResponsive=this._onPtyHostResponsive.event;this._onPtyHostRequestResolveVariables=this._register(new P);this.onPtyHostRequestResolveVariables=this._onPtyHostRequestResolveVariables.event;this._onProcessData=this._register(new P);this.onProcessData=this._onProcessData.event;this._onProcessReady=this._register(new P);this.onProcessReady=this._onProcessReady.event;this._onProcessReplay=this._register(new P);this.onProcessReplay=this._onProcessReplay.event;this._onProcessOrphanQuestion=this._register(new P);this.onProcessOrphanQuestion=this._onProcessOrphanQuestion.event;this._onDidRequestDetach=this._register(new P);this.onDidRequestDetach=this._onDidRequestDetach.event;this._onDidChangeProperty=this._register(new P);this.onDidChangeProperty=this._onDidChangeProperty.event;this._onProcessExit=this._register(new P);this.onProcessExit=this._onProcessExit.event;OM(),this._register(this._ptyHostStarter),this._register(ie(()=>this._disposePtyHost())),this._resolveVariablesRequestStore=this._register(new Gd(void 0,this._logService)),this._register(this._resolveVariablesRequestStore.onCreateRequest(this._onPtyHostRequestResolveVariables.fire,this._onPtyHostRequestResolveVariables)),this._ptyHostStarter.onRequestConnection&&this._register(F.once(this._ptyHostStarter.onRequestConnection)(()=>this._ensurePtyHost())),this._ptyHostStarter.onWillShutdown&&this._register(this._ptyHostStarter.onWillShutdown(()=>this._wasQuitRequested=!0))}get _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(te)return process.env;try{return await Jc(this._configurationService,this._logService,{_:[]},process.env)}catch(e){return this._logService.error("ptyHost was unable to resolve shell environment",e),{}}}_startPtyHost(){let e=this._ptyHostStarter.start(),n=e.client;this._logService.getLevel()===1&&this._logService.trace("PtyHostService#_startPtyHost",new Error().stack?.replace(/^Error/,"")),ds.toService(n.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 i=ds.toService(n.getChannel("ptyHost"));return this._register(i.onProcessData(s=>this._onProcessData.fire(s))),this._register(i.onProcessReady(s=>this._onProcessReady.fire(s))),this._register(i.onProcessExit(s=>this._onProcessExit.fire(s))),this._register(i.onDidChangeProperty(s=>this._onDidChangeProperty.fire(s))),this._register(i.onProcessReplay(s=>this._onProcessReplay.fire(s))),this._register(i.onProcessOrphanQuestion(s=>this._onProcessOrphanQuestion.fire(s))),this._register(i.onDidRequestDetach(s=>this._onDidRequestDetach.fire(s))),this._register(new zd(this._loggerService,n.getChannel("logger"))),this.__connection=e,this.__proxy=i,this._onPtyHostStart.fire(),this._register(this._configurationService.onDidChangeConfiguration(async s=>{s.affectsConfiguration("terminal.integrated.ignoreProcessNames")&&await this._refreshIgnoreProcessNames()})),this._refreshIgnoreProcessNames(),[e,i]}async createProcess(e,n,r,i,s,a,l,c,u,p,m){let g=setTimeout(()=>this._handleUnresponsiveCreateProcess(),5e3),h=await this._proxy.createProcess(e,n,r,i,s,a,l,c,u,p,m);return clearTimeout(g),h}updateTitle(e,n,r){return this._proxy.updateTitle(e,n,r)}updateIcon(e,n,r,i){return this._proxy.updateIcon(e,n,r,i)}attachToProcess(e){return this._proxy.attachToProcess(e)}detachFromProcess(e,n){return this._proxy.detachFromProcess(e,n)}shutdownAll(){return this._proxy.shutdownAll()}listProcesses(){return this._proxy.listProcesses()}async getPerformanceMarks(){return this._optionalProxy?.getPerformanceMarks()??[]}async reduceConnectionGraceTime(){return this._optionalProxy?.reduceConnectionGraceTime()}start(e){return this._proxy.start(e)}shutdown(e,n){return this._proxy.shutdown(e,n)}input(e,n){return this._proxy.input(e,n)}sendSignal(e,n){return this._proxy.sendSignal(e,n)}processBinary(e,n){return this._proxy.processBinary(e,n)}resize(e,n,r,i,s){return this._proxy.resize(e,n,r,i,s)}clearBuffer(e){return this._proxy.clearBuffer(e)}acknowledgeDataEvent(e,n){return this._proxy.acknowledgeDataEvent(e,n)}setUnicodeVersion(e,n){return this._proxy.setUnicodeVersion(e,n)}setNextCommandId(e,n,r){return this._proxy.setNextCommandId(e,n,r)}getInitialCwd(e){return this._proxy.getInitialCwd(e)}getCwd(e){return this._proxy.getCwd(e)}async getLatency(){let e=new Yn,n=await this._proxy.getLatency();return e.stop(),[{label:"ptyhostservice<->ptyhost",latency:e.elapsed()},...n]}orphanQuestionReply(e){return this._proxy.orphanQuestionReply(e)}installAutoReply(e,n){return this._proxy.installAutoReply(e,n)}uninstallAllAutoReplies(){return this._proxy.uninstallAllAutoReplies()}getDefaultSystemShell(e){return this._optionalProxy?.getDefaultSystemShell(e)??Gh(e??Or,process.env)}async getProfiles(e,n,r,i=!1){let s=await this._resolveShellEnv();return HM(n,r,i,this._configurationService,s,void 0,this._logService,this._resolveVariables.bind(this,e))}async getEnvironment(){return this.__proxy?this._proxy.getEnvironment():{...process.env}}getWslPath(e,n){return this._proxy.getWslPath(e,n)}getRevivedPtyNewId(e,n){return this._proxy.getRevivedPtyNewId(e,n)}setTerminalLayoutInfo(e){return this._proxy.setTerminalLayoutInfo(e)}async getTerminalLayoutInfo(e){return this._optionalProxy?.getTerminalLayoutInfo(e)}async requestDetachInstance(e,n){return this._proxy.requestDetachInstance(e,n)}async acceptDetachInstanceReply(e,n){return this._proxy.acceptDetachInstanceReply(e,n)}async freePortKillProcess(e){if(!this._proxy.freePortKillProcess)throw new Error("freePortKillProcess does not exist on the pty proxy");return this._proxy.freePortKillProcess(e)}async serializeTerminalState(e){return this._proxy.serializeTerminalState(e)}async reviveTerminalProcesses(e,n,r){return this._proxy.reviveTerminalProcesses(e,n,r)}async refreshProperty(e,n){return this._proxy.refreshProperty(e,n)}async updateProperty(e,n,r){return this._proxy.updateProperty(e,n,r)}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,n){return this._resolveVariablesRequestStore.createRequest({workspaceId:e,originalText:n})}async acceptPtyHostResolvedVariables(e,n){this._resolveVariablesRequestStore.acceptReply(e,n)}};Kd=E([b(1,xt),b(2,Q),b(3,vr)],Kd)});function o8(o){return{transformIncoming:t=>t.scheme==="vscode-remote"?{scheme:"file",path:t.path,query:t.query,fragment:t.fragment}:t.scheme==="file"?{scheme:"vscode-local",path:t.path,query:t.query,fragment:t.fragment}:t,transformOutgoing:t=>t.scheme==="file"?{scheme:"vscode-remote",authority:o,path:t.path,query:t.query,fragment:t.fragment}:t.scheme==="vscode-local"?{scheme:"file",path:t.path,query:t.query,fragment:t.fragment}:t,transformOutgoingScheme:t=>t==="file"?"vscode-remote":t==="vscode-local"?"file":t}}function gs(o){return new wy(o8(o))}var Qm=y(()=>{xa()});import{exec as Ly}from"child_process";import{totalmem as i8}from"os";function Jm(o){return new Promise((t,e)=>{let n,r=new Map,i=i8();function s(l,c,u,p,m){let g=r.get(c);if(l===o||g){let h={name:a(u),cmd:u,pid:l,ppid:c,load:p,mem:te?m:i*(m/100)};r.set(l,h),l===o&&(n=h),g&&(g.children||(g.children=[]),g.children.push(h),g.children.length>1&&(g.children=g.children.sort((v,x)=>v.pid-x.pid)))}}function a(l){let c=/--utility-sub-type=network/i,u=/--crashes-directory/i,p=/conhost\.exe.+--headless/i,m=/--type=([a-zA-Z-]+)/;if(u.exec(l))return"electron-crash-reporter";if(p.exec(l))return"conpty-agent";let g=m.exec(l);if(g&&g.length===2)return g[1]==="renderer"?"window":g[1]==="utility"?c.exec(l)?"utility-network-service":"utility-process":g[1]==="extensionHost"?"extension-host":g[1];if(l.indexOf("node ")<0&&l.indexOf("node.exe")<0){let h="";do g=s8.exec(l),g&&(h+=g+" ");while(g);if(h)return`electron-nodejs (${h.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(o,u=>{if(!u){e(new Error(`Root process ${o} not found`));return}c.getProcessCpuUsage(u,p=>{let m=new Map;p.forEach(g=>{let h=l(g.commandLine||"");m.set(g.pid,{name:a(h),cmd:h,pid:g.pid,ppid:g.ppid,load:g.cpu||0,mem:g.memory||0})}),n=m.get(o),n?(m.forEach(g=>{let h=m.get(g.ppid);h&&(h.children||(h.children=[]),h.children.push(g))}),m.forEach(g=>{g.children&&(g.children=g.children.sort((h,v)=>h.pid-v.pid))}),t(n)):e(new Error(`Root process ${o} not found`))})},c.ProcessDataFlag.CommandLine|c.ProcessDataFlag.Memory)})}else{let l=function(){let c=[n],u=[];for(;c.length;){let m=c.shift();m&&(u.push(m.pid),m.children&&(c=c.concat(m.children)))}let p=JSON.stringify(yt.asFileUri("vs/base/node/cpuUsage.sh").fsPath);p+=" "+u.join(" "),Ly(p,{},(m,g,h)=>{if(m||h)e(m||new Error(h.toString()));else{let v=g.toString().split(`
- `);for(let x=0;x<u.length;x++){let T=r.get(u[x]);T.load=parseFloat(v[x])}if(!n){e(new Error(`Root process ${o} not found`));return}t(n)}})};Ly("which ps",{},(c,u,p)=>{if(c||p)if(process.platform!=="linux")e(c||new Error(p.toString()));else{let m=JSON.stringify(yt.asFileUri("vs/base/node/ps.sh").fsPath);Ly(m,{},(g,h,v)=>{g||v?e(g||new Error(v.toString())):(KM(h,s),l())})}else{let m=u.toString().trim();Ly(`${m} -ax -o pid=,ppid=,pcpu=,pmem=,command=`,{maxBuffer:1e3*1024,env:{LC_NUMERIC:"en_US.UTF-8"}},(h,v,x)=>{h||x&&!x.includes("screen size is bogus")?e(h||new Error(x.toString())):(KM(v,s),process.platform==="linux"?l():n?t(n):e(new Error(`Root process ${o} not found`)))})}})}})}function KM(o,t){let e=/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+\.[0-9]+)\s+([0-9]+\.[0-9]+)\s+(.+)$/,n=o.toString().split(`
- `);for(let r of n){let i=e.exec(r.trim());i&&i.length===6&&t(parseInt(i[1]),parseInt(i[2]),i[5],parseFloat(i[3]),parseFloat(i[4]))}}var s8,Xw=y(()=>{$e();me();s8=/[a-zA-Z-]+\.js\b/g});function Yw(o){let t=o;return!!t?.hostName&&!!t?.errorMessage}var a8,Zbe,jM=y(()=>{re();a8="diagnosticsService",Zbe=_(a8)});import*as JM from"fs";import*as pn from"os";async function Xm(o,t){let e=`${o}::${t.join(":")}`,n=QM.get(e);if(n)return n;let r=[{tag:"grunt.js",filePattern:/^gruntfile\.js$/i},{tag:"gulp.js",filePattern:/^gulpfile\.js$/i},{tag:"tsconfig.json",filePattern:/^tsconfig\.json$/i},{tag:"package.json",filePattern:/^package\.json$/i},{tag:"jsconfig.json",filePattern:/^jsconfig\.json$/i},{tag:"tslint.json",filePattern:/^tslint\.json$/i},{tag:"eslint.json",filePattern:/^eslint\.json$/i},{tag:"tasks.json",filePattern:/^tasks\.json$/i},{tag:"launch.json",filePattern:/^launch\.json$/i},{tag:"mcp.json",filePattern:/^mcp\.json$/i},{tag:"settings.json",filePattern:/^settings\.json$/i},{tag:"webpack.config.js",filePattern:/^webpack\.config\.js$/i},{tag:"project.json",filePattern:/^project\.json$/i},{tag:"makefile",filePattern:/^makefile$/i},{tag:"sln",filePattern:/^.+\.sln$/i},{tag:"csproj",filePattern:/^.+\.csproj$/i},{tag:"cmake",filePattern:/^.+\.cmake$/i},{tag:"github-actions",filePattern:/^.+\.ya?ml$/i,relativePathPattern:/^\.github(?:\/|\\)workflows$/i},{tag:"devcontainer.json",filePattern:/^devcontainer\.json$/i},{tag:"dockerfile",filePattern:/^(dockerfile|docker\-compose\.ya?ml)$/i},{tag:"cursorrules",filePattern:/^\.cursorrules$/i},{tag:"cursorrules-dir",filePattern:/\.mdc$/i,relativePathPattern:/^\.cursor[\/\\]rules$/i},{tag:"github-instructions-dir",filePattern:/\.instructions\.md$/i,relativePathPattern:/^\.github[\/\\]instructions$/i},{tag:"github-prompts-dir",filePattern:/\.prompt\.md$/i,relativePathPattern:/^\.github[\/\\]prompts$/i},{tag:"clinerules",filePattern:/^\.clinerules$/i},{tag:"clinerules-dir",filePattern:/\.md$/i,relativePathPattern:/^\.clinerules$/i},{tag:"agent.md",filePattern:/^agent\.md$/i},{tag:"agents.md",filePattern:/^agents\.md$/i},{tag:"claude.md",filePattern:/^claude\.md$/i},{tag:"claude-settings",filePattern:/^settings\.json$/i,relativePathPattern:/^\.claude$/i},{tag:"claude-settings-local",filePattern:/^settings\.local\.json$/i,relativePathPattern:/^\.claude$/i},{tag:"claude-mcp",filePattern:/^mcp\.json$/i,relativePathPattern:/^\.claude$/i},{tag:"claude-commands-dir",filePattern:/\.md$/i,relativePathPattern:/^\.claude[\/\\]commands$/i},{tag:"claude-skills-dir",filePattern:/^SKILL\.md$/i,relativePathPattern:/^\.claude[\/\\]skills[\/\\]/i},{tag:"claude-rules-dir",filePattern:/\.md$/i,relativePathPattern:/^\.claude[\/\\]rules$/i},{tag:"gemini.md",filePattern:/^gemini\.md$/i},{tag:"copilot-instructions.md",filePattern:/^copilot\-instructions\.md$/i,relativePathPattern:/^\.github$/i}],i=new Map,s=new Map,a=2e4;function l(u,p,m,g){let h=p.substring(u.length+1);return rn.withAsyncBody(async v=>{let x;g.readdirCount++;try{x=await Te.readdir(p,{withFileTypes:!0})}catch{v();return}if(g.count>=a){g.count+=x.length,g.maxReached=!0,v();return}let T=x.length;if(T===0){v();return}let w=x;g.count+x.length>a&&(g.maxReached=!0,T=a-g.count,w=x.slice(0,T)),g.count+=x.length;for(let k of w)if(k.isDirectory()){if(m.includes(k.name)||await l(u,H(p,k.name),m,g),--T===0){v();return}}else{let M=k.name.lastIndexOf(".");if(M>=0){let B=k.name.substring(M+1);B&&i.set(B,(i.get(B)??0)+1)}for(let B of r)B.relativePathPattern?.test(h)!==!1&&B.filePattern.test(k.name)&&s.set(B.tag,(s.get(B.tag)??0)+1);if(--T===0){v();return}}})}let c=rn.withAsyncBody(async u=>{let p={count:0,maxReached:!1,readdirCount:0},m=new Yn(!0);await l(o,o,t,p);let g=await l8(o);u({configFiles:Zw(s),fileTypes:Zw(i),fileCount:p.count,maxFilesReached:p.maxReached,launchConfigFiles:g,totalScanTime:m.elapsed(),totalReaddirCount:p.readdirCount})});return QM.set(e,c),c}function Zw(o){return Array.from(o.entries(),([t,e])=>({name:t,count:e})).sort((t,e)=>e.count-t.count)}function eC(){let o={os:`${pn.type()} ${pn.arch()} ${pn.release()}`,memory:`${(pn.totalmem()/Yo.GB).toFixed(2)}GB (${(pn.freemem()/Yo.GB).toFixed(2)}GB free)`,vmHint:`${Math.round(Hw.value()*100)}%`},t=pn.cpus();return t&&t.length>0&&(o.cpus=`${t[0].model} (${t.length} x ${t[0].speed})`),o}async function l8(o){try{let t=new Map,e=H(o,".vscode","launch.json"),n=await JM.promises.readFile(e),r=[],i=Lo(n.toString(),r);if(r.length)return console.log(`Unable to parse ${e}`),[];if(Qs(i)==="object"&&i.configurations)for(let s of i.configurations){let a=s.type;a&&(t.has(a)?t.set(a,t.get(a)+1):t.set(a,1))}return Zw(t)}catch{return[]}}var QM,My,XM=y(()=>{ze();Ii();$e();Le();me();Ns();ce();$w();fr();Xw();jM();nt();yn();nr();QM=new Map;My=class{constructor(t,e){this.telemetryService=t;this.productService=e}formatMachineInfo(t){let e=[];return e.push(`OS Version: ${t.os}`),e.push(`CPUs: ${t.cpus}`),e.push(`Memory (System): ${t.memory}`),e.push(`VM: ${t.vmHint}`),e.join(`
- `)}formatEnvironment(t){let e=[];e.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit||"Commit unknown"}, ${this.productService.date||"Date unknown"})`),e.push(`OS Version: ${pn.type()} ${pn.arch()} ${pn.release()}`);let n=pn.cpus();return n&&n.length>0&&e.push(`CPUs: ${n[0].model} (${n.length} x ${n[0].speed})`),e.push(`Memory (System): ${(pn.totalmem()/Yo.GB).toFixed(2)}GB (${(pn.freemem()/Yo.GB).toFixed(2)}GB free)`),te||e.push(`Load (avg): ${pn.loadavg().map(r=>Math.round(r)).join(", ")}`),e.push(`VM: ${Math.round(Hw.value()*100)}%`),e.push(`Screen Reader: ${t.screenReader?"yes":"no"}`),e.push(`Process Argv: ${t.mainArguments.join(" ")}`),e.push(`GPU Status: ${this.expandGPUFeatures(t.gpuFeatureStatus)}`),t.gpuLogMessages&&t.gpuLogMessages.length>0&&(e.push("GPU Log Messages:"),t.gpuLogMessages.forEach(r=>{e.push(`${r.header}: ${r.message}`)})),e.join(`
- `)}async getPerformanceInfo(t,e){return Promise.all([Jm(t.mainPID),this.formatWorkspaceMetadata(t)]).then(async n=>{let[r,i]=n,s=this.formatProcessList(t,r);return e.forEach(a=>{if(Yw(a))s+=`
- ${a.errorMessage}`,i+=`
- ${a.errorMessage}`;else if(s+=`
- Remote: ${a.hostName}`,a.processes&&(s+=`
- ${this.formatProcessList(t,a.processes)}`),a.workspaceMetadata){i+=`
- | Remote: ${a.hostName}`;for(let l of Object.keys(a.workspaceMetadata)){let c=a.workspaceMetadata[l],u=`${c.fileCount} files`;c.maxFilesReached&&(u=`more than ${u}`),i+=`| Folder (${l}): ${u}`,i+=this.formatWorkspaceStats(c)}}}),{processInfo:s,workspaceInfo:i}})}async getSystemInfo(t,e){let{memory:n,vmHint:r,os:i,cpus:s}=eC(),a={os:i,memory:n,cpus:s,vmHint:r,processArgs:`${t.mainArguments.join(" ")}`,gpuStatus:t.gpuFeatureStatus,screenReader:`${t.screenReader?"yes":"no"}`,remoteData:e};return te||(a.load=`${pn.loadavg().map(l=>Math.round(l)).join(", ")}`),_e&&(a.linuxEnv={desktopSession:process.env.DESKTOP_SESSION,xdgSessionDesktop:process.env.XDG_SESSION_DESKTOP,xdgCurrentDesktop:process.env.XDG_CURRENT_DESKTOP,xdgSessionType:process.env.XDG_SESSION_TYPE}),Promise.resolve(a)}async getDiagnostics(t,e){let n=[];return Jm(t.mainPID).then(async r=>(n.push(""),n.push(this.formatEnvironment(t)),n.push(""),n.push(this.formatProcessList(t,r)),t.windows.some(i=>i.folderURIs&&i.folderURIs.length>0&&!i.remoteAuthority)&&(n.push(""),n.push("Workspace Stats: "),n.push(await this.formatWorkspaceMetadata(t))),e.forEach(i=>{if(Yw(i))n.push(`
- ${i.errorMessage}`);else if(n.push(`
- `),n.push(`Remote: ${i.hostName}`),n.push(this.formatMachineInfo(i.machineInfo)),i.processes&&n.push(this.formatProcessList(t,i.processes)),i.workspaceMetadata)for(let s of Object.keys(i.workspaceMetadata)){let a=i.workspaceMetadata[s],l=`${a.fileCount} files`;a.maxFilesReached&&(l=`more than ${l}`),n.push(`Folder (${s}): ${l}`),n.push(this.formatWorkspaceStats(a))}}),n.push(""),n.push(""),n.join(`
- `)))}formatWorkspaceStats(t){let e=[],r=0,i=(c,u)=>{let p=` ${c}(${u})`;r+p.length>60?(e.push(s),s="| ",r=s.length):r+=p.length,s+=p},s="| File types:",a=10,l=t.fileTypes.length>a?a:t.fileTypes.length;for(let c=0;c<l;c++){let u=t.fileTypes[c];i(u.name,u.count)}if(e.push(s),t.configFiles.length>=0&&(s="| Conf files:",r=0,t.configFiles.forEach(c=>{i(c.name,c.count)}),e.push(s)),t.launchConfigFiles.length>0){let c="| Launch Configs:";t.launchConfigFiles.forEach(u=>{let p=u.count>1?` ${u.name}(${u.count})`:` ${u.name}`;c+=p}),e.push(c)}return e.join(`
- `)}expandGPUFeatures(t){let e=Math.max(...Object.keys(t).map(n=>n.length));return Object.keys(t).map(n=>`${n}: ${" ".repeat(e-n.length)} ${t[n]}`).join(`
- `)}formatWorkspaceMetadata(t){let e=[],n=[];return t.windows.forEach(r=>{r.folderURIs.length===0||r.remoteAuthority||(e.push(`| Window (${r.title})`),r.folderURIs.forEach(i=>{let s=I.revive(i);if(s.scheme===z.file){let a=s.fsPath;n.push(Xm(a,["node_modules",".git"]).then(l=>{let c=`${l.fileCount} files`;l.maxFilesReached&&(c=`more than ${c}`),e.push(`| Folder (${at(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(n).then(r=>e.join(`
- `)).catch(r=>`Unable to collect workspace stats: ${r}`)}formatProcessList(t,e){let n=new Map;t.windows.forEach(i=>n.set(i.pid,`window [${i.id}] (${i.title})`)),t.pidToNames.forEach(({pid:i,name:s})=>n.set(i,s));let r=[];return r.push("CPU % Mem MB PID Process"),e&&this.formatProcessItem(t.mainPID,n,r,e,0),r.join(`
- `)}formatProcessItem(t,e,n,r,i){let s=i===0,a;s?a=r.pid===t?this.productService.applicationName:"remote-server":e.has(r.pid)?a=e.get(r.pid):a=`${" ".repeat(i)} ${r.name}`;let l=process.platform==="win32"?r.mem:pn.totalmem()*(r.mem/100);n.push(`${r.load.toFixed(0).padStart(5," ")} ${(l/Yo.MB).toFixed(0).padStart(6," ")} ${r.pid.toFixed(0).padStart(6," ")} ${a}`),Array.isArray(r.children)&&r.children.forEach(c=>this.formatProcessItem(t,e,n,c,i+1))}async getWorkspaceFileExtensions(t){let e=new Set;for(let{uri:n}of t.folders){let r=I.revive(n);if(r.scheme!==z.file)continue;let i=r.fsPath;try{(await Xm(i,["node_modules",".git"])).fileTypes.forEach(a=>e.add(a.name))}catch{}}return{extensions:[...e]}}async reportWorkspaceStats(t){for(let{uri:e}of t.folders){let n=I.revive(e);if(n.scheme!==z.file)continue;let r=n.fsPath;try{let i=await Xm(r,["node_modules",".git"]);this.telemetryService.publicLog2("workspace.stats",{"workspace.id":t.telemetryId,rendererSessionId:t.rendererSessionId}),i.fileTypes.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.file",{rendererSessionId:t.rendererSessionId,type:s.name,count:s.count})}),i.launchConfigFiles.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.launchConfigFile",{rendererSessionId:t.rendererSessionId,type:s.name,count:s.count})}),i.configFiles.forEach(s=>{this.telemetryService.publicLog2("workspace.stats.configFiles",{rendererSessionId:t.rendererSessionId,type:s.name,count:s.count})}),this.telemetryService.publicLog2("workspace.stats.metadata",{duration:i.totalScanTime,reachedLimit:i.maxFilesReached,fileCount:i.fileCount,readdirCount:i.totalReaddirCount})}catch{}}}};My=E([b(0,Ft),b(1,Ve)],My)});var Oy,YM=y(()=>{me();zo();ce();Qm();xa();Xw();XM();Le();Wm();Nt();Oy=class o{constructor(t,e,n,r,i){this._connectionToken=t;this._environmentService=e;this._userDataProfilesService=n;this._extensionHostStatusService=r;this._logService=i}static{this._namePool=1}async call(t,e,n){switch(e){case"getEnvironmentData":{let r=n,i=gs(r.remoteAuthority),s=await this._getEnvironmentData(r.profile);return s=bo(s,i),s}case"getExtensionHostExitInfo":{let r=n;return this._extensionHostStatusService.getExitInfo(r.reconnectionToken)}case"getDiagnosticInfo":{let r=n,i={machineInfo:eC()},s=r.includeProcesses?Jm(process.pid):Promise.resolve(),a=[],l={};if(r.folders){let c=gs("");a=r.folders.map(p=>I.revive(c.transformIncoming(p))).filter(p=>p.scheme==="file").map(p=>Xm(p.fsPath,["node_modules",".git"]).then(m=>{l[at(p.fsPath)]=m}))}return Promise.all([s,...a]).then(([c,u])=>(i.processes=c||void 0,i.workspaceMetadata=r.folders?l:void 0,i))}}throw new Error(`IPC Command ${e} not found`)}listen(t,e,n){throw new Error("Not supported")}async _getEnvironmentData(t){t&&!this._userDataProfilesService.profiles.some(n=>n.id===t)&&await this._userDataProfilesService.createProfile(t,t);let e=!1;if(process.platform==="linux"){let n=process.glibcVersion;e=(n?parseInt(n.split(".")[1]):28)<=27||!!process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER}return this._logService.trace(`[reconnection-grace-time] Server sending grace time to client: ${this._environmentService.reconnectionGraceTime}ms (${Math.floor(this._environmentService.reconnectionGraceTime/1e3)}s)`),{pid:process.pid,connectionToken:this._connectionToken.type!==0?this._connectionToken.value:"",appRoot:I.file(this._environmentService.appRoot),execPath:process.execPath,tmpDir:this._environmentService.tmpDir,settingsPath:this._environmentService.machineSettingsResource,mcpResource:this._environmentService.mcpResource,logsPath:this._environmentService.logsHome,extensionHostLogsPath:ye(this._environmentService.logsHome,`exthost${o._namePool++}`),globalStorageHome:this._userDataProfilesService.defaultProfile.globalStorageHome,workspaceStorageHome:this._environmentService.workspaceStorageHome,localHistoryHome:this._environmentService.localHistoryHome,userHome:this._environmentService.userHome,os:Or,arch:process.arch,marks:xR(),useHostProxy:!!this._environmentService.args["use-host-proxy"],profiles:{home:this._userDataProfilesService.profilesHome,all:[...this._userDataProfilesService.profiles].map(n=>({...n}))},isUnsupportedGlibc:e,reconnectionGraceTime:this._environmentService.reconnectionGraceTime}}}});var Ay,Ny,ZM=y(()=>{de();km();q();et();_c();Wt();Ay=class extends D{constructor(e,n){super();this.provider=e;this.logService=n;this.sessionToWatcher=new Map;this.watchRequests=new Map}call(e,n,r){let i=this.getUriTransformer(e);switch(n){case"stat":return this.stat(i,r[0]);case"realpath":return this.realpath(i,r[0]);case"readdir":return this.readdir(i,r[0]);case"open":return this.open(i,r[0],r[1]);case"close":return this.close(r[0]);case"read":return this.read(r[0],r[1],r[2]);case"readFile":return this.readFile(i,r[0],r[1]);case"write":return this.write(r[0],r[1],r[2],r[3],r[4]);case"writeFile":return this.writeFile(i,r[0],r[1],r[2]);case"rename":return this.rename(i,r[0],r[1],r[2]);case"copy":return this.copy(i,r[0],r[1],r[2]);case"cloneFile":return this.cloneFile(i,r[0],r[1]);case"mkdir":return this.mkdir(i,r[0]);case"delete":return this.delete(i,r[0],r[1]);case"watch":return this.watch(i,r[0],r[1],r[2],r[3]);case"unwatch":return this.unwatch(r[0],r[1])}throw new Error(`IPC Command ${n} not found`)}listen(e,n,r){let i=this.getUriTransformer(e);switch(n){case"fileChange":return this.onFileChange(i,r[0]);case"readFileStream":return this.onReadFileStream(i,r[0],r[1])}throw new Error(`Unknown event ${n}`)}stat(e,n){let r=this.transformIncoming(e,n,!0);return this.provider.stat(r)}realpath(e,n){let r=this.transformIncoming(e,n,!0);return this.provider.realpath(r)}readdir(e,n){let r=this.transformIncoming(e,n);return this.provider.readdir(r)}async readFile(e,n,r){let i=this.transformIncoming(e,n,!0),s=await this.provider.readFile(i,r);return A.wrap(s)}onReadFileStream(e,n,r){let i=this.transformIncoming(e,n,!0),s=new gt,a=new P({onDidRemoveLastListener:()=>{s.cancel()}}),l=this.provider.readFileStream(i,r,s.token);return Dc(l,{onData:c=>a.fire(A.wrap(c)),onError:c=>a.fire(c),onEnd:()=>{a.fire("end"),a.dispose(),s.dispose()}}),a.event}writeFile(e,n,r,i){let s=this.transformIncoming(e,n);return this.provider.writeFile(s,r.buffer,i)}open(e,n,r){let i=this.transformIncoming(e,n,!0);return this.provider.open(i,r)}close(e){return this.provider.close(e)}async read(e,n,r){let i=A.alloc(r),a=await this.provider.read(e,n,i.buffer,0,r);return[i,a]}write(e,n,r,i,s){return this.provider.write(e,n,r.buffer,i,s)}mkdir(e,n){let r=this.transformIncoming(e,n);return this.provider.mkdir(r)}delete(e,n,r){let i=this.transformIncoming(e,n);return this.provider.delete(i,r)}rename(e,n,r,i){let s=this.transformIncoming(e,n),a=this.transformIncoming(e,r);return this.provider.rename(s,a,i)}copy(e,n,r,i){let s=this.transformIncoming(e,n),a=this.transformIncoming(e,r);return this.provider.copy(s,a,i)}cloneFile(e,n,r){let i=this.transformIncoming(e,n),s=this.transformIncoming(e,r);return this.provider.cloneFile(i,s)}onFileChange(e,n){let r=new P({onWillAddFirstListener:()=>{this.sessionToWatcher.set(n,this.createSessionFileWatcher(e,r))},onDidRemoveLastListener:()=>{jt(this.sessionToWatcher.get(n)),this.sessionToWatcher.delete(n)}});return r.event}async watch(e,n,r,i,s){let a=this.sessionToWatcher.get(n);if(a){let l=this.transformIncoming(e,i),c=a.watch(r,l,s);this.watchRequests.set(n+r,c)}}async unwatch(e,n){let r=e+n,i=this.watchRequests.get(r);i&&(jt(i),this.watchRequests.delete(r))}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()}},Ny=class extends D{constructor(e,n,r,i){super();this.uriTransformer=e;this.environmentService=i;this.watcherRequests=new Map;this.fileWatcher=this._register(new Di(r)),this.registerListeners(n)}registerListeners(e){let n=this._register(new P);this._register(n.event(r=>{e.fire(r.map(i=>({resource:this.uriTransformer.transformOutgoingURI(i.resource),type:i.type,cId:i.cId})))})),this._register(this.fileWatcher.onDidChangeFile(r=>n.fire(r))),this._register(this.fileWatcher.onDidWatchError(r=>e.fire(r)))}getRecursiveWatcherOptions(e){}getExtraExcludes(e){}watch(e,n,r){let i=this.getExtraExcludes(this.environmentService);return Array.isArray(i)&&(r.excludes=[...r.excludes,...i]),this.watcherRequests.set(e,this.fileWatcher.watch(n,r)),ie(()=>{jt(this.watcherRequests.get(e)),this.watcherRequests.delete(e)})}dispose(){for(let[,e]of this.watcherRequests)e.dispose();this.watcherRequests.clear(),super.dispose()}}});var Uy,nC,eO=y(()=>{ce();Qm();km();Le();ZM();Uy=class extends Ay{constructor(e,n,r){super(new Di(e),e);this.environmentService=n;this.configurationService=r;this.uriTransformerCache=new Map;this._register(this.provider)}getUriTransformer(e){let n=this.uriTransformerCache.get(e.remoteAuthority);return n||(n=gs(e.remoteAuthority),this.uriTransformerCache.set(e.remoteAuthority,n)),n}transformIncoming(e,n,r=!1){if(r&&n.path==="/vscode-resource"&&n.query){let i=JSON.parse(n.query).requestResourcePath;return I.from({scheme:"file",path:i})}return I.revive(e.transformIncoming(n))}createSessionFileWatcher(e,n){return new nC(e,n,this.logService,this.environmentService,this.configurationService)}},nC=class extends Ny{constructor(t,e,n,r,i){super(t,e,n,r)}getRecursiveWatcherOptions(t){let e=t.args["file-watcher-polling"];if(e){let n=e.split(Ds),r=Number(n[0]);if(r>0)return{usePolling:n.length>1?n.slice(1):!0,pollingInterval:r}}}getExtraExcludes(t){if(t.extensionsPath)return[We.join(t.extensionsPath,"**")]}}});var Fy,tO=y(()=>{q();nr();Fy=class extends D{constructor(e,n){super();this.telemetryService=e;this.telemetryAppender=n}async call(e,n,r){switch(n){case"updateTelemetryLevel":{let{telemetryLevel:i}=r;return this.telemetryService.updateInjectedTelemetryLevel(i)}case"logTelemetry":{let{eventName:i,data:s}=r;return this.telemetryAppender?this.telemetryAppender.log(i,s):Promise.resolve()}case"flushTelemetry":return this.telemetryAppender?this.telemetryAppender.flush():Promise.resolve();case"ping":return}throw new Error(`IPC Command ${n} not found`)}listen(e,n,r){throw new Error("Not supported")}dispose(){this.telemetryService.updateInjectedTelemetryLevel(0),super.dispose()}}});function c8(){let o=d(935,null,St.nameLong),t=St.privacyStatementUrl?d(921,null,"https://aka.ms/vscode-telemetry",St.privacyStatementUrl):d(922,null,"https://aka.ms/vscode-telemetry"),e=Yt?"":d(927,null),n=d(920,null),r=d(925,null),i=d(936,null),s=d(934,null),a=`
- | | ${n} | ${r} | ${i} |
- |:------|:-------------:|:---------------:|:----------:|
- | all | \u2713 | \u2713 | \u2713 |
- | error | \u2713 | \u2713 | - |
- | crash | \u2713 | - | - |
- | off | - | - | - |
- `,l=d(930,null);return`
- ${o} ${t} ${e}
-
- ${s}
- ${a}
-
- ${l}
- `}var hs,d8,nO=y(()=>{q();on();me();oE();Qt();pe();xn();Si();Js();yn();Hr();nr();Ao();hs=class{constructor(t,e,n){this._configurationService=e;this._productService=n;this._experimentProperties={};this._pendingEvents=[];this._isExperimentPropertySet=!1;this._disposables=new le;this._cleanupPatterns=[];this._appenders=t.appenders,this._commonProperties=t.commonProperties??Object.create(null),this.sessionId=this._commonProperties.sessionID,this.machineId=this._commonProperties["common.machineId"],this.sqmId=this._commonProperties["common.sqmId"],this.devDeviceId=this._commonProperties["common.devDeviceId"],this.firstSessionDate=this._commonProperties["common.firstSessionDate"],this.msftInternal=this._commonProperties["common.msftInternal"],this._piiPaths=t.piiPaths||[],this._telemetryLevel=3,this._sendErrorTelemetry=!!t.sendErrorTelemetry,this._meteredConnectionService=t.meteredConnectionService,this._cleanupPatterns=[/(vscode-)?file:\/\/.*?\/resources\/app\//gi];for(let r of this._piiPaths)this._cleanupPatterns.push(new RegExp(ao(r),"gi")),r.indexOf("\\")>=0&&this._cleanupPatterns.push(new RegExp(ao(r.replace(/\\/g,"/")),"gi"));this._updateTelemetryLevel(),this._disposables.add(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(Xc)||r.affectsConfiguration(em)||r.affectsConfiguration(jh))&&this._updateTelemetryLevel()})),t.waitForExperimentProperties?this._flushTimeout=setTimeout(()=>this._flushPendingEvents(),hs.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(t,e){this._experimentProperties[t]=new Oo(e),this._isExperimentPropertySet||this._flushPendingEvents()}setCommonProperty(t,e){this._commonProperties[t]=e}_flushPendingEvents(){if(!this._isExperimentPropertySet){this._isExperimentPropertySet=!0,this._flushTimeout!==void 0&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0);for(let t of this._pendingEvents)this._doLog(t.eventName,t.eventLevel,t.data);this._pendingEvents=[]}}_updateTelemetryLevel(){let t=Yh(this._configurationService),e=this._productService.enabledTelemetryLevels;if(e){this._sendErrorTelemetry=this.sendErrorTelemetry?e.error:!1;let n=e.usage?3:e.error?2:0;t=Math.min(t,n)}this._telemetryLevel=t}get sendErrorTelemetry(){return this._sendErrorTelemetry}get telemetryLevel(){return this._telemetryLevel}dispose(){this._flushPendingEvents(),this._disposables.dispose()}_log(t,e,n){if(!(this._telemetryLevel<e)&&!this._meteredConnectionService?.isConnectionMetered){if(!this._isExperimentPropertySet){this._pendingEvents.length<hs.MAX_BUFFER_SIZE&&this._pendingEvents.push({eventName:t,eventLevel:e,data:n});return}this._doLog(t,e,n)}}_doLog(t,e,n){n=ns(n,this._experimentProperties),n=nm(n,this._cleanupPatterns),n=ns(n,this._commonProperties),e===2&&(n={...n,isError:!0}),this._appenders.forEach(r=>r.log(t,n??{}))}publicLog(t,e){this._log(t,3,e)}publicLog2(t,e){this.publicLog(t,e)}publicLogError(t,e){this._sendErrorTelemetry&&this._log(t,2,e)}publicLogError2(t,e){this.publicLogError(t,e)}};hs=E([b(1,xt),b(2,Ve)],hs);d8=bt.as(kn.Configuration);d8.registerConfiguration({id:E0,order:1,type:"object",title:d(937,null),properties:{[Xc]:{type:"string",enum:["all","error","crash","off"],enumDescriptions:[d(929,null),d(931,null),d(928,null),d(932,null)],markdownDescription:c8(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"],policy:{name:"TelemetryLevel",category:"Telemetry",minimumVersion:"1.99",localization:{description:{key:"telemetry.telemetryLevel.policyDescription",value:d(933,null)},enumDescriptions:[{key:"telemetry.telemetryLevel.default",value:d(929,null)},{key:"telemetry.telemetryLevel.error",value:d(931,null)},{key:"telemetry.telemetryLevel.crash",value:d(928,null)},{key:"telemetry.telemetryLevel.off",value:d(932,null)}]}}},"telemetry.feedback.enabled":{type:"boolean",default:!0,description:d(926,null),policy:{name:"EnableFeedback",category:"Telemetry",minimumVersion:"1.99",localization:{description:{key:"telemetry.feedback.enabled",value:d(926,null)}}}},[em]:{type:"boolean",markdownDescription:St.privacyStatementUrl?d(924,null,St.nameLong,St.privacyStatementUrl):d(923,null,St.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:d(919,null,`\`#${Xc}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}})});var jd,rO,Vy,oO=y(()=>{xn();re();yn();nr();nO();Ao();jd=class extends hs{constructor(t,e,n,r){super(t,n,r),this._injectedTelemetryLevel=e}publicLog(t,e){if(!(this._injectedTelemetryLevel<3))return super.publicLog(t,e)}publicLog2(t,e){return this.publicLog(t,e)}publicLogError(t,e){return this._injectedTelemetryLevel<2?Promise.resolve(void 0):super.publicLogError(t,e)}publicLogError2(t,e){return this.publicLogError(t,e)}async updateInjectedTelemetryLevel(t){if(t===void 0)throw this._injectedTelemetryLevel=0,new Error("Telemetry level cannot be undefined. This will cause infinite looping!");this._injectedTelemetryLevel=this._injectedTelemetryLevel?Math.min(this._injectedTelemetryLevel,t):t,this._injectedTelemetryLevel===0&&this.dispose()}};jd=E([b(2,xt),b(3,Ve)],jd);rO=new class extends tm{async updateInjectedTelemetryLevel(){}},Vy=Ft});function iO(o){let t=qo(o),e=u8[t.toLowerCase()];return Array.isArray(e)?e[0]:e}function rC(o,t){let e=p8.exec(o);return e?`${e[1].toLowerCase()}/${e[2].toLowerCase()}${e[3]??""}`:t?void 0:o}function sO(o){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(o)}var Ir,u8,p8,_l=y(()=>{Le();Ir=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"}),u8={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};p8=/^(.+)\/(.+?)(;.+)?$/});function oC(o){let t=o;return typeof t?.resolve=="function"&&typeof t?.isResolved=="function"}var iC=y(()=>{At()});function oe(o){return Object.assign(o,{apply:function(...e){if(e.length===0)return Reflect.construct(o,[]);{let n=e.length===1?[]:e[1];return Reflect.construct(o,n,e[0].constructor)}},call:function(...e){if(e.length===0)return Reflect.construct(o,[]);{let[n,...r]=e;return Reflect.construct(o,r,n.constructor)}}})}var qr=y(()=>{});var On,xr,sC=y(()=>{oa();qr();xr=class{constructor(t,e=!1){fc(this,On);rp(this,On,new Sn(t,{supportThemeIcons:e}))}static isMarkdownString(t){return t instanceof xr?!0:!t||typeof t!="object"?!1:t.appendCodeblock&&t.appendMarkdown&&t.appendText&&t.value!==void 0}get value(){return Kt(this,On).value}set value(t){Kt(this,On).value=t}get isTrusted(){return Kt(this,On).isTrusted}set isTrusted(t){Kt(this,On).isTrusted=t}get supportThemeIcons(){return Kt(this,On).supportThemeIcons}set supportThemeIcons(t){Kt(this,On).supportThemeIcons=t}get supportHtml(){return Kt(this,On).supportHtml}set supportHtml(t){Kt(this,On).supportHtml=t}get supportAlertSyntax(){return Kt(this,On).supportAlertSyntax}set supportAlertSyntax(t){Kt(this,On).supportAlertSyntax=t}get baseUri(){return Kt(this,On).baseUri}set baseUri(t){Kt(this,On).baseUri=t}appendText(t){return Kt(this,On).appendText(t),this}appendMarkdown(t){return Kt(this,On).appendMarkdown(t),this}appendCodeblock(t,e){return Kt(this,On).appendCodeblock(e??"",t),this}};On=new WeakMap,xr=E([oe],xr)});var Re,Qd=y(()=>{Se();qr();Re=class{static Min(...t){if(t.length===0)throw new TypeError;let e=t[0];for(let n=1;n<t.length;n++){let r=t[n];r.isBefore(e)&&(e=r)}return e}static Max(...t){if(t.length===0)throw new TypeError;let e=t[0];for(let n=1;n<t.length;n++){let r=t[n];r.isAfter(e)&&(e=r)}return e}static isPosition(t){if(!t)return!1;if(t instanceof Re)return!0;let{line:e,character:n}=t;return typeof e=="number"&&typeof n=="number"}static of(t){if(t instanceof Re)return t;if(this.isPosition(t))return new Re(t.line,t.character);throw new Error("Invalid argument, is NOT a position-like object")}get line(){return this._line}get character(){return this._character}constructor(t,e){if(t<0)throw Je("line must be non-negative");if(e<0)throw Je("character must be non-negative");this._line=t,this._character=e}isBefore(t){return this._line<t._line?!0:t._line<this._line?!1:this._character<t._character}isBeforeOrEqual(t){return this._line<t._line?!0:t._line<this._line?!1:this._character<=t._character}isAfter(t){return!this.isBeforeOrEqual(t)}isAfterOrEqual(t){return!this.isBefore(t)}isEqual(t){return this._line===t._line&&this._character===t._character}compareTo(t){return this._line<t._line?-1:this._line>t.line?1:this._character<t._character?-1:this._character>t._character?1:0}translate(t,e=0){if(t===null||e===null)throw Je();let n;return typeof t>"u"?n=0:typeof t=="number"?n=t:(n=typeof t.lineDelta=="number"?t.lineDelta:0,e=typeof t.characterDelta=="number"?t.characterDelta:0),n===0&&e===0?this:new Re(this.line+n,this.character+e)}with(t,e=this.character){if(t===null||e===null)throw Je();let n;return typeof t>"u"?n=this.line:typeof t=="number"?n=t:(n=typeof t.line=="number"?t.line:this.line,e=typeof t.character=="number"?t.character:this.character),n===this.line&&e===this.character?this:new Re(n,e)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Re=E([oe],Re)});function aC(o){return o.isEmpty?`[${o.start.line}:${o.start.character})`:`[${o.start.line}:${o.start.character} -> ${o.end.line}:${o.end.character})`}var Be,Mi=y(()=>{Se();qr();Qd();Be=class{static isRange(t){return t instanceof Be?!0:!t||typeof t!="object"?!1:Re.isPosition(t.start)&&Re.isPosition(t.end)}static of(t){if(t instanceof Be)return t;if(this.isRange(t))return new Be(t.start,t.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(t,e,n,r){let i,s;if(typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof r=="number"?(i=new Re(t,e),s=new Re(n,r)):Re.isPosition(t)&&Re.isPosition(e)&&(i=Re.of(t),s=Re.of(e)),!i||!s)throw new Error("Invalid arguments");i.isBefore(s)?(this._start=i,this._end=s):(this._start=s,this._end=i)}contains(t){return Be.isRange(t)?this.contains(t.start)&&this.contains(t.end):Re.isPosition(t)?!(Re.of(t).isBefore(this._start)||this._end.isBefore(t)):!1}isEqual(t){return this._start.isEqual(t._start)&&this._end.isEqual(t._end)}intersection(t){let e=Re.Max(t.start,this._start),n=Re.Min(t.end,this._end);if(!e.isAfter(n))return new Be(e,n)}union(t){if(this.contains(t))return this;if(t.contains(this))return t;let e=Re.Min(t.start,this._start),n=Re.Max(t.end,this.end);return new Be(e,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(t,e=this.end){if(t===null||e===null)throw Je();let n;return t?Re.isPosition(t)?n=t:(n=t.start||this.start,e=t.end||this.end):n=this.start,n.isEqual(this._start)&&e.isEqual(this.end)?this:new Be(n,e)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return aC(this)}};Be=E([oe],Be)});var wt,aO=y(()=>{qr();wt=class{constructor(t){this.value=t}append(t){return new wt(this.value?this.value+wt.sep+t:t)}intersects(t){return this.contains(t)||t.contains(this)}contains(t){return this.value===t.value||t.value.startsWith(this.value+wt.sep)}};wt.sep=".",wt=E([oe],wt);wt.Empty=new wt("");wt.QuickFix=wt.Empty.append("quickfix");wt.Refactor=wt.Empty.append("refactor");wt.RefactorExtract=wt.Refactor.append("extract");wt.RefactorInline=wt.Refactor.append("inline");wt.RefactorMove=wt.Refactor.append("move");wt.RefactorRewrite=wt.Refactor.append("rewrite");wt.Source=wt.Empty.append("source");wt.SourceOrganizeImports=wt.Source.append("organizeImports");wt.SourceFixAll=wt.Source.append("fixAll");wt.Notebook=wt.Empty.append("notebook")});var Wy,Ea,Ll,lO=y(()=>{At();ce();qr();Mi();Wy=(r=>(r[r.Hint=3]="Hint",r[r.Information=2]="Information",r[r.Warning=1]="Warning",r[r.Error=0]="Error",r))(Wy||{}),Ea=class{static is(t){return t?typeof t.message=="string"&&t.location&&Be.isRange(t.location.range)&&I.isUri(t.location.uri):!1}constructor(t,e){this.location=t,this.message=e}static isEqual(t,e){return t===e?!0:!t||!e?!1:t.message===e.message&&t.location.range.isEqual(e.location.range)&&t.location.uri.toString()===e.location.uri.toString()}};Ea=E([oe],Ea);Ll=class{constructor(t,e,n=0){if(!Be.isRange(t))throw new TypeError("range must be set");if(!e)throw new TypeError("message must be set");this.range=t,this.message=e,this.severity=n}toJSON(){return{severity:Wy[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(t,e){return t===e?!0:!t||!e?!1:t.message===e.message&&t.severity===e.severity&&t.code===e.code&&t.severity===e.severity&&t.source===e.source&&t.range.isEqual(e.range)&&mn(t.tags,e.tags)&&mn(t.relatedInformation,e.relatedInformation,Ea.isEqual)}};Ll=E([oe],Ll)});var sr,lC=y(()=>{ce();qr();Qd();Mi();sr=class{static isLocation(t){return t instanceof sr?!0:t?Be.isRange(t.range)&&I.isUri(t.uri):!1}constructor(t,e){if(this.uri=t,e)if(Be.isRange(e))this.range=Be.of(e);else if(Re.isPosition(e))this.range=new Be(e,e);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};sr=E([oe],sr)});var ri,Jd,Ym,Kr,Zm,ef,cC=y(()=>{qr();Se();_l();sn();ri=class o{static isNotebookRange(t){return t instanceof o?!0:t?typeof t.start=="number"&&typeof t.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(t,e){if(t<0)throw Je("start must be positive");if(e<0)throw Je("end must be positive");t<=e?(this._start=t,this._end=e):(this._start=e,this._end=t)}with(t){let e=this._start,n=this._end;return t.start!==void 0&&(e=t.start),t.end!==void 0&&(n=t.end),e===this._start&&n===this._end?this:new o(e,n)}},Jd=class o{static validate(t){if(typeof t.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof t.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof t.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(t){return Array.isArray(t)&&t.every(e=>o.isNotebookCellData(e))}static isNotebookCellData(t){return!0}constructor(t,e,n,r,i,s,a){this.kind=t,this.value=e,this.languageId=n,this.mime=r,this.outputs=i??[],this.metadata=s,this.executionSummary=a,o.validate(this)}},Ym=class{constructor(t){this.cells=t}},Kr=class{static isNotebookCellEdit(t){return t instanceof Kr?!0:t?ri.isNotebookRange(t)&&Array.isArray(t.newCells):!1}static replaceCells(t,e){return new Kr(t,e)}static insertCells(t,e){return new Kr(new ri(t,t),e)}static deleteCells(t){return new Kr(t,[])}static updateCellMetadata(t,e){let n=new Kr(new ri(t,t),[]);return n.newCellMetadata=e,n}static updateNotebookMetadata(t){let e=new Kr(new ri(0,0),[]);return e.newNotebookMetadata=t,e}constructor(t,e){this.range=t,this.newCells=e}};Kr=E([oe],Kr);Zm=class o{constructor(t,e){this.data=t;this.mime=e;let n=rC(e,!0);if(!n)throw new Error(`INVALID mime type: ${e}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}static isNotebookCellOutputItem(t){return t instanceof o?!0:t?typeof t.mime=="string"&&t.data instanceof Uint8Array:!1}static error(t){let e={name:t.name,message:t.message,stack:t.stack};return o.json(e,"application/vnd.code.notebook.error")}static stdout(t){return o.text(t,"application/vnd.code.notebook.stdout")}static stderr(t){return o.text(t,"application/vnd.code.notebook.stderr")}static bytes(t,e="application/octet-stream"){return new o(t,e)}static $a=new TextEncoder;static text(t,e=Ir.text){let n=o.$a.encode(String(t));return new o(n,e)}static json(t,e="text/x-json"){let n=JSON.stringify(t,void 0," ");return o.text(n,e)}},ef=class o{static isNotebookCellOutput(t){return t instanceof o?!0:!t||typeof t!="object"?!1:typeof t.id=="string"&&Array.isArray(t.items)}static ensureUniqueMimeTypes(t,e=!1){let n=new Set,r=new Set;for(let i=0;i<t.length;i++){let s=t[i],a=rC(s.mime);if(!n.has(a)||sO(a)){n.add(a);continue}r.add(i),e&&console.warn(`DUPLICATED mime type '${s.mime}' will be dropped`)}return r.size===0?t:t.filter((i,s)=>!r.has(s))}constructor(t,e,n){this.items=o.ensureUniqueMimeTypes(t,!0),typeof e=="string"?(this.id=e,this.metadata=n):(this.id=Ce(),this.metadata=e??n)}}});function m8(o){let t=aC(o);return o.isEmpty||(o.active.isEqual(o.start)?t=`|${t}`:t=`${t}|`),t}var oi,cO=y(()=>{qr();Qd();Mi();oi=class extends Be{static isSelection(t){return t instanceof oi?!0:!t||typeof t!="object"?!1:Be.isRange(t)&&Re.isPosition(t.anchor)&&Re.isPosition(t.active)&&typeof t.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(t,e,n,r){let i,s;if(typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&typeof r=="number"?(i=new Re(t,e),s=new Re(n,r)):Re.isPosition(t)&&Re.isPosition(e)&&(i=Re.of(t),s=Re.of(e)),!i||!s)throw new Error("Invalid arguments");super(i,s),this._anchor=i,this._active=s}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return m8(this)}};oi=E([oe],oi)});var Sr,dC=y(()=>{qr();Sr=class{constructor(t){this._tabstop=1;this.value=t||""}static isSnippetString(t){return t instanceof Sr?!0:!t||typeof t!="object"?!1:typeof t.value=="string"}static _escape(t){return t.replace(/\$|}|\\/g,"\\$&")}appendText(t){return this.value+=Sr._escape(t),this}appendTabstop(t=this._tabstop++){return this.value+="$",this.value+=t,this}appendPlaceholder(t,e=this._tabstop++){if(typeof t=="function"){let n=new Sr;n._tabstop=this._tabstop,t(n),this._tabstop=n._tabstop,t=n.value}else t=Sr._escape(t);return this.value+="${",this.value+=e,this.value+=":",this.value+=t,this.value+="}",this}appendChoice(t,e=this._tabstop++){let n=t.map(r=>r.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=e,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(t,e){if(typeof e=="function"){let n=new Sr;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else typeof e=="string"&&(e=e.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=t,e&&(this.value+=":",this.value+=e),this.value+="}",this}};Sr=E([oe],Sr)});var Ml,uC=y(()=>{dC();Mi();Ml=class o{static isSnippetTextEdit(t){return t instanceof o?!0:t?Be.isRange(t.range)&&Sr.isSnippetString(t.snippet):!1}static replace(t,e){return new o(t,e)}static insert(t,e){return o.replace(new Be(t,t),e)}constructor(t,e){this.range=t,this.snippet=e}}});var By,vs,dO=y(()=>{qr();lC();Mi();By=(W=>(W[W.File=0]="File",W[W.Module=1]="Module",W[W.Namespace=2]="Namespace",W[W.Package=3]="Package",W[W.Class=4]="Class",W[W.Method=5]="Method",W[W.Property=6]="Property",W[W.Field=7]="Field",W[W.Constructor=8]="Constructor",W[W.Enum=9]="Enum",W[W.Interface=10]="Interface",W[W.Function=11]="Function",W[W.Variable=12]="Variable",W[W.Constant=13]="Constant",W[W.String=14]="String",W[W.Number=15]="Number",W[W.Boolean=16]="Boolean",W[W.Array=17]="Array",W[W.Object=18]="Object",W[W.Key=19]="Key",W[W.Null=20]="Null",W[W.EnumMember=21]="EnumMember",W[W.Struct=22]="Struct",W[W.Event=23]="Event",W[W.Operator=24]="Operator",W[W.TypeParameter=25]="TypeParameter",W))(By||{}),vs=class{static validate(t){if(!t.name)throw new Error("name must not be falsy")}constructor(t,e,n,r,i){this.name=t,this.kind=e,this.containerName=i,typeof n=="string"&&(this.containerName=n),r instanceof sr?this.location=r:n instanceof Be&&(this.location=new sr(r,n)),vs.validate(this)}toJSON(){return{name:this.name,kind:By[this.kind],location:this.location,containerName:this.containerName}}};vs=E([oe],vs)});var ar,pC=y(()=>{Se();qr();Qd();Mi();ar=class{static isTextEdit(t){return t instanceof ar?!0:!t||typeof t!="object"?!1:Be.isRange(t)&&typeof t.newText=="string"}static replace(t,e){return new ar(t,e)}static insert(t,e){return ar.replace(new Be(t,t),e)}static delete(t){return ar.replace(t,"")}static setEndOfLine(t){let e=new ar(new Be(new Re(0,0),new Re(0,0)),"");return e.newEol=t,e}get range(){return this._range}set range(t){if(t&&!Be.isRange(t))throw Je("range");this._range=t}get newText(){return this._newText||""}set newText(t){if(t&&typeof t!="string")throw Je("newText");this._newText=t}get newEol(){return this._newEol}set newEol(t){if(t&&typeof t!="number")throw Je("newEol");this._newEol=t}constructor(t,e){this._range=t,this._newText=e}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};ar=E([oe],ar)});function Hy(o){if(o.scheme!==z.vscodeNotebookCell)return;let t=o.fragment.indexOf("s");if(t<0)return;let e=parseInt(o.fragment.substring(0,t).replace(g8,""),uO),n=Yi(o.fragment.substring(t+1)).toString();if(!isNaN(e))return{handle:e,notebook:o.with({scheme:n,fragment:null})}}function pO(o,t){let e=t.toString(uO),r=`${e.length<mC.length?mC[e.length-1]:"z"}${e}s${_o(A.fromString(o.scheme),!0,!0)}`;return o.with({scheme:z.vscodeNotebookCell,fragment:r})}function mO(o){if(o.scheme!==z.vscodeNotebookMetadata)return;let t=Yi(o.fragment).toString();return o.with({scheme:t,fragment:null})}function fO(o){let t=`${_o(A.fromString(o.scheme),!0,!0)}`;return o.with({scheme:z.vscodeNotebookMetadata,fragment:t})}function gC(o){if(o.scheme!==z.vscodeNotebookCellOutput)return;let t=new URLSearchParams(o.query),e=t.get("openIn");if(!e)return;let n=t.get("outputId")??void 0,r=Hy(o.with({scheme:z.vscodeNotebookCell,query:null})),i=t.get("outputIndex")?parseInt(t.get("outputIndex")||"",10):void 0,s=r?r.notebook:o.with({scheme:t.get("notebookScheme")||z.file,fragment:null,query:null}),a=t.get("cellIndex")?parseInt(t.get("cellIndex")||"",10):void 0;return{notebook:s,openIn:e,outputId:n,outputIndex:i,cellHandle:r?.handle,cellFragment:o.fragment,cellIndex:a}}var f8,mC,g8,uO,fC,gO=y(()=>{et();Hn();$e();Mm();re();f8=_("notebookDocumentService"),mC=["W","X","Y","Z","a","b","c","d","e","f"],g8=new RegExp(`^[${mC.join("")}]+`),uO=7;fC=class{constructor(){this._documents=new lt}getNotebook(t){if(t.scheme===z.vscodeNotebookCell){let e=Hy(t);if(e){let n=this._documents.get(e.notebook);if(n)return n}}if(t.scheme===z.vscodeNotebookCellOutput){let e=gC(t);if(e){let n=this._documents.get(e.notebook);if(n)return n}}return this._documents.get(t)}addNotebookDocument(t){this._documents.set(t.uri,t)}removeNotebookDocument(t){this._documents.delete(t.uri)}};fa(f8,fC,1)});var sEe,aEe,h8,v8,lEe,cEe,hO,dEe,y8,uEe,$y=y(()=>{et();Fv();Ko();_l();$e();Le();me();mo();gO();sEe=["application/json","application/javascript","text/html","image/svg+xml",Ir.latex,Ir.markdown,"image/png","image/jpeg",Ir.text],aEe=[Ir.latex,Ir.markdown,"application/json","text/html","image/svg+xml","image/png","image/jpeg",Ir.text];(n=>{n.scheme=z.vscodeNotebookMetadata;function t(r){return fO(r)}n.generate=t;function e(r){return mO(r)}n.parse=e})(h8||={});(c=>{c.scheme=z.vscodeNotebookCell;function t(u,p){return pO(u,p)}c.generate=t;function e(u){return Hy(u)}c.parse=e;function n(u,p){return u.with({scheme:z.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"editor",outputId:p??"",notebookScheme:u.scheme!==z.file?u.scheme:""}).toString()})}c.generateCellOutputUriWithId=n;function r(u,p,m){return u.with({scheme:z.vscodeNotebookCellOutput,fragment:p.fragment,query:new URLSearchParams({openIn:"notebook",outputIndex:String(m)}).toString()})}c.generateCellOutputUriWithIndex=r;function i(u,p,m,g,h){return u.with({scheme:z.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"notebookOutputEditor",notebook:u.toString(),cellIndex:String(m),outputId:g,outputIndex:String(h)}).toString()})}c.generateOutputEditorUri=i;function s(u){return gC(u)}c.parseCellOutputUri=s;function a(u,p,m){return c.generate(u,p).with({scheme:m})}c.generateCellPropertyUri=a;function l(u,p){if(u.scheme===p)return c.parse(u.with({scheme:c.scheme}))}c.parseCellPropertyUri=l})(v8||={});lEe=new S("notebookEditorCursorAtBoundary","none"),cEe=new S("notebookEditorCursorAtLineBoundary","none"),hO=class o{static{this._prefix="notebook/"}static create(t,e){return`${o._prefix}${t}/${e??t}`}static parse(t){if(t.startsWith(o._prefix)){let e=t.substring(o._prefix.length).split("/");if(e.length===2)return{notebookType:e[0],viewType:e[1]}}}},dEe=new TextDecoder,y8="\x1B[A",uEe=y8.split("").map(o=>o.charCodeAt(0))});var wa,yO=y(()=>{At();Hn();$y();cC();uC();qr();Mi();pC();wa=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(t,e,n,r){this._edits.push({_type:1,from:t,to:e,options:n,metadata:r})}createFile(t,e,n){this._edits.push({_type:1,from:void 0,to:t,options:e,metadata:n})}deleteFile(t,e,n){this._edits.push({_type:1,from:t,to:void 0,options:e,metadata:n})}replaceNotebookMetadata(t,e,n){this._edits.push({_type:3,metadata:n,uri:t,edit:{editType:5,metadata:e}})}replaceNotebookCells(t,e,n,r){let i=e.start,s=e.end;(i!==s||n.length>0)&&this._edits.push({_type:5,uri:t,index:i,count:s-i,cells:n,metadata:r})}replaceNotebookCellMetadata(t,e,n,r){this._edits.push({_type:3,metadata:r,uri:t,edit:{editType:3,index:e,metadata:n}})}replace(t,e,n,r){this._edits.push({_type:2,uri:t,edit:new ar(e,n),metadata:r})}insert(t,e,n,r){this.replace(t,new Be(e,e),n,r)}delete(t,e,n){this.replace(t,e,"",n)}has(t){return this._edits.some(e=>e._type===2&&e.uri.toString()===t.toString())}set(t,e){if(e)for(let n of e){if(!n)continue;let r,i;Array.isArray(n)?(r=n[0],i=n[1]):r=n,Kr.isNotebookCellEdit(r)?r.newCellMetadata?this.replaceNotebookCellMetadata(t,r.range.start,r.newCellMetadata,i):r.newNotebookMetadata?this.replaceNotebookMetadata(t,r.newNotebookMetadata,i):this.replaceNotebookCells(t,r.range,r.newCells,i):Ml.isSnippetTextEdit(r)?this._edits.push({_type:6,uri:t,range:r.range,edit:r.snippet,metadata:i,keepWhitespace:r.keepWhitespace}):this._edits.push({_type:2,uri:t,edit:r,metadata:i})}else{for(let n=0;n<this._edits.length;n++){let r=this._edits[n];switch(r._type){case 2:case 6:case 3:case 5:r.uri.toString()===t.toString()&&(this._edits[n]=void 0);break}}qR(this._edits)}}get(t){let e=[];for(let n of this._edits)n._type===2&&n.uri.toString()===t.toString()&&e.push(n.edit);return e}entries(){let t=new lt;for(let e of this._edits)if(e._type===2){let n=t.get(e.uri);n||(n=[e.uri,[]],t.set(e.uri,n)),n[1].push(e.edit)}return[...t.values()]}get size(){return this.entries().length}toJSON(){return this.entries()}};wa=E([oe],wa)});function SO(o){let t="";for(let e=0;e<o.length;e++)t+=o[e].replace(/,/g,",,")+",";return t}function Tf(o){if(o){if(o.covered>o.total)throw new Error(`The total number of covered items (${o.covered}) cannot be greater than the total (${o.total})`);if(o.total<0)throw new Error(`The number of covered items (${o.total}) cannot be negative`)}}var Ul,bs,nf,Xd,xO,Yd,Zd,Is,zy,eu,mu,pb,mb,Gy,qy,Ky,jy,tu,nu,vC,ru,Qy,Jy,Xy,yC,bC,ou,Ol,Yy,iu,lr,rf,of,hC,cr,C8,su,sf,fu,fb,gb,ys,Fl,af,au,Zy,Pa,xs,eb,Ca,T8,Al,tb,nb,rb,ob,ib,sb,ab,lu,cu,du,uu,pu,zn,lb,tf,cb,hb,db,vb,ub,Ta,Nl,lf,yb,bb,Ib,xb,gu,cf,df,Sb,uf,pf,Eb,mf,ff,gf,hf,vf,yf,bf,If,wb,xf,Cb,Tb,Pb,Sf,Ef,kb,Rb,wf,bO,Db,_b,Vl,Lb,Mb,Wl,bn,Er,hu,Oi,IO,Cf,Ob,Ab,Nb,Ub,Fb=y(()=>{At();et();Se();Cc();_l();Qt();Me();ce();sn();iC();_n();nt();my();qr();sC();Mi();aO();lO();lC();sC();cC();Qd();Mi();cO();dC();uC();dO();pC();yO();bs=class{constructor(t){fc(this,Ul);rp(this,Ul,t)}static from(...t){let e=t;return new bs(function(){if(e){for(let n of e)n&&typeof n.dispose=="function"&&n.dispose();e=void 0}})}dispose(){typeof Kt(this,Ul)=="function"&&(Kt(this,Ul).call(this),rp(this,Ul,void 0))}};Ul=new WeakMap,bs=E([oe],bs);nf=class{constructor(t,e){if(!t)throw new Error("Illegal argument, contents must be defined");Array.isArray(t)?this.contents=t:this.contents=[t],this.range=e}};nf=E([oe],nf);Xd=class extends nf{constructor(t,e,n,r){super(t,e),this.canIncreaseVerbosity=n,this.canDecreaseVerbosity=r}};Xd=E([oe],Xd);xO=(n=>(n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write",n))(xO||{}),Yd=class{constructor(t,e=0){this.range=t,this.kind=e}toJSON(){return{range:this.range,kind:xO[this.kind]}}};Yd=E([oe],Yd);Zd=class{constructor(t,e){this.uri=t,this.highlights=e}toJSON(){return{uri:this.uri,highlights:this.highlights.map(t=>t.toJSON())}}};Zd=E([oe],Zd);Is=class{static validate(t){if(!t.name)throw new Error("name must not be falsy");if(!t.range.contains(t.selectionRange))throw new Error("selectionRange must be contained in fullRange");t.children?.forEach(Is.validate)}constructor(t,e,n,r,i){this.name=t,this.detail=e,this.kind=n,this.range=r,this.selectionRange=i,this.children=[],Is.validate(this)}};Is=E([oe],Is);zy=class{constructor(t,e){this.title=t,this.kind=e}};zy=E([oe],zy);eu=class{constructor(t,e){if(this.range=t,this.parent=e,e&&!e.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};eu=E([oe],eu);mu=class{constructor(t,e,n,r,i,s){this.kind=t,this.name=e,this.detail=n,this.uri=r,this.range=i,this.selectionRange=s}},pb=class{constructor(t,e){this.fromRanges=e,this.from=t}},mb=class{constructor(t,e){this.fromRanges=e,this.to=t}},Gy=class{constructor(t,e){this.range=t,this.command=e}get isResolved(){return!!this.command}};Gy=E([oe],Gy);qy=class{constructor(t,e){this.label=t,this.documentation=e}};qy=E([oe],qy);Ky=class{constructor(t,e){this.label=t,this.documentation=e,this.parameters=[]}};Ky=E([oe],Ky);jy=class{constructor(){this.activeSignature=0;this.activeParameter=0;this.signatures=[]}};jy=E([oe],jy);tu=class{constructor(t){this.value=t}};tu=E([oe],tu);nu=class{constructor(t,e,n){this.position=t,this.label=e,this.kind=n}};nu=E([oe],nu);vC=(ee=>(ee[ee.Text=0]="Text",ee[ee.Method=1]="Method",ee[ee.Function=2]="Function",ee[ee.Constructor=3]="Constructor",ee[ee.Field=4]="Field",ee[ee.Variable=5]="Variable",ee[ee.Class=6]="Class",ee[ee.Interface=7]="Interface",ee[ee.Module=8]="Module",ee[ee.Property=9]="Property",ee[ee.Unit=10]="Unit",ee[ee.Value=11]="Value",ee[ee.Enum=12]="Enum",ee[ee.Keyword=13]="Keyword",ee[ee.Snippet=14]="Snippet",ee[ee.Color=15]="Color",ee[ee.File=16]="File",ee[ee.Reference=17]="Reference",ee[ee.Folder=18]="Folder",ee[ee.EnumMember=19]="EnumMember",ee[ee.Constant=20]="Constant",ee[ee.Struct=21]="Struct",ee[ee.Event=22]="Event",ee[ee.Operator=23]="Operator",ee[ee.TypeParameter=24]="TypeParameter",ee[ee.User=25]="User",ee[ee.Issue=26]="Issue",ee))(vC||{}),ru=class{constructor(t,e){this.label=t,this.kind=e}toJSON(){return{label:this.label,kind:this.kind&&vC[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};ru=E([oe],ru);Qy=class{constructor(t=[],e=!1){this.items=t,this.isIncomplete=e}};Qy=E([oe],Qy);Jy=class{constructor(t,e,n){this.insertText=t,this.range=e,this.command=n}};Jy=E([oe],Jy);Xy=class{constructor(t){this.commands=void 0;this.suppressSuggestions=void 0;this.items=t}};Xy=E([oe],Xy);yC=(n=>(n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command",n))(yC||{});(t=>{function o(e){switch(e){case"keyboard":return 1;case"mouse":return 2;case"api":case"code.jump":case"code.navigation":return 3}}t.fromValue=o})(yC||={});bC=(r=>(r[r.Other=0]="Other",r[r.Comment=1]="Comment",r[r.String=2]="String",r[r.RegEx=3]="RegEx",r))(bC||{});(t=>{function o(e){switch(e){case 0:return"other";case 1:return"comment";case 2:return"string";case 3:return"regex"}return"other"}t.toString=o})(bC||={});ou=class{constructor(t,e){if(e&&!I.isUri(e))throw Je("target");if(!Be.isRange(t)||t.isEmpty)throw Je("range");this.range=t,this.target=e}};ou=E([oe],ou);Ol=class{constructor(t,e,n,r){this.red=t,this.green=e,this.blue=n,this.alpha=r}};Ol=E([oe],Ol);Yy=class{constructor(t,e){if(e&&!(e instanceof Ol))throw Je("color");if(!Be.isRange(t)||t.isEmpty)throw Je("range");this.range=t,this.color=e}};Yy=E([oe],Yy);iu=class{constructor(t){if(!t||typeof t!="string")throw Je("label");this.label=t}};iu=E([oe],iu);lr=class{constructor(t,e){this.label=e;if(typeof t!="string")throw Je("name");if(typeof e!="string")throw Je("name");this._id=t}static from(t){switch(t){case"clean":return lr.Clean;case"build":return lr.Build;case"rebuild":return lr.Rebuild;case"test":return lr.Test;default:return}}get id(){return this._id}};lr.Clean=new lr("clean","Clean"),lr.Build=new lr("build","Build"),lr.Rebuild=new lr("rebuild","Rebuild"),lr.Test=new lr("test","Test"),lr=E([oe],lr);rf=class{constructor(t,e,n){if(typeof t!="string")throw Je("process");this._args=[],this._process=t,e!==void 0&&(Array.isArray(e)?(this._args=e,this._options=n):this._options=e)}get process(){return this._process}set process(t){if(typeof t!="string")throw Je("process");this._process=t}get args(){return this._args}set args(t){Array.isArray(t)||(t=[]),this._args=t}get options(){return this._options}set options(t){this._options=t}computeId(){let t=[];if(t.push("process"),this._process!==void 0&&t.push(this._process),this._args&&this._args.length>0)for(let e of this._args)t.push(e);return SO(t)}};rf=E([oe],rf);of=class{constructor(t,e,n){this._args=[];if(Array.isArray(e)){if(!t)throw Je("command can't be undefined or null");if(typeof t!="string"&&typeof t.value!="string")throw Je("command");this._command=t,e&&(this._args=e),this._options=n}else{if(typeof t!="string")throw Je("commandLine");this._commandLine=t,this._options=e}}get commandLine(){return this._commandLine}set commandLine(t){if(typeof t!="string")throw Je("commandLine");this._commandLine=t}get command(){return this._command?this._command:""}set command(t){if(typeof t!="string"&&typeof t.value!="string")throw Je("command");this._command=t}get args(){return this._args}set args(t){this._args=t||[]}get options(){return this._options}set options(t){this._options=t}computeId(){let t=[];if(t.push("shell"),this._commandLine!==void 0&&t.push(this._commandLine),this._command!==void 0&&t.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(let e of this._args)t.push(typeof e=="string"?e:e.value);return SO(t)}};of=E([oe],of);hC=class{constructor(t){this._callback=t}computeId(){return"customExecution"+Ce()}set callback(t){this._callback=t}get callback(){return this._callback}},cr=class{constructor(t,e,n,r,i,s){this.__deprecated=!1;this._definition=this.definition=t;let a;typeof e=="string"?(this._name=this.name=e,this._source=this.source=n,this.execution=r,a=i,this.__deprecated=!0):e===1||e===2?(this.target=e,this._name=this.name=n,this._source=this.source=r,this.execution=i,a=s):(this.target=e,this._name=this.name=n,this._source=this.source=r,this.execution=i,a=s),typeof a=="string"?(this._problemMatchers=[a],this._hasDefinedMatchers=!0):Array.isArray(a)?(this._problemMatchers=a,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(t){this.__id=t}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof rf?this._definition={type:cr.ProcessType,id:this._execution.computeId()}:this._execution instanceof of?this._definition={type:cr.ShellType,id:this._execution.computeId()}:this._execution instanceof hC?this._definition={type:cr.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:cr.EmptyType,id:Ce()}}get definition(){return this._definition}set definition(t){if(t==null)throw Je("Kind can't be undefined or null");this.clear(),this._definition=t}get scope(){return this._scope}set target(t){this.clear(),this._scope=t}get name(){return this._name}set name(t){if(typeof t!="string")throw Je("name");this.clear(),this._name=t}get execution(){return this._execution}set execution(t){t===null&&(t=void 0),this.clear(),this._execution=t;let e=this._definition.type;(cr.EmptyType===e||cr.ProcessType===e||cr.ShellType===e||cr.ExtensionCallbackType===e)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(t){if(Array.isArray(t))this.clear(),this._problemMatchers=t,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(t){t!==!0&&t!==!1&&(t=!1),this.clear(),this._isBackground=t}get source(){return this._source}set source(t){if(typeof t!="string"||t.length===0)throw Je("source must be a string of length > 0");this.clear(),this._source=t}get group(){return this._group}set group(t){t===null&&(t=void 0),this.clear(),this._group=t}get detail(){return this._detail}set detail(t){t===null&&(t=void 0),this._detail=t}get presentationOptions(){return this._presentationOptions}set presentationOptions(t){t==null&&(t=Object.create(null)),this.clear(),this._presentationOptions=t}get runOptions(){return this._runOptions}set runOptions(t){t==null&&(t=Object.create(null)),this.clear(),this._runOptions=t}};cr.ExtensionCallbackType="customExecution",cr.ProcessType="process",cr.ShellType="shell",cr.EmptyType="$empty",cr=E([oe],cr);(t=>{function o(e){let n=e;return Jn(n.value)?n.tooltip&&!ne(n.tooltip)?(console.log("INVALID view badge, invalid tooltip",n.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",n.value),!1)}t.isViewBadge=o})(C8||={});su=class{constructor(t,e=0){this.collapsibleState=e;I.isUri(t)?this.resourceUri=t:this.label=t}static isTreeItem(t,e){let n=t;if(n.checkboxState!==void 0){let r=Jn(n.checkboxState)?n.checkboxState:Ue(n.checkboxState)&&Jn(n.checkboxState.state)?n.checkboxState.state:void 0,i=!Jn(n.checkboxState)&&Ue(n.checkboxState)?n.checkboxState.tooltip:void 0;if(r===void 0||r!==1&&r!==0||i!==void 0&&!ne(i))return console.log("INVALID tree item, invalid checkboxState",n.checkboxState),!1}if(t instanceof su)return!0;if(n.label!==void 0&&!ne(n.label)&&!n.label?.label)return console.log("INVALID tree item, invalid label",n.label),!1;if(n.id!==void 0&&!ne(n.id))return console.log("INVALID tree item, invalid id",n.id),!1;if(n.iconPath!==void 0&&!ne(n.iconPath)&&!I.isUri(n.iconPath)&&(!n.iconPath||!ne(n.iconPath.id))){let r=n.iconPath;if(!r||!ne(r.light)&&!I.isUri(r.light)&&!ne(r.dark)&&!I.isUri(r.dark))return console.log("INVALID tree item, invalid iconPath",n.iconPath),!1}return n.description!==void 0&&!ne(n.description)&&typeof n.description!="boolean"?(console.log("INVALID tree item, invalid description",n.description),!1):n.resourceUri!==void 0&&!I.isUri(n.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",n.resourceUri),!1):n.tooltip!==void 0&&!ne(n.tooltip)&&!(n.tooltip instanceof xr)?(console.log("INVALID tree item, invalid tooltip",n.tooltip),!1):n.command!==void 0&&!n.command.command?(console.log("INVALID tree item, invalid command",n.command),!1):n.collapsibleState!==void 0&&n.collapsibleState<0&&n.collapsibleState>2?(console.log("INVALID tree item, invalid collapsibleState",n.collapsibleState),!1):n.contextValue!==void 0&&!ne(n.contextValue)?(console.log("INVALID tree item, invalid contextValue",n.contextValue),!1):n.accessibilityInformation!==void 0&&!n.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",n.accessibilityInformation),!1):!0}};su=E([oe],su);sf=class{constructor(t){this.value=t}async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}};sf=E([oe],sf);fu=class extends sf{},fb=class extends fu{$b;constructor(t){super(""),this.$b=t}asFile(){return this.$b}},gb=class{constructor(t,e,n,r){this.name=t,this.uri=e,this._itemId=n,this._getData=r}data(){return this._getData()}},au=class{constructor(t){fc(this,Fl);fc(this,ys,new Map);for(let[e,n]of t??[]){let r=Kt(this,ys).get(op(this,Fl,af).call(this,e));r?r.push(n):Kt(this,ys).set(op(this,Fl,af).call(this,e),[n])}}get(t){return Kt(this,ys).get(op(this,Fl,af).call(this,t))?.[0]}set(t,e){Kt(this,ys).set(op(this,Fl,af).call(this,t),[e])}forEach(t,e){for(let[n,r]of Kt(this,ys))for(let i of r)t.call(e,i,n,this)}*[Symbol.iterator](){for(let[t,e]of Kt(this,ys))for(let n of e)yield[t,n]}};ys=new WeakMap,Fl=new WeakSet,af=function(t){return t.toLowerCase()},au=E([oe],au);Zy=class{constructor(t,e,n){this.insertText=t,this.title=e,this.kind=n}};Zy=E([oe],Zy);Pa=class o{constructor(t){this.value=t}static{this.sep="."}append(...t){return new o((this.value?[this.value,...t]:t).join(o.sep))}intersects(t){return this.contains(t)||t.contains(this)}contains(t){return this.value===t.value||t.value.startsWith(this.value+o.sep)}};Pa.Empty=new Pa("");Pa.Text=new Pa("text");Pa.TextUpdateImports=Pa.Text.append("updateImports");xs=class{constructor(t,e){this.id=t,this.color=e}static isThemeIcon(t){return typeof t.id!="string"?(console.log("INVALID ThemeIcon, invalid id",t.id),!1):!0}};xs=E([oe],xs);xs.File=new xs("file");xs.Folder=new xs("folder");eb=class{constructor(t){this.id=t}};eb=E([oe],eb);Ca=class{get base(){return this._base}set base(t){this._base=t,this._baseUri=I.file(t)}get baseUri(){return this._baseUri}set baseUri(t){this._baseUri=t,this._base=t.fsPath}constructor(t,e){if(typeof t!="string"&&(!t||!I.isUri(t)&&!I.isUri(t.uri)))throw Je("base");if(typeof e!="string")throw Je("pattern");typeof t=="string"?this.baseUri=I.file(t):I.isUri(t)?this.baseUri=t:this.baseUri=t.uri,this.pattern=e}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};Ca=E([oe],Ca);T8=new WeakMap,Al=class{constructor(t,e,n,r,i){this.enabled=typeof t=="boolean"?t:!0,typeof e=="string"&&(this.condition=e),typeof n=="string"&&(this.hitCondition=n),typeof r=="string"&&(this.logMessage=r),typeof i=="string"&&(this.mode=i)}get id(){return this._id||(this._id=T8.get(this)??Ce()),this._id}};Al=E([oe],Al);tb=class extends Al{constructor(t,e,n,r,i,s){if(super(e,n,r,i,s),t===null)throw Je("location");this.location=t}};tb=E([oe],tb);nb=class extends Al{constructor(t,e,n,r,i,s){super(e,n,r,i,s),this.functionName=t}};nb=E([oe],nb);rb=class extends Al{constructor(t,e,n,r,i,s,a,l){if(super(r,i,s,a,l),!e)throw Je("dataId");this.label=t,this.dataId=e,this.canPersist=n}};rb=E([oe],rb);ob=class{constructor(t,e,n){this.command=t,this.args=e||[],this.options=n}};ob=E([oe],ob);ib=class{constructor(t,e){this.port=t,this.host=e}};ib=E([oe],ib);sb=class{constructor(t){this.path=t}};sb=E([oe],sb);ab=class{constructor(t){this.implementation=t}};ab=E([oe],ab);lu=class{constructor(t,e){this.range=t,this.expression=e}};lu=E([oe],lu);cu=class{constructor(t,e){this.range=t,this.text=e}};cu=E([oe],cu);du=class{constructor(t,e,n=!0){this.range=t,this.variableName=e,this.caseSensitiveLookup=n}};du=E([oe],du);uu=class{constructor(t,e){this.range=t,this.expression=e}};uu=E([oe],uu);pu=class{constructor(t,e){this.frameId=t,this.stoppedLocation=e}};pu=E([oe],pu);zn=class extends Error{static FileExists(t){return new zn(t,"EntryExists",zn.FileExists)}static FileNotFound(t){return new zn(t,"EntryNotFound",zn.FileNotFound)}static FileNotADirectory(t){return new zn(t,"EntryNotADirectory",zn.FileNotADirectory)}static FileIsADirectory(t){return new zn(t,"EntryIsADirectory",zn.FileIsADirectory)}static NoPermissions(t){return new zn(t,"NoPermissions",zn.NoPermissions)}static Unavailable(t){return new zn(t,"Unavailable",zn.Unavailable)}constructor(t,e="Unknown",n){super(I.isUri(t)?t.toString(!0):t),this.code=n?.name??"Unknown",AS(this,e),Object.setPrototypeOf(this,zn.prototype),typeof Error.captureStackTrace=="function"&&typeof n=="function"&&Error.captureStackTrace(this,n)}};zn=E([oe],zn);lb=class{constructor(t,e,n){this.start=t,this.end=e,this.kind=n}};lb=E([oe],lb);tf=class{constructor(){}};tf.Back={iconPath:new xs("arrow-left")},tf=E([oe],tf);cb=class{constructor(t){this.kind=t}};cb=E([oe],cb);hb=class{constructor(t,e=[]){this.uri=t;this.provides=Bg(e)}},db=class{constructor(t,e){this.label=t;this.timestamp=e}};db=E([oe],db);vb=class{constructor(t,e,n){this.controllerId=t;this.profileId=e;this.kind=n}},ub=class{constructor(t=void 0,e=void 0,n=void 0,r=!1,i=!0){this.include=t;this.exclude=e;this.profile=n;this.continuous=r;this.preserveFocus=i}};ub=E([oe],ub);Ta=class{constructor(t){this.message=t}static diff(t,e,n){let r=new Ta(t);return r.expectedOutput=e,r.actualOutput=n,r}};Ta=E([oe],Ta);Nl=class{constructor(t){this.id=t}};Nl=E([oe],Nl);lf=class{constructor(t,e){this.covered=t;this.total=e;Tf(this)}};yb=class o{constructor(t,e,n,r,i=[]){this.uri=t;this.statementCoverage=e;this.branchCoverage=n;this.declarationCoverage=r;this.includesTests=i}static fromDetails(t,e){let n=new lf(0,0),r=new lf(0,0),i=new lf(0,0);for(let a of e)if("branches"in a){n.total+=1,n.covered+=a.executed?1:0;for(let l of a.branches)r.total+=1,r.covered+=l.executed?1:0}else i.total+=1,i.covered+=a.executed?1:0;let s=new o(t,n,r.total>0?r:void 0,i.total>0?i:void 0);return s.detailedCoverage=e,s}},bb=class{constructor(t,e,n=[]){this.executed=t;this.location=e;this.branches=n}get executionCount(){return+this.executed}set executionCount(t){this.executed=t}},Ib=class{constructor(t,e,n){this.executed=t;this.location=e;this.label=n}get executionCount(){return+this.executed}set executionCount(t){this.executed=t}},xb=class{constructor(t,e,n){this.name=t;this.executed=e;this.location=n}get executionCount(){return+this.executed}set executionCount(t){this.executed=t}},gu=class{constructor(t,e,n,r,i,s){this.kind=t,this.name=e,this.detail=n,this.uri=r,this.range=i,this.selectionRange=s}},cf=class{constructor(t){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new xr(t):t}},df=class{constructor(t,e){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new xr(t):t,this.vulnerabilities=e}},Sb=class{constructor(t,e,n,r){this.title=t,this.message=e,this.data=n,this.buttons=r}},uf=class{constructor(t,e){this.value=t,this.baseUri=e}},pf=class{constructor(t,e,n){this.value=t,this.title=e,this.readOnly=n}},Eb=class{constructor(t,e,n,r){this.description=t,this.agentName=e,this.prompt=n,this.result=r}},mf=class{constructor(t,e){this.value=t,this.value2=t,this.title=e}},ff=class{constructor(t){this.value=t}},gf=class{constructor(t,e,n){this.value=t,this.id=e,this.metadata=n}},hf=class{constructor(t,e,n,r){this.hookType=t,this.stopReason=e,this.systemMessage=n,this.metadata=r}},vf=class{constructor(t){if(typeof t!="string"&&t.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof t=="string"?new xr(t):t}},yf=class{constructor(t){this.value=t}},bf=class{constructor(t,e,n){this.value=t,this.iconPath=e,this.options=n}},If=class{constructor(t,e,n){this.value=t,this.isEdit=e,this.undoStopId=n}},wb=class{constructor(t,e,n){this.value=t,this.license=e,this.snippet=n}},xf=class{constructor(t,e){this.uri=t;this.range=e}},Cb=class{constructor(t){this.extensions=t}},Tb=class{constructor(t,e,n,r,i){this.title=e;this.description=n;this.author=r;this.linkTag=i;el(t)?(this.uri=t,this.command={title:"Open Pull Request",command:"vscode.open",arguments:[t]}):this.command=t}toJSON(){return{$mid:26,uri:this.uri,title:this.title,description:this.description,author:this.author}}},Pb=class{constructor(t,e,n,r){this.id=t,this.type=e,this.title=n,this.message=r?.message,this.options=r?.options,this.defaultValue=r?.defaultValue,this.allowFreeformInput=r?.allowFreeformInput}},Sf=class{constructor(t,e=!0){this.questions=t,this.allowSkip=e}},Ef=class{constructor(t,e){this.uri=t,e===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(e)?e:[e]}},kb=class{constructor(t,e){this.uri=t,e===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(e)?e:[e]}},Rb=class{constructor(t){this.edits=t}},wf=class{constructor(t,e,n){this.toolName=t,this.toolCallId=e,this.errorMessage=n}},bO=class o{constructor(t){this.id=t}static{this.Agent=new o("agent")}static{this.Skill=new o("skill")}static{this.Instructions=new o("instructions")}static{this.Prompt=new o("prompt")}static{this.Hook=new o("hook")}static{this.Plugins=new o("plugins")}},Db=class{constructor(t,e,n){this.mimeType=t,this.data=e,this.reference=n}},_b=class{constructor(t){this.diagnostics=t}},Vl=class{constructor(t,e,n){this.callId=t,this.content=e,this.isError=n??!1}},Lb=class o{constructor(t,e,n){this._content=[];this.role=t,this.content=e,this.name=n}static User(t,e){return new o(1,t,e)}static Assistant(t,e){return new o(2,t,e)}set content(t){typeof t=="string"?this._content=[new bn(t)]:this._content=t}get content(){return this._content}},Mb=class o{constructor(t,e,n){this._content=[];this.role=t,this.content=e,this.name=n}static User(t,e){return new o(1,t,e)}static Assistant(t,e){return new o(2,t,e)}set content(t){typeof t=="string"?this._content=[new bn(t)]:this._content=t}get content(){return this._content}set content2(t){t&&(this.content=t.map(e=>typeof e=="string"?new bn(e):e))}get content2(){return this.content.map(t=>t instanceof bn?t.value:t)}},Wl=class{constructor(t,e,n){this.callId=t,this.name=e,this.input=n}},bn=class{constructor(t,e){this.value=t,e=e}toJSON(){return{$mid:21,value:this.value,audience:this.audience}}},Er=class o{constructor(t,e,n){this.mimeType=e,this.data=t,this.audience=n}static image(t,e){return new o(t,e)}static json(t,e="text/x-json"){let n=JSON.stringify(t,void 0," ");return new o(A.fromString(n).buffer,e)}static text(t,e=Ir.text){return new o(A.fromString(t).buffer,e)}toJSON(){return{$mid:24,mimeType:this.mimeType,data:_o(A.wrap(this.data)),audience:this.audience}}},hu=class{constructor(t,e,n){this.value=t,this.id=e,this.metadata=n}toJSON(){return{$mid:22,value:this.value,id:this.id,metadata:this.metadata}}},Oi=class{constructor(t){this.value=t}toJSON(){return{$mid:23,value:this.value}}},IO=class o extends Error{static $c="LanguageModelError";static NotFound(t){return new o(t,o.NotFound.name)}static NoPermissions(t){return new o(t,o.NoPermissions.name)}static Blocked(t){return new o(t,o.Blocked.name)}static tryDeserialize(t){if(t.name===o.$c)return new o(t.message,t.code,t.cause)}constructor(t,e,n){super(t,{cause:n}),this.name=o.$c,this.code=e??""}},Cf=class{constructor(t){this.content=t}toJSON(){return{$mid:20,content:this.content}}},Ob=class{constructor(t,e){this.id=t;this.label=e}},Ab=class{constructor(t,e,n){this.label=t;this.name=e;this.instructions=n}},Nb=class{constructor(t,e,n,r={},i,s){this.label=t;this.command=e;this.args=n;this.env=r;this.version=i;this.metadata=s}},Ub=class{constructor(t,e,n={},r,i,s){this.label=t;this.uri=e;this.headers=n;this.version=r;this.metadata=i;this.authentication=s}}});var Vb,wO=y(()=>{At();Ko();sn();Vb=Object.freeze({create:o=>pr(o.map(t=>t.toString())).join(`\r
- `),split:o=>o.split(`\r
- `),parse:o=>Vb.split(o).filter(t=>!t.startsWith("#"))})});function SC(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function DO(o){Hl=o}function Io(o,t){if(t){if(_O.test(o))return o.replace(P8,CO)}else if(LO.test(o))return o.replace(k8,CO);return o}function Vt(o,t){let e=typeof o=="string"?o:o.source;t=t||"";let n={replace:(r,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(D8,"$1"),e=e.replace(r,s),n},getRegex:()=>new RegExp(e,t)};return n}function TO(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}function PO(o,t){let e=o.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=e.split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function Pf(o,t,e){let n=o.length;if(n===0)return"";let r=0;for(;r<n;){let i=o.charAt(n-r-1);if(i===t&&!e)r++;else if(i!==t&&e)r++;else break}return o.slice(0,n-r)}function _8(o,t){if(o.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<o.length;n++)if(o[n]==="\\")n++;else if(o[n]===t[0])e++;else if(o[n]===t[1]&&(e--,e<0))return n;return-1}function kO(o,t,e,n){let r=t.href,i=t.title?Io(t.title):null,s=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){n.state.inLink=!0;let a={type:"link",raw:e,href:r,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:e,href:r,title:i,text:Io(s)}}function L8(o,t){let e=o.match(/^(\s+)(?:```)/);if(e===null)return t;let n=e[1];return t.split(`
- `).map(r=>{let i=r.match(/^\s+/);if(i===null)return r;let[s]=i;return s.length>=n.length?r.slice(n.length):r}).join(`
- `)}function Tt(o,t){return Bl.parse(o,t)}var Hl,_O,P8,LO,k8,R8,CO,D8,Rf,yu,M8,O8,A8,_f,N8,MO,OO,EC,U8,wC,F8,V8,Hb,CC,W8,AO,B8,TC,RO,H8,$8,NO,z8,UO,G8,Lf,q8,K8,j8,Q8,J8,X8,Y8,Z8,e6,Bb,t6,FO,VO,n6,PC,r6,IC,o6,Wb,kf,Ss,bu,Df,Es,vu,xC,Bl,dwe,uwe,pwe,mwe,fwe,gwe,hwe,WO=y(()=>{Hl=SC();_O=/[&<>"']/,P8=new RegExp(_O.source,"g"),LO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,k8=new RegExp(LO.source,"g"),R8={"&":"&","<":"<",">":">",'"':""","'":"'"},CO=o=>R8[o];D8=/(^|[^\[])\^/g;Rf={exec:()=>null};yu=class{options;rules;lexer;constructor(t){this.options=t||Hl}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Pf(n,`
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=L8(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){let r=Pf(n,"#");(this.options.pedantic||!r||/ $/.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Pf(e[0],`
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Pf(e[0],`
- `).split(`
- `),r="",i="",s=[];for(;n.length>0;){let a=!1,l=[],c;for(c=0;c<n.length;c++)if(/^ {0,3}>/.test(n[c]))l.push(n[c]),a=!0;else if(!a)l.push(n[c]);else break;n=n.slice(c);let u=l.join(`
- `),p=u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
- $1`).replace(/^ {0,3}>[ \t]?/gm,"");r=r?`${r}
- ${u}`:u,i=i?`${i}
- ${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=m,n.length===0)break;let g=s[s.length-1];if(g?.type==="code")break;if(g?.type==="blockquote"){let h=g,v=h.raw+`
- `+n.join(`
- `),x=this.blockquote(v);s[s.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,i=i.substring(0,i.length-h.text.length)+x.text;break}else if(g?.type==="list"){let h=g,v=h.raw+`
- `+n.join(`
- `),x=this.list(v);s[s.length-1]=x,r=r.substring(0,r.length-g.raw.length)+x.raw,i=i.substring(0,i.length-h.raw.length)+x.raw,n=v.substring(s[s.length-1].raw.length).split(`
- `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),a=!1;for(;t;){let l=!1,c="",u="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let p=e[2].split(`
- `,1)[0].replace(/^\t+/,T=>" ".repeat(3*T.length)),m=t.split(`
- `,1)[0],g=!p.trim(),h=0;if(this.options.pedantic?(h=2,u=p.trimStart()):g?h=e[1].length+1:(h=e[2].search(/[^ ]/),h=h>4?1:h,u=p.slice(h),h+=e[1].length),g&&/^ *$/.test(m)&&(c+=m+`
- `,t=t.substring(m.length+1),l=!0),!l){let T=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),w=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),k=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),M=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;t;){let B=t.split(`
- `,1)[0];if(m=B,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),k.test(m)||M.test(m)||T.test(m)||w.test(t))break;if(m.search(/[^ ]/)>=h||!m.trim())u+=`
- `+m.slice(h);else{if(g||p.search(/[^ ]/)>=4||k.test(p)||M.test(p)||w.test(p))break;u+=`
- `+m}!g&&!m.trim()&&(g=!0),c+=B+`
- `,t=t.substring(B.length+1),p=m.slice(h)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(c)&&(a=!0));let v=null,x;this.options.gfm&&(v=/^\[[ xX]\] /.exec(u),v&&(x=v[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:c,task:!!v,checked:x,loose:!1,text:u,tokens:[]}),i.raw+=c}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let l=0;l<i.items.length;l++)if(this.lexer.state.top=!1,i.items[l].tokens=this.lexer.blockTokens(i.items[l].text,[]),!i.loose){let c=i.items[l].tokens.filter(p=>p.type==="space"),u=c.length>0&&c.some(p=>/\n.*\n/.test(p.raw));i.loose=u}if(i.loose)for(let l=0;l<i.items.length;l++)i.items[l].loose=!0;return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(/\s+/g," "),r=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!/[:|]/.test(e[2]))return;let n=PO(e[1]),r=e[2].replace(/^\||\| *$/g,"").split("|"),i=e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split(`
- `):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)/^ *-+: *$/.test(a)?s.align.push("right"):/^ *:-+: *$/.test(a)?s.align.push("center"):/^ *:-+ *$/.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(PO(a,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:Io(e[1])}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let s=Pf(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=_8(e[2],"()");if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(n)?r=r.slice(1):r=r.slice(1,-1)),kO(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(/\s+/g," "),i=e[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return kO(n,i,n[0],this.lexer)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,l,c=s,u=0,p=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(r=p.exec(e))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);let m=[...r[0]][0].length,g=t.slice(0,s+r.index+m+l);if(Math.min(s,l)%2){let v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}let h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return r&&i&&(n=n.substring(1,n.length-1)),n=Io(n,!0),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=Io(e[1]),r="mailto:"+n):(n=Io(e[1]),r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=Io(e[0]),r="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=Io(e[0]),e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n;return this.lexer.state.inRawBlock?n=e[0]:n=Io(e[0]),{type:"text",raw:e[0],text:n}}}},M8=/^(?: *(?:\n|$))+/,O8=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,A8=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_f=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,N8=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,MO=/(?:[*+-]|\d{1,9}[.)])/,OO=Vt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,MO).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),EC=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,U8=/^[^\n]+/,wC=/(?!\s*\])(?:\\.|[^\[\]\\])+/,F8=Vt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",wC).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),V8=Vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,MO).getRegex(),Hb="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",CC=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,W8=Vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",CC).replace("tag",Hb).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),AO=Vt(EC).replace("hr",_f).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hb).getRegex(),B8=Vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",AO).getRegex(),TC={blockquote:B8,code:O8,def:F8,fences:A8,heading:N8,hr:_f,html:W8,lheading:OO,list:V8,newline:M8,paragraph:AO,table:Rf,text:U8},RO=Vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_f).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hb).getRegex(),H8={...TC,table:RO,paragraph:Vt(EC).replace("hr",_f).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",RO).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hb).getRegex()},$8={...TC,html:Vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",CC).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vt(EC).replace("hr",_f).replace("heading",` *#{1,6} *[^
- ]`).replace("lheading",OO).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,z8=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,UO=/^( {2,}|\\)\n(?!\s*$)/,G8=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lf="\\p{P}\\p{S}",q8=Vt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Lf).getRegex(),K8=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,j8=Vt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Lf).getRegex(),Q8=Vt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Lf).getRegex(),J8=Vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Lf).getRegex(),X8=Vt(/\\([punct])/,"gu").replace(/punct/g,Lf).getRegex(),Y8=Vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Z8=Vt(CC).replace("(?:-->|$)","-->").getRegex(),e6=Vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Z8).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bb=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,t6=Vt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Bb).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),FO=Vt(/^!?\[(label)\]\[(ref)\]/).replace("label",Bb).replace("ref",wC).getRegex(),VO=Vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",wC).getRegex(),n6=Vt("reflink|nolink(?!\\()","g").replace("reflink",FO).replace("nolink",VO).getRegex(),PC={_backpedal:Rf,anyPunctuation:X8,autolink:Y8,blockSkip:K8,br:UO,code:z8,del:Rf,emStrongLDelim:j8,emStrongRDelimAst:Q8,emStrongRDelimUnd:J8,escape:NO,link:t6,nolink:VO,punctuation:q8,reflink:FO,reflinkSearch:n6,tag:e6,text:G8,url:Rf},r6={...PC,link:Vt(/^!?\[(label)\]\((.*?)\)/).replace("label",Bb).getRegex(),reflink:Vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bb).getRegex()},IC={...PC,escape:Vt(NO).replace("])","~|])").getRegex(),url:Vt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},o6={...IC,br:Vt(UO).replace("{2,}","*").getRegex(),text:Vt(IC.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Wb={normal:TC,gfm:H8,pedantic:$8},kf={normal:PC,gfm:IC,breaks:o6,pedantic:r6},Ss=class o{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Hl,this.options.tokenizer=this.options.tokenizer||new yu,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={block:Wb.normal,inline:kf.normal};this.options.pedantic?(e.block=Wb.pedantic,e.inline=kf.pedantic):this.options.gfm&&(e.block=Wb.gfm,this.options.breaks?e.inline=kf.breaks:e.inline=kf.gfm),this.tokenizer.rules=e}static get rules(){return{block:Wb,inline:kf}}static lex(t,e){return new o(e).lex(t)}static lexInline(t,e){return new o(e).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
- `),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let n=this.inlineQueue[e];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let r,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,e))?(t=t.substring(r.raw.length),e.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&e.length>0?e[e.length-1].raw+=`
- `:e.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
- `+r.raw,i.text+=`
- `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),i=e[e.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
- `+r.raw,i.text+=`
- `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),e.push(r);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){i=e[e.length-1],n&&i?.type==="paragraph"?(i.raw+=`
- `+r.raw,i.text+=`
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r),n=s.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=e[e.length-1],i&&i.type==="text"?(i.raw+=`
- `+r.raw,i.text+=`
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(r);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,r,i,s=t,a,l,c;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),r=e[e.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),r=e[e.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),e.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0,p=t.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(u=Math.min(u,m))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,r=e[e.length-1],r&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):e.push(n);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return e}},bu=class{options;parser;constructor(t){this.options=t||Hl}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(/^\S*/)?.[0],i=t.replace(/\n$/,"")+`
- `;return r?'<pre><code class="language-'+Io(r)+'">'+(n?i:Io(i,!0))+`</code></pre>
- `:"<pre><code>"+(n?i:Io(i,!0))+`</code></pre>
- `}blockquote({tokens:t}){return`<blockquote>
- ${this.parser.parse(t)}</blockquote>
- `}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
- `}hr(t){return`<hr>
- `}list(t){let e=t.ordered,n=t.start,r="";for(let a=0;a<t.items.length;a++){let l=t.items[a];r+=this.listitem(l)}let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
- `+r+"</"+i+`>
- `}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens.length>0&&t.tokens[0].type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
- `}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
- <thead>
- `+e+`</thead>
- `+r+`</table>
- `}tablerow({text:t}){return`<tr>
- ${t}</tr>
- `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${t}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),i=TO(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+e+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n}){let r=TO(t);if(r===null)return n;t=r;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${e}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):t.text}},Df=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Es=class o{options;renderer;textRenderer;constructor(t){this.options=t||Hl,this.options.renderer=this.options.renderer||new bu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Df}static parse(t,e){return new o(e).parse(t)}static parseInline(t,e){return new o(e).parseInline(t)}parse(t,e=!0){let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=i,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=l||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);continue}case"hr":{n+=this.renderer.hr(s);continue}case"heading":{n+=this.renderer.heading(s);continue}case"code":{n+=this.renderer.code(s);continue}case"table":{n+=this.renderer.table(s);continue}case"blockquote":{n+=this.renderer.blockquote(s);continue}case"list":{n+=this.renderer.list(s);continue}case"html":{n+=this.renderer.html(s);continue}case"paragraph":{n+=this.renderer.paragraph(s);continue}case"text":{let a=s,l=this.renderer.text(a);for(;r+1<t.length&&t[r+1].type==="text";)a=t[++r],l+=`
- `+this.renderer.text(a);e?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):n+=l;continue}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case"escape":{n+=e.text(s);break}case"html":{n+=e.html(s);break}case"link":{n+=e.link(s);break}case"image":{n+=e.image(s);break}case"strong":{n+=e.strong(s);break}case"em":{n+=e.em(s);break}case"codespan":{n+=e.codespan(s);break}case"br":{n+=e.br(s);break}case"del":{n+=e.del(s);break}case"text":{n+=e.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},vu=class{options;constructor(t){this.options=t||Hl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}},xC=class{defaults=SC();options=this.setOptions;parse=this.parseMarkdown(Ss.lex,Es.parse);parseInline=this.parseMarkdown(Ss.lexInline,Es.parseInline);Parser=Es;Renderer=bu;TextRenderer=Df;Lexer=Ss;Tokenizer=yu;Hooks=vu;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{let i=r;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){let i=this.defaults.renderer||new bu(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=n.renderer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new yu(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=n.tokenizer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new vu;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;let a=s,l=n.hooks[a],c=i[a];vu.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(i,u)).then(m=>c.call(i,m));let p=l.call(i,u);return c.call(i,p)}:i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Ss.lex(t,e??this.defaults)}parser(t,e){return Es.parse(t,e??this.defaults)}parseMarkdown(t,e){return(r,i)=>{let s={...i},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(c=>t(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>e(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(l);try{a.hooks&&(r=a.hooks.preprocess(r));let c=t(r,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let u=e(c,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(c){return l(c)}}}onError(t,e){return n=>{if(n.message+=`
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Io(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Bl=new xC;Tt.options=Tt.setOptions=function(o){return Bl.setOptions(o),Tt.defaults=Bl.defaults,DO(Tt.defaults),Tt};Tt.getDefaults=SC;Tt.defaults=Hl;Tt.use=function(...o){return Bl.use(...o),Tt.defaults=Bl.defaults,DO(Tt.defaults),Tt};Tt.walkTokens=function(o,t){return Bl.walkTokens(o,t)};Tt.parseInline=Bl.parseInline;Tt.Parser=Es;Tt.parser=Es.parse;Tt.Renderer=bu;Tt.TextRenderer=Df;Tt.Lexer=Ss;Tt.lexer=Ss.lex;Tt.Tokenizer=yu;Tt.Hooks=vu;Tt.parse=Tt;dwe=Tt.options,uwe=Tt.setOptions,pwe=Tt.use,mwe=Tt.walkTokens,fwe=Tt.parseInline,gwe=Es.parse,hwe=Ss.lex});function*BO(o){let t=[o];for(;t.length>0;){let e=t.pop();if(yield e,e.children)for(let n of e.children.values())t.push(n)}}var wr,$b,Mf,HO=y(()=>{Ko();wr=Symbol("unset"),$b=class{constructor(){this.root=new Mf;this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||fn.empty()}get entries(){return this.root.children?.entries()||fn.empty()}insert(t,e,n){this.opNode(t,r=>r._value=e,n)}mutate(t,e){this.opNode(t,n=>n._value=e(n._value===wr?void 0:n._value))}mutatePath(t,e){this.opNode(t,()=>{},n=>e(n))}delete(t){let e=this.getPathToKey(t);if(!e)return;let n=e.length-1,r=e[n].node._value;if(r!==wr){for(this._size--,e[n].node._value=wr;n>0;n--){let{node:i,part:s}=e[n];if(i.children?.size||i._value!==wr)break;e[n-1].node.children.delete(s)}return r}}*deleteRecursive(t){let e=this.getPathToKey(t);if(!e)return;let n=e[e.length-1].node;for(let r=e.length-1;r>0;r--){let i=e[r-1];if(i.node.children.delete(e[r].part),i.node.children.size>0||i.node._value!==wr)break}for(let r of BO(n))r._value!==wr&&(this._size--,yield r._value);n===this.root&&(this.root._value=wr,this.root.children=void 0)}find(t){let e=this.root;for(let n of t){let r=e.children?.get(n);if(!r)return;e=r}return e._value===wr?void 0:e._value}hasKeyOrParent(t){let e=this.root;for(let n of t){let r=e.children?.get(n);if(!r)return!1;if(r._value!==wr)return!0;e=r}return!1}hasKeyOrChildren(t){let e=this.root;for(let n of t){let r=e.children?.get(n);if(!r)return!1;e=r}return!0}hasKey(t){let e=this.root;for(let n of t){let r=e.children?.get(n);if(!r)return!1;e=r}return e._value!==wr}getPathToKey(t){let e=[{part:"",node:this.root}],n=0;for(let r of t){let i=e[n].node.children?.get(r);if(!i)return;e.push({part:r,node:i}),n++}return e}opNode(t,e,n){let r=this.root;for(let a of t){if(r.children)if(r.children.has(a))r=r.children.get(a);else{let l=new Mf;r.children.set(a,l),r=l}else{let l=new Mf;r.children=new Map([[a,l]]),r=l}n?.(r)}let i=r._value===wr?0:1;e(r);let s=r._value===wr?0:1;this._size+=s-i}*values(){for(let{_value:t}of BO(this.root))t!==wr&&(yield t)}};Mf=class{constructor(){this._value=wr}get value(){return this._value===wr?void 0:this._value}set value(t){this._value=t===void 0?wr:t}}});var $O=y(()=>{de();q()});var zO,GO=y(()=>{de();zO=new class{constructor(){this._zoomLevel=0;this._onDidChangeZoomLevel=new P;this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(o){o=Math.min(Math.max(-5,o),20),this._zoomLevel!==o&&(this._zoomLevel=o,this._onDidChangeZoomLevel.fire(this._zoomLevel))}}});var s6,kC,RC,a6,zb,DC,_C,l6,c6,d6,ii,qO=y(()=>{me();GO();s6=rt?1.5:1.35,kC=8,RC=class o{constructor(t){this._bareFontInfoBrand=void 0;this.pixelRatio=t.pixelRatio,this.fontFamily=String(t.fontFamily),this.fontWeight=String(t.fontWeight),this.fontSize=t.fontSize,this.fontFeatureSettings=t.fontFeatureSettings,this.fontVariationSettings=t.fontVariationSettings,this.lineHeight=t.lineHeight|0,this.letterSpacing=t.letterSpacing}static _create(t,e,n,r,i,s,a,l,c){s===0?s=s6*n:s<kC&&(s=s*n),s=Math.round(s),s<kC&&(s=kC);let u=1+(c?0:zO.getZoomLevel()*.1);return n*=u,s*=u,i===_C&&(e==="normal"||e==="bold"?i=DC:(i=`'wght' ${parseInt(e,10)}`,e="normal")),new o({pixelRatio:l,fontFamily:t,fontWeight:e,fontSize:n,fontFeatureSettings:r,fontVariationSettings:i,lineHeight:s,letterSpacing:a})}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=ii.fontFamily,e=o._wrapInQuotes(this.fontFamily);return t&&this.fontFamily!==t?`${e}, ${t}`:e}static _wrapInQuotes(t){return/[,"']/.test(t)?t:/[+ ]/.test(t)?`"${t}"`:t}},a6=2,zb=class extends RC{constructor(e,n){super(e);this._editorStylingBrand=void 0;this.version=a6;this.isTrusted=n,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}},DC="normal",_C="translate",l6="Consolas, 'Courier New', monospace",c6="Menlo, Monaco, 'Courier New', monospace",d6="'Droid Sans Mono', monospace",ii={fontFamily:rt?c6:te?l6:d6,fontWeight:"normal",fontSize:rt?12:14,lineHeight:0,letterSpacing:0}});var LC,KO=y(()=>{LC={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}}});function u6(o=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(let e of MC)o.indexOf(e)>=0||(t+="\\"+e);return t+="\\s]+)",new RegExp(t,"g")}var MC,Owe,p6,jO=y(()=>{Ko();q();Kg();MC="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";Owe=u6(),p6=new As;p6.unshift({maxLen:1e3,windowSize:15,timeBudget:150})});var QO,Fwe,OC=y(()=>{mo();re();QO=_("accessibilityService"),Fwe=new S("accessibilityModeEnabled",!1)});function Gb(o,t){if(typeof o!="object"||typeof t!="object"||!o||!t)return new Iu(t,o!==t);if(Array.isArray(o)||Array.isArray(t)){let n=Array.isArray(o)&&Array.isArray(t)&&mn(o,t);return new Iu(t,!n)}let e=!1;for(let n in t)if(t.hasOwnProperty(n)){let r=Gb(o[n],t[n]);r.didChange&&(o[n]=r.newValue,e=!0)}return new Iu(o,e)}function X(o,t){return typeof o>"u"?t:o==="false"?!1:!!o}function f6(o,t,e,n){if(typeof o=="string"&&(o=parseInt(o,10)),typeof o!="number"||isNaN(o))return t;let r=o;return r=Math.max(e,r),r=Math.min(n,r),r|0}function ut(o,t,e,n){return typeof o!="string"?t:n&&o in n?n[o]:e.indexOf(o)===-1?t:o}function g6(o){switch(o){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}function h6(o){switch(o){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}function JO(o){switch(o){case"line":return 1;case"block":return 2;case"underline":return 3;case"line-thin":return 4;case"block-outline":return 5;case"underline-thin":return 6}}function v6(o){return o==="ctrlCmd"?rt?"metaKey":"ctrlKey":"altKey"}function XO(o,t){if(typeof o!="string")return t;switch(o){case"hidden":return 2;case"visible":return 3;default:return 1}}function xu(o,t,e){let n=e.indexOf(o);return n===-1?t:e[n]}function R(o){return y6[o.id]=o,o}var m6,AC,pt,Iu,Ai,ka,ge,qe,jr,Gn,dt,zl,NC,UC,FC,VC,WC,BC,HC,$C,zC,GC,qC,KC,jC,QC,JC,XC,YC,ZC,eT,tT,nT,rT,oT,iT,sT,aT,lT,cT,dT,uT,pT,mT,si,$l,fT,gT,hT,vT,yT,bT,IT,xT,ST,ET,wT,y6,jwe,YO=y(()=>{At();on();me();$O();Nx();qO();KO();jO();pe();OC();m6=8,AC=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},pt=class{constructor(t,e,n,r){this.id=t,this.name=e,this.defaultValue=n,this.schema=r}applyUpdate(t,e){return Gb(t,e)}compute(t,e,n){return n}},Iu=class{constructor(t,e){this.newValue=t;this.didChange=e}};Ai=class{constructor(t,e){this.schema=void 0;this.id=t,this.name="_never_",this.defaultValue=e}applyUpdate(t,e){return Gb(t,e)}validate(t){return this.defaultValue}},ka=class{constructor(t,e,n,r){this.id=t,this.name=e,this.defaultValue=n,this.schema=r}applyUpdate(t,e){return Gb(t,e)}compute(t,e,n){return n}};ge=class extends ka{constructor(t,e,n,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=n),super(t,e,n,r)}validate(t){return X(t,this.defaultValue)}};qe=class o extends ka{static clampedInt(t,e,n,r){return f6(t,e,n,r)}constructor(t,e,n,r,i,s=void 0){typeof s<"u"&&(s.type="integer",s.default=n,s.minimum=r,s.maximum=i),super(t,e,n,s),this.minimum=r,this.maximum=i}validate(t){return o.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}},jr=class o extends ka{static clamp(t,e,n){return t<e?e:t>n?n:t}static float(t,e){return typeof t=="string"&&(t=parseFloat(t)),typeof t!="number"||isNaN(t)?e:t}constructor(t,e,n,r,i,s,a){typeof i<"u"&&(i.type="number",i.default=n,i.minimum=s,i.maximum=a),super(t,e,n,i),this.validationFn=r,this.minimum=s,this.maximum=a}validate(t){return this.validationFn(o.float(t,this.defaultValue))}},Gn=class o extends ka{static string(t,e){return typeof t!="string"?e:t}constructor(t,e,n,r=void 0){typeof r<"u"&&(r.type="string",r.default=n),super(t,e,n,r)}validate(t){return o.string(t,this.defaultValue)}};dt=class extends ka{constructor(t,e,n,r,i=void 0){typeof i<"u"&&(i.type="string",i.enum=r.slice(0),i.default=n),super(t,e,n,i),this._allowedValues=r}validate(t){return ut(t,this.defaultValue,this._allowedValues)}},zl=class extends pt{constructor(t,e,n,r,i,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=i,a.default=r),super(t,e,n,a),this._allowedValues=i,this._convert=s}validate(t){return typeof t!="string"?this.defaultValue:this._allowedValues.indexOf(t)===-1?this.defaultValue:this._convert(t)}};NC=class extends pt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[d(93,null),d(95,null),d(94,null)],default:"auto",tags:["accessibility"],description:d(92,null)})}validate(t){switch(t){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(t,e,n){return n===0?t.accessibilitySupport:n}},UC=class extends pt{constructor(){let t={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",t,{"editor.comments.insertSpace":{type:"boolean",default:t.insertSpace,description:d(123,null)},"editor.comments.ignoreEmptyLines":{type:"boolean",default:t.ignoreEmptyLines,description:d(122,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{insertSpace:X(e.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:X(e.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};FC=class extends Ai{constructor(){super(162,"")}compute(t,e,n){let r=["monaco-editor"];return e.get(48)&&r.push(e.get(48)),t.extraEditorClassName&&r.push(t.extraEditorClassName),e.get(82)==="default"?r.push("mouse-default"):e.get(82)==="copy"&&r.push("mouse-copy"),e.get(127)&&r.push("showUnused"),e.get(157)&&r.push("showDeprecated"),r.join(" ")}},VC=class extends ge{constructor(){super(45,"emptySelectionClipboard",!0,{description:d(246,null)})}compute(t,e,n){return n&&t.emptySelectionClipboard}},WC=class extends pt{constructor(){let t={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,closeOnResult:!1,history:"workspace",replaceHistory:"workspace"};super(50,"find",t,{"editor.find.cursorMoveOnType":{type:"boolean",default:t.cursorMoveOnType,description:d(259,null)},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:t.seedSearchStringFromSelection,enumDescriptions:[d(182,null),d(181,null),d(183,null)],description:d(265,null)},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:t.autoFindInSelection,enumDescriptions:[d(176,null),d(174,null),d(175,null)],description:d(257,null)},"editor.find.globalFindClipboard":{type:"boolean",default:t.globalFindClipboard,description:d(261,null),included:rt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:t.addExtraSpaceOnTop,description:d(256,null)},"editor.find.loop":{type:"boolean",default:t.loop,description:d(263,null)},"editor.find.closeOnResult":{type:"boolean",default:t.closeOnResult,description:d(258,null)},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[d(177,null),d(178,null)],description:d(262,null)},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[d(179,null),d(180,null)],description:d(264,null)},"editor.find.findOnType":{type:"boolean",default:t.findOnType,description:d(260,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{cursorMoveOnType:X(e.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:X(e.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":ut(e.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":ut(e.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:X(e.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:X(e.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:X(e.loop,this.defaultValue.loop),closeOnResult:X(e.closeOnResult,this.defaultValue.closeOnResult),history:ut(e.history,this.defaultValue.history,["never","workspace"]),replaceHistory:ut(e.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}},BC=class o extends pt{static{this.OFF='"liga" off, "calt" off'}static{this.ON='"liga" on, "calt" on'}constructor(){super(60,"fontLigatures",o.OFF,{anyOf:[{type:"boolean",description:d(275,null)},{type:"string",description:d(274,null)}],description:d(276,null),default:!1})}validate(t){return typeof t>"u"?this.defaultValue:typeof t=="string"?t==="false"||t.length===0?o.OFF:t==="true"?o.ON:t:t?o.ON:o.OFF}},HC=class o extends pt{static{this.OFF=DC}static{this.TRANSLATE=_C}constructor(){super(63,"fontVariations",o.OFF,{anyOf:[{type:"boolean",description:d(278,null)},{type:"string",description:d(279,null)}],description:d(280,null),default:!1})}validate(t){return typeof t>"u"?this.defaultValue:typeof t=="string"?t==="false"?o.OFF:t==="true"?o.TRANSLATE:t:t?o.TRANSLATE:o.OFF}compute(t,e,n){return t.fontInfo.fontVariationSettings}},$C=class extends Ai{constructor(){super(59,new zb({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(t,e,n){return t.fontInfo}},zC=class extends Ai{constructor(){super(161,1)}compute(t,e,n){return t.inputMode==="overtype"?e.get(92):e.get(34)}},GC=class extends Ai{constructor(){super(170,!1)}compute(t,e){return t.editContextSupported&&e.get(44)}},qC=class extends Ai{constructor(){super(172,!1)}compute(t,e){return t.accessibilitySupport===2?e.get(7):e.get(6)}},KC=class extends ka{constructor(){super(61,"fontSize",ii.fontSize,{type:"number",minimum:6,maximum:100,default:ii.fontSize,description:d(277,null)})}validate(t){let e=jr.float(t,this.defaultValue);return e===0?ii.fontSize:jr.clamp(e,6,100)}compute(t,e,n){return t.fontInfo.fontSize}},jC=class o extends pt{static{this.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(62,"fontWeight",ii.fontWeight,{anyOf:[{type:"number",minimum:o.MINIMUM_VALUE,maximum:o.MAXIMUM_VALUE,errorMessage:d(282,null)},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:o.SUGGESTION_VALUES}],default:ii.fontWeight,description:d(281,null)})}validate(t){return t==="normal"||t==="bold"?t:String(qe.clampedInt(t,ii.fontWeight,o.MINIMUM_VALUE,o.MAXIMUM_VALUE))}},QC=class extends pt{constructor(){let t={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},e={type:"string",enum:["peek","gotoAndPeek","goto"],default:t.multiple,enumDescriptions:[d(187,null),d(186,null),d(185,null)]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",t,{"editor.gotoLocation.multiple":{deprecationMessage:d(184,null)},"editor.gotoLocation.multipleDefinitions":{description:d(170,null),...e},"editor.gotoLocation.multipleTypeDefinitions":{description:d(173,null),...e},"editor.gotoLocation.multipleDeclarations":{description:d(169,null),...e},"editor.gotoLocation.multipleImplementations":{description:d(171,null),...e},"editor.gotoLocation.multipleReferences":{description:d(172,null),...e},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:t.alternativeDefinitionCommand,enum:n,description:d(100,null)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:t.alternativeTypeDefinitionCommand,enum:n,description:d(103,null)},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:t.alternativeDeclarationCommand,enum:n,description:d(99,null)},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:t.alternativeImplementationCommand,enum:n,description:d(101,null)},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:t.alternativeReferenceCommand,enum:n,description:d(102,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{multiple:ut(e.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:ut(e.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:ut(e.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:ut(e.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:ut(e.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:ut(e.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:ut(e.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Gn.string(e.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Gn.string(e.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Gn.string(e.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Gn.string(e.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Gn.string(e.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Gn.string(e.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},JC=class extends pt{constructor(){let t={enabled:"on",delay:300,hidingDelay:300,sticky:!0,above:!0,showLongLineWarning:!0};super(69,"hover",t,{"editor.hover.enabled":{type:"string",enum:["on","off","onKeyboardModifier"],default:t.enabled,markdownEnumDescriptions:[d(291,null),d(290,null),d(292,null,rt?"Command":"Control")],description:d(289,null)},"editor.hover.delay":{type:"number",default:t.delay,minimum:0,maximum:1e4,description:d(288,null)},"editor.hover.sticky":{type:"boolean",default:t.sticky,description:d(295,null)},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:t.hidingDelay,markdownDescription:d(293,null)},"editor.hover.above":{type:"boolean",default:t.above,description:d(287,null)},"editor.hover.showLongLineWarning":{type:"boolean",default:t.showLongLineWarning,description:d(294,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:ut(e.enabled,this.defaultValue.enabled,["on","off","onKeyboardModifier"]),delay:qe.clampedInt(e.delay,this.defaultValue.delay,0,1e4),sticky:X(e.sticky,this.defaultValue.sticky),hidingDelay:qe.clampedInt(e.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:X(e.above,this.defaultValue.above),showLongLineWarning:X(e.showLongLineWarning,this.defaultValue.showLongLineWarning)}}},XC=class o extends Ai{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,e,n){return o.computeLayout(e,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(t){let e=t.height/t.lineHeight,n=Math.floor(t.paddingTop/t.lineHeight),r=Math.floor(t.paddingBottom/t.lineHeight);t.scrollBeyondLastLine&&(r=Math.max(r,e-1));let i=(n+t.viewLineCount+r)/(t.pixelRatio*t.height),s=Math.floor(t.viewLineCount/i);return{typicalViewportLineCount:e,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:i,minimapLineCount:s}}static _computeMinimapLayout(t,e){let n=t.outerWidth,r=t.outerHeight,i=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(i*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};let s=e.stableMinimapLayoutInput,a=s&&t.outerHeight===s.outerHeight&&t.lineHeight===s.lineHeight&&t.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&t.pixelRatio===s.pixelRatio&&t.scrollBeyondLastLine===s.scrollBeyondLastLine&&t.paddingTop===s.paddingTop&&t.paddingBottom===s.paddingBottom&&t.minimap.enabled===s.minimap.enabled&&t.minimap.side===s.minimap.side&&t.minimap.size===s.minimap.size&&t.minimap.showSlider===s.minimap.showSlider&&t.minimap.renderCharacters===s.minimap.renderCharacters&&t.minimap.maxColumn===s.minimap.maxColumn&&t.minimap.scale===s.minimap.scale&&t.verticalScrollbarWidth===s.verticalScrollbarWidth&&t.isViewportWrapping===s.isViewportWrapping,l=t.lineHeight,c=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,p=t.minimap.renderCharacters,m=i>=2?Math.round(t.minimap.scale*2):t.minimap.scale,g=t.minimap.maxColumn,h=t.minimap.size,v=t.minimap.side,x=t.verticalScrollbarWidth,T=t.viewLineCount,w=t.remainingWidth,k=t.isViewportWrapping,M=p?2:3,B=Math.floor(i*r),He=B/i,U=!1,Y=!1,G=M*m,W=m/i,ee=1;if(h==="fill"||h==="fit"){let{typicalViewportLineCount:Z,extraLinesBeforeFirstLine:ae,extraLinesBeyondLastLine:ve,desiredRatio:Ie,minimapLineCount:mt}=o.computeContainedMinimapLineCount({viewLineCount:T,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:r,lineHeight:l,pixelRatio:i});if(T/mt>1)U=!0,Y=!0,m=1,G=1,W=m/i;else{let ft=!1,Pt=m+1;if(h==="fit"){let Dt=Math.ceil((ae+T+ve)*G);k&&a&&w<=e.stableFitRemainingWidth?(ft=!0,Pt=e.stableFitMaxMinimapScale):ft=Dt>B}if(h==="fill"||ft){U=!0;let Dt=m;G=Math.min(l*i,Math.max(1,Math.floor(1/Ie))),k&&a&&w<=e.stableFitRemainingWidth&&(Pt=e.stableFitMaxMinimapScale),m=Math.min(Pt,Math.max(1,Math.floor(G/M))),m>Dt&&(ee=Math.min(2,m/Dt)),W=m/i/ee,B=Math.ceil(Math.max(Z,ae+T+ve)*G),k?(e.stableMinimapLayoutInput=t,e.stableFitRemainingWidth=w,e.stableFitMaxMinimapScale=m):(e.stableMinimapLayoutInput=null,e.stableFitRemainingWidth=0)}}}let se=Math.floor(g*W),Ht=Math.min(se,Math.max(0,Math.floor((w-x-2)*W/(c+W)))+m6),ct=Math.floor(i*Ht),$=ct/i;ct=Math.floor(ct*ee);let V=p?1:2,K=v==="left"?0:n-Ht-x;return{renderMinimap:V,minimapLeft:K,minimapWidth:Ht,minimapHeightIsEditorHeight:U,minimapIsSampling:Y,minimapScale:m,minimapLineHeight:G,minimapCanvasInnerWidth:ct,minimapCanvasInnerHeight:B,minimapCanvasOuterWidth:$,minimapCanvasOuterHeight:He}}static computeLayout(t,e){let n=e.outerWidth|0,r=e.outerHeight|0,i=e.lineHeight|0,s=e.lineNumbersDigitCount|0,a=e.typicalHalfwidthCharacterWidth,l=e.maxDigitWidth,c=e.pixelRatio,u=e.viewLineCount,p=t.get(154),m=p==="inherit"?t.get(153):p,g=m==="inherit"?t.get(149):m,h=t.get(152),v=e.isDominatedByLongLines,x=t.get(66),T=t.get(76).renderType!==0,w=t.get(77),k=t.get(119),M=t.get(96),B=t.get(81),He=t.get(117),U=He.verticalScrollbarSize,Y=He.verticalHasArrows,G=He.arrowSize,W=He.horizontalScrollbarSize,ee=t.get(52),se=t.get(126)!=="never",Ht=t.get(74);ee&&se&&(Ht+=16);let ct=0;if(T){let Zr=Math.max(s,w);ct=Math.round(Zr*l)}let $=0;x&&($=i*e.glyphMarginDecorationLaneCount);let V=0,K=V+$,Z=K+ct,ae=Z+Ht,ve=n-$-ct-Ht,Ie=!1,mt=!1,Ne=-1;t.get(2)===2&&m==="inherit"&&v?(Ie=!0,mt=!0):g==="on"||g==="bounded"?mt=!0:g==="wordWrapColumn"&&(Ne=h);let ft=o._computeMinimapLayout({outerWidth:n,outerHeight:r,lineHeight:i,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:k,paddingTop:M.top,paddingBottom:M.bottom,minimap:B,verticalScrollbarWidth:U,viewLineCount:u,remainingWidth:ve,isViewportWrapping:mt},e.memory||new AC);ft.renderMinimap!==0&&ft.minimapLeft===0&&(V+=ft.minimapWidth,K+=ft.minimapWidth,Z+=ft.minimapWidth,ae+=ft.minimapWidth);let Pt=ve-ft.minimapWidth,Dt=Math.max(1,Math.floor((Pt-U-2)/a)),En=Y?G:0;return mt&&(Ne=Math.max(1,Dt),g==="bounded"&&(Ne=Math.min(Ne,h))),{width:n,height:r,glyphMarginLeft:V,glyphMarginWidth:$,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount,lineNumbersLeft:K,lineNumbersWidth:ct,decorationsLeft:Z,decorationsWidth:Ht,contentLeft:ae,contentWidth:Pt,minimap:ft,viewportColumn:Dt,isWordWrapMinified:Ie,isViewportWrapping:mt,wrappingColumn:Ne,verticalScrollbarWidth:U,horizontalScrollbarHeight:W,overviewRuler:{top:En,width:U,height:r-2*En,right:0}}}},YC=class extends pt{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[d(508,null),d(507,null)],type:"string",enum:["simple","advanced"],default:"simple",description:d(506,null)}})}validate(t){return ut(t,"simple",["simple","advanced"])}compute(t,e,n){return e.get(2)===2?"advanced":n}},ZC=class extends pt{constructor(){let t={enabled:"onCode"};super(73,"lightbulb",t,{"editor.lightbulb.enabled":{type:"string",enum:["off","onCode","on"],default:t.enabled,enumDescriptions:[d(208,null),d(210,null),d(209,null)],description:d(247,null)}})}validate(t){return!t||typeof t!="object"?this.defaultValue:{enabled:ut(t.enabled,this.defaultValue.enabled,["off","onCode","on"])}}},eT=class extends pt{constructor(){let t={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",t,{"editor.stickyScroll.enabled":{type:"boolean",default:t.enabled,description:d(212,null)},"editor.stickyScroll.maxLineCount":{type:"number",default:t.maxLineCount,minimum:1,maximum:20,description:d(213,null)},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:t.defaultModel,description:d(211,null)},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:t.scrollWithEditor,description:d(214,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:X(e.enabled,this.defaultValue.enabled),maxLineCount:qe.clampedInt(e.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:ut(e.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:X(e.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},tT=class extends pt{constructor(){let t={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",t,{"editor.inlayHints.enabled":{type:"string",default:t.enabled,description:d(297,null),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[d(204,null),d(205,null,rt?"Ctrl+Option":"Ctrl+Alt"),d(203,null,rt?"Ctrl+Option":"Ctrl+Alt"),d(202,null)]},"editor.inlayHints.fontSize":{type:"number",default:t.fontSize,markdownDescription:d(299,null,"`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:t.fontFamily,markdownDescription:d(298,null,"`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:t.padding,description:d(301,null)},"editor.inlayHints.maximumLength":{type:"number",default:t.maximumLength,markdownDescription:d(300,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return typeof e.enabled=="boolean"&&(e.enabled=e.enabled?"on":"off"),{enabled:ut(e.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:qe.clampedInt(e.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Gn.string(e.fontFamily,this.defaultValue.fontFamily),padding:X(e.padding,this.defaultValue.padding),maximumLength:qe.clampedInt(e.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}},nT=class extends pt{constructor(){super(74,"lineDecorationsWidth",10)}validate(t){return typeof t=="string"&&/^\d+(\.\d+)?ch$/.test(t)?-parseFloat(t.substring(0,t.length-2)):qe.clampedInt(t,this.defaultValue,0,1e3)}compute(t,e,n){return n<0?qe.clampedInt(-n*t.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},rT=class extends jr{constructor(){super(75,"lineHeight",ii.lineHeight,t=>jr.clamp(t,0,150),{markdownDescription:d(323,null)},0,150)}compute(t,e,n){return t.fontInfo.lineHeight}},oT=class extends pt{constructor(){let t={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",t,{"editor.minimap.enabled":{type:"boolean",default:t.enabled,description:d(336,null)},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[d(334,null),d(333,null),d(335,null)],default:t.autohide,description:d(332,null)},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[d(350,null),d(348,null),d(349,null)],default:t.size,description:d(347,null)},"editor.minimap.side":{type:"string",enum:["left","right"],default:t.side,description:d(346,null)},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:t.showSlider,description:d(345,null)},"editor.minimap.scale":{type:"number",default:t.scale,minimum:1,maximum:3,enum:[1,2,3],description:d(340,null)},"editor.minimap.renderCharacters":{type:"boolean",default:t.renderCharacters,description:d(339,null)},"editor.minimap.maxColumn":{type:"number",default:t.maxColumn,description:d(338,null)},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:t.showRegionSectionHeaders,description:d(344,null)},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:t.showMarkSectionHeaders,description:d(343,null)},"editor.minimap.markSectionHeaderRegex":{type:"string",default:t.markSectionHeaderRegex,description:d(337,null)},"editor.minimap.sectionHeaderFontSize":{type:"number",default:t.sectionHeaderFontSize,description:d(341,null)},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:t.sectionHeaderLetterSpacing,description:d(342,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t,n=this.defaultValue.markSectionHeaderRegex,r=e.markSectionHeaderRegex;if(typeof r=="string")try{new RegExp(r,"d"),n=r}catch{}return{enabled:X(e.enabled,this.defaultValue.enabled),autohide:ut(e.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:ut(e.size,this.defaultValue.size,["proportional","fill","fit"]),side:ut(e.side,this.defaultValue.side,["right","left"]),showSlider:ut(e.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:X(e.renderCharacters,this.defaultValue.renderCharacters),scale:qe.clampedInt(e.scale,1,1,3),maxColumn:qe.clampedInt(e.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:X(e.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:X(e.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:jr.clamp(jr.float(e.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:jr.clamp(jr.float(e.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};iT=class extends pt{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:d(375,null)},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:d(374,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{top:qe.clampedInt(e.top,0,0,1e3),bottom:qe.clampedInt(e.bottom,0,0,1e3)}}},sT=class extends pt{constructor(){let t={enabled:!0,cycle:!0};super(98,"parameterHints",t,{"editor.parameterHints.enabled":{type:"boolean",default:t.enabled,description:d(377,null)},"editor.parameterHints.cycle":{type:"boolean",default:t.cycle,description:d(376,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:X(e.enabled,this.defaultValue.enabled),cycle:X(e.cycle,this.defaultValue.cycle)}}},aT=class extends Ai{constructor(){super(163,1)}compute(t,e,n){return t.pixelRatio}},lT=class extends pt{constructor(){super(100,"placeholder",void 0)}validate(t){return typeof t>"u"?this.defaultValue:typeof t=="string"?t:this.defaultValue}},cT=class extends pt{constructor(){let t={other:"on",comments:"off",strings:"off"},e=[{type:"boolean"},{type:"string",enum:["on","inline","off","offWhenInlineCompletions"],enumDescriptions:[d(370,null),d(302,null),d(368,null),d(369,null)]}];super(102,"quickSuggestions",t,{anyOf:[{type:"boolean"},{type:"string",enum:["on","inline","off","offWhenInlineCompletions"],enumDescriptions:[d(392,null),d(389,null),d(390,null),d(391,null)]},{type:"object",additionalProperties:!1,properties:{strings:{anyOf:e,default:t.strings,description:d(388,null)},comments:{anyOf:e,default:t.comments,description:d(386,null)},other:{anyOf:e,default:t.other,description:d(387,null)}}}],default:t,markdownDescription:d(385,null,"`#editor.suggestOnTriggerCharacters#`"),experiment:{mode:"auto"}}),this.defaultValue=t}validate(t){if(typeof t=="boolean"){let c=t?"on":"off";return{comments:c,strings:c,other:c}}if(typeof t=="string"){let c=["on","inline","off","offWhenInlineCompletions"],u=ut(t,this.defaultValue.other,c);return{comments:u,strings:u,other:u}}if(!t||typeof t!="object")return this.defaultValue;let{other:e,comments:n,strings:r}=t,i=["on","inline","off","offWhenInlineCompletions"],s,a,l;return typeof e=="boolean"?s=e?"on":"off":s=ut(e,this.defaultValue.other,i),typeof n=="boolean"?a=n?"on":"off":a=ut(n,this.defaultValue.comments,i),typeof r=="boolean"?l=r?"on":"off":l=ut(r,this.defaultValue.strings,i),{other:s,comments:a,strings:l}}},dT=class extends pt{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[d(326,null),d(327,null),d(328,null),d(325,null)],default:"on",description:d(324,null)})}validate(t){let e=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof t<"u"&&(typeof t=="function"?(e=4,n=t):t==="interval"?e=3:t==="relative"?e=2:t==="on"?e=1:e=0),{renderType:e,renderFn:n}}},uT=class extends pt{constructor(){let t=[],e={type:"number",description:d(409,null)};super(116,"rulers",t,{type:"array",items:{anyOf:[e,{type:["object"],properties:{column:e,color:{type:"string",description:d(408,null),format:"color-hex"}}}]},default:t,description:d(407,null)})}validate(t){if(Array.isArray(t)){let e=[];for(let n of t)if(typeof n=="number")e.push({column:qe.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){let r=n;e.push({column:qe.clampedInt(r.column,0,0,1e4),color:r.color})}return e.sort((n,r)=>n.column-r.column),e}return this.defaultValue}},pT=class extends pt{constructor(){super(105,"readOnlyMessage",void 0)}validate(t){return!t||typeof t!="object"?this.defaultValue:t}};mT=class extends pt{constructor(){let t={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(117,"scrollbar",t,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[d(419,null),d(421,null),d(420,null)],default:"auto",description:d(418,null)},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[d(412,null),d(414,null),d(413,null)],default:"auto",description:d(411,null)},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:t.verticalScrollbarSize,description:d(422,null)},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:t.horizontalScrollbarSize,description:d(415,null)},"editor.scrollbar.scrollByPage":{type:"boolean",default:t.scrollByPage,description:d(417,null)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:t.ignoreHorizontalScrollbarInContentHeight,description:d(416,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t,n=qe.clampedInt(e.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=qe.clampedInt(e.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:qe.clampedInt(e.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:XO(e.vertical,this.defaultValue.vertical),horizontal:XO(e.horizontal,this.defaultValue.horizontal),useShadows:X(e.useShadows,this.defaultValue.useShadows),verticalHasArrows:X(e.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:X(e.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:X(e.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:X(e.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:qe.clampedInt(e.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:qe.clampedInt(e.verticalSliderSize,r,0,1e3),scrollByPage:X(e.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:X(e.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},si="inUntrustedWorkspace",$l={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"},fT=class extends pt{constructor(){let t={nonBasicASCII:si,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:si,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",t,{[$l.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,si],default:t.nonBasicASCII,description:d(483,null)},[$l.invisibleCharacters]:{restricted:!0,type:"boolean",default:t.invisibleCharacters,description:d(482,null)},[$l.ambiguousCharacters]:{restricted:!0,type:"boolean",default:t.ambiguousCharacters,description:d(479,null)},[$l.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,si],default:t.includeComments,description:d(480,null)},[$l.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,si],default:t.includeStrings,description:d(481,null)},[$l.allowedCharacters]:{restricted:!0,type:"object",default:t.allowedCharacters,description:d(477,null),additionalProperties:{type:"boolean"}},[$l.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:t.allowedLocales,description:d(478,null)}})}applyUpdate(t,e){let n=!1;e.allowedCharacters&&t&&(Ut(t.allowedCharacters,e.allowedCharacters)||(t={...t,allowedCharacters:e.allowedCharacters},n=!0)),e.allowedLocales&&t&&(Ut(t.allowedLocales,e.allowedLocales)||(t={...t,allowedLocales:e.allowedLocales},n=!0));let r=super.applyUpdate(t,e);return n?new Iu(r.newValue,!0):r}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{nonBasicASCII:xu(e.nonBasicASCII,si,[!0,!1,si]),invisibleCharacters:X(e.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:X(e.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:xu(e.includeComments,si,[!0,!1,si]),includeStrings:xu(e.includeStrings,si,[!0,!1,si]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(t,e){if(typeof t!="object"||!t)return e;let n={};for(let[r,i]of Object.entries(t))i===!0&&(n[r]=!0);return n}},gT=class extends pt{constructor(){let t={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always",showLongDistanceHint:!0},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",t,{"editor.inlineSuggest.enabled":{type:"boolean",default:t.enabled,description:d(309,null)},"editor.inlineSuggest.showToolbar":{type:"string",default:t.showToolbar,enum:["always","onHover","never"],enumDescriptions:[d(314,null),d(316,null),d(315,null)],description:d(313,null)},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:t.syntaxHighlightingEnabled,description:d(320,null)},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:t.suppressSuggestions,description:d(319,null)},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:t.suppressInSnippetMode,description:d(318,null)},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:d(311,null)},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:t.experimental.suppressInlineSuggestions,tags:["experimental"],description:d(317,null),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:t.experimental.emptyResponseInformation,tags:["experimental"],description:d(308,null),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:t.triggerCommandOnProviderChange,tags:["experimental"],description:d(321,null),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:t.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:d(312,null),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:t.fontFamily,description:d(310,null)},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:t.edits.allowCodeShifting,description:d(304,null),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showLongDistanceHint":{type:"boolean",default:t.edits.showLongDistanceHint,description:d(307,null),tags:["nextEditSuggestions","experimental"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:t.edits.renderSideBySide,description:d(305,null),enum:["auto","never"],enumDescriptions:[d(206,null),d(207,null)],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:t.edits.showCollapsed,description:d(306,null),tags:["nextEditSuggestions"]}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:X(e.enabled,this.defaultValue.enabled),mode:ut(e.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:ut(e.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:X(e.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:X(e.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Gn.string(e.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:X(e.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:qe.clampedInt(e.minShowDelay,0,0,1e4),suppressInSnippetMode:X(e.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(e.edits),triggerCommandOnProviderChange:X(e.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(e.experimental)}}_validateEdits(t){if(!t||typeof t!="object")return this.defaultValue.edits;let e=t;return{enabled:X(e.enabled,this.defaultValue.edits.enabled),showCollapsed:X(e.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:ut(e.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),showLongDistanceHint:X(e.showLongDistanceHint,this.defaultValue.edits.showLongDistanceHint),renderSideBySide:ut(e.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])}}_validateExperimental(t){if(!t||typeof t!="object")return this.defaultValue.experimental;let e=t;return{suppressInlineSuggestions:Gn.string(e.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:ut(e.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:X(e.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},hT=class extends pt{constructor(){let t={enabled:LC.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:LC.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",t,{"editor.bracketPairColorization.enabled":{type:"boolean",default:t.enabled,markdownDescription:d(113,null,"`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:t.independentColorPoolPerBracketType,description:d(114,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:X(e.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:X(e.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},vT=class extends pt{constructor(){let t={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",t,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[d(191,null),d(189,null),d(190,null)],default:t.bracketPairs,description:d(188,null)},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[d(195,null),d(193,null),d(194,null)],default:t.bracketPairsHorizontal,description:d(192,null)},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:t.highlightActiveBracketPair,description:d(196,null)},"editor.guides.indentation":{type:"boolean",default:t.indentation,description:d(201,null)},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[d(200,null),d(198,null),d(199,null)],default:t.highlightActiveIndentation,description:d(197,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{bracketPairs:xu(e.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:xu(e.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:X(e.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:X(e.indentation,this.defaultValue.indentation),highlightActiveIndentation:xu(e.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}};yT=class extends pt{constructor(){let t={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(134,"suggest",t,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[d(449,null),d(451,null)],default:t.insertMode,description:d(447,null)},"editor.suggest.filterGraceful":{type:"boolean",default:t.filterGraceful,description:d(446,null)},"editor.suggest.localityBonus":{type:"boolean",default:t.localityBonus,description:d(454,null)},"editor.suggest.shareSuggestSelections":{type:"boolean",default:t.shareSuggestSelections,markdownDescription:d(458,null)},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[d(448,null),d(450,null),d(453,null),d(452,null)],default:t.selectionMode,markdownDescription:d(457,null,"`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:t.snippetsPreventQuickSuggestions,description:d(462,null)},"editor.suggest.showIcons":{type:"boolean",default:t.showIcons,description:d(459,null)},"editor.suggest.showStatusBar":{type:"boolean",default:t.showStatusBar,description:d(461,null)},"editor.suggest.preview":{type:"boolean",default:t.preview,description:d(456,null)},"editor.suggest.showInlineDetails":{type:"boolean",default:t.showInlineDetails,description:d(460,null)},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:d(455,null)},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:d(139,null)},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:d(232,null)},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:d(228,null)},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:d(219,null)},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:d(221,null)},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:d(215,null)},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:d(225,null)},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:d(244,null)},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:d(216,null)},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:d(238,null)},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:d(229,null)},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:d(233,null)},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:d(235,null)},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:d(224,null)},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:d(234,null)},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:d(241,null)},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:d(243,null)},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:d(218,null)},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:d(223,null)},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:d(222,null)},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:d(231,null)},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:d(239,null)},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:d(217,null)},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:d(226,null)},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:d(236,null)},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:d(220,null)},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:d(227,null)},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:d(240,null)},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:d(237,null)},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:d(242,null)},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:d(230,null)}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{insertMode:ut(e.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:X(e.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:X(e.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:X(e.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:X(e.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:ut(e.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:X(e.showIcons,this.defaultValue.showIcons),showStatusBar:X(e.showStatusBar,this.defaultValue.showStatusBar),preview:X(e.preview,this.defaultValue.preview),previewMode:ut(e.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:X(e.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:X(e.showMethods,this.defaultValue.showMethods),showFunctions:X(e.showFunctions,this.defaultValue.showFunctions),showConstructors:X(e.showConstructors,this.defaultValue.showConstructors),showDeprecated:X(e.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:X(e.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:X(e.showFields,this.defaultValue.showFields),showVariables:X(e.showVariables,this.defaultValue.showVariables),showClasses:X(e.showClasses,this.defaultValue.showClasses),showStructs:X(e.showStructs,this.defaultValue.showStructs),showInterfaces:X(e.showInterfaces,this.defaultValue.showInterfaces),showModules:X(e.showModules,this.defaultValue.showModules),showProperties:X(e.showProperties,this.defaultValue.showProperties),showEvents:X(e.showEvents,this.defaultValue.showEvents),showOperators:X(e.showOperators,this.defaultValue.showOperators),showUnits:X(e.showUnits,this.defaultValue.showUnits),showValues:X(e.showValues,this.defaultValue.showValues),showConstants:X(e.showConstants,this.defaultValue.showConstants),showEnums:X(e.showEnums,this.defaultValue.showEnums),showEnumMembers:X(e.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:X(e.showKeywords,this.defaultValue.showKeywords),showWords:X(e.showWords,this.defaultValue.showWords),showColors:X(e.showColors,this.defaultValue.showColors),showFiles:X(e.showFiles,this.defaultValue.showFiles),showReferences:X(e.showReferences,this.defaultValue.showReferences),showFolders:X(e.showFolders,this.defaultValue.showFolders),showTypeParameters:X(e.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:X(e.showSnippets,this.defaultValue.showSnippets),showUsers:X(e.showUsers,this.defaultValue.showUsers),showIssues:X(e.showIssues,this.defaultValue.showIssues)}}},bT=class extends pt{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:d(431,null),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:d(432,null),default:!0,type:"boolean"}})}validate(t){return!t||typeof t!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:X(t.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:X(t.selectSubwords,this.defaultValue.selectSubwords)}}},IT=class extends pt{constructor(){let t=[];super(147,"wordSegmenterLocales",t,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:d(492,null),type:"array",items:{type:"string"},default:t})}validate(t){if(typeof t=="string"&&(t=[t]),Array.isArray(t)){let e=[];for(let n of t)if(typeof n=="string")try{Intl.Segmenter.supportedLocalesOf(n).length>0&&e.push(n)}catch{}return e}return this.defaultValue}},xT=class extends pt{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[d(504,null),d(505,null),d(503,null),d(502,null)],description:d(501,null),default:"same"}})}validate(t){switch(t){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(t,e,n){return e.get(2)===2?0:n}},ST=class extends Ai{constructor(){super(166,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(t,e,n){let r=e.get(165);return{isDominatedByLongLines:t.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}},ET=class extends pt{constructor(){let t={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",t,{"editor.dropIntoEditor.enabled":{type:"boolean",default:t.enabled,markdownDescription:d(142,null)},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:d(143,null),enum:["afterDrop","never"],enumDescriptions:[d(144,null),d(145,null)],default:"afterDrop"}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:X(e.enabled,this.defaultValue.enabled),showDropSelector:ut(e.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}},wT=class extends pt{constructor(){let t={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",t,{"editor.pasteAs.enabled":{type:"boolean",default:t.enabled,markdownDescription:d(378,null)},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:d(379,null),enum:["afterPaste","never"],enumDescriptions:[d(380,null),d(381,null)],default:"afterPaste"}})}validate(t){if(!t||typeof t!="object")return this.defaultValue;let e=t;return{enabled:X(e.enabled,this.defaultValue.enabled),showPasteSelector:ut(e.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}},y6=[];jwe={acceptSuggestionOnCommitCharacter:R(new ge(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:d(88,null)})),acceptSuggestionOnEnter:R(new dt(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",d(90,null),""],markdownDescription:d(89,null)})),accessibilitySupport:R(new NC),accessibilityPageSize:R(new qe(3,"accessibilityPageSize",500,1,1073741824,{description:d(91,null),tags:["accessibility"]})),allowOverflow:R(new ge(4,"allowOverflow",!0)),allowVariableLineHeights:R(new ge(5,"allowVariableLineHeights",!0,{description:d(98,null)})),allowVariableFonts:R(new ge(6,"allowVariableFonts",!0,{description:d(96,null)})),allowVariableFontsInAccessibilityMode:R(new ge(7,"allowVariableFontsInAccessibilityMode",!1,{description:d(97,null),tags:["accessibility"]})),ariaLabel:R(new Gn(8,"ariaLabel",d(245,null))),ariaRequired:R(new ge(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:R(new ge(12,"screenReaderAnnounceInlineSuggestion",!0,{description:d(410,null),tags:["accessibility"]})),autoClosingBrackets:R(new dt(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",d(148,null),d(147,null),""],description:d(104,null)})),autoClosingComments:R(new dt(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",d(150,null),d(149,null),""],description:d(105,null)})),autoClosingDelete:R(new dt(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",d(151,null),""],description:d(106,null)})),autoClosingOvertype:R(new dt(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",d(152,null),""],description:d(107,null)})),autoClosingQuotes:R(new dt(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",d(154,null),d(153,null),""],description:d(108,null)})),autoIndent:R(new zl(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],g6,{enumDescriptions:[d(159,null),d(158,null),d(156,null),d(155,null),d(157,null)],description:d(109,null)})),autoIndentOnPaste:R(new ge(17,"autoIndentOnPaste",!1,{description:d(110,null)})),autoIndentOnPasteWithinString:R(new ge(18,"autoIndentOnPasteWithinString",!0,{description:d(111,null)})),automaticLayout:R(new ge(19,"automaticLayout",!1)),autoSurround:R(new dt(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[d(161,null),d(162,null),d(160,null),""],description:d(112,null)})),bracketPairColorization:R(new hT),bracketPairGuides:R(new vT),stickyTabStops:R(new ge(132,"stickyTabStops",!1,{description:d(445,null)})),codeLens:R(new ge(23,"codeLens",!0,{description:d(115,null)})),codeLensFontFamily:R(new Gn(24,"codeLensFontFamily","",{description:d(116,null)})),codeLensFontSize:R(new qe(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:d(117,null)})),colorDecorators:R(new ge(26,"colorDecorators",!0,{description:d(119,null)})),colorDecoratorActivatedOn:R(new dt(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[d(164,null),d(165,null),d(163,null)],description:d(118,null)})),colorDecoratorsLimit:R(new qe(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:d(120,null)})),columnSelection:R(new ge(28,"columnSelection",!1,{description:d(121,null)})),comments:R(new UC),contextmenu:R(new ge(30,"contextmenu",!0)),copyWithSyntaxHighlighting:R(new ge(31,"copyWithSyntaxHighlighting",!0,{description:d(124,null)})),cursorBlinking:R(new zl(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],h6,{description:d(125,null)})),cursorSmoothCaretAnimation:R(new dt(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[d(129,null),d(128,null),d(130,null)],description:d(127,null)})),cursorStyle:R(new zl(34,"cursorStyle",1,"line",["line","block","underline","line-thin","block-outline","underline-thin"],JO,{description:d(131,null)})),overtypeCursorStyle:R(new zl(92,"overtypeCursorStyle",2,"block",["line","block","underline","line-thin","block-outline","underline-thin"],JO,{description:d(371,null)})),cursorSurroundingLines:R(new qe(35,"cursorSurroundingLines",0,0,1073741824,{description:d(132,null)})),cursorSurroundingLinesStyle:R(new dt(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[d(135,null),d(134,null)],markdownDescription:d(133,null)})),cursorWidth:R(new qe(37,"cursorWidth",0,0,1073741824,{markdownDescription:d(136,null)})),cursorHeight:R(new qe(38,"cursorHeight",0,0,1073741824,{markdownDescription:d(126,null)})),disableLayerHinting:R(new ge(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:R(new ge(40,"disableMonospaceOptimizations",!1)),domReadOnly:R(new ge(41,"domReadOnly",!1)),doubleClickSelectsBlock:R(new ge(173,"doubleClickSelectsBlock",!0,{description:d(140,null)})),dragAndDrop:R(new ge(42,"dragAndDrop",!0,{description:d(141,null)})),emptySelectionClipboard:R(new VC),dropIntoEditor:R(new ET),editContext:R(new ge(44,"editContext",!0,{description:d(146,null),included:dp||Dg||Rg})),renderRichScreenReaderContent:R(new ge(107,"renderRichScreenReaderContent",!1,{markdownDescription:d(401,null)})),stickyScroll:R(new eT),experimentalGpuAcceleration:R(new dt(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[d(249,null),d(250,null)],description:d(248,null)})),experimentalWhitespaceRendering:R(new dt(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[d(254,null),d(252,null),d(253,null)],description:d(251,null)})),extraEditorClassName:R(new Gn(48,"extraEditorClassName","")),fastScrollSensitivity:R(new jr(49,"fastScrollSensitivity",5,o=>o<=0?5:o,{markdownDescription:d(255,null)})),find:R(new WC),fixedOverflowWidgets:R(new ge(51,"fixedOverflowWidgets",!1)),folding:R(new ge(52,"folding",!0,{description:d(266,null)})),foldingStrategy:R(new dt(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[d(271,null),d(272,null)],description:d(270,null)})),foldingHighlight:R(new ge(54,"foldingHighlight",!0,{description:d(267,null)})),foldingImportsByDefault:R(new ge(55,"foldingImportsByDefault",!1,{description:d(268,null)})),foldingMaximumRegions:R(new qe(56,"foldingMaximumRegions",5e3,10,65e3,{description:d(269,null)})),unfoldOnClickAfterEndOfLine:R(new ge(57,"unfoldOnClickAfterEndOfLine",!1,{description:d(476,null)})),fontFamily:R(new Gn(58,"fontFamily",ii.fontFamily,{description:d(273,null)})),fontInfo:R(new $C),fontLigatures2:R(new BC),fontSize:R(new KC),fontWeight:R(new jC),fontVariations:R(new HC),formatOnPaste:R(new ge(64,"formatOnPaste",!1,{description:d(283,null)})),formatOnType:R(new ge(65,"formatOnType",!1,{description:d(284,null)})),glyphMargin:R(new ge(66,"glyphMargin",!0,{description:d(285,null)})),gotoLocation:R(new QC),hideCursorInOverviewRuler:R(new ge(68,"hideCursorInOverviewRuler",!1,{description:d(286,null)})),hover:R(new JC),inDiffEditor:R(new ge(70,"inDiffEditor",!1)),inertialScroll:R(new ge(158,"inertialScroll",!1,{description:d(296,null)})),letterSpacing:R(new jr(72,"letterSpacing",ii.letterSpacing,o=>jr.clamp(o,-5,20),{description:d(322,null)})),lightbulb:R(new ZC),lineDecorationsWidth:R(new nT),lineHeight:R(new rT),lineNumbers:R(new dT),lineNumbersMinChars:R(new qe(77,"lineNumbersMinChars",5,1,300)),linkedEditing:R(new ge(78,"linkedEditing",!1,{description:d(329,null)})),links:R(new ge(79,"links",!0,{description:d(330,null)})),matchBrackets:R(new dt(80,"matchBrackets","always",["always","near","never"],{description:d(331,null)})),minimap:R(new oT),mouseStyle:R(new dt(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:R(new jr(83,"mouseWheelScrollSensitivity",1,o=>o===0?1:o,{markdownDescription:d(352,null)})),mouseWheelZoom:R(new ge(84,"mouseWheelZoom",!1,{markdownDescription:rt?d(354,null):d(353,null)})),multiCursorMergeOverlapping:R(new ge(85,"multiCursorMergeOverlapping",!0,{description:d(356,null)})),multiCursorModifier:R(new zl(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],v6,{markdownEnumDescriptions:[d(359,null),d(358,null)],markdownDescription:d(357,null)})),mouseMiddleClickAction:R(new dt(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:d(351,null)})),multiCursorPaste:R(new dt(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[d(362,null),d(361,null)],markdownDescription:d(360,null)})),multiCursorLimit:R(new qe(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:d(355,null)})),occurrencesHighlight:R(new dt(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[d(365,null),d(366,null),d(364,null)],markdownDescription:d(363,null)})),occurrencesHighlightDelay:R(new qe(91,"occurrencesHighlightDelay",0,0,2e3,{description:d(367,null),tags:["preview"]})),overtypeOnPaste:R(new ge(93,"overtypeOnPaste",!0,{description:d(372,null)})),overviewRulerBorder:R(new ge(94,"overviewRulerBorder",!0,{description:d(373,null)})),overviewRulerLanes:R(new qe(95,"overviewRulerLanes",3,0,3)),padding:R(new iT),pasteAs:R(new wT),parameterHints:R(new sT),peekWidgetDefaultFocus:R(new dt(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[d(384,null),d(383,null)],description:d(382,null)})),placeholder:R(new lT),definitionLinkOpensInPeek:R(new ge(101,"definitionLinkOpensInPeek",!1,{description:d(138,null)})),quickSuggestions:R(new cT),quickSuggestionsDelay:R(new qe(103,"quickSuggestionsDelay",10,0,1073741824,{description:d(393,null),experiment:{mode:"auto"}})),readOnly:R(new ge(104,"readOnly",!1)),readOnlyMessage:R(new pT),renameOnType:R(new ge(106,"renameOnType",!1,{description:d(394,null),markdownDeprecationMessage:d(395,null)})),renderControlCharacters:R(new ge(108,"renderControlCharacters",!0,{description:d(396,null),restricted:!0})),renderFinalNewline:R(new dt(109,"renderFinalNewline",_e?"dimmed":"on",["off","on","dimmed"],{description:d(397,null)})),renderLineHighlight:R(new dt(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",d(399,null)],description:d(398,null)})),renderLineHighlightOnlyWhenFocus:R(new ge(111,"renderLineHighlightOnlyWhenFocus",!1,{description:d(400,null)})),renderValidationDecorations:R(new dt(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:R(new dt(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",d(403,null),d(404,null),d(405,null),""],description:d(402,null)})),revealHorizontalRightPadding:R(new qe(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:R(new ge(115,"roundedSelection",!0,{description:d(406,null)})),rulers:R(new uT),scrollbar:R(new mT),scrollBeyondLastColumn:R(new qe(118,"scrollBeyondLastColumn",4,0,1073741824,{description:d(423,null)})),scrollBeyondLastLine:R(new ge(119,"scrollBeyondLastLine",!0,{description:d(424,null)})),scrollOnMiddleClick:R(new ge(171,"scrollOnMiddleClick",!1,{description:d(425,null)})),scrollPredominantAxis:R(new ge(120,"scrollPredominantAxis",!0,{description:d(426,null)})),selectionClipboard:R(new ge(121,"selectionClipboard",!0,{description:d(427,null),included:_e})),selectionHighlight:R(new ge(122,"selectionHighlight",!0,{description:d(428,null)})),selectionHighlightMaxLength:R(new qe(123,"selectionHighlightMaxLength",200,0,1073741824,{description:d(429,null)})),selectionHighlightMultiline:R(new ge(124,"selectionHighlightMultiline",!1,{description:d(430,null)})),selectOnLineNumbers:R(new ge(125,"selectOnLineNumbers",!0)),showFoldingControls:R(new dt(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[d(435,null),d(437,null),d(436,null)],description:d(434,null)})),showUnused:R(new ge(127,"showUnused",!0,{description:d(438,null)})),showDeprecated:R(new ge(157,"showDeprecated",!0,{description:d(433,null)})),inlayHints:R(new tT),snippetSuggestions:R(new dt(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[d(444,null),d(441,null),d(442,null),d(443,null)],description:d(440,null)})),smartSelect:R(new bT),smoothScrolling:R(new ge(130,"smoothScrolling",!1,{description:d(439,null)})),stopRenderingLineAfter:R(new qe(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:R(new yT),inlineSuggest:R(new gT),inlineCompletionsAccessibilityVerbose:R(new ge(169,"inlineCompletionsAccessibilityVerbose",!1,{description:d(303,null)})),suggestFontSize:R(new qe(135,"suggestFontSize",0,0,1e3,{markdownDescription:d(463,null,"`0`","`#editor.fontSize#`")})),suggestLineHeight:R(new qe(136,"suggestLineHeight",0,0,1e3,{markdownDescription:d(464,null,"`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:R(new ge(137,"suggestOnTriggerCharacters",!0,{description:d(465,null)})),suggestSelection:R(new dt(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[d(467,null),d(468,null),d(469,null)],description:d(466,null)})),tabCompletion:R(new dt(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[d(472,null),d(471,null),d(473,null)],description:d(470,null)})),tabIndex:R(new qe(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:R(new ge(141,"trimWhitespaceOnDelete",!1,{description:d(475,null)})),unicodeHighlight:R(new fT),unusualLineTerminators:R(new dt(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[d(485,null),d(486,null),d(487,null)],description:d(484,null)})),useShadowDOM:R(new ge(144,"useShadowDOM",!0)),useTabStops:R(new ge(145,"useTabStops",!0,{description:d(488,null)})),wordBreak:R(new dt(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[d(491,null),d(490,null)],description:d(489,null)})),wordSegmenterLocales:R(new IT),wordSeparators:R(new Gn(148,"wordSeparators",MC,{description:d(493,null)})),wordWrap:R(new dt(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[d(496,null),d(497,null),d(498,null),d(495,null)],description:d(494,null)})),wordWrapBreakAfterCharacters:R(new Gn(150,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:R(new Gn(151,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:R(new qe(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:d(499,null)})),wordWrapOverride1:R(new dt(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:R(new dt(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:R(new ge(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:d(500,null)})),effectiveCursorStyle:R(new zC),editorClassName:R(new FC),defaultColorDecorators:R(new dt(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[d(167,null),d(166,null),d(168,null)],description:d(137,null)})),pixelRatio:R(new aT),tabFocusMode:R(new ge(164,"tabFocusMode",!1,{markdownDescription:d(474,null)})),layoutInfo:R(new XC),wrappingInfo:R(new ST),wrappingIndent:R(new xT),wrappingStrategy:R(new YC),effectiveEditContextEnabled:R(new GC),effectiveAllowVariableFonts:R(new qC)}});var ai,qb=y(()=>{ai=class o{constructor(t,e){this.lineNumber=t,this.column=e}with(t=this.lineNumber,e=this.column){return t===this.lineNumber&&e===this.column?this:new o(t,e)}delta(t=0,e=0){return this.with(Math.max(1,this.lineNumber+t),Math.max(1,this.column+e))}equals(t){return o.equals(this,t)}static equals(t,e){return!t&&!e?!0:!!t&&!!e&&t.lineNumber===e.lineNumber&&t.column===e.column}isBefore(t){return o.isBefore(this,t)}static isBefore(t,e){return t.lineNumber<e.lineNumber?!0:e.lineNumber<t.lineNumber?!1:t.column<e.column}isBeforeOrEqual(t){return o.isBeforeOrEqual(this,t)}static isBeforeOrEqual(t,e){return t.lineNumber<e.lineNumber?!0:e.lineNumber<t.lineNumber?!1:t.column<=e.column}static compare(t,e){let n=t.lineNumber|0,r=e.lineNumber|0;if(n===r){let i=t.column|0,s=e.column|0;return i-s}return n-r}clone(){return new o(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(t){return new o(t.lineNumber,t.column)}static isIPosition(t){return!!t&&typeof t.lineNumber=="number"&&typeof t.column=="number"}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}});var An,Gl=y(()=>{qb();An=class o{constructor(t,e,n,r){t>n||t===n&&e>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=t,this.endColumn=e):(this.startLineNumber=t,this.startColumn=e,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return o.isEmpty(this)}static isEmpty(t){return t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn}containsPosition(t){return o.containsPosition(this,t)}static containsPosition(t,e){return!(e.lineNumber<t.startLineNumber||e.lineNumber>t.endLineNumber||e.lineNumber===t.startLineNumber&&e.column<t.startColumn||e.lineNumber===t.endLineNumber&&e.column>t.endColumn)}static strictContainsPosition(t,e){return!(e.lineNumber<t.startLineNumber||e.lineNumber>t.endLineNumber||e.lineNumber===t.startLineNumber&&e.column<=t.startColumn||e.lineNumber===t.endLineNumber&&e.column>=t.endColumn)}containsRange(t){return o.containsRange(this,t)}static containsRange(t,e){return!(e.startLineNumber<t.startLineNumber||e.endLineNumber<t.startLineNumber||e.startLineNumber>t.endLineNumber||e.endLineNumber>t.endLineNumber||e.startLineNumber===t.startLineNumber&&e.startColumn<t.startColumn||e.endLineNumber===t.endLineNumber&&e.endColumn>t.endColumn)}strictContainsRange(t){return o.strictContainsRange(this,t)}static strictContainsRange(t,e){return!(e.startLineNumber<t.startLineNumber||e.endLineNumber<t.startLineNumber||e.startLineNumber>t.endLineNumber||e.endLineNumber>t.endLineNumber||e.startLineNumber===t.startLineNumber&&e.startColumn<=t.startColumn||e.endLineNumber===t.endLineNumber&&e.endColumn>=t.endColumn)}plusRange(t){return o.plusRange(this,t)}static plusRange(t,e){let n,r,i,s;return e.startLineNumber<t.startLineNumber?(n=e.startLineNumber,r=e.startColumn):e.startLineNumber===t.startLineNumber?(n=e.startLineNumber,r=Math.min(e.startColumn,t.startColumn)):(n=t.startLineNumber,r=t.startColumn),e.endLineNumber>t.endLineNumber?(i=e.endLineNumber,s=e.endColumn):e.endLineNumber===t.endLineNumber?(i=e.endLineNumber,s=Math.max(e.endColumn,t.endColumn)):(i=t.endLineNumber,s=t.endColumn),new o(n,r,i,s)}intersectRanges(t){return o.intersectRanges(this,t)}static intersectRanges(t,e){let n=t.startLineNumber,r=t.startColumn,i=t.endLineNumber,s=t.endColumn,a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn;return n<a?(n=a,r=l):n===a&&(r=Math.max(r,l)),i>c?(i=c,s=u):i===c&&(s=Math.min(s,u)),n>i||n===i&&r>s?null:new o(n,r,i,s)}equalsRange(t){return o.equalsRange(this,t)}static equalsRange(t,e){return!t&&!e?!0:!!t&&!!e&&t.startLineNumber===e.startLineNumber&&t.startColumn===e.startColumn&&t.endLineNumber===e.endLineNumber&&t.endColumn===e.endColumn}getEndPosition(){return o.getEndPosition(this)}static getEndPosition(t){return new ai(t.endLineNumber,t.endColumn)}getStartPosition(){return o.getStartPosition(this)}static getStartPosition(t){return new ai(t.startLineNumber,t.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(t,e){return new o(this.startLineNumber,this.startColumn,t,e)}setStartPosition(t,e){return new o(t,e,this.endLineNumber,this.endColumn)}collapseToStart(){return o.collapseToStart(this)}static collapseToStart(t){return new o(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return o.collapseToEnd(this)}static collapseToEnd(t){return new o(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new o(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(t,e=t){return new o(t.lineNumber,t.column,e.lineNumber,e.column)}static lift(t){return t?new o(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(t){return!!t&&typeof t.startLineNumber=="number"&&typeof t.startColumn=="number"&&typeof t.endLineNumber=="number"&&typeof t.endColumn=="number"}static areIntersectingOrTouching(t,e){return!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn||e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn)}static areIntersecting(t,e){return!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn||e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn)}static areOnlyIntersecting(t,e){return!(t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1||e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1)}static compareRangesUsingStarts(t,e){if(t&&e){let i=t.startLineNumber|0,s=e.startLineNumber|0;if(i===s){let a=t.startColumn|0,l=e.startColumn|0;if(a===l){let c=t.endLineNumber|0,u=e.endLineNumber|0;if(c===u){let p=t.endColumn|0,m=e.endColumn|0;return p-m}return c-u}return a-l}return i-s}return(t?1:0)-(e?1:0)}static compareRangesUsingEnds(t,e){return t.endLineNumber===e.endLineNumber?t.endColumn===e.endColumn?t.startLineNumber===e.startLineNumber?t.startColumn-e.startColumn:t.startLineNumber-e.startLineNumber:t.endColumn-e.endColumn:t.endLineNumber-e.endLineNumber}static spansMultipleLines(t){return t.endLineNumber>t.startLineNumber}toJSON(){return this}}});var CT=y(()=>{});var eA=y(()=>{Gl()});var Kb,TT,tA=y(()=>{de();q();CT();Kb=class{constructor(){this._tokenizationSupports=new Map;this._factories=new Map;this._onDidChange=new P;this.onDidChange=this._onDidChange.event;this._colorMap=null}handleChange(t){this._onDidChange.fire({changedLanguages:t,changedColorMap:!1})}register(t,e){return this._tokenizationSupports.set(t,e),this.handleChange([t]),ie(()=>{this._tokenizationSupports.get(t)===e&&(this._tokenizationSupports.delete(t),this.handleChange([t]))})}get(t){return this._tokenizationSupports.get(t)||null}registerFactory(t,e){this._factories.get(t)?.dispose();let n=new TT(this,t,e);return this._factories.set(t,n),ie(()=>{let r=this._factories.get(t);!r||r!==n||(this._factories.delete(t),r.dispose())})}async getOrCreate(t){let e=this.get(t);if(e)return e;let n=this._factories.get(t);return!n||n.isResolved?null:(await n.resolve(),this.get(t))}isResolved(t){if(this.get(t))return!0;let n=this._factories.get(t);return!!(!n||n.isResolved)}setColorMap(t){this._colorMap=t,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},TT=class extends D{constructor(e,n,r){super();this._registry=e;this._languageId=n;this._factory=r;this._isDisposed=!1;this._resolvePromise=null;this._isResolved=!1}get isResolved(){return this._isResolved}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}});function nA(o){return!!o&&I.isUri(o.uri)&&An.isIRange(o.range)}var I6,bCe,x6,ws,PT,ICe,kT=y(()=>{xl();ce();eA();Gl();tA();pe();(i=>{let o=new Map;o.set(0,J.symbolMethod),o.set(1,J.symbolFunction),o.set(2,J.symbolConstructor),o.set(3,J.symbolField),o.set(4,J.symbolVariable),o.set(5,J.symbolClass),o.set(6,J.symbolStruct),o.set(7,J.symbolInterface),o.set(8,J.symbolModule),o.set(9,J.symbolProperty),o.set(10,J.symbolEvent),o.set(11,J.symbolOperator),o.set(12,J.symbolUnit),o.set(13,J.symbolValue),o.set(15,J.symbolEnum),o.set(14,J.symbolConstant),o.set(15,J.symbolEnum),o.set(16,J.symbolEnumMember),o.set(17,J.symbolKeyword),o.set(28,J.symbolSnippet),o.set(18,J.symbolText),o.set(19,J.symbolColor),o.set(20,J.symbolFile),o.set(21,J.symbolReference),o.set(22,J.symbolCustomColor),o.set(23,J.symbolFolder),o.set(24,J.symbolTypeParameter),o.set(25,J.account),o.set(26,J.issues),o.set(27,J.tools);function t(s){let a=o.get(s);return a||(console.info("No codicon found for CompletionItemKind "+s),a=J.symbolProperty),a}i.toIcon=t;function e(s){switch(s){case 0:return d(548,null);case 1:return d(544,null);case 2:return d(536,null);case 3:return d(541,null);case 4:return d(561,null);case 5:return d(533,null);case 6:return d(554,null);case 7:return d(545,null);case 8:return d(549,null);case 9:return d(551,null);case 10:return d(540,null);case 11:return d(550,null);case 12:return d(558,null);case 13:return d(560,null);case 14:return d(535,null);case 15:return d(538,null);case 16:return d(539,null);case 17:return d(547,null);case 18:return d(555,null);case 19:return d(534,null);case 20:return d(542,null);case 21:return d(552,null);case 22:return d(537,null);case 23:return d(543,null);case 24:return d(557,null);case 25:return d(559,null);case 26:return d(546,null);case 27:return d(556,null);case 28:return d(553,null);default:return""}}i.toLabel=e;let n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",28),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26),n.set("tool",27);function r(s,a){let l=n.get(s);return typeof l>"u"&&!a&&(l=9),l}i.fromString=r})(I6||={});bCe={17:d(509,null),16:d(510,null),4:d(511,null),13:d(512,null),8:d(513,null),9:d(514,null),21:d(515,null),23:d(516,null),7:d(517,null),0:d(518,null),11:d(519,null),10:d(520,null),19:d(521,null),5:d(522,null),1:d(523,null),2:d(524,null),20:d(525,null),15:d(526,null),18:d(527,null),24:d(528,null),3:d(529,null),6:d(530,null),14:d(531,null),22:d(532,null),25:d(563,null),12:d(564,null)};(r=>{let o=new Map;o.set(0,J.symbolFile),o.set(1,J.symbolModule),o.set(2,J.symbolNamespace),o.set(3,J.symbolPackage),o.set(4,J.symbolClass),o.set(5,J.symbolMethod),o.set(6,J.symbolProperty),o.set(7,J.symbolField),o.set(8,J.symbolConstructor),o.set(9,J.symbolEnum),o.set(10,J.symbolInterface),o.set(11,J.symbolFunction),o.set(12,J.symbolVariable),o.set(13,J.symbolConstant),o.set(14,J.symbolString),o.set(15,J.symbolNumber),o.set(16,J.symbolBoolean),o.set(17,J.symbolArray),o.set(18,J.symbolObject),o.set(19,J.symbolKey),o.set(20,J.symbolNull),o.set(21,J.symbolEnumMember),o.set(22,J.symbolStruct),o.set(23,J.symbolEvent),o.set(24,J.symbolOperator),o.set(25,J.symbolTypeParameter);function t(i){let s=o.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=J.symbolProperty),s}r.toIcon=t;let e=new Map;e.set(0,20),e.set(1,8),e.set(2,8),e.set(3,8),e.set(4,5),e.set(5,0),e.set(6,9),e.set(7,3),e.set(8,2),e.set(9,15),e.set(10,7),e.set(11,1),e.set(12,4),e.set(13,14),e.set(14,18),e.set(15,13),e.set(16,13),e.set(17,13),e.set(18,13),e.set(19,17),e.set(20,13),e.set(21,16),e.set(22,6),e.set(23,10),e.set(24,11),e.set(25,24);function n(i){let s=e.get(i);return s===void 0&&(console.info("No completion kind found for SymbolKind "+i),s=20),s}r.toCompletionKind=n})(x6||={});ws=class o{constructor(t){this.value=t}static{this.Comment=new o("comment")}static{this.Imports=new o("imports")}static{this.Region=new o("region")}static fromValue(t){switch(t){case"comment":return o.Comment;case"imports":return o.Imports;case"region":return o.Region}return new o(t)}};(t=>{function o(e){return!e||typeof e!="object"?!1:typeof e.id=="string"&&typeof e.title=="string"}t.is=o})(PT||={});ICe=new Kb});var RT=y(()=>{on()});var Of,E6,TCe,rA=y(()=>{as();pe();re();Of=(r=>(r[r.Hint=1]="Hint",r[r.Info=2]="Info",r[r.Warning=4]="Warning",r[r.Error=8]="Error",r))(Of||{});(a=>{function o(l,c){return c-l}a.compare=o;let t=Object.create(null);t[8]=d(883,null),t[4]=d(887,null),t[2]=d(885,null);function e(l){return t[l]||""}a.toString=e;let n=Object.create(null);n[8]=d(884,null),n[4]=d(888,null),n[2]=d(886,null);function r(l){return n[l]||""}a.toStringPlural=r;function i(l){switch(l){case Ae.Error:return 8;case Ae.Warning:return 4;case Ae.Info:return 2;case Ae.Ignore:return 1}}a.fromSeverity=i;function s(l){switch(l){case 8:return Ae.Error;case 4:return Ae.Warning;case 2:return Ae.Info;case 1:return Ae.Ignore}}a.toSeverity=s})(Of||={});(n=>{function t(r){return e(r,!0)}n.makeKey=t;function e(r,i){let s=[""];return r.source?s.push(r.source.replace("\xA6","\\\xA6")):s.push(""),r.code?typeof r.code=="string"?s.push(r.code.replace("\xA6","\\\xA6")):s.push(r.code.value.replace("\xA6","\\\xA6")):s.push(""),r.severity!==void 0&&r.severity!==null?s.push(Of.toString(r.severity)):s.push(""),r.message&&i?s.push(r.message.replace("\xA6","\\\xA6")):s.push(""),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(""),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(""),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(""),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(""),s.push(""),s.join("\xA6")}n.makeKeyOptionalMessage=e})(E6||={});TCe=_("markerService")});var w6,MCe,oA,jb,OCe,iA=y(()=>{ze();Wt();q();re();w6=_("progressService"),MCe=Object.freeze({total(){},worked(){},done(){}}),oA=class{constructor(t){this.callback=t}static{this.None=Object.freeze({report(){}})}get value(){return this._value}report(t){this._value=t,this.callback(this._value)}},jb=class extends D{constructor(e,n){super();this.deferred=new Wr;n.withProgress(e,r=>(this.reporter=r,this.lastStep&&r.report(this.lastStep),this.deferred.p)),this._register(ie(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};jb=E([b(1,w6)],jb);OCe=_("editorProgressService")});var DT,sA,Qb,aA,_T=y(()=>{de();q();pe();DT=class extends D{constructor(e,n="",r="",i=!0,s){super();this._onDidChange=this._register(new P);this._enabled=!0;this._id=e,this._label=n,this._cssClass=r,this._enabled=i,this._actionCallback=s}get onDidChange(){return this._onDidChange.event}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,n){this._actionCallback&&await this._actionCallback(e)}},sA=class o{constructor(){this.id=o.ID;this.label="";this.tooltip="";this.class="separator";this.enabled=!1;this.checked=void 0}static join(...t){let e=[];for(let n of t)n.length&&(e.length?e=[...e,new o,...n]:e=n);return e}static clean(t){for(;t.length>0&&t[0].id===o.ID;)t.shift();for(;t.length>0&&t[t.length-1].id===o.ID;)t.pop();for(let e=t.length-2;e>=0;e--)t[e].id===o.ID&&t[e+1].id===o.ID&&t.splice(e+1,1);return t}static{this.ID="vs.actions.separator"}async run(){}},Qb=class{constructor(t,e,n,r){this.tooltip="";this.enabled=!0;this.checked=void 0;this.id=t,this.label=e,this.class=r,this._actions=n}get actions(){return this._actions}async run(){}},aA=class o extends DT{static{this.ID="vs.actions.empty"}constructor(){super(o.ID,d(0,null),void 0,!1)}}});function Jb(o,t,e){for(let n of e.visibleEditorPanes)if(n.group.id===t&&o.matches(n.input))return n.getViewState()}function uA(o){if(Qr(o))return!1;let t=o;return I.isUri(t?.resource)}function li(o){if(Qr(o))return!1;let t=o;return t?.original!==void 0&&t.modified!==void 0}function Su(o){if(Qr(o))return!1;let t=o;return!t||t.resources&&!Array.isArray(t.resources)?!1:!!t.resources||!!t.multiDiffSource}function Da(o){if(Qr(o)||li(o))return!1;let t=o;return t?.primary!==void 0&&t.secondary!==void 0}function Ra(o){if(Qr(o))return!1;let t=o;return I.isUri(t?.base?.resource)&&I.isUri(t?.input1?.resource)&&I.isUri(t?.input2?.resource)&&I.isUri(t?.result?.resource)}function Qr(o){return o instanceof Af}function C6(o){let t=o;return I.isUri(t?.preferredResource)}function T6(o){let t=o;return Qr(t?.primary)&&Qr(t?.secondary)}function NT(o){let t=o;return Qr(t?.modified)&&Qr(t?.original)}var lA,AT,cA,dA,LT,uTe,Af,MT,Eu,OT,_a=y(()=>{pe();Me();ce();q();re();Hr();nt();$e();rl();_T();as();lA={EditorPane:"workbench.contributions.editors",EditorFactory:"workbench.contributions.editor.inputFactories"},AT={id:"default",displayName:d(1124,null),providerDisplayName:d(1121,null)},cA="workbench.editors.textDiffEditor",dA="workbench.editors.binaryResourceDiffEditor";LT=class{constructor(){this.mapIdToSaveSource=new Map}registerSource(t,e){let n=this.mapIdToSaveSource.get(t);return n||(n={source:t,label:e},this.mapIdToSaveSource.set(t,n)),n.source}getSourceLabel(t){return this.mapIdToSaveSource.get(t)?.label??t}},uTe=new LT,Af=class extends D{};MT=class{getOriginalUri(t,e){if(!t)return;if(Ra(t))return Eu.getOriginalUri(t.result,e);if(e?.supportSideBySide){let{primary:r,secondary:i}=this.getSideEditors(t);if(r&&i){if(e?.supportSideBySide===3)return{primary:this.getOriginalUri(r,{filterByScheme:e.filterByScheme}),secondary:this.getOriginalUri(i,{filterByScheme:e.filterByScheme})};if(e?.supportSideBySide===4)return this.getOriginalUri(r,{filterByScheme:e.filterByScheme})??this.getOriginalUri(i,{filterByScheme:e.filterByScheme});t=e.supportSideBySide===1?r:i}}if(li(t)||Su(t)||Da(t)||Ra(t))return;let n=C6(t)?t.preferredResource:t.resource;return!n||!e?.filterByScheme?n:this.filterUri(n,e.filterByScheme)}getSideEditors(t){return T6(t)||Da(t)?{primary:t.primary,secondary:t.secondary}:NT(t)||li(t)?{primary:t.modified,secondary:t.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(t,e){if(!t)return;if(Ra(t))return Eu.getCanonicalUri(t.result,e);if(e?.supportSideBySide){let{primary:r,secondary:i}=this.getSideEditors(t);if(r&&i){if(e?.supportSideBySide===3)return{primary:this.getCanonicalUri(r,{filterByScheme:e.filterByScheme}),secondary:this.getCanonicalUri(i,{filterByScheme:e.filterByScheme})};if(e?.supportSideBySide===4)return this.getCanonicalUri(r,{filterByScheme:e.filterByScheme})??this.getCanonicalUri(i,{filterByScheme:e.filterByScheme});t=e.supportSideBySide===1?r:i}}if(li(t)||Su(t)||Da(t)||Ra(t))return;let n=t.resource;return!n||!e?.filterByScheme?n:this.filterUri(n,e.filterByScheme)}filterUri(t,e){if(Array.isArray(e)){if(e.some(n=>t.scheme===n))return t}else if(e===t.scheme)return t}},Eu=new MT,OT=class{constructor(){this.editorSerializerConstructors=new Map;this.editorSerializerInstances=new Map}start(t){let e=this.instantiationService=t.get(gr);for(let[n,r]of this.editorSerializerConstructors)this.createEditorSerializer(n,r,e);this.editorSerializerConstructors.clear()}createEditorSerializer(t,e,n){let r=n.createInstance(e);this.editorSerializerInstances.set(t,r)}registerFileEditorFactory(t){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=t}getFileEditorFactory(){return gp(this.fileEditorFactory)}registerEditorSerializer(t,e){if(this.editorSerializerConstructors.has(t)||this.editorSerializerInstances.has(t))throw new Error(`A editor serializer with type ID '${t}' was already registered.`);return this.instantiationService?this.createEditorSerializer(t,e,this.instantiationService):this.editorSerializerConstructors.set(t,e),ie(()=>{this.editorSerializerConstructors.delete(t),this.editorSerializerInstances.delete(t)})}getEditorSerializer(t){return this.editorSerializerInstances.get(typeof t=="string"?t:t.typeId)}};bt.add(lA.EditorFactory,new OT)});var UT,P6,k6,Xb=y(()=>{ce();re();UT="local";(r=>{function o(i){return new Map(Object.entries(i))}r.fromRecord=o;function t(i){let s=Object.create(null),a=n(i);for(let[l,c]of a)s[l]=c;return s}r.toRecord=t;function e(i){if(!i)return;let s=n(i);return Array.from(s,([a,l])=>({optionId:a,value:typeof l=="string"?l:l.id}))}r.toStrValueArray=e;function n(i){return i instanceof Map?i:Object.entries(i)}})(P6||={});k6=_("chatSessionsService")});var FT,pA=y(()=>{et();$e();ce();Xb();(s=>{s.scheme=z.vscodeLocalChatSession;function t(a){let l=_o(A.wrap(new TextEncoder().encode(a)),!1,!0);return I.from({scheme:s.scheme,authority:UT,path:"/"+l})}s.forSession=t;function e(){let a=Math.floor(Math.random()*1e9);return t(`chat-${a}`)}s.getNewSessionUri=e;function n(a){let l=i(a);return l?.chatSessionType===UT?l.sessionId:void 0}s.parseLocalSessionId=n;function r(a){return!!n(a)}s.isLocalSession=r;function i(a){if(a.scheme!==s.scheme||!a.authority)return;let l=a.path.split("/");if(l.length!==2)return;let c=a.authority,u=Yi(l[1]);return{chatSessionType:c,sessionId:new TextDecoder().decode(u.buffer)}}})(FT||={})});function mA(o){return o.kind==="image"}function fA(o){return o.kind==="promptFile"}function gA(o){return o.kind==="promptText"}var R6,D6,hA=y(()=>{xl();Nt();fm();ce();kT();pe();et();(i=>{i.icon=J.error;function t(s){return{filterUri:s.resource,owner:s.owner,problemMessage:s.message,filterRange:{startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,startColumn:s.startColumn,endColumn:s.endColumn}}}i.fromMarker=t;function e(s){return{id:n(s),name:r(s),icon:i.icon,value:s,kind:"diagnostic",...s}}i.toEntry=e;function n(s){return[s.filterUri,s.owner,s.filterSeverity,s.filterRange?.startLineNumber,s.filterRange?.startColumn].join(":")}i.id=n;function r(s){let a;if((p=>(p[p.MaxChars=30]="MaxChars",p[p.MaxSpaceLookback=10]="MaxSpaceLookback"))(a||={}),s.problemMessage){if(s.problemMessage.length<30)return s.problemMessage;let c=s.problemMessage.lastIndexOf(" ",30);return c===-1||c+10<30?s.problemMessage.substring(0,30)+"\u2026":s.problemMessage.substring(0,c)+"\u2026"}let l=d(1217,null);return s.filterUri&&(l=d(1218,null,Zn(s.filterUri))),l}i.label=r})(R6||={});(n=>{function o(r){return I.isUri(r.value)?r.value:nA(r.value)?r.value.uri:void 0}n.toUri=o;function t(r){if(r.value instanceof Uint8Array){let i={...r};return i.value={$base64:_o(A.wrap(r.value))},i}return r}n.toExport=t;function e(r){if(r&&"values"in r&&Array.isArray(r.values))return{kind:"generic",id:r.id??"",name:r.name,value:r.values[0]?.value,range:r.range,modelDescription:r.modelDescription,references:r.references};if(r.value&&typeof r.value=="object"&&"$base64"in r.value&&typeof r.value.$base64=="string"){let i={...r};return i.value=Yi(r.value.$base64).buffer,i}return r}n.fromExport=e})(D6||={})});var Yb,OTe,ATe,NTe,VT=y(()=>{$e();Xb();mo();Yb=(r=>(r.Chat="panel",r.Terminal="terminal",r.Notebook="notebook",r.EditorInline="editor",r))(Yb||{});(t=>{function o(e){switch(e){case"panel":return"panel";case"terminal":return"terminal";case"notebook":return"notebook";case"editor":return"editor"}return"panel"}t.fromRaw=o})(Yb||={});OTe=new Set([z.vscodeChatEditor,z.walkThrough,z.vscodeLocalChatSession,z.vscodeSettings,z.webviewPanel,z.vscodeUserData,z.extension,"ccreq","openai-codex"]),ATe=new S("inModelsEditor",!1),NTe=new S("inModelsSearch",!1)});function wu(o,t=te){return $x(o,t)?o.charAt(0).toUpperCase()+o.slice(1):o}function yA(o,t=Zt){let e=new Array(o.length),n=!1;for(let r=0;r<o.length;r++){let i=t,s=o[r];if(s===""){e[r]=`.${i}`;continue}if(!s){e[r]=s;continue}n=!0;let a="",l=s;_6.test(l)?(a=l.substr(0,l.indexOf("//")+2),l=l.substr(l.indexOf("//")+2),i="/"):l.indexOf(Nf)===0?(a=l.substr(0,l.indexOf(Nf)+Nf.length),l=l.substr(l.indexOf(Nf)+Nf.length)):l.indexOf(i)===0?(a=l.substr(0,l.indexOf(i)+i.length),l=l.substr(l.indexOf(i)+i.length)):l.indexOf(Uf)===0&&(a=l.substr(0,l.indexOf(Uf)+Uf.length),l=l.substr(l.indexOf(Uf)+Uf.length));let c=l.split(i);for(let u=1;n&&u<=c.length;u++)for(let p=c.length-u;n&&p>=0;p--){n=!1;let m=c.slice(p,p+u).join(i);for(let g=0;!n&&g<o.length;g++)if(g!==r&&o[g]&&o[g].indexOf(m)>-1){let h=p+u===c.length,v=p>0&&o[g].indexOf(i)>-1?i+m:m,x=o[g].endsWith(v);n=!h||x}if(!n){let g="";(c[0].endsWith(":")||a!=="")&&(p===1&&(p=0,u++,m=c[0]+i+m),p>0&&(g=c[0]+i),g=a+g),p>0&&(g=g+vA+i),g=g+m,p+u<c.length&&(p+u===c.length-1&&c[c.length-1]===""?g=g+i:g=g+i+vA),e[r]=g}}n&&(e[r]=s)}return e}var vA,Nf,_6,Uf,Ff=y(()=>{yi();Le();me();Nt();Qt();vA="\u2026",Nf="\\\\",_6=/^[^:/\\?#]+?:\/\//,Uf="~"});var WT=y(()=>{});var BT,bA,IA,xA=y(()=>{pe();WT();BT=(u=>(u.SessionStart="SessionStart",u.SessionEnd="SessionEnd",u.UserPromptSubmit="UserPromptSubmit",u.PreToolUse="PreToolUse",u.PostToolUse="PostToolUse",u.PreCompact="PreCompact",u.SubagentStart="SubagentStart",u.SubagentStop="SubagentStop",u.Stop="Stop",u.ErrorOccurred="ErrorOccurred",u))(BT||{}),bA={vscode:{SessionStart:"SessionStart",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop"},"github-copilot":{sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"},claude:{SessionStart:"SessionStart",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop"},undefined:Object.fromEntries(Object.values(BT).map(o=>[o,o]))},IA={SessionStart:{label:d(1293,null),description:d(1292,null)},UserPromptSubmit:{label:d(1301,null),description:d(1300,null)},PreToolUse:{label:d(1289,null),description:d(1288,null)},PostToolUse:{label:d(1285,null),description:d(1284,null)},PreCompact:{label:d(1287,null),description:d(1286,null)},SubagentStart:{label:d(1297,null),description:d(1296,null)},SubagentStop:{label:d(1299,null),description:d(1298,null)},Stop:{label:d(1295,null),description:d(1294,null)},SessionEnd:{label:d(1291,null),description:d(1290,null)},ErrorOccurred:{label:d(1283,null),description:d(1282,null)}}});function SA(o,t){return Object.fromEntries(Object.entries(bA[o]).map(([e,n])=>[e,{...t,description:IA[n]?.description}]))}function EA(o,t){return t===1&&o.windows?o.windows:t===2&&o.osx?o.osx:t===3&&o.linux?o.linux:o.command}var Jr,M6,O6,A6,N6,U6,F6,tPe,wA=y(()=>{pe();ce();Nt();Le();Ff();me();xA();WT();Jr={type:d(1275,null),command:d(1266,null),windows:d(1276,null),linux:d(1270,null),osx:d(1271,null),bash:d(1264,null),powershell:d(1272,null),cwd:d(1268,null),env:d(1269,null),timeout:d(1273,null),timeoutSec:d(1274,null)},M6={type:"object",additionalProperties:!0,required:["type"],anyOf:[{required:["command"]},{required:["windows"]},{required:["linux"]},{required:["osx"]},{required:["bash"]},{required:["powershell"]}],errorMessage:d(1267,null),properties:{type:{type:"string",enum:["command"],description:Jr.type},command:{type:"string",description:Jr.command},windows:{type:"string",description:Jr.windows},linux:{type:"string",description:Jr.linux},osx:{type:"string",description:Jr.osx},cwd:{type:"string",description:Jr.cwd},env:{type:"object",additionalProperties:{type:"string"},description:Jr.env},timeout:{type:"number",default:30,description:Jr.timeout}}},O6={type:"array",items:M6};A6=SA("vscode",O6),N6={type:"object",additionalProperties:!0,required:["type"],anyOf:[{required:["bash"]},{required:["powershell"]}],errorMessage:d(1265,null),properties:{type:{type:"string",enum:["command"],description:Jr.type},bash:{type:"string",description:Jr.bash},powershell:{type:"string",description:Jr.powershell},cwd:{type:"string",description:Jr.cwd},env:{type:"object",additionalProperties:{type:"string"},description:Jr.env},timeoutSec:{type:"number",default:10,description:Jr.timeoutSec}}},U6={type:"array",items:N6},F6=SA("github-copilot",U6),tPe={$schema:"http://json-schema.org/draft-07/schema#",type:"object",description:d(1277,null),additionalProperties:!0,required:["hooks"],properties:{hooks:{type:"object",description:d(1278,null),additionalProperties:!0}},if:{required:["version"],properties:{version:{type:"number"}}},then:{properties:{version:{type:"number",description:d(1281,null)},hooks:{properties:F6}}},else:{properties:{hooks:{properties:A6}}},defaultSnippets:[{label:d(1279,null),description:d(1280,null),body:{hooks:{SessionStart:[{type:"command",command:'${1:echo "Session started" >> session.log}'}],PreToolUse:[{type:"command",command:"${2:./scripts/validate.sh}",timeout:15}]}}}]}});function kA(o,t){let e=HT.get(o);if(e)return e;let n=V6(o,t);if(n){let r=CA.get(n)??0;r++,CA.set(n,r);let i=r===1?n:`${n}#${r}`;return HT.set(o,i),i}}function V6(o,t){let e=HT.get(o);if(e)return e;let n=t.owner?B6(t.owner)+".":"",r,i=t.debugNameSource;if(i!==void 0)if(typeof i=="function"){if(r=i(),r!==void 0)return n+r}else return n+i;let s=t.referenceFn;if(s!==void 0&&(r=Vf(s),r!==void 0))return n+r;if(t.owner!==void 0){let a=W6(t.owner,o);if(a!==void 0)return n+a}}function W6(o,t){for(let e in o)if(o[e]===t)return e}function B6(o){let t=PA.get(o);if(t)return t;let e=$T(o)??"Object",n=TA.get(e)??0;n++,TA.set(e,n);let r=n===1?e:`${e}#${n}`;return PA.set(o,r),r}function $T(o){let t=o.constructor;if(t)return t.name==="Object"?void 0:t.name}function Vf(o){let t=o.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t);return(n?n[1]:void 0)?.trim()}var Dr,CA,HT,TA,PA,xo=y(()=>{Dr=class{constructor(t,e,n){this.owner=t;this.debugNameSource=e;this.referenceFn=n}getDebugName(t){return kA(t,this)}},CA=new Map,HT=new WeakMap;TA=new Map,PA=new WeakMap});function Fo(o,t){return o===t}function H6(){return(o,t)=>o===t}function $6(o,t,e){return mn(o,t,e??Fo)}function z6(o){return(t,e)=>mn(t,e,o??Fo)}function Zb(o,t){if(o===t)return!0;if(Array.isArray(o)&&Array.isArray(t)){if(o.length!==t.length)return!1;for(let e=0;e<o.length;e++)if(!Zb(o[e],t[e]))return!1;return!0}if(o&&typeof o=="object"&&t&&typeof t=="object"&&Object.getPrototypeOf(o)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let e=o,n=t,r=Object.keys(e),i=Object.keys(n),s=new Set(i);if(r.length!==i.length)return!1;for(let a of r)if(!s.has(a)||!Zb(e[a],n[a]))return!1;return!0}return!1}function G6(){return(o,t)=>Zb(o,t)}function q6(o,t){return JSON.stringify(o)===JSON.stringify(t)}function K6(){return(o,t)=>JSON.stringify(o)===JSON.stringify(t)}function j6(){return(o,t)=>o.equals(t)}function Q6(o,t,e){return o==null||t===void 0||t===null?t===o:e(o,t)}function J6(o){return(t,e)=>t==null||e===void 0||e===null?e===t:o(t,e)}var X6,RA=y(()=>{At();(p=>(p.strict=Fo,p.strictC=H6,p.array=$6,p.arrayC=z6,p.structural=Zb,p.structuralC=G6,p.jsonStringify=q6,p.jsonStringifyC=K6,p.thisC=j6,p.ifDefined=Q6,p.ifDefinedC=J6))(X6||={})});var _r=y(()=>{hi();RA();Se();de();q()});function zT(o){let t=new Error("BugIndicatingErrorRecovery: "+o);Ke(t),console.error("recovered from an error that indicates a bug",t)}var DA=y(()=>{_r()});function Wf(o){ql?ql instanceof eI?ql.loggers.push(o):ql=new eI([ql,o]):ql=o}function Gt(){return ql}function _A(o){GT=o}function LA(o){GT&>(o)}var ql,GT,eI,Ni=y(()=>{eI=class{constructor(t){this.loggers=t}handleObservableCreated(t,e){for(let n of this.loggers)n.handleObservableCreated(t,e)}handleOnListenerCountChanged(t,e){for(let n of this.loggers)n.handleOnListenerCountChanged(t,e)}handleObservableUpdated(t,e){for(let n of this.loggers)n.handleObservableUpdated(t,e)}handleAutorunCreated(t,e){for(let n of this.loggers)n.handleAutorunCreated(t,e)}handleAutorunDisposed(t){for(let e of this.loggers)e.handleAutorunDisposed(t)}handleAutorunDependencyChanged(t,e,n){for(let r of this.loggers)r.handleAutorunDependencyChanged(t,e,n)}handleAutorunStarted(t){for(let e of this.loggers)e.handleAutorunStarted(t)}handleAutorunFinished(t){for(let e of this.loggers)e.handleAutorunFinished(t)}handleDerivedDependencyChanged(t,e,n){for(let r of this.loggers)r.handleDerivedDependencyChanged(t,e,n)}handleDerivedCleared(t){for(let e of this.loggers)e.handleDerivedCleared(t)}handleBeginTransaction(t){for(let e of this.loggers)e.handleBeginTransaction(t)}handleEndTransaction(t){for(let e of this.loggers)e.handleEndTransaction(t)}}});function Cu(o,t){let e=new Kl(o,t);try{o(e)}finally{e.finish()}}function qT(o,t,e){o?t(o):Cu(t,e)}var Kl,La=y(()=>{DA();xo();Ni();Kl=class{constructor(t,e){this._fn=t;this._getDebugName=e;this._updatingObservers=[];Gt()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Vf(this._fn)}updateObserver(t,e){if(!this._updatingObservers){zT("Transaction already finished!"),Cu(n=>{n.updateObserver(t,e)});return}this._updatingObservers.push({observer:t,observable:e}),t.beginUpdate(e)}finish(){let t=this._updatingObservers;if(!t){zT("transaction.finish() has already been called!");return}for(let e=0;e<t.length;e++){let{observer:n,observable:r}=t[e];n.endUpdate(r)}this._updatingObservers=null,Gt()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}}});function Y6(o){let t=o.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:o};let e=o.match(/at ([^\(\)]*):(\d+):(\d+)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:o}}var Nn,KT,So=y(()=>{(n=>{let o=!1;function t(){o=!0}n.enable=t;function e(){if(!o)return;let r=Error,i=r.stackTraceLimit;r.stackTraceLimit=3;let s=new Error().stack;return r.stackTraceLimit=i,KT.fromStack(s,2)}n.ofCaller=e})(Nn||={});KT=class o{constructor(t,e,n,r){this.fileName=t;this.line=e;this.column=n;this.id=r}static fromStack(t,e){let n=t.split(`
- `),r=Y6(n[e+1]);if(r)return new o(r.fileName,r.line,r.column,r.id)}}});function MA(o){jT=o}function AA(o){OA=o}function UA(o){NA=o}function FA(o){QT=o}var jT,OA,NA,QT,tI,JT,ci,di=y(()=>{So();xo();Ni();tI=class{get TChange(){return null}reportChanges(){this.get()}read(t){return t?t.readObservable(this):this.get()}map(t,e,n=Nn.ofCaller()){let r=e===void 0?void 0:t,i=e===void 0?t:e;return jT({owner:r,debugName:()=>{let s=Vf(i);if(s!==void 0)return s;let l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i.toString());if(l)return`${this.debugName}.${l[2]}`;if(!r)return`${this.debugName} (mapped)`},debugReferenceFn:i},s=>i(this.read(s),s),n)}flatten(){return jT({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},t=>this.read(t).read(t))}recomputeInitiallyAndOnChange(t,e){return t.add(OA(this,e)),this}keepObserved(t){return t.add(NA(this)),this}get debugValue(){return this.get()}get debug(){return new JT(this)}},JT=class{constructor(t){this.observable=t}getDependencyGraph(){return QT(this.observable,{type:"dependencies"})}getObserverGraph(){return QT(this.observable,{type:"observers"})}},ci=class extends tI{constructor(e){super();this._observers=new Set;Gt()?.handleObservableCreated(this,e)}addObserver(e){let n=this._observers.size;this._observers.add(e),n===0&&this.onFirstObserverAdded(),n!==this._observers.size&&Gt()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let n=this._observers.delete(e);n&&this._observers.size===0&&this.onLastObserverRemoved(),n&&Gt()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!Gt();return LA(this),e||Gt()?.handleObservableCreated(this,Nn.ofCaller()),this}debugGetObservers(){return this._observers}}});function Bf(o,t,e=Nn.ofCaller()){let n;return typeof o=="string"?n=new Dr(void 0,o,void 0):n=new Dr(o,void 0,void 0),new Cs(n,t,Fo,e)}var Cs,Ma=y(()=>{La();di();_r();xo();Ni();So();Cs=class extends ci{constructor(e,n,r,i){super(i);this._debugNameData=e;this._equalityComparator=r;this._value=n,Gt()?.handleObservableUpdated(this,{hadValue:!1,newValue:n,change:void 0,didChange:!0,oldValue:void 0})}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}get(){return this._value}set(e,n,r){if(r===void 0&&this._equalityComparator(this._value,e))return;let i;n||(n=i=new Kl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),Gt()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:r,didChange:!0,hadValue:!0});for(let a of this._observers)n.updateObserver(a,this),a.handleChange(this,r)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}});var VA=y(()=>{La();Ni();di()});var nI=y(()=>{xo();_r();Ma();VA();So()});function Z6(o){switch(o){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var Oa,rI=y(()=>{_r();Ni();Oa=class{constructor(t,e,n,r){this._debugNameData=t;this._runFn=e;this._changeTracker=n;this._state=2;this._updateCount=0;this._disposed=!1;this._dependencies=new Set;this._dependenciesToBeRemoved=new Set;this._isRunning=!1;this._iteration=0;this._store=void 0;this._delayedStore=void 0;this._changeSummary=this._changeTracker?.createChangeSummary(void 0),Gt()?.handleAutorunCreated(this,r),this._run(),Ms(this)}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}dispose(){if(!this._disposed){this._disposed=!0;for(let t of this._dependencies)t.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),Gt()?.handleAutorunDisposed(this),Os(this)}}_run(){let t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t,this._state=3;try{if(!this._disposed){Gt()?.handleAutorunStarted(this);let e=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(r){_s(r)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||Gt()?.handleAutorunFinished(this);for(let e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(t){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(t){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let e of this._dependencies)if(e.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}fp(()=>this._updateCount>=0)}handlePossibleChange(t){this._state===3&&this._isDependency(t)&&(this._checkIterations(),this._state=1)}handleChange(t,e){if(this._isDependency(t)){Gt()?.handleAutorunDependencyChanged(this,t,e);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:t,change:e,didChange:r=>r===t},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){_s(n)}}}_isDependency(t){return this._dependencies.has(t)&&!this._dependenciesToBeRemoved.has(t)}_ensureNoRunning(){if(!this._isRunning)throw new $t("The reader object cannot be used outside its compute function!")}readObservable(t){if(this._ensureNoRunning(),this._disposed)return t.get();t.addObserver(this);let e=t.get();return this._dependencies.add(t),this._dependenciesToBeRemoved.delete(t),e}get store(){if(this._ensureNoRunning(),this._disposed)throw new $t("Cannot access store after dispose");return this._store===void 0&&(this._store=new le),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new $t("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new le),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Z6(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?(_s(new $t(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}}});var Tu=y(()=>{_r();xo();rI();So()});function e3(o){switch(o){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}var qn,Pu=y(()=>{di();_r();Ni();qn=class extends ci{constructor(e,n,r,i=void 0,s,a){super(a);this._debugNameData=e;this._computeFn=n;this._changeTracker=r;this._handleLastObserverRemoved=i;this._equalityComparator=s;this._state=0;this._value=void 0;this._updateCount=0;this._dependencies=new Set;this._dependenciesToBeRemoved=new Set;this._changeSummary=void 0;this._isUpdating=!1;this._isComputing=!1;this._didReportChange=!1;this._isInBeforeUpdate=!1;this._isReaderValid=!1;this._store=void 0;this._delayedStore=void 0;this._removedObserverToCallEndUpdateOn=null;this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}onLastObserverRemoved(){this._state=0,this._value=void 0,Gt()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let n;try{this._isReaderValid=!0;let r;this._changeTracker&&(r=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,r)),n=this._computeFn(this,r)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),n}else{do{if(this._state===1){for(let n of this._dependencies)if(n.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let n=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=n;try{let r=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,r),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(r));let i=this._state!==0,s=this._value;this._state=3;let a=this._delayedStore;a!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,r)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),a!==void 0&&a.dispose()}e=this._didReportChange||i&&!this._equalityComparator(s,this._value),Gt()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:i})}catch(r){_s(r)}if(this._isComputing=!1,!this._didReportChange&&e)for(let r of this._observers)r.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new $t("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let n=this._updateCount===1;if(this._state===3&&(this._state=1,!n))for(let r of this._observers)r.handlePossibleChange(this);if(n)for(let r of this._observers)r.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let n=[...this._observers];for(let r of n)r.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let r=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let i of r)i.endUpdate(this)}}fp(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let n of this._observers)n.handlePossibleChange(this)}}handleChange(e,n){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){Gt()?.handleDerivedDependencyChanged(this,e,n);let r=!1;try{r=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:n,didChange:s=>s===e},this._changeSummary):!0}catch(s){_s(s)}let i=this._state===3;if(r&&(this._state===1||i)&&(this._state=2,i))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new $t("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let n=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),n}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let n of this._observers)n.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new le),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new le),this._delayedStore}addObserver(e){let n=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),n&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:e3(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,n,r){this._value=e;let i=this._observers;n.updateObserver(this,this);for(let s of i)s.handleChange(this,r)}}});function XT(o,t,e=Nn.ofCaller()){return new qn(new Dr(o.owner,o.debugName,o.debugReferenceFn),t,void 0,o.onLastObserverRemoved,o.equalsFn??Fo,e)}var oI=y(()=>{_r();So();xo();di();Pu();MA(XT)});var WA=y(()=>{La();oI();Ma()});var ZT=y(()=>{Se();Wt()});var HA=y(()=>{xo();ZT();_r();Tu();Pu();So()});function Ui(...o){let t,e,n,r;return o.length===2?[e,n]=o:[t,e,n,r]=o,new Vo(new Dr(t,void 0,n),e,n,()=>Vo.globalTransaction,Fo,r??Nn.ofCaller())}var Vo,Aa=y(()=>{La();_r();xo();Ni();di();So();Vo=class extends ci{constructor(e,n,r,i,s,a){super(a);this._debugNameData=e;this.event=n;this._getValue=r;this._getTransaction=i;this._equalityComparator=s;this._hasValue=!1;this.handleEvent=e=>{let n=this._getValue(e),r=this._value,i=!this._hasValue||!this._equalityComparator(r,n),s=!1;i&&(this._value=n,this._hasValue&&(s=!0,qT(this._getTransaction(),a=>{Gt()?.handleObservableUpdated(this,{oldValue:r,newValue:n,change:void 0,didChange:i,hadValue:this._hasValue});for(let l of this._observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{let a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")})),this._hasValue=!0),s||Gt()?.handleObservableUpdated(this,{oldValue:r,newValue:n,change:void 0,didChange:i,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};(e=>{e.Observer=Vo;function t(n,r){let i=!1;Vo.globalTransaction===void 0&&(Vo.globalTransaction=n,i=!0);try{r()}finally{i&&(Vo.globalTransaction=void 0)}}e.batchEventsGlobally=t})(Ui||={})});var eP=y(()=>{La();xo();di();So()});function $A(o){let t=new iI(!1,void 0);return o.addObserver(t),ie(()=>{o.removeObserver(t)})}function zA(o,t){let e=new iI(!0,t);o.addObserver(e);try{e.beginUpdate(o)}finally{e.endUpdate(o)}return ie(()=>{o.removeObserver(e)})}var iI,tP=y(()=>{Tu();Ma();_r();oI();Aa();eP();di();So();UA($A);AA(zA);iI=class{constructor(t,e){this._forceRecompute=t;this._handleValue=e;this._counter=0}beginUpdate(t){this._counter++}endUpdate(t){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(t.get()):t.reportChanges()),this._counter--}handlePossibleChange(t){}handleChange(t,e){}}});var GA=y(()=>{_r()});var qA=y(()=>{di()});var KA=y(()=>{La();xo();di();So()});var jA=y(()=>{_r();Aa()});var QA=y(()=>{ZT();_r();Tu()});var JA=y(()=>{_r();xo();Aa();Tu();tP()});var YA=y(()=>{nI()});var ZA=y(()=>{nI()});function eN(o){sI||(sI=new Hf,Wf(sI)),sI.addFilteredObj(o)}function s3(o){let t=new Array,e=[],n="";function r(s){if("length"in s)for(let a of s)a&&r(a);else"text"in s?(n+=`%c${s.text}`,t.push(s.style),s.data&&e.push(...s.data)):"data"in s&&e.push(...s.data)}r(o);let i=[n,...t];return i.push(...e),i}function ku(o){return Wo(o,{color:"black"})}function Ru(o){return Wo(d3(`${o}: `,10),{color:"black",bold:!0})}function Wo(o,t={color:"black"}){function e(r){return Object.entries(r).reduce((i,[s,a])=>`${i}${s}:${a};`,"")}let n={color:t.color};return t.strikeThrough&&(n["text-decoration"]="line-through"),t.bold&&(n["font-weight"]="bold"),{text:o,style:e(n)}}function Eo(o,t){switch(typeof o){case"number":return""+o;case"string":return o.length+2<=t?`"${o}"`:`"${o.substr(0,t-7)}"+...`;case"boolean":return o?"true":"false";case"undefined":return"undefined";case"object":return o===null?"null":Array.isArray(o)?a3(o,t):l3(o,t);case"symbol":return o.toString();case"function":return`[[Function${o.name?" "+o.name:""}]]`;default:return""+o}}function a3(o,t){let e="[ ",n=!0;for(let r of o){if(n||(e+=", "),e.length-5>t){e+="...";break}n=!1,e+=`${Eo(r,t-e.length)}`}return e+=" ]",e}function l3(o,t){if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString){let i=o.toString();return i.length<=t?i:i.substring(0,t-3)+"..."}let e=$T(o),n=e?e+"(":"{ ",r=!0;for(let[i,s]of Object.entries(o)){if(r||(n+=", "),n.length-5>t){n+="...";break}r=!1,n+=`${i}: ${Eo(s,t-n.length)}`}return n+=e?")":" }",n}function c3(o,t){let e="";for(let n=1;n<=t;n++)e+=o;return e}function d3(o,t){for(;o.length<t;)o+=" ";return o}var sI,Hf,aI=y(()=>{Ni();xo();Pu();Hf=class{constructor(){this.indentation=0;this.changedObservablesSets=new WeakMap}addFilteredObj(t){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(t)}_isIncluded(t){return this._filteredObjects?.has(t)??!0}textToConsoleArgs(t){return s3([ku(c3("| ",this.indentation)),t])}formatInfo(t){return t.hadValue?t.didChange?[ku(" "),Wo(Eo(t.oldValue,70),{color:"red",strikeThrough:!0}),ku(" "),Wo(Eo(t.newValue,60),{color:"green"})]:[ku(" (unchanged)")]:[ku(" "),Wo(Eo(t.newValue,60),{color:"green"}),ku(" (initial)")]}handleObservableCreated(t){if(t instanceof qn){let e=t;if(this.changedObservablesSets.set(e,new Set),!1){let r=[];e.__debugUpdating=r;let i=e.beginUpdate;e.beginUpdate=a=>(r.push(a),i.apply(e,[a]));let s=e.endUpdate;e.endUpdate=a=>{let l=r.indexOf(a);return l===-1&&console.error("endUpdate called without beginUpdate",e.debugName,a.debugName),r.splice(l,1),s.apply(e,[a])}}}}handleOnListenerCountChanged(t,e){}handleObservableUpdated(t,e){if(this._isIncluded(t)){if(t instanceof qn){this._handleDerivedRecomputed(t,e);return}console.log(...this.textToConsoleArgs([Ru("observable value changed"),Wo(t.debugName,{color:"BlueViolet"}),...this.formatInfo(e)]))}}formatChanges(t){if(t.size!==0)return Wo(" (changed deps: "+[...t].map(e=>e.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(t,e,n){this._isIncluded(t)&&this.changedObservablesSets.get(t)?.add(e)}_handleDerivedRecomputed(t,e){if(!this._isIncluded(t))return;let n=this.changedObservablesSets.get(t);n&&(console.log(...this.textToConsoleArgs([Ru("derived recomputed"),Wo(t.debugName,{color:"BlueViolet"}),...this.formatInfo(e),this.formatChanges(n),{data:[{fn:t._debugNameData.referenceFn??t._computeFn}]}])),n.clear())}handleDerivedCleared(t){this._isIncluded(t)&&console.log(...this.textToConsoleArgs([Ru("derived cleared"),Wo(t.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(t,e){this._isIncluded(t)&&console.log(...this.textToConsoleArgs([Ru("observable from event triggered"),Wo(t.debugName,{color:"BlueViolet"}),...this.formatInfo(e),{data:[{fn:t._getValue}]}]))}handleAutorunCreated(t){this._isIncluded(t)&&this.changedObservablesSets.set(t,new Set)}handleAutorunDisposed(t){}handleAutorunDependencyChanged(t,e,n){this._isIncluded(t)&&this.changedObservablesSets.get(t).add(e)}handleAutorunStarted(t){let e=this.changedObservablesSets.get(t);e&&(this._isIncluded(t)&&console.log(...this.textToConsoleArgs([Ru("autorun"),Wo(t.debugName,{color:"BlueViolet"}),this.formatChanges(e),{data:[{fn:t._debugNameData.referenceFn??t._runFn}]}])),e.clear(),this.indentation++)}handleAutorunFinished(t){this.indentation--}handleBeginTransaction(t){let e=t.getDebugName();e===void 0&&(e=""),this._isIncluded(t)&&console.log(...this.textToConsoleArgs([Ru("transaction"),Wo(e,{color:"BlueViolet"}),{data:[{fn:t._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}}});var lI,tN=y(()=>{lI=class o{constructor(t,e){this._channelFactory=t;this._getHandler=e;this._channel=this._channelFactory({handleNotification:i=>{let s=i,a=this._getHandler().notifications[s[0]];if(!a)throw new Error(`Unknown notification "${s[0]}"!`);a(...s[1])},handleRequest:i=>{let s=i;try{return{type:"result",value:this._getHandler().requests[s[0]](...s[1])}}catch(a){return{type:"error",value:a}}}});let n=new Proxy({},{get:(i,s)=>async(...a)=>{let l=await this._channel.sendRequest([s,a]);if(l.type==="error")throw l.value;return l.value}}),r=new Proxy({},{get:(i,s)=>(...a)=>{this._channel.sendNotification([s,a])}});this.api={notifications:r,requests:n}}static createHost(t,e){return new o(t,e)}static createClient(t,e){return new o(t,e)}}});function nN(o,t){let e=globalThis,n=[],r,{channel:i,handler:s}=u3({sendNotification:l=>{r?r.sendNotification(l):n.push(l)}}),a;return(e.$$debugValueEditor_debugChannels??(e.$$debugValueEditor_debugChannels={}))[o]=l=>{a=t(),r=l;for(let c of n)l.sendNotification(c);return n=[],s},lI.createClient(i,()=>{if(!a)throw new Error("Not supported");return a})}function u3(o){let t;return{channel:n=>(t=n,{sendNotification:r=>{o.sendNotification(r)},sendRequest:r=>{throw new Error("not supported")}}),handler:{handleRequest:n=>n.type==="notification"?t?.handleNotification(n.data):t?.handleRequest(n.data)}}}var rN=y(()=>{tN()});function nP(o,t){for(let e in t)o[e]&&typeof o[e]=="object"&&t[e]&&typeof t[e]=="object"?nP(o[e],t[e]):o[e]=t[e]}function rP(o,t){for(let e in t)t[e]===null?delete o[e]:o[e]&&typeof o[e]=="object"&&t[e]&&typeof t[e]=="object"?rP(o[e],t[e]):o[e]=t[e]}var cI,oN=y(()=>{cI=class{constructor(){this._timeout=void 0}throttle(t,e){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,t()},e))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}});var dI,iN=y(()=>{rI();aI();rN();oN();Me();Aa();Se();Pu();Ma();So();dI=class o{constructor(){this._declarationId=0;this._instanceId=0;this._declarations=new Map;this._instanceInfos=new WeakMap;this._aliveInstances=new Map;this._activeTransactions=new Set;this._channel=nN("observableDevTools",()=>({notifications:{setDeclarationIdFilter:t=>{},logObservableValue:t=>{console.log("logObservableValue",t)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{let t={};for(let e of this._declarations.values())t[e.id]=e;return{decls:t}},getSummarizedInstances:()=>null,getObservableValueInfo:t=>({observers:[...this._aliveInstances.get(t).debugGetObservers()].map(n=>this._formatObserver(n)).filter(io)}),getDerivedInfo:t=>{let e=this._aliveInstances.get(t);return{dependencies:[...e.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(io),observers:[...e.debugGetObservers()].map(n=>this._formatObserver(n)).filter(io)}},getAutorunInfo:t=>({dependencies:[...this._aliveInstances.get(t).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(io)}),getTransactionState:()=>this.getTransactionState(),setValue:(t,e)=>{let n=this._aliveInstances.get(t);if(n instanceof qn)n.debugSetValue(e);else if(n instanceof Cs)n.debugSetValue(e);else if(n instanceof Vo)n.debugSetValue(e);else throw new $t("Observable is not supported");let r=[...n.debugGetObservers()];for(let i of r)i.beginUpdate(n);for(let i of r)i.handleChange(n,void 0);for(let i of r)i.endUpdate(n)},getValue:t=>{let e=this._aliveInstances.get(t);if(e instanceof qn)return Eo(e.debugGetState().value,200);if(e instanceof Cs)return Eo(e.debugGetState().value,200)},logValue:t=>{let e=this._aliveInstances.get(t);if(e&&"get"in e)console.log("Logged Value:",e.get());else throw new $t("Observable is not supported")},rerun:t=>{let e=this._aliveInstances.get(t);if(e instanceof qn)e.debugRecompute();else if(e instanceof Oa)e.debugRerun();else throw new $t("Observable is not supported")}}}));this._pendingChanges=null;this._changeThrottler=new cI;this._fullState={};this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)};Nn.enable()}static{this._instance=void 0}static getInstance(){return o._instance===void 0&&(o._instance=new o),o._instance}getTransactionState(){let t=[],e=[...this._activeTransactions];if(e.length===0)return;let n=e.flatMap(i=>i.debugGetUpdatingObservers()??[]).map(i=>i.observer),r=new Set;for(;n.length>0;){let i=n.shift();if(r.has(i))continue;r.add(i);let s=this._getInfo(i,a=>{r.has(a)||n.push(a)});s&&t.push(s)}return{names:e.map(i=>i.getDebugName()??"tx"),affected:t}}_getObservableInfo(t){let e=this._instanceInfos.get(t);if(!e){Ke(new $t("No info found"));return}return e}_getAutorunInfo(t){let e=this._instanceInfos.get(t);if(!e){Ke(new $t("No info found"));return}return e}_getInfo(t,e){if(t instanceof qn){let n=[...t.debugGetObservers()];for(let l of n)e(l);let r=this._getObservableInfo(t);if(!r)return;let i=t.debugGetState(),s={name:t.debugName,instanceId:r.instanceId,updateCount:i.updateCount},a=[...r.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(io);if(i.isComputing)return{...s,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(i.state){case 0:return{...s,type:"observable/derived",state:"noValue"};case 3:return{...s,type:"observable/derived",state:"upToDate"};case 2:return{...s,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...s,type:"observable/derived",state:"possiblyStale"}}}else if(t instanceof Oa){let n=this._getAutorunInfo(t);if(!n)return;let r={name:t.debugName,instanceId:n.instanceId,updateCount:n.updateCount},i=[...n.changedObservables].map(s=>this._instanceInfos.get(s).instanceId);if(t.debugGetState().isRunning)return{...r,type:"autorun",state:"updating",changedDependencies:i};switch(t.debugGetState().state){case 3:return{...r,type:"autorun",state:"upToDate"};case 2:return{...r,type:"autorun",state:"stale",changedDependencies:i};case 1:return{...r,type:"autorun",state:"possiblyStale"}}}}_formatObservable(t){let e=this._getObservableInfo(t);if(e)return{name:t.debugName,instanceId:e.instanceId}}_formatObserver(t){if(t instanceof qn)return{name:t.toString(),instanceId:this._getObservableInfo(t)?.instanceId};let e=this._getAutorunInfo(t);if(e)return{name:t.toString(),instanceId:e.instanceId}}_handleChange(t){rP(this._fullState,t),this._pendingChanges===null?this._pendingChanges=t:nP(this._pendingChanges,t),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(t,e){if(!e)return-1;let n=this._declarations.get(e.id);return n===void 0&&(n={id:this._declarationId++,type:t,url:e.fileName,line:e.line,column:e.column},this._declarations.set(e.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(t,e){let r={declarationId:this._getDeclarationId("observable/value",e),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(t,r)}handleOnListenerCountChanged(t,e){let n=this._getObservableInfo(t);if(n){if(n.listenerCount===0&&e>0){let r=t instanceof qn?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,t),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:r,name:t.debugName}}})}else n.listenerCount>0&&e===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=e}}handleObservableUpdated(t,e){if(t instanceof qn){this._handleDerivedRecomputed(t,e);return}let n=this._getObservableInfo(t);n&&e.didChange&&(n.lastValue=Eo(e.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(t,e){let r={declarationId:this._getDeclarationId("autorun",e),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(t,r),this._aliveInstances.set(r.instanceId,t),r&&this._handleChange({instances:{[r.instanceId]:{instanceId:r.instanceId,declarationId:r.declarationId,runCount:0,type:"autorun",name:t.debugName}}})}handleAutorunDisposed(t){let e=this._getAutorunInfo(t);e&&(this._handleChange({instances:{[e.instanceId]:null}}),this._instanceInfos.delete(t),this._aliveInstances.delete(e.instanceId))}handleAutorunDependencyChanged(t,e,n){let r=this._getAutorunInfo(t);r&&r.changedObservables.add(e)}handleAutorunStarted(t){}handleAutorunFinished(t){let e=this._getAutorunInfo(t);e&&(e.changedObservables.clear(),e.updateCount++,this._handleChange({instances:{[e.instanceId]:{runCount:e.updateCount}}}))}handleDerivedDependencyChanged(t,e,n){let r=this._getObservableInfo(t);r&&r.changedObservables.add(e)}_handleDerivedRecomputed(t,e){let n=this._getObservableInfo(t);if(!n)return;let r=Eo(e.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=r,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:r,recomputationCount:n.updateCount}}})}handleDerivedCleared(t){let e=this._getObservableInfo(t);e&&(e.lastValue=void 0,e.changedObservables.clear(),e.listenerCount>0&&this._handleChange({instances:{[e.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(t){this._activeTransactions.add(t)}handleEndTransaction(t){this._activeTransactions.delete(t)}}});function sN(o,t){let e=t?.debugNamePostProcessor??(i=>i),n=jl.from(o,e);if(!n)return"";let r=new Set;return t.type==="observers"?lN(n,0,r,t).trim():aN(n,0,r,t).trim()}function aN(o,t,e,n){let r=" ".repeat(t),i=[];if(e.has(o.sourceObj))return i.push(`${r}* ${o.type} ${o.name} (already listed)`),i.join(`
- `);if(e.add(o.sourceObj),i.push(`${r}* ${o.type} ${o.name}:`),i.push(`${r} value: ${Eo(o.value,50)}`),i.push(`${r} state: ${o.state}`),o.dependencies.length>0){i.push(`${r} dependencies:`);for(let a of o.dependencies){let l=jl.from(a,n.debugNamePostProcessor??(c=>c))??jl.unknown(a);i.push(aN(l,t+1,e,n))}}return i.join(`
- `)}function lN(o,t,e,n){let r=" ".repeat(t),i=[];if(e.has(o.sourceObj))return i.push(`${r}* ${o.type} ${o.name} (already listed)`),i.join(`
- `);if(e.add(o.sourceObj),i.push(`${r}* ${o.type} ${o.name}:`),i.push(`${r} value: ${Eo(o.value,50)}`),i.push(`${r} state: ${o.state}`),o.observers.length>0){i.push(`${r} observers:`);for(let a of o.observers){let l=jl.from(a,n.debugNamePostProcessor??(c=>c))??jl.unknown(a);i.push(lN(l,t+1,e,n))}}return i.join(`
- `)}var jl,cN=y(()=>{Pu();Aa();Ma();rI();aI();jl=class o{constructor(t,e,n,r,i,s,a){this.sourceObj=t;this.name=e;this.type=n;this.value=r;this.state=i;this.dependencies=s;this.observers=a}static from(t,e){if(t instanceof Oa){let n=t.debugGetState();return new o(t,e(t.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(t instanceof qn){let n=t.debugGetState();return new o(t,e(t.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(t.debugGetObservers()))}else if(t instanceof Cs){let n=t.debugGetState();return new o(t,e(t.debugName),"observableValue",n.value,"upToDate",[],Array.from(t.debugGetObservers()))}else if(t instanceof Vo){let n=t.debugGetState();return new o(t,e(t.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(t.debugGetObservers()))}}static unknown(t){return new o(t,"(unknown)","unknown",void 0,"unknown",[],[])}}});var f3,dN=y(()=>{nI();Tu();Ma();oI();WA();HA();tP();GA();qA();eP();Aa();KA();La();jA();QA();JA();Aa();Ma();YA();ZA();So();Ni();aI();iN();no();di();cN();FA(sN);_A(eN);f3=!1;f3&&Wf(new Hf);tn&&tn.VSCODE_DEV_DEBUG_OBSERVABLES&&Wf(dI.getInstance())});var $f=y(()=>{dN()});var uN=y(()=>{});var oP,t0e,g3,h3,pN=y(()=>{Ko();q();$e();$f();ce();pe();nt();re();uN();(i=>{i.Internal={type:"internal",label:"Built-In"},i.External={type:"external",label:"External"};function e(s){switch(s.type){case"extension":return`extension:${s.extensionId.value}`;case"mcp":return`mcp:${s.collectionId}:${s.definitionId}`;case"user":return`user:${s.file.toString()}`;case"internal":return"internal";case"external":return"external"}}i.toKey=e;function n(s,a){return e(s)===e(a)}i.equals=n;function r(s){return s.type==="internal"?{ordinal:1,label:d(1332,null)}:s.type==="mcp"?{ordinal:2,label:s.label}:s.type==="user"?{ordinal:0,label:d(1334,null)}:{ordinal:3,label:s.label}}i.classify=r})(oP||={});t0e=_("ILanguageModelToolsService");(a=>(a.execute="execute",a.edit="edit",a.search="search",a.agent="agent",a.read="read",a.web="web",a.todo="todo"))(g3||={});(e=>(e.runSubagent="runSubagent",e.vscode="vscode"))(h3||={})});var iP,i0e,mN,fN=y(()=>{re();$e();iP=class{constructor(t){this.options=t}getItemLabel(t){return t.label}getItemDescription(t){if(!this.options?.skipDescription)return t.description}getItemPath(t){if(!this.options?.skipPath)return t.resource?.scheme===z.file?t.resource.fsPath:t.resource?.path}},i0e=new iP,mN=_("quickInputService")});var gN,l0e,hN=y(()=>{re();gN=_("encryptionService"),l0e=_("encryptionMainService")});var vN,uI,yN=y(()=>{ze();hN();re();ad();de();Fe();q();Qi();vN=_("secretStorageService"),uI=class extends D{constructor(e,n,r,i){super();this._useInMemoryStorage=e;this._storageService=n;this._encryptionService=r;this._logService=i;this._storagePrefix="secret://";this.onDidChangeSecretEmitter=this._register(new P);this.onDidChangeSecret=this.onDidChangeSecretEmitter.event;this._sequencer=new Pc;this._type="unknown";this._onDidChangeValueDisposable=this._register(new le);this._lazyStorageService=new gn(()=>this.initialize())}get type(){return this._type}get resolvedStorageService(){return this._lazyStorageService.value}get(e){return this._sequencer.queue(e,async()=>{let n=await this.resolvedStorageService,r=this.getKey(e);this._logService.trace("[secrets] getting secret for key:",r);let i=n.get(r,-1);if(!i){this._logService.trace("[secrets] no secret found for key:",r);return}try{this._logService.trace("[secrets] decrypting gotten secret for key:",r);let s=this._type==="in-memory"?i:await this._encryptionService.decrypt(i);return this._logService.trace("[secrets] decrypted secret for key:",r),s}catch(s){this._logService.error(s),this.delete(e);return}})}set(e,n){return this._sequencer.queue(e,async()=>{let r=await this.resolvedStorageService;this._logService.trace("[secrets] encrypting secret for key:",e);let i;try{i=this._type==="in-memory"?n:await this._encryptionService.encrypt(n)}catch(a){throw this._logService.error(a),a}let s=this.getKey(e);this._logService.trace("[secrets] storing encrypted secret for key:",s),r.store(s,i,-1,1),this._logService.trace("[secrets] stored encrypted secret for key:",s)})}delete(e){return this._sequencer.queue(e,async()=>{let n=await this.resolvedStorageService,r=this.getKey(e);this._logService.trace("[secrets] deleting secret for key:",r),n.remove(r,-1),this._logService.trace("[secrets] deleted secret for key:",r)})}keys(){return this._sequencer.queue("__keys__",async()=>{let e=await this.resolvedStorageService;this._logService.trace("[secrets] fetching keys of all secrets");let n=e.keys(-1,1);return this._logService.trace("[secrets] fetched keys of all secrets"),n.filter(r=>r.startsWith(this._storagePrefix)).map(r=>r.slice(this._storagePrefix.length))})}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 gv)}return this._onDidChangeValueDisposable.clear(),this._onDidChangeValueDisposable.add(e.onDidChangeValue(-1,void 0,this._onDidChangeValueDisposable)(n=>{this.onDidChangeValue(n.key)})),e}reinitialize(){this._lazyStorageService=new gn(()=>this.initialize())}onDidChangeValue(e){if(!e.startsWith(this._storagePrefix))return;let n=e.slice(this._storagePrefix.length);this._logService.trace(`[SecretStorageService] Notifying change in value for secret: ${n}`),this.onDidChangeSecretEmitter.fire(n)}getKey(e){return`${this._storagePrefix}${e}`}};uI=E([b(1,na),b(2,gN),b(3,Q)],uI)});var sP,aP,lP=y(()=>{Se();_n();sP=class{constructor(){this._generators=new Map;this._cache=new WeakMap}register(t,e){this._generators.set(t,e)}readActivationEvents(t){return this._cache.has(t)||this._cache.set(t,this._readActivationEvents(t)),this._cache.get(t)}createActivationEventsMap(t){let e=Object.create(null);for(let n of t){let r=this.readActivationEvents(n);r.length>0&&(e[un.toKey(n.identifier)]=r)}return e}_readActivationEvents(t){if(typeof t.main>"u"&&typeof t.browser>"u")return[];let e=Array.isArray(t.activationEvents)?t.activationEvents.slice(0):[];for(let n=0;n<e.length;n++)e[n]==="onUri"&&(e[n]=`onUri:${un.toKey(t.identifier)}`);if(!t.contributes)return e;for(let n in t.contributes){let r=this._generators.get(n);if(!r)continue;let i=t.contributes[n],s=Array.isArray(i)?i:[i];try{e.push(...r(s))}catch(a){Ke(a)}}return e}},aP=new sP});function pI(o,t){return!!o.enabledApiProposals}function cP(o,t){if(!pI(o,t))throw new Error(`Extension '${o.identifier.value}' CANNOT use API proposal: ${t}.
- Its package.json#enabledApiProposals-property declares: ${o.enabledApiProposals?.join(", ")??"[]"} but NOT ${t}.
- The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${o.identifier.value}`)}var O0e,bN,dP=y(()=>{de();ce();No();lP();_n();re();O0e=Object.freeze({identifier:new un("nullExtensionDescription"),name:"Null Extension Description",version:"0.0.0",publisher:"vscode",engines:{vscode:""},extensionLocation:I.parse("void:location"),isBuiltin:!1,targetPlatform:"undefined",isUserBuiltin:!1,isUnderDevelopment:!1,preRelease:!1}),bN=_("extensionService")});var gP,uP,pP,v3,IN,mP,fP,xN,SN,EN=y(()=>{pe();Se();as();rr();PS();Hr();_n();yn();lP();uE();gP=bt.as(Bp.JSONContribution),uP=class o{constructor(t,e){this.added=t;this.removed=e}static _toSet(t){let e=new rm;for(let n=0,r=t.length;n<r;n++)e.add(t[n].description.identifier);return e}static compute(t,e){if(!t||!t.length)return new o(e,[]);if(!e||!e.length)return new o([],t);let n=this._toSet(t),r=this._toSet(e),i=e.filter(a=>!n.has(a.description.identifier)),s=t.filter(a=>!r.has(a.description.identifier));return new o(i,s)}},pP=class{constructor(t,e,n){this.name=t,this.defaultExtensionKind=e,this.canHandleResolver=n,this._handler=null,this._users=null,this._delta=null}setHandler(t){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=t,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(t){this._delta=uP.compute(this._users,t),this._users=t,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(t){Ke(t)}}},v3={type:"string",enum:["ui","workspace"],enumDescriptions:[d(1477,null),d(1557,null)]},IN="vscode://schemas/vscode-extensions",mP={properties:{engines:{type:"object",description:d(1541,null),properties:{vscode:{type:"string",description:d(1542,null),default:"^1.105.0"}}},publisher:{description:d(1553,null),type:"string"},displayName:{description:d(1538,null),type:"string"},categories:{description:d(1532,null),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:nv},{type:"string",const:"Languages",deprecationMessage:d(1533,null)}]}},galleryBanner:{type:"object",description:d(1545,null),properties:{color:{description:d(1546,null),type:"string"},theme:{description:d(1547,null),type:"string",enum:["dark","light"]}}},contributes:{description:d(1534,null),type:"object",properties:{},default:{}},preview:{type:"boolean",description:d(1551,null)},enableProposedApi:{type:"boolean",deprecationMessage:d(1540,null)},enabledApiProposals:{markdownDescription:d(1539,null),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(hl).map(o=>o),markdownEnumDescriptions:Object.values(hl).map(o=>o.proposal)}},api:{markdownDescription:d(1512,null),type:"string",enum:["none"],enumDescriptions:[d(1513,null)]},activationEvents:{description:d(1478,null),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:d(1509,null),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:d(1492,null),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:d(1482,null),body:"onCommand:${2:commandId}"},{label:"onDebug",description:d(1484,null),body:"onDebug"},{label:"onDebugInitialConfigurations",description:d(1487,null),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:d(1486,null),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:d(1488,null),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:d(1485,null),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:d(1511,null),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:d(1500,null),body:"onStartupFinished"},{label:"onTaskType",description:d(1501,null),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:d(1490,null),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:d(1489,null),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:d(1499,null),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:d(1507,null)},{label:"onUri",body:"onUri",description:d(1506,null)},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:d(1497,null)},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:d(1483,null)},{label:"onNotebook",body:"onNotebook:${1:type}",description:d(1496,null)},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:d(1479,null)},{label:"onRenderer",description:d(1498,null),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:d(1503,null)},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:d(1504,null)},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:d(1508,null)},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:d(1491,null)},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:d(1481,null)},{label:"onChatContextProvider",body:"onChatContextProvider:${1:contextProviderId}",description:d(1480,null)},{label:"onLanguageModelChatProvider",body:"onLanguageModelChatProvider:${1:vendor}",description:d(1493,null)},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolId}",description:d(1494,null)},{label:"onTerminal",body:"onTerminal:{1:shellType}",description:d(1502,null)},{label:"onTerminalShellIntegration",body:"onTerminalShellIntegration:${1:shellType}",description:d(1505,null)},{label:"onMcpCollection",description:d(1495,null),body:"onMcpCollection:${2:collectionId}"},{label:"*",description:d(1510,null),body:"*"}]}},badges:{type:"array",description:d(1514,null),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:d(1517,null)},href:{type:"string",description:d(1516,null)},description:{type:"string",description:d(1515,null)}}}},markdown:{type:"string",description:d(1550,null),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:d(1554,null),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:d(1544,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:om}},extensionAffinity:{description:d(1543,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:om}},extensionPack:{description:d(1535,null),type:"array",uniqueItems:!0,items:{type:"string",pattern:om}},extensionKind:{description:d(1470,null),type:"array",items:v3,default:["workspace"],defaultSnippets:[{body:["ui"],description:d(1472,null)},{body:["workspace"],description:d(1474,null)},{body:["ui","workspace"],description:d(1473,null)},{body:["workspace","ui"],description:d(1475,null)},{body:[],description:d(1471,null)}]},capabilities:{description:d(1518,null),type:"object",properties:{virtualWorkspaces:{description:d(1526,null),type:["boolean","object"],defaultSnippets:[{label:"limited",body:{supported:"${1:limited}",description:"${2}"}},{label:"false",body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:d(1528,null),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[d(1530,null),d(1531,null),d(1529,null)]},description:{type:"string",markdownDescription:d(1527,null)}}},untrustedWorkspaces:{description:d(1519,null),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:d(1522,null),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[d(1524,null),d(1525,null),d(1523,null)]},restrictedConfigurations:{description:d(1521,null),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:d(1520,null)}}}}},sponsor:{description:d(1536,null),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:d(1537,null),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:d(1555,null),type:"string"},"vscode:uninstall":{description:d(1556,null),type:"string"}}},icon:{type:"string",description:d(1548,null)},l10n:{type:"string",description:d(1549,null)},pricing:{type:"string",markdownDescription:d(1552,null),enum:["Free","Trial"],default:"Free"}}},fP=class{constructor(){this._extensionPoints=new Map}registerExtensionPoint(t){if(this._extensionPoints.has(t.extensionPoint))throw new Error("Duplicate extension point: "+t.extensionPoint);let e=new pP(t.extensionPoint,t.defaultExtensionKind,t.canHandleResolver);return this._extensionPoints.set(t.extensionPoint,e),t.activationEventsGenerator&&aP.register(t.extensionPoint,t.activationEventsGenerator),mP.properties.contributes.properties[t.extensionPoint]=t.jsonSchema,gP.registerSchema(IN,mP),e}getExtensionPoints(){return Array.from(this._extensionPoints.values())}},xN={ExtensionsRegistry:"ExtensionsRegistry"};bt.add(xN.ExtensionsRegistry,new fP);SN=bt.as(xN.ExtensionsRegistry);gP.registerSchema(IN,mP);gP.registerSchema(X0,{properties:{extensionEnabledApiProposals:{description:d(1476,null),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(hl),markdownEnumDescriptions:Object.values(hl).map(o=>o.proposal)}}]}}}})});var Y0e,Z0e,e_e,wN,t_e,n_e,r_e,o_e,i_e,y3,s_e,CN=y(()=>{me();pe();mo();Y0e=new S("isMac",rt,d(640,null)),Z0e=new S("isLinux",_e,d(639,null)),e_e=new S("isWindows",te,d(644,null)),wN=new S("isWeb",Yt,d(643,null)),t_e=new S("isMacNative",rt&&!Yt,d(641,null)),n_e=new S("isIOS",_R,d(638,null)),r_e=new S("isMobile",LR,d(642,null)),o_e=new S("isDevelopment",!1,!0),i_e=new S("productQualityType","",d(645,null)),y3="inputFocus",s_e=new S(y3,!1,d(637,null))});var zf,hP=y(()=>{re();zf=_("languageService")});var Gf,vP=y(()=>{re();Gf=_("modelService")});var qf,PN=y(()=>{de();_a();Nt();qf=class extends Af{constructor(){super(...arguments);this._onDidChangeDirty=this._register(new P);this._onDidChangeLabel=this._register(new P);this._onDidChangeCapabilities=this._register(new P);this._onWillDispose=this._register(new P);this.onDidChangeDirty=this._onDidChangeDirty.event;this.onDidChangeLabel=this._onDidChangeLabel.event;this.onDidChangeCapabilities=this._onDidChangeCapabilities.event;this.onWillDispose=this._onWillDispose.event}get editorId(){}get capabilities(){return 2}hasCapability(e){return e===0?this.capabilities===0:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(2)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(0)}getIcon(){}getTelemetryDescriptor(){return{typeId:this.typeId}}isDirty(){return!1}isModified(){return this.isDirty()}isSaving(){return!1}async resolve(){return null}async save(e,n){return this}async saveAs(e,n){return this}async revert(e,n){}async rename(e,n){}copy(){return this}canMove(e,n){return!0}canReopen(){return!0}matches(e){if(Qr(e))return this===e;let n=e.options?.override;return this.editorId!==n&&n!==void 0&&this.editorId!==void 0?!1:bi(this.resource,Eu.getCanonicalUri(e))}prefersEditorPane(e){return e.at(0)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}});var H_e,kN=y(()=>{re();_a();H_e=_("editorGroupsService")});var Du,RN,DN,Kf=y(()=>{re();kN();Du=_("editorService"),RN=-1,DN=-2});var ui,_N=y(()=>{de();pe();Hr();_a();PN();Kf();ui=class extends qf{constructor(e,n,r,i,s){super();this.preferredName=e;this.preferredDescription=n;this.secondary=r;this.primary=i;this.editorService=s;this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}static{this.ID="workbench.editorinputs.sidebysideEditorInput"}get typeId(){return ui.ID}get capabilities(){let e=this.primary.capabilities;return e&=-33,this.secondary.hasCapability(16)&&(e|=16),this.secondary.hasCapability(8)&&(e|=8),this.secondary.hasCapability(1024)&&(e|=1024),e|=256,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}registerListeners(){this._register(F.once(F.any(this.primary.onWillDispose,this.secondary.onWillDispose))(()=>{this.isDisposed()||this.dispose()})),this._register(this.primary.onDidChangeDirty(()=>this._onDidChangeDirty.fire())),this._register(this.primary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.secondary.onDidChangeCapabilities(()=>this._onDidChangeCapabilities.fire())),this._register(this.primary.onDidChangeLabel(()=>this._onDidChangeLabel.fire())),this._register(this.secondary.onDidChangeLabel(()=>this._onDidChangeLabel.fire()))}getName(){let e=this.getPreferredName();return e||(this.hasIdenticalSides?this.primary.getName():d(1126,null,this.secondary.getName(),this.primary.getName()))}getPreferredName(){return this.preferredName}getDescription(e){let n=this.getPreferredDescription();return n||(this.hasIdenticalSides?this.primary.getDescription(e):super.getDescription(e))}getPreferredDescription(){return this.preferredDescription}getTitle(e){let n;this.hasIdenticalSides?n=this.primary.getTitle(e)??this.getName():n=super.getTitle(e);let r=this.getPreferredTitle();return r&&(n=`${r} (${n})`),n}getPreferredTitle(){if(this.preferredName&&this.preferredDescription)return`${this.preferredName} ${this.preferredDescription}`;if(this.preferredName||this.preferredDescription)return this.preferredName??this.preferredDescription}getLabelExtraClasses(){return this.hasIdenticalSides?this.primary.getLabelExtraClasses():super.getLabelExtraClasses()}getAriaLabel(){return this.hasIdenticalSides?this.primary.getAriaLabel():super.getAriaLabel()}getTelemetryDescriptor(){return{...this.primary.getTelemetryDescriptor(),...super.getTelemetryDescriptor()}}isDirty(){return this.primary.isDirty()}isSaving(){return this.primary.isSaving()}async save(e,n){let r=await this.primary.save(e,n);return this.saveResultToEditor(r)}async saveAs(e,n){let r=await this.primary.saveAs(e,n);return this.saveResultToEditor(r)}saveResultToEditor(e){if(!e||!this.hasIdenticalSides)return e;if(this.primary.matches(e))return this;if(e instanceof qf)return new ui(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!li(e)&&!Su(e)&&!Da(e)&&!Ra(e))return{primary:e,secondary:e,label:this.preferredName,description:this.preferredDescription}}revert(e,n){return this.primary.revert(e,n)}async rename(e,n){if(!this.hasIdenticalSides)return;let r=await this.primary.rename(e,n);if(r){if(Qr(r.editor))return{editor:new ui(this.preferredName,this.preferredDescription,r.editor,r.editor,this.editorService),options:{...r.options,viewState:Jb(this,e,this.editorService)}};if(uA(r.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:r.editor,secondary:r.editor,options:{...r.options,viewState:Jb(this,e,this.editorService)}}}}}isReadonly(){return this.primary.isReadonly()}toUntyped(e){let n=this.primary.toUntyped(e),r=this.secondary.toUntyped(e);if(n&&r&&!li(n)&&!li(r)&&!Su(n)&&!Su(r)&&!Da(n)&&!Da(r)&&!Ra(n)&&!Ra(r)){let i={label:this.preferredName,description:this.preferredDescription,primary:n,secondary:r};return typeof e?.preserveViewState=="number"&&(i.options={viewState:Jb(this,e.preserveViewState,this.editorService)}),i}}matches(e){return this===e?!0:NT(e)||li(e)?!1:e instanceof ui?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):Da(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}};ui=E([b(4,Du)],ui)});var _u,yP=y(()=>{de();q();_u=class extends D{constructor(){super(...arguments);this._onWillDispose=this._register(new P);this.onWillDispose=this._onWillDispose.event;this.resolved=!1}async resolve(){this.resolved=!0}isResolved(){return this.resolved}isDisposed(){return this._store.isDisposed}dispose(){this._onWillDispose.fire(),super.dispose()}}});var I3,bP,LN,jf,x3,MN=y(()=>{pe();de();Hr();q();_l();Si();I3={ModesRegistry:"editor.modesRegistry"},bP=class extends D{constructor(){super();this._onDidChangeLanguages=this._register(new P);this.onDidChangeLanguages=this._onDidChangeLanguages.event;this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let n=0,r=this._languages.length;n<r;n++)if(this._languages[n]===e){this._languages.splice(n,1);return}}}}getLanguages(){return this._languages}},LN=new bP;bt.add(I3.ModesRegistry,LN);jf="plaintext",x3=".txt";LN.registerLanguage({id:jf,extensions:[x3],aliases:[d(565,null),"text"],mimetypes:[Ir.text]});bt.as(kn.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1},"[go]":{"editor.insertSpaces":!1},"[makefile]":{"editor.insertSpaces":!1},"[shellscript]":{"files.eol":`
- `},"[yaml]":{"editor.insertSpaces":!0,"editor.tabSize":2}}}])});var ON,IP,AN=y(()=>{re();ON=_("ILanguageDetectionService"),IP="languageDetection"});var Ts,NN=y(()=>{RT();yP();hP();vP();q();MN();AN();ze();OC();pe();Ts=class extends _u{constructor(e,n,r,i,s){super();this.modelService=e;this.languageService=n;this.languageDetectionService=r;this.accessibilityService=i;this.textEditorModelHandle=void 0;this.modelDisposeListener=this._register(new mr);this.autoDetectLanguageThrottler=this._register(new kr(Ts.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY));this._blockLanguageChangeListener=!1;this._languageChangeSource=void 0;s&&this.handleExistingModel(s)}static{this.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600}handleExistingModel(e){let n=this.modelService.getModel(e);if(!n)throw new Error(`Document with resource ${e.toString(!0)} does not exist`);this.textEditorModelHandle=e,this.registerModelDisposeListener(n)}registerModelDisposeListener(e){this.modelDisposeListener.value=e.onWillDispose(()=>{this.textEditorModelHandle=void 0,this.dispose()})}get textEditorModel(){return this.textEditorModelHandle?this.modelService.getModel(this.textEditorModelHandle):null}isReadonly(){return!0}get languageChangeSource(){return this._languageChangeSource}get hasLanguageSetExplicitly(){return typeof this._languageChangeSource=="string"}setLanguageId(e,n){this._languageChangeSource="user",this.setLanguageIdInternal(e,n)}setLanguageIdInternal(e,n){if(this.isResolved()&&!(!e||e===this.textEditorModel.getLanguageId())){this._blockLanguageChangeListener=!0;try{this.textEditorModel.setLanguage(this.languageService.createById(e),n)}finally{this._blockLanguageChangeListener=!1}}}installModelListeners(e){let n=this._register(e.onDidChangeLanguage(r=>{r.source===IP||this._blockLanguageChangeListener||(this._languageChangeSource="api",n.dispose())}))}getLanguageId(){return this.textEditorModel?.getLanguageId()}autoDetectLanguage(){return this.autoDetectLanguageThrottler.trigger(()=>this.doAutoDetectLanguage())}async doAutoDetectLanguage(){if(this.hasLanguageSetExplicitly||!this.textEditorModelHandle||!this.languageDetectionService.isEnabledForLanguage(this.getLanguageId()??jf))return;let e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),n=this.getLanguageId();if(e&&e!==n&&!this.isDisposed()){this.setLanguageIdInternal(e,IP);let r=this.languageService.getLanguageName(e);this.accessibilityService.alert(d(1127,null,r??e))}}createTextEditorModel(e,n,r){let i=this.getFirstLineText(e),s=this.getOrCreateLanguage(n,this.languageService,r,i);return this.doCreateTextEditorModel(e,s,n)}doCreateTextEditorModel(e,n,r){let i=r&&this.modelService.getModel(r);return i?this.updateTextEditorModel(e,n.languageId):(i=this.modelService.createModel(e,n,r),this.createdEditorModel=!0,this.registerModelDisposeListener(i)),this.textEditorModelHandle=i.uri,i}getFirstLineText(e){let n=e;return typeof n.getFirstLineText=="function"?n.getFirstLineText(1e3):e.getLineContent(1).substr(0,1e3)}getOrCreateLanguage(e,n,r,i){return!r||r===jf?n.createByFilepathOrFirstLine(e??null,i):n.createById(r)}updateTextEditorModel(e,n,r){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e,r),n&&n!==jf&&this.textEditorModel.getLanguageId()!==n&&this.textEditorModel.setLanguage(this.languageService.createById(n)))}createSnapshot(){return this.textEditorModel?this.textEditorModel.createSnapshot(!0):null}isResolved(){return!!this.textEditorModelHandle}dispose(){this.modelDisposeListener.dispose(),this.textEditorModelHandle&&this.createdEditorModel&&this.modelService.destroyModel(this.textEditorModelHandle),this.textEditorModelHandle=void 0,this.createdEditorModel=!1,super.dispose()}};Ts=E([b(0,Gf),b(1,zf),b(2,ON),b(3,QO)],Ts)});var Lu,xP=y(()=>{yP();Lu=class extends _u{get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}constructor(t,e){super(),this._originalModel=t,this._modifiedModel=e}async resolve(){await Promise.all([this._originalModel?.resolve(),this._modifiedModel?.resolve()])}isResolved(){return!!(this._originalModel?.isResolved()&&this._modifiedModel?.isResolved())}dispose(){super.dispose()}}});var mI,UN=y(()=>{xP();mI=class extends Lu{constructor(e,n){super(e,n);this._textDiffEditorModel=void 0;this._originalModel=e,this._modifiedModel=n,this.updateTextDiffEditorModel()}get originalModel(){return this._originalModel}get modifiedModel(){return this._modifiedModel}get textDiffEditorModel(){return this._textDiffEditorModel}async resolve(){await super.resolve(),this.updateTextDiffEditorModel()}updateTextDiffEditorModel(){this.originalModel?.isResolved()&&this.modifiedModel?.isResolved()&&(this._textDiffEditorModel?(this._textDiffEditorModel.original=this.originalModel.textEditorModel,this._textDiffEditorModel.modified=this.modifiedModel.textEditorModel):this._textDiffEditorModel={original:this.originalModel.textEditorModel,modified:this.modifiedModel.textEditorModel})}isResolved(){return!!this._textDiffEditorModel}isReadonly(){return!!this.modifiedModel&&this.modifiedModel.isReadonly()}dispose(){this._textDiffEditorModel=void 0,super.dispose()}}});var Na,FN=y(()=>{pe();_N();_a();NN();xP();UN();Kf();Ff();iC();Na=class extends ui{constructor(e,n,r,i,s,a){super(e,n,r,i,a);this.original=r;this.modified=i;this.forceOpenAsBinary=s;this.cachedModel=void 0;this.labels=this.computeLabels()}static{this.ID="workbench.editors.diffEditorInput"}get typeId(){return Na.ID}get editorId(){return this.modified.editorId===this.original.editorId?this.modified.editorId:void 0}get capabilities(){let e=super.capabilities;return this.labels.forceDescription&&(e|=64),e}computeLabels(){let e,n=!1;if(this.preferredName)e=this.preferredName;else{let p=this.original.getName(),m=this.modified.getName();e=d(1125,null,p,m),n=p===m}let r,i,s;if(this.preferredDescription)r=this.preferredDescription,i=this.preferredDescription,s=this.preferredDescription;else{r=this.computeLabel(this.original.getDescription(0),this.modified.getDescription(0)),s=this.computeLabel(this.original.getDescription(2),this.modified.getDescription(2));let p=this.original.getDescription(1),m=this.modified.getDescription(1);if(typeof p=="string"&&typeof m=="string"&&(p||m)){let[g,h]=yA([p,m]);i=this.computeLabel(g,h)}}let a=this.computeLabel(this.original.getTitle(0)??this.original.getName(),this.modified.getTitle(0)??this.modified.getName()," \u2194 "),l=this.computeLabel(this.original.getTitle(1)??this.original.getName(),this.modified.getTitle(1)??this.modified.getName()," \u2194 "),c=this.computeLabel(this.original.getTitle(2)??this.original.getName(),this.modified.getTitle(2)??this.modified.getName()," \u2194 "),u=this.getPreferredTitle();return u&&(a=`${u} (${a})`,l=`${u} (${l})`,c=`${u} (${c})`),{name:e,shortDescription:r,mediumDescription:i,longDescription:s,forceDescription:n,shortTitle:a,mediumTitle:l,longTitle:c}}computeLabel(e,n,r=" - "){if(!(!e||!n))return e===n?n:`${e}${r}${n}`}getName(){return this.labels.name}getDescription(e=1){switch(e){case 0:return this.labels.shortDescription;case 2:return this.labels.longDescription;case 1:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case 0:return this.labels.shortTitle;case 2:return this.labels.longTitle;default:case 1:return this.labels.mediumTitle}}async resolve(){let e=await this.createModel();return this.cachedModel?.dispose(),this.cachedModel=e,this.cachedModel}prefersEditorPane(e){return this.forceOpenAsBinary?e.find(n=>n.typeId===dA):e.find(n=>n.typeId===cA)}async createModel(){let[e,n]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return n instanceof Ts&&e instanceof Ts?new mI(e,n):new Lu(oC(e)?e:void 0,oC(n)?n:void 0)}toUntyped(e){let n=super.toUntyped(e);if(n)return{...n,modified:n.primary,original:n.secondary}}matches(e){return this===e?!0:e instanceof Na?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:li(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}};Na=E([b(5,Du)],Na)});var TMe,PMe,kMe,RMe,DMe,_Me,VN,LMe,MMe,OMe,AMe,NMe,UMe,FMe,VMe,WMe,BMe,HMe,$Me,zMe,GMe,qMe,KMe,jMe,QMe,JMe,XMe,YMe,ZMe,eOe,tOe,nOe,rOe,oOe,iOe,sOe,aOe,S3,lOe,cOe,dOe,uOe,E3,pOe,mOe,fOe,gOe,hOe,vOe,yOe,bOe,IOe,xOe,SOe,EOe,wOe,COe,TOe,POe,kOe,ROe,DOe,_Oe,LOe,MOe,OOe,AOe,NOe,UOe,FOe,VOe,WOe,BOe,HOe,$Oe,zOe,GOe,qOe,Lr,fI,WN=y(()=>{q();pe();mo();Nt();hP();nt();vP();$e();_a();FN();TMe=new S("workbenchState",void 0,{type:"string",description:d(1119,null)}),PMe=new S("workspaceFolderCount",0,d(1120,null)),kMe=new S("openFolderWorkspaceSupport",!0,!0),RMe=new S("enterMultiRootWorkspaceSupport",!0,!0),DMe=new S("emptyWorkspaceSupport",!0,!0),_Me=new S("dirtyWorkingCopies",!1,d(1063,null)),VN=new S("remoteName","",d(1097,null)),LMe=new S("virtualWorkspace","",d(1118,null)),MMe=new S("temporaryWorkspace",!1,d(1112,null)),OMe=new S("isSessionsWindow",!1,d(1084,null)),AMe=new S("hasWebFileSystemAccess",!1,!0),NMe=new S("embedderIdentifier",void 0,d(1073,null)),UMe=new S("inAutomation",!1,d(1076,null)),FMe=new S("isFullscreen",!1,d(1082,null)),VMe=new S("isAuxiliaryWindowFocusedContext",!1,d(1079,null)),WMe=new S("isWindowAlwaysOnTop",!1,d(1085,null)),BMe=new S("isAuxiliaryWindow",!1,d(1078,null)),HMe=new S("activeEditorIsDirty",!1,d(1051,null)),$Me=new S("activeEditorIsNotPreview",!1,d(1054,null)),zMe=new S("activeEditorIsFirstInGroup",!1,d(1052,null)),GMe=new S("activeEditorIsLastInGroup",!1,d(1053,null)),qMe=new S("activeEditorIsPinned",!1,d(1055,null)),KMe=new S("activeEditorIsReadonly",!1,d(1056,null)),jMe=new S("activeCompareEditorCanSwap",!1,d(1042,null)),QMe=new S("activeEditorCanToggleReadonly",!0,d(1046,null)),JMe=new S("activeEditorCanRevert",!1,d(1045,null)),XMe=new S("activeEditorCanSplitInGroup",!0),YMe=new S("activeEditor",null,{type:"string",description:d(1043,null)}),ZMe=new S("activeEditorAvailableEditorIds","",d(1044,null)),eOe=new S("textCompareEditorVisible",!1,d(1114,null)),tOe=new S("textCompareEditorActive",!1,d(1113,null)),nOe=new S("sideBySideEditorActive",!1,d(1109,null)),rOe=new S("groupEditorsCount",0,d(1075,null)),oOe=new S("activeEditorGroupEmpty",!1,d(1047,null)),iOe=new S("activeEditorGroupIndex",0,d(1048,null)),sOe=new S("activeEditorGroupLast",!1,d(1049,null)),aOe=new S("activeEditorGroupLocked",!1,d(1050,null)),S3=new S("multipleEditorGroups",!1,d(1087,null)),lOe=S3.toNegated(),cOe=new S("multipleEditorsSelectedInGroup",!1,d(1088,null)),dOe=new S("twoEditorsSelectedInGroup",!1,d(1117,null)),uOe=new S("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,d(1106,null)),E3=new S("editorPartMultipleEditorGroups",!1,d(1071,null)),pOe=E3.toNegated(),mOe=new S("editorPartMaximizedEditorGroup",!1,d(1065,null)),fOe=new S("editorPartModal",!1,d(1066,null)),gOe=new S("editorPartModalMaximized",!1,d(1067,null)),hOe=new S("editorPartModalNavigation",!1,d(1068,null)),vOe=new S("editorPartModalSidebar",!1,d(1069,null)),yOe=new S("editorPartModalSidebarVisible",!1,d(1070,null)),bOe=new S("editorIsOpen",!1,d(1064,null)),IOe=new S("inZenMode",!1,d(1077,null)),xOe=new S("isCenteredLayout",!1,d(1083,null)),SOe=new S("splitEditorsVertically",!1,d(1110,null)),EOe=new S("mainEditorAreaVisible",!0,d(1086,null)),wOe=new S("editorTabsVisible",!0,d(1072,null)),COe=new S("sideBarVisible",!1,d(1108,null)),TOe=new S("sideBarFocus",!1,d(1107,null)),POe=new S("activeViewlet","",d(1058,null)),kOe=new S("statusBarFocused",!1,d(1111,null)),ROe=new S("titleBarStyle","custom",d(1115,null)),DOe=new S("titleBarVisible",!1,d(1116,null)),_Oe=new S("isCompactTitleBar",!1,d(1080,null)),LOe=new S("bannerFocused",!1,d(1062,null)),MOe=new S("notificationFocus",!0,d(1090,null)),OOe=new S("notificationCenterVisible",!1,d(1089,null)),AOe=new S("notificationToastsVisible",!1,d(1091,null)),NOe=new S("activeAuxiliary","",d(1041,null)),UOe=new S("auxiliaryBarFocus",!1,d(1059,null)),FOe=new S("auxiliaryBarVisible",!1,d(1061,null)),VOe=new S("auxiliaryBarMaximized",!1,d(1060,null)),WOe=new S("activePanel","",d(1057,null)),BOe=new S("panelFocus",!1,d(1093,null)),HOe=new S("panelPosition","bottom",d(1095,null)),$Oe=new S("panelAlignment","center",d(1092,null)),zOe=new S("panelVisible",!1,d(1096,null)),GOe=new S("panelMaximized",!1,d(1094,null)),qOe=new S("focusedView","",d(1074,null)),Lr=class{constructor(t,e,n,r){this._contextKeyService=t;this._fileService=e;this._languageService=n;this._modelService=r;this._schemeKey=Lr.Scheme.bindTo(this._contextKeyService),this._filenameKey=Lr.Filename.bindTo(this._contextKeyService),this._dirnameKey=Lr.Dirname.bindTo(this._contextKeyService),this._pathKey=Lr.Path.bindTo(this._contextKeyService),this._langIdKey=Lr.LangId.bindTo(this._contextKeyService),this._resourceKey=Lr.Resource.bindTo(this._contextKeyService),this._extensionKey=Lr.Extension.bindTo(this._contextKeyService),this._hasResource=Lr.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=Lr.IsFileSystemResource.bindTo(this._contextKeyService)}static{this.Scheme=new S("resourceScheme",void 0,{type:"string",description:d(1104,null)})}static{this.Filename=new S("resourceFilename",void 0,{type:"string",description:d(1101,null)})}static{this.Dirname=new S("resourceDirname",void 0,{type:"string",description:d(1099,null)})}static{this.Path=new S("resourcePath",void 0,{type:"string",description:d(1103,null)})}static{this.LangId=new S("resourceLangId",void 0,{type:"string",description:d(1102,null)})}static{this.Resource=new S("resource",void 0,{type:"URI",description:d(1098,null)})}static{this.Extension=new S("resourceExtname",void 0,{type:"string",description:d(1100,null)})}static{this.HasResource=new S("resourceSet",void 0,{type:"boolean",description:d(1105,null)})}static{this.IsFileSystemResource=new S("isFileSystemResource",void 0,{type:"boolean",description:d(1081,null)})}_setLangId(){let t=this.get();if(!t){this._langIdKey.set(null);return}let e=this._modelService.getModel(t)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(t);this._langIdKey.set(e)}set(t){t=t??void 0,!bi(this._value,t)&&(this._value=t,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.set(t?t.toString():null),this._schemeKey.set(t?t.scheme:null),this._filenameKey.set(t?Zn(t):null),this._dirnameKey.set(t?this.uriToPath(th(t)):null),this._pathKey.set(t?this.uriToPath(t):null),this._setLangId(),this._extensionKey.set(t?eh(t):null),this._hasResource.set(!!t),this._isFileSystemResource.set(t?this._fileService.hasProvider(t):!1)}))}uriToPath(t){return t.scheme===z.file?t.fsPath:t.path}reset(){this._value=void 0,this._contextKeyService.bufferChangeEvents(()=>{this._resourceKey.reset(),this._schemeKey.reset(),this._filenameKey.reset(),this._dirnameKey.reset(),this._pathKey.reset(),this._langIdKey.reset(),this._extensionKey.reset(),this._hasResource.reset(),this._isFileSystemResource.reset()})}get(){return this._value}};Lr=E([b(0,js),b(1,Oe),b(2,zf),b(3,Gf)],Lr);fI=class extends Lr{constructor(e,n,r,i){super(e,n,r,i);this._disposables=new le;this._disposables.add(n.onDidChangeFileSystemProviderRegistrations(()=>{let s=this.get();this._isFileSystemResource.set(!!(s&&n.hasProvider(s)))})),this._disposables.add(i.onModelAdded(s=>{bi(s.uri,this.get())&&this._setLangId()})),this._disposables.add(i.onModelLanguageChanged(s=>{bi(s.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}};fI=E([b(0,js),b(1,Oe),b(2,zf),b(3,Gf)],fI)});var BN,rAe,HN=y(()=>{Nt();as();pe();re();Ff();me();on();BN=_("dialogService"),rAe=_("fileDialogService")});var $N,sAe,zN=y(()=>{re();$N=_("IAuthenticationService"),sAe=_("IAuthenticationExtensionsService")});var GN,qN=y(()=>{re();GN=_("openerService")});var gI,SP=y(()=>{re();vn();gI=It});var KN,jN=y(()=>{re();KN=_("lifecycleService")});var QN,JN=y(()=>{re();QN=_("defaultAccountService")});function C3(o){return o===10||o===6||o===7||o===8||o===9}function EP(o,t,e){return!(o.getValue(XN)!==!0||t!==1||e.hidden||e.disabledInWorkspace)}function YN(o,t,e){e.publicLog2("chatEntitlements",{chatHidden:!!o.hidden,chatDisabled:!!o.disabled,chatEntitlement:o.entitlement,chatRegistered:!!o.registered,chatAnonymous:EP(t,o.entitlement,o)})}var he,w3,hI,XN,Qf,Jf,wo,ZN=y(()=>{Js();ze();Wt();de();Qi();q();pe();xn();mo();HN();re();Fe();yn();Zo();ad();nr();zN();qN();ce();as();SP();me();jN();Mm();$f();JN();(i=>(i.Setup={hidden:new S("chatSetupHidden",!1,!0),installed:new S("chatSetupInstalled",!1,!0),disabled:new S("chatSetupDisabled",!1,!0),disabledInWorkspace:new S("chatSetupDisabledInWorkspace",!1,!0),untrusted:new S("chatSetupUntrusted",!1,!0),later:new S("chatSetupLater",!1,!0),registered:new S("chatSetupRegistered",!1,!0),completed:new S("chatSetupCompleted",!1,!0)},i.Entitlement={signedOut:new S("chatEntitlementSignedOut",!1,!0),canSignUp:new S("chatPlanCanSignUp",!1,!0),planFree:new S("chatPlanFree",!1,!0),planPro:new S("chatPlanPro",!1,!0),planEdu:new S("chatPlanEdu",!1,!0),planProPlus:new S("chatPlanProPlus",!1,!0),planBusiness:new S("chatPlanBusiness",!1,!0),planEnterprise:new S("chatPlanEnterprise",!1,!0),organisations:new S("chatEntitlementOrganisations",void 0,!0),internal:new S("chatEntitlementInternal",!1,!0),sku:new S("chatEntitlementSku",void 0,!0)},i.chatQuotaExceeded=new S("chatQuotaExceeded",!1,!0),i.completionsQuotaExceeded=new S("completionsQuotaExceeded",!1,!0),i.chatAnonymous=new S("chatAnonymous",!1,!0)))(he||={});w3=_("chatEntitlementService");hI={upgradePlanUrl:St.defaultChatAgent?.upgradePlanUrl??"",providerUriSetting:St.defaultChatAgent?.providerUriSetting??"",entitlementSignupLimitedUrl:St.defaultChatAgent?.entitlementSignupLimitedUrl??"",chatQuotaExceededContext:St.defaultChatAgent?.chatQuotaExceededContext??"",completionsQuotaExceededContext:St.defaultChatAgent?.completionsQuotaExceededContext??""},XN="chat.allowAnonymousAccess";Qf=class extends D{constructor(e,n,r,i,s,a){super();this.contextKeyService=i;this.configurationService=s;this.telemetryService=a;this._onDidChangeQuotaExceeded=this._register(new P);this.onDidChangeQuotaExceeded=this._onDidChangeQuotaExceeded.event;this._onDidChangeQuotaRemaining=this._register(new P);this.onDidChangeQuotaRemaining=this._onDidChangeQuotaRemaining.event;this._quotas={};this.ExtensionQuotaContextKeys={chatQuotaExceeded:hI.chatQuotaExceededContext,completionsQuotaExceeded:hI.completionsQuotaExceededContext};this._onDidChangeAnonymous=this._register(new P);this.onDidChangeAnonymous=this._onDidChangeAnonymous.event;this.anonymousObs=Ui(this.onDidChangeAnonymous,()=>this.anonymous);if(this.chatQuotaExceededContextKey=he.chatQuotaExceeded.bindTo(this.contextKeyService),this.completionsQuotaExceededContextKey=he.completionsQuotaExceeded.bindTo(this.contextKeyService),this.anonymousContextKey=he.chatAnonymous.bindTo(this.contextKeyService),this.anonymousContextKey.set(this.anonymous),this.onDidChangeEntitlement=F.map(F.filter(this.contextKeyService.onDidChangeContext,c=>c.affectsSome(new Set([he.Entitlement.planEdu.key,he.Entitlement.planPro.key,he.Entitlement.planBusiness.key,he.Entitlement.planEnterprise.key,he.Entitlement.planProPlus.key,he.Entitlement.planFree.key,he.Entitlement.canSignUp.key,he.Entitlement.signedOut.key,he.Entitlement.organisations.key,he.Entitlement.internal.key,he.Entitlement.sku.key])),this._store),()=>{},this._store),this.entitlementObs=Ui(this.onDidChangeEntitlement,()=>this.entitlement),this.onDidChangeSentiment=F.map(F.filter(this.contextKeyService.onDidChangeContext,c=>c.affectsSome(new Set([he.Setup.completed.key,he.Setup.hidden.key,he.Setup.disabled.key,he.Setup.untrusted.key,he.Setup.installed.key,he.Setup.later.key,he.Setup.registered.key])),this._store),()=>{},this._store),this.sentimentObs=Ui(this.onDidChangeSentiment,()=>this.sentiment),Yt&&!r.remoteAuthority){he.Setup.hidden.bindTo(this.contextKeyService).set(!0);return}if(!n.defaultChatAgent)return;let l=this.context=new gn(()=>this._register(e.createInstance(wo)));this.requests=new gn(()=>this._register(e.createInstance(Jf,l.value,{clearQuotas:()=>this.clearQuotas(),acceptQuotas:c=>this.acceptQuotas(c)}))),this.registerListeners()}get entitlement(){return this.contextKeyService.getContextKeyValue(he.Entitlement.planEdu.key)===!0?10:this.contextKeyService.getContextKeyValue(he.Entitlement.planPro.key)===!0?6:this.contextKeyService.getContextKeyValue(he.Entitlement.planBusiness.key)===!0?8:this.contextKeyService.getContextKeyValue(he.Entitlement.planEnterprise.key)===!0?9:this.contextKeyService.getContextKeyValue(he.Entitlement.planProPlus.key)===!0?7:this.contextKeyService.getContextKeyValue(he.Entitlement.planFree.key)===!0?5:this.contextKeyService.getContextKeyValue(he.Entitlement.canSignUp.key)===!0?3:this.contextKeyService.getContextKeyValue(he.Entitlement.signedOut.key)===!0?1:2}get isInternal(){return this.contextKeyService.getContextKeyValue(he.Entitlement.internal.key)===!0}get organisations(){return this.contextKeyService.getContextKeyValue(he.Entitlement.organisations.key)}get sku(){return this.contextKeyService.getContextKeyValue(he.Entitlement.sku.key)}get copilotTrackingId(){return this.context?.value.state.copilotTrackingId}get previewFeaturesDisabled(){return this.contextKeyService.getContextKeyValue("github.copilot.previewFeaturesDisabled")===!0}get clientByokEnabled(){return this.contextKeyService.getContextKeyValue("github.copilot.clientByokEnabled")===!0}get quotas(){return this._quotas}registerListeners(){let e=new Set([this.ExtensionQuotaContextKeys.chatQuotaExceeded,this.ExtensionQuotaContextKeys.completionsQuotaExceeded]),n=this._register(new mr);this._register(this.contextKeyService.onDidChangeContext(s=>{s.affectsSome(e)&&(n.value&&n.value.cancel(),n.value=new gt,this.update(n.value.token))}));let r=this.anonymous,i=()=>{let s=this.anonymous;s!==r&&(r=s,this.anonymousContextKey.set(s),this.context?.hasValue&&YN(this.context.value.state,this.configurationService,this.telemetryService),this._onDidChangeAnonymous.fire())};this._register(this.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(XN)&&i()})),this._register(this.onDidChangeEntitlement(()=>i())),this._register(this.onDidChangeSentiment(()=>i()))}acceptQuotas(e){let n=this._quotas;this._quotas=e,this.updateContextKeys();let{changed:r}=this.compareQuotas(n.chat,e.chat),{changed:i}=this.compareQuotas(n.completions,e.completions),{changed:s}=this.compareQuotas(n.premiumChat,e.premiumChat);(r.exceeded||i.exceeded||s.exceeded)&&this._onDidChangeQuotaExceeded.fire(),(r.remaining||i.remaining||s.remaining)&&this._onDidChangeQuotaRemaining.fire()}compareQuotas(e,n){return{changed:{exceeded:e?.percentRemaining===0!=(n?.percentRemaining===0),remaining:e?.percentRemaining!==n?.percentRemaining}}}clearQuotas(){this.acceptQuotas({})}updateContextKeys(){this.chatQuotaExceededContextKey.set(this._quotas.chat?.percentRemaining===0),this.completionsQuotaExceededContextKey.set(this._quotas.completions?.percentRemaining===0)}get sentiment(){return{completed:this.contextKeyService.getContextKeyValue(he.Setup.completed.key)===!0,installed:this.contextKeyService.getContextKeyValue(he.Setup.installed.key)===!0,hidden:this.contextKeyService.getContextKeyValue(he.Setup.hidden.key)===!0,disabledInWorkspace:this.contextKeyService.getContextKeyValue(he.Setup.disabledInWorkspace.key)===!0,disabled:this.contextKeyService.getContextKeyValue(he.Setup.disabled.key)===!0,untrusted:this.contextKeyService.getContextKeyValue(he.Setup.untrusted.key)===!0,later:this.contextKeyService.getContextKeyValue(he.Setup.later.key)===!0,registered:this.contextKeyService.getContextKeyValue(he.Setup.registered.key)===!0}}get anonymous(){return EP(this.configurationService,this.entitlement,this.sentiment)}markAnonymousRateLimited(){this.anonymous&&(this.chatQuotaExceededContextKey.set(!0),this._onDidChangeQuotaExceeded.fire())}async update(e){await this.requests?.value.forceResolveEntitlement(e)}};Qf=E([b(0,gr),b(1,Ve),b(2,gI),b(3,js),b(4,xt),b(5,Ft)],Qf);Jf=class extends D{constructor(e,n,r,i,s,a,l,c,u,p){super();this.context=e;this.chatQuotasAccessor=n;this.telemetryService=r;this.logService=i;this.requestService=s;this.dialogService=a;this.openerService=l;this.lifecycleService=c;this.defaultAccountService=u;this.authenticationService=p;this.pendingResolveCts=new gt;this.state={entitlement:this.context.state.entitlement},this.registerListeners(),this.resolve()}registerListeners(){this._register(this.defaultAccountService.onDidChangeDefaultAccount(()=>this.resolve())),this._register(this.context.onDidChange(()=>{(this.context.state.disabled||this.context.state.entitlement===1)&&(this.state={entitlement:this.state.entitlement,quotas:void 0},this.chatQuotasAccessor.clearQuotas())}))}async resolve(){this.pendingResolveCts.dispose(!0);let e=this.pendingResolveCts=new gt,n=await this.defaultAccountService.getDefaultAccount();if(e.token.isCancellationRequested)return;let r;n?this.state.entitlement===1&&(r={entitlement:2}):r={entitlement:1},r&&this.update(r),n&&await this.resolveEntitlement(n,e.token)}async resolveEntitlement(e,n){let r=await this.doResolveEntitlement(e,n);return typeof r?.entitlement=="number"&&!n.isCancellationRequested&&this.update(r),r}async doResolveEntitlement(e,n){if(n.isCancellationRequested)return;let r=e.entitlementsData;if(!r)return this.logService.trace("[chat entitlement]: no entitlements data available on default account"),{entitlement:r===null?1:2};let i;r.access_type_sku==="free_limited_copilot"?i=5:r.can_signup_for_limited?i=3:r.copilot_plan==="individual_edu"?i=10:r.copilot_plan==="individual"?i=6:r.copilot_plan==="individual_pro"?i=7:r.copilot_plan==="business"?i=8:r.copilot_plan==="enterprise"?i=9:i=4;let s={entitlement:i,organisations:r.organization_login_list,quotas:this.toQuotas(r),sku:r.access_type_sku,copilotTrackingId:r.analytics_tracking_id};return this.logService.trace(`[chat entitlement]: resolved to ${s.entitlement}, quotas: ${JSON.stringify(s.quotas)}`),this.telemetryService.publicLog2("chatInstallEntitlement",{entitlement:s.entitlement,tid:r.analytics_tracking_id,sku:s.sku,quotaChat:s.quotas?.chat?.remaining,quotaPremiumChat:s.quotas?.premiumChat?.remaining,quotaCompletions:s.quotas?.completions?.remaining,quotaResetDate:s.quotas?.resetDate}),s}toQuotas(e){let n={resetDate:e.quota_reset_date_utc??e.quota_reset_date??e.limited_user_reset_date,resetDateHasTime:typeof e.quota_reset_date_utc=="string"};if(e.monthly_quotas?.chat&&typeof e.limited_user_quotas?.chat=="number"&&(n.chat={total:e.monthly_quotas.chat,remaining:e.limited_user_quotas.chat,percentRemaining:Math.min(100,Math.max(0,e.limited_user_quotas.chat/e.monthly_quotas.chat*100)),overageEnabled:!1,overageCount:0,unlimited:!1}),e.monthly_quotas?.completions&&typeof e.limited_user_quotas?.completions=="number"&&(n.completions={total:e.monthly_quotas.completions,remaining:e.limited_user_quotas.completions,percentRemaining:Math.min(100,Math.max(0,e.limited_user_quotas.completions/e.monthly_quotas.completions*100)),overageEnabled:!1,overageCount:0,unlimited:!1}),e.quota_snapshots)for(let r of["chat","completions","premium_interactions"]){let i=e.quota_snapshots[r];if(!i)continue;let s={total:i.entitlement,remaining:i.remaining,percentRemaining:Math.min(100,Math.max(0,i.percent_remaining)),overageEnabled:i.overage_permitted,overageCount:i.overage_count,unlimited:i.unlimited};switch(r){case"chat":n.chat=s;break;case"completions":n.completions=s;break;case"premium_interactions":n.premiumChat=s;break}}return n}async request(e,n,r,i,s,a){let l;for(let c of i){if(s.isCancellationRequested)return l;try{let u=await this.requestService.request({type:n,url:e,data:n==="POST"?JSON.stringify(r):void 0,disableCache:!0,headers:{Authorization:`Bearer ${c.accessToken}`},callSite:a},s),p=u.res.statusCode;if(p&&p!==200){l=u;continue}return u}catch(u){s.isCancellationRequested||this.logService.error(`[chat entitlement] request: error ${u}`)}}return l}update(e){this.state=e,this.context.update({entitlement:this.state.entitlement,organisations:this.state.organisations,sku:this.state.sku,copilotTrackingId:this.state.copilotTrackingId}),e.quotas&&this.chatQuotasAccessor.acceptQuotas(e.quotas)}async forceResolveEntitlement(e=Ee.None){let n=await this.defaultAccountService.refresh();if(n)return this.resolveEntitlement(n,e)}async signUpFree(){let e=await this.getSessions();if(e.length!==0)return this.doSignUpFree(e)}async doSignUpFree(e){let n={restricted_telemetry:this.telemetryService.telemetryLevel===0?"disabled":"enabled",public_code_suggestions:"enabled"},r=await this.request(hI.entitlementSignupLimitedUrl,"POST",n,e,Ee.None,"chatEntitlementService.signUpFree");if(!r)return await this.onUnknownSignUpError(d(1449,null),"[chat entitlement] sign-up: no response")?this.doSignUpFree(e):{errorCode:1};if(r.res.statusCode&&r.res.statusCode!==200){if(r.res.statusCode===422)try{let l=await jc(r);if(l){let c=JSON.parse(l);if(typeof c.message=="string"&&c.message)return this.onUnprocessableSignUpError(`[chat entitlement] sign-up: unprocessable entity (${c.message})`,c.message),{errorCode:r.res.statusCode}}}catch{}return await this.onUnknownSignUpError(d(1450,null,r.res.statusCode),`[chat entitlement] sign-up: unexpected status code ${r.res.statusCode}`)?this.doSignUpFree(e):{errorCode:r.res.statusCode}}let i=null;try{i=await jc(r)}catch{}if(!i)return await this.onUnknownSignUpError(d(1448,null),"[chat entitlement] sign-up: response has no content")?this.doSignUpFree(e):{errorCode:2};let s;try{s=JSON.parse(i),this.logService.trace(`[chat entitlement] sign-up: response is ${i}`)}catch(a){return await this.onUnknownSignUpError(d(1447,null),`[chat entitlement] sign-up: error parsing response (${a})`)?this.doSignUpFree(e):{errorCode:3}}return this.update({entitlement:5}),!!s?.subscribed}async getSessions(){let e=await this.defaultAccountService.getDefaultAccount();if(e){let r=(await this.authenticationService.getSessions(e.authenticationProvider.id)).filter(i=>i.id===e.sessionId);if(r.length)return r}return[...await this.authenticationService.getSessions(this.defaultAccountService.getDefaultAccountAuthenticationProvider().id)]}async onUnknownSignUpError(e,n){if(this.logService.error(n),!this.lifecycleService.willShutdown){let{confirmed:r}=await this.dialogService.confirm({type:Ae.Error,message:d(1451,null),detail:e,primaryButton:d(1446,null)});return r}return!1}onUnprocessableSignUpError(e,n){this.logService.error(e),this.lifecycleService.willShutdown||this.dialogService.prompt({type:Ae.Error,message:d(1452,null),detail:n,buttons:[{label:d(1439,null),run:()=>{}},{label:d(1438,null),run:()=>this.openerService.open(I.parse(hI.upgradePlanUrl))}]})}async signIn(e){let n=await this.defaultAccountService.signIn({additionalScopes:e?.additionalScopes,extraAuthorizeParameters:{get_started_with:"copilot-vscode"},provider:e?.useSocialProvider});if(!n)return{};let r=await this.doResolveEntitlement(n,Ee.None);return{defaultAccount:n,entitlements:r}}dispose(){this.pendingResolveCts.dispose(!0),super.dispose()}};Jf=E([b(2,Ft),b(3,Q),b(4,Rn),b(5,BN),b(6,GN),b(7,KN),b(8,QN),b(9,$N)],Jf);wo=class extends D{constructor(e,n,r,i,s){super();this.storageService=n;this.logService=r;this.configurationService=i;this.telemetryService=s;this.suspendedState=void 0;this._onDidChange=this._register(new P);this.onDidChange=this._onDidChange.event;this.updateBarrier=void 0;this.canSignUpContextKey=he.Entitlement.canSignUp.bindTo(e),this.signedOutContextKey=he.Entitlement.signedOut.bindTo(e),this.freeContextKey=he.Entitlement.planFree.bindTo(e),this.eduContextKey=he.Entitlement.planEdu.bindTo(e),this.proContextKey=he.Entitlement.planPro.bindTo(e),this.proPlusContextKey=he.Entitlement.planProPlus.bindTo(e),this.businessContextKey=he.Entitlement.planBusiness.bindTo(e),this.enterpriseContextKey=he.Entitlement.planEnterprise.bindTo(e),this.organisationsContextKey=he.Entitlement.organisations.bindTo(e),this.isInternalContextKey=he.Entitlement.internal.bindTo(e),this.skuContextKey=he.Entitlement.sku.bindTo(e),this.completedContext=he.Setup.completed.bindTo(e),this.hiddenContext=he.Setup.hidden.bindTo(e),this.disabledInWorkspaceContext=he.Setup.disabledInWorkspace.bindTo(e),this.laterContext=he.Setup.later.bindTo(e),this.installedContext=he.Setup.installed.bindTo(e),this.disabledContext=he.Setup.disabled.bindTo(e),this.untrustedContext=he.Setup.untrusted.bindTo(e),this.registeredContext=he.Setup.registered.bindTo(e),this._state=this.storageService.getObject(wo.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,0)??{entitlement:1,organisations:void 0,sku:void 0,copilotTrackingId:void 0},this.storageService.getBoolean(wo.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,0)===!0||(this.storageService.store(wo.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,!0,0,1),this._state.installed&&!this._state.completed&&(this._state.completed=!0,this.storageService.store(wo.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,this._state,0,1))),this.updateContextSync(),this.registerListeners()}static{this.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY="chat.setupContext"}static{this.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY="chat.setupContext.migrated.v1"}static{this.CHAT_DISABLED_CONFIGURATION_KEY="chat.disableAIFeatures"}get state(){return this.withConfiguration(this.suspendedState??this._state)}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(wo.CHAT_DISABLED_CONFIGURATION_KEY)&&this.updateContext()}))}withConfiguration(e){return this.configurationService.getValue(wo.CHAT_DISABLED_CONFIGURATION_KEY)===!0?{...e,hidden:!0}:e}async update(e){this.logService.trace(`[chat entitlement context] update(): ${JSON.stringify(e)}`);let n=JSON.stringify(this._state);if(typeof e.installed=="boolean"&&typeof e.disabled=="boolean"&&typeof e.untrusted=="boolean"&&(this._state.installed=e.installed,this._state.disabled=e.disabled,this._state.untrusted=e.untrusted,this._state.disabledInWorkspace=e.disabledInWorkspace,e.installed&&!e.disabled&&(e.hidden=!1)),typeof e.hidden=="boolean"&&(this._state.hidden=e.hidden),typeof e.later=="boolean"&&(this._state.later=e.later),typeof e.completed=="boolean"&&(this._state.completed=e.completed),typeof e.entitlement=="number"&&(this._state.entitlement=e.entitlement,this._state.organisations=e.organisations,this._state.sku=e.sku,this._state.copilotTrackingId=e.copilotTrackingId,this._state.entitlement===5||C3(this._state.entitlement)?this._state.registered=!0:this._state.entitlement===3&&(this._state.registered=!1)),EP(this.configurationService,this._state.entitlement,this._state)&&(this._state.sku="no_auth_limited_copilot"),n!==JSON.stringify(this._state))return this.storageService.store(wo.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,{...this._state,later:void 0},0,1),this.updateContext()}async updateContext(){await this.updateBarrier?.wait(),this.updateContextSync()}updateContextSync(){let e=this.withConfiguration(this._state);this.signedOutContextKey.set(e.entitlement===1),this.canSignUpContextKey.set(e.entitlement===3),this.freeContextKey.set(e.entitlement===5),this.eduContextKey.set(e.entitlement===10),this.proContextKey.set(e.entitlement===6),this.proPlusContextKey.set(e.entitlement===7),this.businessContextKey.set(e.entitlement===8),this.enterpriseContextKey.set(e.entitlement===9),this.organisationsContextKey.set(e.organisations),this.isInternalContextKey.set(!!e.organisations?.some(n=>n==="github"||n==="microsoft"||n==="ms-copilot"||n==="MicrosoftCopilot")),this.skuContextKey.set(e.sku),this.completedContext.set(!!e.completed),this.hiddenContext.set(!!e.hidden),this.disabledInWorkspaceContext.set(!!e.disabledInWorkspace),this.laterContext.set(!!e.later),this.installedContext.set(!!e.installed),this.disabledContext.set(!!e.disabled),this.untrustedContext.set(!!e.untrusted),this.registeredContext.set(!!e.registered),this.logService.trace(`[chat entitlement context] updateContext(): ${JSON.stringify(e)}`),YN(e,this.configurationService,this.telemetryService),this._onDidChange.fire()}suspend(){this.suspendedState={...this._state},this.updateBarrier=new lo}resume(){this.suspendedState=void 0,this.updateBarrier?.open(),this.updateBarrier=void 0}};wo=E([b(0,js),b(1,na),b(2,Q),b(3,xt),b(4,Ft)],wo);fa(w3,Qf,0)});var Ql,T3,eU=y(()=>{pe();mo();CN();WN();ZN();VT();(j=>{j.responseVote=new S("chatSessionResponseVote","",{type:"string",description:d(1211,null)}),j.responseDetectedAgentCommand=new S("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:d(1189,null)}),j.responseSupportsIssueReporting=new S("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:d(1180,null)}),j.responseIsFiltered=new S("chatSessionResponseFiltered",!1,{type:"boolean",description:d(1179,null)}),j.responseHasError=new S("chatSessionResponseError",!1,{type:"boolean",description:d(1178,null)}),j.requestInProgress=new S("chatSessionRequestInProgress",!1,{type:"boolean",description:d(1210,null)}),j.hasActiveRequest=new S("chatSessionHasActiveRequest",!1,{type:"boolean",description:d(1181,null)}),j.currentlyEditing=new S("chatSessionCurrentlyEditing",!1,{type:"boolean",description:d(1208,null)}),j.currentlyEditingInput=new S("chatSessionCurrentlyEditingInput",!1,{type:"boolean",description:d(1209,null)});let c;(cx=>(cx.Sent="s",cx.Queue="q",cx.Steer="st"))(c=j.EditingRequestType||={}),j.editingRequestType=new S("chatEditingSentRequest",void 0,{type:"string",description:d(1153,null)}),j.isResponse=new S("chatResponse",!1,{type:"boolean",description:d(1177,null)}),j.isRequest=new S("chatRequest",!1,{type:"boolean",description:d(1175,null)}),j.isFirstRequest=new S("chatFirstRequest",!1,{type:"boolean",description:d(1155,null)}),j.isPendingRequest=new S("chatRequestIsPending",!1,{type:"boolean",description:d(1176,null)}),j.itemId=new S("chatItemId","",{type:"string",description:d(1164,null)}),j.lastItemId=new S("chatLastItemId",[],{type:"string",description:d(1165,null)}),j.editApplied=new S("chatEditApplied",!1,{type:"boolean",description:d(1147,null)}),j.inputHasText=new S("chatInputHasText",!1,{type:"boolean",description:d(1207,null)}),j.inputHasFocus=new S("chatInputHasFocus",!1,{type:"boolean",description:d(1206,null)}),j.inChatInput=new S("inChatInput",!1,{type:"boolean",description:d(1204,null)}),j.inChatSession=new S("inChat",!1,{type:"boolean",description:d(1198,null)}),j.inChatQuestionCarousel=new S("inChatQuestionCarousel",!1,{type:"boolean",description:d(1200,null)}),j.inChatEditor=new S("inChatEditor",!1,{type:"boolean",description:d(1199,null)}),j.inChatTodoList=new S("inChatTodoList",!1,{type:"boolean",description:d(1203,null)}),j.inChatTip=new S("inChatTip",!1,{type:"boolean",description:d(1202,null)}),j.multipleChatTips=new S("multipleChatTips",!1,{type:"boolean",description:d(1214,null)}),j.inChatTerminalToolOutput=new S("inChatTerminalToolOutput",!1,{type:"boolean",description:d(1201,null)}),j.chatModeKind=new S("chatAgentKind","ask",{type:"string",description:d(1132,null)}),j.chatPermissionLevel=new S("chatPermissionLevel","default",{type:"string",description:d(1173,null)}),j.chatModeName=new S("chatModeName","",{type:"string",description:d(1168,null)}),j.chatModelId=new S("chatModelId","",{type:"string",description:d(1166,null)}),j.supported=Lt.or(wN.negate(),VN.notEqualsTo(""),Lt.has("config.chat.experimental.serverlessWebEnabled")),j.enabled=new S("chatIsEnabled",!1,{type:"boolean",description:d(1162,null)}),j.lockedToCodingAgent=new S("lockedToCodingAgent",!1,{type:"boolean",description:d(1213,null)}),j.lockedCodingAgentId=new S("lockedCodingAgentId","",{type:"string",description:d(1212,null)}),j.chatSessionHasCustomAgentTarget=new S("chatSessionHasCustomAgentTarget",!1,{type:"boolean",description:d(1182,null)}),j.chatSessionHasTargetedModels=new S("chatSessionHasTargetedModels",!1,{type:"boolean",description:d(1186,null)}),j.agentSupportsAttachments=new S("agentSupportsAttachments",!1,{type:"boolean",description:d(1144,null)}),j.withinEditSessionDiff=new S("withinEditSessionDiff",!1,{type:"boolean",description:d(1216,null)}),j.filePartOfEditSession=new S("filePartOfEditSession",!1,{type:"boolean",description:d(1195,null)}),j.extensionParticipantRegistered=new S("chatPanelExtensionParticipantRegistered",!1,{type:"boolean",description:d(1170,null)}),j.panelParticipantRegistered=new S("chatPanelParticipantRegistered",!1,{type:"boolean",description:d(1172,null)}),j.chatEditingCanUndo=new S("chatEditingCanUndo",!1,{type:"boolean",description:d(1149,null)}),j.chatEditingCanRedo=new S("chatEditingCanRedo",!1,{type:"boolean",description:d(1148,null)}),j.languageModelsAreUserSelectable=new S("chatModelsAreUserSelectable",!1,{type:"boolean",description:d(1167,null)}),j.chatSessionHasModels=new S("chatSessionHasModels",!1,{type:"boolean",description:d(1185,null)}),j.chatSessionOptionsValid=new S("chatSessionOptionsValid",!0,{type:"boolean",description:d(1188,null)}),j.extensionInvalid=new S("chatExtensionInvalid",!1,{type:"boolean",description:d(1154,null)}),j.inputCursorAtTop=new S("chatCursorAtTop",!1),j.inputHasAgent=new S("chatInputHasAgent",!1),j.location=new S("chatLocation",void 0),j.inQuickChat=new S("quickChatHasFocus",!1,{type:"boolean",description:d(1205,null)}),j.inAgentSessionsWelcome=new S("inAgentSessionsWelcome",!1,{type:"boolean",description:d(1197,null)}),j.chatSessionType=new S("chatSessionType","",{type:"string",description:d(1192,null)}),j.hasFileAttachments=new S("chatHasFileAttachments",!1,{type:"boolean",description:d(1159,null)}),j.chatSessionIsEmpty=new S("chatSessionIsEmpty",!0,{type:"boolean",description:d(1187,null)}),j.hasPendingRequests=new S("chatHasPendingRequests",!1,{type:"boolean",description:d(1160,null)}),j.chatSessionHasDebugData=new S("chatSessionHasDebugData",!1,{type:"boolean",description:d(1183,null)}),j.chatSessionHasDebugTools=new S("chatSessionHasDebugTools",!1,{type:"boolean",description:d(1184,null)}),j.remoteJobCreating=new S("chatRemoteJobCreating",!1,{type:"boolean",description:d(1174,null)}),j.hasRemoteCodingAgent=new S("hasRemoteCodingAgent",!1,d(1196,null)),j.hasCanDelegateProviders=new S("chatHasCanDelegateProviders",!1,{type:"boolean",description:d(1158,null)}),j.enableRemoteCodingAgentPromptFileOverlay=new S("enableRemoteCodingAgentPromptFileOverlay",!1,d(1194,null)),j.skipChatRequestInProgressMessage=new S("chatSkipRequestInProgressMessage",!1,{type:"boolean",description:d(1193,null)}),j.Setup=he.Setup,j.Entitlement=he.Entitlement,j.chatQuotaExceeded=he.chatQuotaExceeded,j.completionsQuotaExceeded=he.completionsQuotaExceeded,j.Editing={hasToolConfirmation:new S("chatHasToolConfirmation",!1,{type:"boolean",description:d(1152,null)}),hasElicitationRequest:new S("chatHasElicitationRequest",!1,{type:"boolean",description:d(1150,null)}),hasQuestionCarousel:new S("chatHasQuestionCarousel",!1,{type:"boolean",description:d(1151,null)})},j.Tools={toolsCount:new S("toolsCount",0,{type:"number",description:d(1215,null)})},j.foregroundSessionCount=new S("chatForegroundSessionCount",0,{type:"number",description:d(1156,null)}),j.Modes={hasCustomChatModes:new S("chatHasCustomAgents",!1,{type:"boolean",description:d(1157,null)}),agentModeDisabledByPolicy:new S("chatAgentModeDisabledByPolicy",!1,{type:"boolean",description:d(1145,null)})},j.panelLocation=new S("chatPanelLocation",void 0,{type:"number",description:d(1171,null)}),j.agentSessionsViewerFocused=new S("agentSessionsViewerFocused",!0,{type:"boolean",description:d(1139,null)}),j.agentSessionsViewerOrientation=new S("agentSessionsViewerOrientation",void 0,{type:"number",description:d(1140,null)}),j.agentSessionsViewerPosition=new S("agentSessionsViewerPosition",void 0,{type:"number",description:d(1141,null)}),j.agentSessionsViewerVisible=new S("agentSessionsViewerVisible",void 0,{type:"boolean",description:d(1142,null)}),j.agentSessionType=new S("chatSessionType","",{type:"string",description:d(1143,null)}),j.chatSessionSupportsDelegation=new S("chatSessionSupportsDelegation",!0,{type:"boolean",description:d(1190,null)}),j.chatSessionSupportsFork=new S("chatSessionSupportsFork",!1,{type:"boolean",description:d(1191,null)}),j.agentSessionSection=new S("agentSessionSection","",{type:"string",description:d(1138,null)}),j.isArchivedAgentSession=new S("agentSessionIsArchived",!1,{type:"boolean",description:d(1135,null)}),j.isPinnedAgentSession=new S("agentSessionIsPinned",!1,{type:"boolean",description:d(1136,null)}),j.isReadAgentSession=new S("agentSessionIsRead",!1,{type:"boolean",description:d(1137,null)}),j.hasMultipleAgentSessionsSelected=new S("agentSessionHasMultipleSelected",!1,{type:"boolean",description:d(1134,null)}),j.hasAgentSessionChanges=new S("agentSessionHasChanges",!1,{type:"boolean",description:d(1133,null)}),j.isKatexMathElement=new S("chatIsKatexMathElement",!1,{type:"boolean",description:d(1163,null)}),j.hasUsedCreateSlashCommands=new S("chatHasUsedCreateSlashCommands",!1,{type:"boolean",description:d(1161,null)}),j.contextUsageHasBeenOpened=new S("chatContextUsageHasBeenOpened",!1,{type:"boolean",description:d(1146,null)}),j.newChatButtonExperimentIcon=new S("chatNewChatButtonExperimentIcon","",{type:"string",description:d(1169,null)})})(Ql||={});(e=>(e.inEditingMode=Lt.or(Ql.chatModeKind.isEqualTo("edit"),Ql.chatModeKind.isEqualTo("agent")),e.isAgentHostSession=Lt.or(Lt.regex(Ql.lockedCodingAgentId.key,/^agent-host-/),Lt.regex(Ql.lockedCodingAgentId.key,/^remote-/))))(T3||={})});var tU,nU=y(()=>{re();tU=_("ILanguageModelsConfigurationService")});var iU,WNe,rU,P3,wP,oU,CP,TP,Jl,sU=y(()=>{ze();Wt();Se();de();ol();Ko();q();$f();on();as();Qt();_T();Me();sn();pe();mo();re();Fe();yn();Zo();fN();yN();ad();dP();EN();eU();nU();(n=>{function o(r){return(typeof r.capabilities?.agentMode>"u"||r.capabilities.agentMode)&&!!r.capabilities?.toolCalling}n.suitableForAgentMode=o;function t(r){return`${r.name} (${r.vendor})`}n.asQualifiedName=t;function e(r,i){return i.vendor==="copilot"&&r===i.name?!0:r===t(i)}n.matchesQualifiedName=e})(iU||={});WNe=_("ILanguageModelsService"),rU={type:"object",required:["vendor","displayName"],properties:{vendor:{type:"string",description:d(1239,null)},displayName:{type:"string",description:d(1235,null)},configuration:{type:"object",description:d(1233,null),anyOf:[{$ref:"http://json-schema.org/draft-07/schema#"},{properties:{properties:{type:"object",additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#",properties:{secret:{type:"boolean",description:d(1234,null)}}}},additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#",properties:{secret:{type:"boolean",description:d(1234,null)}}}}}]},managementCommand:{type:"string",description:d(1237,null),deprecated:!0,deprecationMessage:d(1238,null)},when:{type:"string",description:d(1241,null)}}},P3=SN.registerExtensionPoint({extensionPoint:"languageModelChatProviders",jsonSchema:{description:d(1232,null),oneOf:[rU,{type:"array",items:rU}]},activationEventsGenerator:function*(o){for(let t of o)yield`onLanguageModelChatProvider:${t.vendor}`}}),wP="chatModelPickerPreferences",oU="chatModelRecentlyUsed",CP="chat.participantNameRegistry",TP="chat.modelsControl",Jl=class{constructor(t,e,n,r,i,s,a,l,c){this._extensionService=t;this._logService=e;this._storageService=n;this._contextKeyService=r;this._languageModelsConfigurationService=i;this._quickInputService=s;this._secretStorageService=a;this._productService=l;this._requestService=c;this._store=new le;this._providers=new Map;this._vendors=new Map;this._onDidChangeLanguageModelVendors=this._store.add(new P);this.onDidChangeLanguageModelVendors=this._onDidChangeLanguageModelVendors.event;this._modelsGroups=new Map;this._modelCache=new Map;this._resolveLMSequencer=new Pc;this._modelPickerUserPreferences={};this._modelConfigurations=new Map;this._onLanguageModelChange=this._store.add(new P);this.onDidChangeLanguageModels=this._onLanguageModelChange.event;this._recentlyUsedModelIds=[];this._onDidChangeModelsControlManifest=this._store.add(new P);this.onDidChangeModelsControlManifest=this._onDidChangeModelsControlManifest.event;this._modelsControlManifest={free:{},paid:{}};this._chatControlDisposed=!1;this._restrictedChatParticipants=Bf(this,Object.create(null));this.restrictedChatParticipants=this._restrictedChatParticipants;this._hasUserSelectableModels=Ql.languageModelsAreUserSelectable.bindTo(r),this._modelPickerUserPreferences=this._readModelPickerPreferences(),this._recentlyUsedModelIds=this._readRecentlyUsedModels(),this._initChatControlData(),this._store.add(this._storageService.onDidChangeValue(0,wP,this._store)(()=>this._onDidChangeModelPickerPreferences())),this._store.add(this.onDidChangeLanguageModels(()=>{this._hasUserSelectableModels.set(this._modelCache.size>0&&Array.from(this._modelCache.values()).some(u=>u.isUserSelectable)),this._refreshModelsControlManifest()})),this._store.add(this._languageModelsConfigurationService.onDidChangeLanguageModelGroups(u=>this._onDidChangeLanguageModelGroups(u))),this._store.add(P3.setHandler((u,{added:p,removed:m})=>{let g=[],h=[];for(let v of p)for(let x of fn.wrap(v.value)){if(this._vendors.has(x.vendor)){v.collector.error(d(1240,null,x.vendor));continue}if(vp(x.vendor)){v.collector.error(d(1236,null));continue}if(x.vendor.trim()!==x.vendor){v.collector.error(d(1242,null));continue}g.push(x)}for(let v of m)for(let x of fn.wrap(v.value))h.push(x);this.deltaLanguageModelChatProviderDescriptors(g,h)}))}static{this.SECRET_KEY_PREFIX="chat.lm.secret."}static{this.SECRET_INPUT="${input:{0}}"}deltaLanguageModelChatProviderDescriptors(t,e){let n=[],r=[];for(let i of t){if(this._vendors.has(i.vendor)){this._logService.error(`The vendor '${i.vendor}' is already registered and cannot be registered twice`);continue}if(vp(i.vendor)){this._logService.error("The vendor field cannot be empty.");continue}if(i.vendor.trim()!==i.vendor){this._logService.error("The vendor field cannot start or end with whitespace.");continue}let s={vendor:i.vendor,displayName:i.displayName,configuration:i.configuration,managementCommand:i.managementCommand,when:i.when,isDefault:i.vendor==="copilot"};this._vendors.set(i.vendor,s),n.push(i.vendor),this._hasStoredModelForVendor(i.vendor)&&this._extensionService.activateByEvent(`onLanguageModelChatProvider:${i.vendor}`)}for(let i of e)this._vendors.delete(i.vendor),this._providers.delete(i.vendor),this._clearModelCache(i.vendor),r.push(i.vendor);for(let[i,s]of this._providers)this._vendors.has(i)||this._providers.delete(i);if((n.length>0||r.length>0)&&(this._onDidChangeLanguageModelVendors.fire([...n,...r]),r.length>0))for(let i of r)this._onLanguageModelChange.fire(i)}async _onDidChangeLanguageModelGroups(t){let e=new Set(t.map(n=>n.vendor));await Promise.all(Array.from(e).map(n=>this._resolveAllLanguageModels(n,!0)))}_readModelPickerPreferences(){return this._storageService.getObject(wP,0,{})}_onDidChangeModelPickerPreferences(){let t=this._readModelPickerPreferences(),e=this._modelPickerUserPreferences,n=new Set,r=!1;for(let i in t)if(e[i]!==t[i]){r=!0;let s=this._modelCache.get(i);s&&n.add(s.vendor)}for(let i in e)if(!t.hasOwnProperty(i)){r=!0;let s=this._modelCache.get(i);s&&n.add(s.vendor)}if(r){this._logService.trace("[LM] Updated model picker preferences from storage"),this._modelPickerUserPreferences=t;for(let i of n)this._onLanguageModelChange.fire(i)}}_hasStoredModelForVendor(t){return Object.keys(this._modelPickerUserPreferences).some(e=>e.startsWith(t))}_saveModelPickerPreferences(){this._storageService.store(wP,this._modelPickerUserPreferences,0,0)}updateModelPickerPreference(t,e){let n=this._modelCache.get(t);if(!n){this._logService.warn(`[LM] Cannot update model picker preference for unknown model ${t}`);return}this._modelPickerUserPreferences[t]=e,e===n.isUserSelectable?(delete this._modelPickerUserPreferences[t],this._saveModelPickerPreferences()):n.isUserSelectable!==e&&this._saveModelPickerPreferences(),this._onLanguageModelChange.fire(n.vendor),this._logService.trace(`[LM] Updated model picker preference for ${t} to ${e}`)}getVendors(){return Array.from(this._vendors.values()).filter(t=>{if(!t.when)return!0;let e=Lt.deserialize(t.when);return e?this._contextKeyService.contextMatchesRules(e):!1})}getLanguageModelIds(){return Array.from(this._modelCache.keys())}lookupLanguageModel(t){let e=this._modelCache.get(t);return e&&this._modelPickerUserPreferences[t]!==void 0?{...e,isUserSelectable:this._modelPickerUserPreferences[t]}:e}lookupLanguageModelByQualifiedName(t){for(let[e,n]of this._modelCache.entries())if(iU.matchesQualifiedName(t,n))return{metadata:n,identifier:e}}async _resolveAllLanguageModels(t,e){let n=this._vendors.get(t);if(!n)return;await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${t}`);let r=this._providers.get(t);if(!r){this._logService.warn(`[LM] No provider registered for vendor ${t}`);return}return this._resolveLMSequencer.queue(t,async()=>{let i=[],s=[];try{let p=await r.provideLanguageModelChatInfo({silent:e},Ee.None);if(p.length){i.push(...p);let m=[];for(let g of p)n.isDefault?g.metadata.isUserSelectable||this._modelPickerUserPreferences[g.identifier]===!0?m.push(g.identifier):this._logService.trace(`[LM] Skipping model ${g.identifier} from model picker as it is not user selectable.`):m.push(g.identifier);s.push({modelIdentifiers:m})}}catch(p){s.push({modelIdentifiers:[],status:{message:fe(p),severity:Ae.Error}})}let a=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),l=new Map;for(let p of a){if(p.vendor!==t)continue;if(!n.configuration&&i.length>0){if(p.settings)for(let g of i){let h=p.settings[g.metadata.id];h&&l.set(g.identifier,{...h})}s.push({group:p,modelIdentifiers:[]});continue}let m=await this._resolveConfiguration(p,n.configuration);try{let g=await r.provideLanguageModelChatInfo({group:p.name,silent:e,configuration:m},Ee.None);if(g.length&&(i.push(...g),s.push({group:p,modelIdentifiers:g.map(h=>h.identifier)})),p.settings)for(let h of g){let v=p.settings[h.metadata.id];v&&l.set(h.identifier,{...v})}}catch(g){s.push({group:p,modelIdentifiers:[],status:{message:fe(g),severity:Ae.Error}})}}this._modelsGroups.set(t,s);let c=this._clearModelCache(t),u=!1;for(let p of i){if(this._modelCache.has(p.identifier)){this._logService.warn(`[LM] Model ${p.identifier} is already registered. Skipping.`);continue}this._modelCache.set(p.identifier,p.metadata),u=u||!Ut(c.get(p.identifier),p.metadata),c.delete(p.identifier)}this._logService.trace(`[LM] Resolved language models for vendor ${t}`,i),u=u||c.size>0,this._clearModelConfigurations(t);for(let[p,m]of l)this._modelCache.has(p)&&this._modelConfigurations.set(p,m);u?this._onLanguageModelChange.fire(t):this._logService.trace(`[LM] No changes in language models for vendor ${t}`)})}getLanguageModelGroups(t){return this._modelsGroups.get(t)??[]}async selectLanguageModels(t){if(t.vendor)await this._resolveAllLanguageModels(t.vendor,!0);else{let n=Array.from(this._vendors.keys());await Promise.all(n.map(r=>this._resolveAllLanguageModels(r,!0)))}let e=[];for(let[n,r]of this._modelCache)(t.vendor===void 0||r.vendor===t.vendor)&&(t.family===void 0||r.family===t.family)&&(t.version===void 0||r.version===t.version)&&(t.id===void 0||r.id===t.id)&&e.push(n);return this._logService.trace("[LM] selected language models",t,e),e}registerLanguageModelProvider(t,e){if(this._logService.trace("[LM] registering language model provider",t,e),!this._vendors.has(t))throw new Error(`Chat model provider uses UNKNOWN vendor ${t}.`);if(this._providers.has(t))throw new Error(`Chat model provider for vendor ${t} is already registered.`);this._providers.set(t,e),this._hasStoredModelForVendor(t)&&this._resolveAllLanguageModels(t,!0);let n=e.onDidChange(()=>{this._resolveAllLanguageModels(t,!0)});return ie(()=>{this._logService.trace("[LM] UNregistered language model provider",t),this._clearModelCache(t),this._providers.delete(t),n.dispose()})}async sendChatRequest(t,e,n,r,i){let s=this._modelCache.get(t),a=this._providers.get(s?.vendor||"");if(!a)throw new Error(`Chat provider for model ${t} is not registered.`);let l=this.getModelConfiguration(t),c=l?{...r,configuration:{...l,...r.configuration}}:r;return a.sendChatRequest(t,n,e,c,i)}_resolveModelConfigurationWithDefaults(t,e){let n=this._modelConfigurations.get(t),r=e?.configurationSchema;if(!r?.properties&&!n)return;let i={};if(r?.properties)for(let[s,a]of Object.entries(r.properties))a.default!==void 0&&(i[s]=a.default);if(!(!n&&Object.keys(i).length===0))return{...i,...n}}computeTokenLength(t,e,n){let r=this._modelCache.get(t);if(!r)throw new Error(`Chat model ${t} could not be found.`);let i=this._providers.get(r.vendor);if(!i)throw new Error(`Chat provider for model ${t} is not registered.`);return i.provideTokenCount(t,e,n)}getModelConfiguration(t){let e=this._modelCache.get(t);return this._resolveModelConfigurationWithDefaults(t,e)}async setModelConfiguration(t,e){let n=this._modelCache.get(t);if(!n)return;let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i;i=r.find(c=>c.vendor===n.vendor&&c.settings?.[n.id]!==void 0),i||(i=r.find(c=>c.vendor===n.vendor));let a={...this._modelConfigurations.get(t)??{},...e},l=n.configurationSchema;if(l?.properties)for(let[c,u]of Object.entries(a)){let p=l.properties[c];p?.default!==void 0&&p.default===u&&delete a[c]}if(i){let c=i.settings??{},u;Object.keys(a).length===0?(u={...c},delete u[n.id]):u={...c,[n.id]:a};let p={...i,settings:Object.keys(u).length>0?u:void 0};!p.settings&&Object.keys(p).filter(m=>m!=="name"&&m!=="vendor"&&m!=="range"&&m!=="settings").length===0?await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(i):await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,p)}else if(Object.keys(a).length>0){let c=this._vendors.get(n.vendor);if(!c)return;let u={name:c.displayName,vendor:n.vendor,settings:{[n.id]:a}};await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(u)}Object.keys(a).length>0?this._modelConfigurations.set(t,a):this._modelConfigurations.delete(t),this._onLanguageModelChange.fire(n.vendor)}getModelConfigurationActions(t){let n=this._modelCache.get(t)?.configurationSchema;if(!n?.properties)return[];let r=[],i=this._modelConfigurations.get(t)??{};for(let[s,a]of Object.entries(n.properties)){if(!a.enum||!Array.isArray(a.enum))continue;let l=i[s]??a.default,c=(typeof a.title=="string"?a.title:void 0)??s.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,h=>h.toUpperCase()),u=a.default,p=a.enumItemLabels,m=a.enumDescriptions,g=a.enum.map((h,v)=>{let x=p?.[v]??String(h),T=h===u?d(1227,null,x):x,w=m?.[v]??"";return{id:`configureModel.${s}.${h}`,label:T,class:void 0,enabled:!0,tooltip:w,checked:l===h,run:()=>this.setModelConfiguration(t,{[s]:h})}});r.push(new Qb(`configureModel.${s}`,c,g))}return r}async configureLanguageModelsProviderGroup(t,e){let n=this.getVendors().find(({vendor:l})=>l===t);if(!n)throw new Error(`Vendor ${t} not found.`);if(n.managementCommand){await this._resolveAllLanguageModels(n.vendor,!1);return}let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=r.find(l=>l.vendor===t&&l.name===e),s=await this.promptForName(r,n,i);if(!s)return;let a=i?await this._resolveConfiguration(i,n.configuration):void 0;try{let l=n.configuration?await this.promptForConfiguration(s,n.configuration,a):void 0;if(n.configuration&&!l)return;let c=await this._resolveLanguageModelProviderGroup(s,t,l,n.configuration),u=i?await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,c):await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(c);if(n.configuration&&this.requireConfiguring(n.configuration)){let p=this.getSnippetForFirstUnconfiguredProperty(l??{},n.configuration);await this._languageModelsConfigurationService.configureLanguageModels({group:u,snippet:p})}}catch(l){if(Tn(l))return;throw l}}async configureModel(t){let e=this._modelCache.get(t);if(!e||!e.configurationSchema)return;let n=this._modelsGroups.get(e.vendor),r;if(n){for(let s of n)if(s.modelIdentifiers.includes(t)&&s.group){r=s.group;break}}if(!r){let s=this.getVendors().find(c=>c.vendor===e.vendor);if(!s)return;let l={name:s.displayName,vendor:e.vendor,settings:{[e.id]:{}}};r=await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(l),await this._resolveAllLanguageModels(e.vendor,!0)}let i=this._getModelConfigurationSnippet(e.id,e.configurationSchema);await this._languageModelsConfigurationService.configureLanguageModels({group:r,snippet:i})}_getModelConfigurationSnippet(t,e){let n=[];if(e.properties)for(let[i,s]of Object.entries(e.properties))if(s.defaultSnippets?.[0]){let a=s.defaultSnippets[0],l=a.bodyText??JSON.stringify(a.body,null," ");l=l.replace(/"(\^[^"]*)"/g,(c,u)=>u.substring(1)),n.push(` "${i}": ${l}`)}else s.default!==void 0?n.push(` "${i}": ${JSON.stringify(s.default)}`):n.push(` "${i}": \${${i}}`);let r=n.length>0?`{
- ${n.join(`,
- `)}
- }`:`{
- $0
- }`;return`"settings": {
- "${t}": ${r}
- }`}async addLanguageModelsProviderGroup(t,e,n){let r=this.getVendors().find(({vendor:s})=>s===e);if(!r)throw new Error(`Vendor ${e} not found.`);let i=await this._resolveLanguageModelProviderGroup(t,e,n,r.configuration);await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(i)}async removeLanguageModelsProviderGroup(t,e){let n=this.getVendors().find(({vendor:s})=>s===t);if(!n)throw new Error(`Vendor ${t} not found.`);let i=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(s=>s.vendor===t&&s.name===e);if(!i)throw new Error(`Language model provider group ${e} for vendor ${t} not found.`);await this._deleteSecretsInConfiguration(i,n.configuration),await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(i)}requireConfiguring(t){if(t.additionalProperties)return!0;if(!t.properties)return!1;for(let e of Object.keys(t.properties))if(!this.canPromptForProperty(t.properties[e]))return!0;return!1}getSnippetForFirstUnconfiguredProperty(t,e){if(e.properties){for(let n of Object.keys(e.properties))if(t[n]===void 0){let r=e.properties[n];if(r&&typeof r!="boolean"&&r.defaultSnippets?.[0]){let i=r.defaultSnippets[0],s=i.bodyText??JSON.stringify(i.body,null," ");return s=s.replace(/"(\^[^"]*)"/g,(a,l)=>l.substring(1)),`"${n}": ${s}`}}}}async promptForName(t,e,n){let r=n?.name;if(!r){r=e.displayName;let a=1;for(;t.some(l=>l.vendor===e.vendor&&l.name===r);)a++,r=`${e.displayName} ${a}`}let i,s=new le;try{await new Promise(a=>{let l=s.add(this._quickInputService.createInputBox());l.title=d(1223,null),l.placeholder=d(1226,null),l.value=r,l.ignoreFocusOut=!0,s.add(l.onDidChangeValue(c=>{if(!c){l.validationMessage=d(1224,null),l.severity=Ae.Error;return}if(!n&&t.some(u=>u.name===c)){l.validationMessage=d(1228,null),l.severity=Ae.Error;return}l.validationMessage=void 0,l.severity=Ae.Ignore})),s.add(l.onDidAccept(async()=>{i=l.value,l.hide()})),s.add(l.onDidHide(()=>a())),l.show()})}finally{s.dispose()}return i}async promptForConfiguration(t,e,n){if(!e.properties)return;let r=n?{...n}:{};for(let i of Object.keys(e.properties)){let s=e.properties[i],a=!!e.required?.includes(i),l=await this.promptForValue(t,i,s,a,n);l!==void 0&&(r[i]=l)}return r}async promptForValue(t,e,n,r,i){if(!n||!this.canPromptForProperty(n))return;if(n.type==="array"&&n.items&&!Array.isArray(n.items)&&n.items.enum){let a=await this.promptForArray(t,e,n);return a===void 0?void 0:a}let s=await this.promptForInput(t,e,n,r,i);if(s!==void 0)return s}canPromptForProperty(t){return!t||typeof t=="boolean"?!1:!!(t.type==="array"&&t.items&&!Array.isArray(t.items)&&t.items.enum||t.type==="string"||t.type==="number"||t.type==="integer"||t.type==="boolean")}async promptForArray(t,e,n){if(!n.items||Array.isArray(n.items)||!n.items.enum)return;let r=n.items.enum,i=new le;try{return await new Promise(s=>{let a=i.add(this._quickInputService.createQuickPick());a.title=`${t}: ${n.title??e}`,a.items=r.map(l=>({label:l})),a.placeholder=n.description??d(1230,null,e),a.canSelectMany=!0,a.ignoreFocusOut=!0,i.add(a.onDidAccept(()=>{s(a.selectedItems.map(l=>l.label)),a.hide()})),i.add(a.onDidHide(()=>{s(void 0)})),a.show()})}finally{i.dispose()}}async promptForInput(t,e,n,r,i){let s=new le;try{let a=await new Promise((l,c)=>{let u=s.add(this._quickInputService.createInputBox());u.title=`${t}: ${n.title??e}`,u.placeholder=d(1225,null,e),u.password=!!n.secret,u.ignoreFocusOut=!0,i?.[e]?u.value=String(i?.[e]):n.default&&(u.value=String(n.default)),n.description&&(u.prompt=n.description),s.add(u.onDidChangeValue(p=>{if(!p&&r){u.validationMessage=d(1231,null),u.severity=Ae.Error;return}if((n.type==="number"||n.type==="integer")&&isNaN(Number(p))){u.validationMessage=d(1229,null),u.severity=Ae.Error;return}if(n.type==="boolean"&&p!=="true"&&p!=="false"){u.validationMessage=d(1222,null),u.severity=Ae.Error;return}u.validationMessage=void 0,u.severity=Ae.Ignore})),s.add(u.onDidAccept(()=>{if(!u.value&&r){u.validationMessage=d(1231,null),u.severity=Ae.Error;return}l(u.value),u.hide()})),s.add(u.onDidHide(p=>{p.reason===2?c(new Ye):l(void 0)})),u.show()});return a?n.type==="number"||n.type==="integer"?Number(a):n.type==="boolean"?a==="true":a:void 0}finally{s.dispose()}}encodeSecretKey(t){return h1(Jl.SECRET_INPUT,t)}decodeSecretKey(t){if(ne(t))return t.substring(t.indexOf(":")+1,t.length-1)}_clearModelCache(t){let e=new Map;for(let[n,r]of this._modelCache.entries())r.vendor===t&&(e.set(n,r),this._modelCache.delete(n));return e}_clearModelConfigurations(t){for(let[e]of this._modelConfigurations)(this._modelCache.get(e)?.vendor===t||e.startsWith(`${t}/`))&&this._modelConfigurations.delete(e)}async _resolveConfiguration(t,e){if(!e)return{};let n={};for(let r in t){if(r==="vendor"||r==="name"||r==="range"||r==="settings")continue;let i=t[r];if(e.properties?.[r]?.secret){let s=this.decodeSecretKey(i);i=s?await this._secretStorageService.get(s):void 0}n[r]=i}return n}async _resolveLanguageModelProviderGroup(t,e,n,r){if(!r)return{name:t,vendor:e};let i={};for(let s in n){let a=n[s];if(r.properties?.[s]?.secret&&ne(a)){let l=`${Jl.SECRET_KEY_PREFIX}${po(Ce()).toString(16)}`;await this._secretStorageService.set(l,a),a=this.encodeSecretKey(l)}i[s]=a}return{name:t,vendor:e,...i}}async _deleteSecretsInConfiguration(t,e){if(!e)return;let{vendor:n,name:r,range:i,...s}=t;for(let a in s){let l=t[a];if(e.properties?.[a]?.secret){let c=this.decodeSecretKey(l);c&&await this._secretStorageService.delete(c)}}}async migrateLanguageModelsProviderGroup(t){let{vendor:e,name:n,...r}=t;if(!this._vendors.get(e))throw new Error(`Vendor ${e} not found.`);await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${e}`);let i=this._providers.get(e);if(!i)throw new Error(`Chat model provider for vendor ${e} is not registered.`);let s=await i.provideLanguageModelChatInfo({group:n,silent:!1,configuration:r},Ee.None);for(let a of s){let l=`${e}/${a.metadata.id}`;this._modelPickerUserPreferences[l]===!0&&(this._modelPickerUserPreferences[a.identifier]=!0),delete this._modelPickerUserPreferences[l]}this._saveModelPickerPreferences(),await this.addLanguageModelsProviderGroup(n,e,r)}_readRecentlyUsedModels(){return this._storageService.getObject(oU,0,[])}_saveRecentlyUsedModels(){this._storageService.store(oU,this._recentlyUsedModelIds,0,0)}getRecentlyUsedModelIds(){return this._recentlyUsedModelIds.filter(t=>this._modelCache.has(t)&&t!=="copilot/auto").slice(0,4)}addToRecentlyUsedList(t){if(t==="copilot/auto")return;let e=this._recentlyUsedModelIds.indexOf(t);e!==-1&&this._recentlyUsedModelIds.splice(e,1),this._recentlyUsedModelIds.unshift(t),this._recentlyUsedModelIds.length>20&&(this._recentlyUsedModelIds.length=20),this._saveRecentlyUsedModels()}clearRecentlyUsedList(){this._recentlyUsedModelIds=[],this._saveRecentlyUsedModels()}getModelsControlManifest(){return this._modelsControlManifest}_setModelsControlManifest(t){this._modelsControlRawResponse=t,this._refreshModelsControlManifest()}_refreshModelsControlManifest(){let t=this._modelsControlRawResponse,e={},n={};if(t?.free){let r=Array.isArray(t.free)?t.free:Object.values(t.free);for(let i of r)!i||!Ue(i)||(e[i.id]={label:i.label,featured:i.featured,exists:this._modelCache.has(`copilot/${i.id}`)})}if(t?.paid){let r=Array.isArray(t.paid)?t.paid:Object.values(t.paid);for(let i of r)!i||!Ue(i)||(n[i.id]={label:i.label,featured:i.featured,minVSCodeVersion:i.minVSCodeVersion,exists:this._modelCache.has(`copilot/${i.id}`)})}this._modelsControlManifest={free:e,paid:n},this._onDidChangeModelsControlManifest.fire(this._modelsControlManifest)}_initChatControlData(){if(this._chatControlUrl=this._productService.chatParticipantRegistry,!this._chatControlUrl)return;let t=this._storageService.get(CP,-1);try{this._restrictedChatParticipants.set(JSON.parse(t??"{}"),void 0)}catch{this._storageService.remove(CP,-1)}let e=this._storageService.get(TP,-1);try{let n=JSON.parse(e??"{}");Ue(n)&&this._setModelsControlManifest(n)}catch{this._storageService.remove(TP,-1)}this._refreshChatControlData()}_refreshChatControlData(){this._chatControlDisposed||this._fetchChatControlData().catch(t=>this._logService.warn("Failed to fetch chat control data",t)).then(()=>uo(300*1e3)).then(()=>this._refreshChatControlData())}async _fetchChatControlData(){this._logService.trace("[LM] Fetching chat control data from",this._chatControlUrl);let t;try{t=await this._requestService.request({type:"GET",url:this._chatControlUrl,callSite:"languageModels.fetchChatControlData"},Ee.None)}catch(r){this._logService.warn("[LM] Failed to request chat control data",fe(r));return}if(t.res.statusCode!==200){this._logService.warn(`[LM] Chat control data request failed with status ${t.res.statusCode}`);return}let e;try{e=await Ci(t)}catch(r){this._logService.warn("[LM] Failed to parse chat control response",fe(r));return}if(this._logService.trace("[LM] Received chat control response",e?Object.keys(e):"null"),!e||e.version!==1){this._logService.warn("[LM] Unexpected chat control response version",e?.version);return}let n=e.restrictedChatParticipants;this._restrictedChatParticipants.set(n,void 0),this._storageService.store(CP,JSON.stringify(n),-1,1),e.models&&(this._logService.trace("[LM] Updating models control manifest",{freeCount:Object.keys(e.models.free??{}).length,paidCount:Object.keys(e.models.paid??{}).length}),this._setModelsControlManifest(e.models),this._storageService.store(TP,JSON.stringify(e.models),-1,1))}dispose(){this._chatControlDisposed=!0,this._store.dispose(),this._providers.clear()}};Jl=E([b(0,bN),b(1,Q),b(2,na),b(3,js),b(4,tU),b(5,mN),b(6,vN),b(7,Ve),b(8,Rn)],Jl)});var KNe,jNe,QNe,R3,JNe,XNe,YNe,ZNe,eUe,tUe,nUe,rUe,oUe,iUe,sUe,aUe,lUe,cUe,dUe,uUe,pUe,mUe,fUe,gUe,hUe,vUe,yUe,bUe,IUe,xUe,SUe,EUe,wUe,CUe,TUe,PUe,kUe,RUe,DUe,_Ue,LUe,MUe,OUe,AUe,NUe,UUe,FUe,VUe,WUe,BUe,HUe,$Ue,zUe,GUe,qUe,KUe,jUe,QUe,JUe,XUe,YUe,ZUe,e2e,t2e,n2e,r2e,D3,_3,aU=y(()=>{ce();pe();mo();re();KNe=new S("debugType",void 0,{type:"string",description:d(1363,null)}),jNe=new S("debugConfigurationType",void 0,{type:"string",description:d(1354,null)}),QNe=new S("debugState","inactive",{type:"string",description:d(1362,null)}),R3="debugUx",JNe=new S(R3,"default",{type:"string",description:d(1364,null)}),XNe=new S("hasDebugged",!1,{type:"boolean",description:d(1372,null)}),YNe=new S("inDebugMode",!1,{type:"boolean",description:d(1374,null)}),ZNe=new S("inDebugRepl",!1,{type:"boolean",description:d(1375,null)}),eUe=new S("breakpointWidgetVisible",!1,{type:"boolean",description:d(1344,null)}),tUe=new S("inBreakpointWidget",!1,{type:"boolean",description:d(1373,null)}),nUe=new S("breakpointsFocused",!0,{type:"boolean",description:d(1342,null)}),rUe=new S("watchExpressionsFocused",!0,{type:"boolean",description:d(1400,null)}),oUe=new S("watchExpressionsExist",!1,{type:"boolean",description:d(1399,null)}),iUe=new S("variablesFocused",!0,{type:"boolean",description:d(1396,null)}),sUe=new S("expressionSelected",!1,{type:"boolean",description:d(1368,null)}),aUe=new S("breakpointInputFocused",!1,{type:"boolean",description:d(1338,null)}),lUe=new S("callStackItemType",void 0,{type:"string",description:d(1350,null)}),cUe=new S("callStackSessionIsAttach",!1,{type:"boolean",description:d(1352,null)}),dUe=new S("callStackItemStopped",!1,{type:"boolean",description:d(1349,null)}),uUe=new S("callStackSessionHasOneThread",!1,{type:"boolean",description:d(1351,null)}),pUe=new S("callStackFocused",!0,{type:"boolean",description:d(1348,null)}),mUe=new S("watchItemType",void 0,{type:"string",description:d(1401,null)}),fUe=new S("canViewMemory",void 0,{type:"boolean",description:d(1353,null)}),gUe=new S("breakpointItemType",void 0,{type:"string",description:d(1340,null)}),hUe=new S("breakpointItemBytes",void 0,{type:"boolean",description:d(1339,null)}),vUe=new S("breakpointHasModes",!1,{type:"boolean",description:d(1337,null)}),yUe=new S("breakpointSupportsCondition",!1,{type:"boolean",description:d(1343,null)}),bUe=new S("loadedScriptsSupported",!1,{type:"boolean",description:d(1380,null)}),IUe=new S("loadedScriptsItemType",void 0,{type:"string",description:d(1379,null)}),xUe=new S("focusedSessionIsAttach",!1,{type:"boolean",description:d(1369,null)}),SUe=new S("focusedSessionIsNoDebug",!1,{type:"boolean",description:d(1370,null)}),EUe=new S("stepBackSupported",!1,{type:"boolean",description:d(1385,null)}),wUe=new S("restartFrameSupported",!1,{type:"boolean",description:d(1383,null)}),CUe=new S("stackFrameSupportsRestart",!1,{type:"boolean",description:d(1384,null)}),TUe=new S("jumpToCursorSupported",!1,{type:"boolean",description:d(1377,null)}),PUe=new S("stepIntoTargetsSupported",!1,{type:"boolean",description:d(1386,null)}),kUe=new S("breakpointsExist",!1,{type:"boolean",description:d(1341,null)}),RUe=new S("debuggersAvailable",!1,{type:"boolean",description:d(1357,null)}),DUe=new S("debugExtensionAvailable",!0,{type:"boolean",description:d(1355,null)}),_Ue=new S("debugProtocolVariableMenuContext",void 0,{type:"string",description:d(1358,null)}),LUe=new S("debugSetVariableSupported",!1,{type:"boolean",description:d(1361,null)}),MUe=new S("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:d(1359,null)}),OUe=new S("debugSetExpressionSupported",!1,{type:"boolean",description:d(1360,null)}),AUe=new S("breakWhenValueChangesSupported",!1,{type:"boolean",description:d(1345,null)}),NUe=new S("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:d(1346,null)}),UUe=new S("breakWhenValueIsReadSupported",!1,{type:"boolean",description:d(1347,null)}),FUe=new S("terminateDebuggeeSupported",!1,{type:"boolean",description:d(1388,null)}),VUe=new S("suspendDebuggeeSupported",!1,{type:"boolean",description:d(1387,null)}),WUe=new S("terminateThreadsSupported",!1,{type:"boolean",description:d(1389,null)}),BUe=new S("variableEvaluateNamePresent",!1,{type:"boolean",description:d(1390,null)}),HUe=new S("variableIsReadonly",!1,{type:"boolean",description:d(1393,null)}),$Ue=new S("variableValue",!1,{type:"string",description:d(1398,null)}),zUe=new S("variableType",!1,{type:"string",description:d(1397,null)}),GUe=new S("variableInterfaces",!1,{type:"array",description:d(1392,null)}),qUe=new S("variableName",!1,{type:"string",description:d(1395,null)}),KUe=new S("variableLanguage",!1,{type:"string",description:d(1394,null)}),jUe=new S("variableExtensionId",!1,{type:"string",description:d(1391,null)}),QUe=new S("exceptionWidgetVisible",!1,{type:"boolean",description:d(1367,null)}),JUe=new S("multiSessionRepl",!1,{type:"boolean",description:d(1382,null)}),XUe=new S("multiSessionDebug",!1,{type:"boolean",description:d(1381,null)}),YUe=new S("disassembleRequestSupported",!1,{type:"boolean",description:d(1365,null)}),ZUe=new S("disassemblyViewFocus",!1,{type:"boolean",description:d(1366,null)}),e2e=new S("languageSupportsDisassembleRequest",!1,{type:"boolean",description:d(1378,null)}),t2e=new S("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:d(1371,null)}),n2e={enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:d(1376,null)},r2e=_("debugService");(e=>(e.deserialize=n=>n,e.serialize=n=>n))(D3||={});(e=>(e.deserialize=n=>({id:n.id,name:n.name,iconPath:n.iconPath&&{light:I.revive(n.iconPath.light),dark:I.revive(n.iconPath.dark)},iconClass:n.iconClass,visualization:n.visualization}),e.serialize=n=>n))(_3||={})});function Xl(o,t){let[e,n]=t.split("/");for(let r of o.resources){let[i,s]=r.type.split("/");if(i===e){if(!n||s===n)return r.id;break}}}var vI,Xf=y(()=>{re();vI=_("IMcpGalleryManifestService")});var PP,lU=y(()=>{(l=>(l.LATEST_PROTOCOL_VERSION="2025-11-25",l.JSONRPC_VERSION="2.0",l.PARSE_ERROR=-32700,l.INVALID_REQUEST=-32600,l.METHOD_NOT_FOUND=-32601,l.INVALID_PARAMS=-32602,l.INTERNAL_ERROR=-32603,l.URL_ELICITATION_REQUIRED=-32042))(PP||={})});var cU=y(()=>{lU()});var L3,M3,pU,O3,T2e,A3,Yf,N3,dU,U3,yI,P2e,k2e,F3,R2e,D2e,mU=y(()=>{At();hi();et();q();on();$f();ce();pe();mo();_n();re();Xf();cU();(t=>{function o(e,n){return e.id===n.id&&e.remoteAuthority===n.remoteAuthority&&e.label===n.label&&e.trustBehavior===n.trustBehavior&&Ut(e.sandbox,n.sandbox)}t.equals=o})(L3||={});(n=>{function o(r){return r}n.toSerialized=o;function t(r){return{id:r.id,label:r.label,cacheNonce:r.cacheNonce,staticMetadata:r.staticMetadata,launch:Yf.fromSerialized(r.launch),sandboxEnabled:r.sandboxEnabled,variableReplacement:r.variableReplacement?pU.fromSerialized(r.variableReplacement):void 0}}n.fromSerialized=t;function e(r,i){return r.id===i.id&&r.label===i.label&&r.cacheNonce===i.cacheNonce&&mn(r.roots,i.roots,(s,a)=>s.toString()===a.toString())&&Ut(r.launch,i.launch)&&Ut(r.presentation,i.presentation)&&Ut(r.variableReplacement,i.variableReplacement)&&Ut(r.devMode,i.devMode)&&r.sandboxEnabled===i.sandboxEnabled}n.equals=e})(M3||={});(e=>{function o(n){return n}e.toSerialized=o;function t(n){return{section:n.section,folder:n.folder?{...n.folder,uri:I.revive(n.folder.uri)}:void 0,target:n.target}}e.fromSerialized=t})(pU||={});(t=>t.Empty={working:!1,starting:[],serversRequiringInteraction:[]})(O3||={});T2e=_("IMcpService");(t=>{let o;(s=>(s[s.Trusted=0]="Trusted",s[s.TrustedOnNonce=1]="TrustedOnNonce",s[s.Untrusted=2]="Untrusted",s[s.Unknown=3]="Unknown"))(o=t.Kind||={})})(A3||={});(n=>{function o(r){return r}n.toSerialized=o;function t(r){switch(r.type){case 2:return{type:r.type,uri:I.revive(r.uri),headers:r.headers,oauth:r.oauth,authentication:r.authentication};case 1:return{type:r.type,cwd:r.cwd,command:r.command,args:r.args,env:r.env,envFile:r.envFile,sandbox:r.sandbox}}}n.fromSerialized=t;async function e(r){let i=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify(r)));return Dp(A.wrap(new Uint8Array(i)))}n.hash=e})(Yf||={});(i=>{let o;(u=>(u[u.Stopped=0]="Stopped",u[u.Starting=1]="Starting",u[u.Running=2]="Running",u[u.Error=3]="Error"))(o=i.Kind||={}),i.toString=s=>{switch(s.state){case 0:return d(1413,null);case 1:return d(1412,null);case 2:return d(1411,null);case 3:return d(1410,null,s.message);default:Qa(s)}},i.toKindString=s=>{switch(s){case 0:return"stopped";case 1:return"starting";case 2:return"running";case 3:return"error";default:Qa(s)}},i.canBeStarted=s=>s===3||s===0,i.isRunning=s=>!(0,i.canBeStarted)(s.state)})(N3||={});dU=class o extends Error{constructor(e){super(`${o.prefix}${e}`);this.reason=e}static{this.prefix="User interaction required: "}static is(e){return e.message.startsWith(this.prefix)}},U3=_("IMcpWorkbenchService"),yI=class extends D{constructor(e,n){super();this.containers=e;this._register(n.onChange(this.update,this))}set mcpServer(e){this.containers.forEach(n=>n.mcpServer=e)}update(e){for(let n of this.containers)e&&n.mcpServer?e.id===n.mcpServer.id&&(n.mcpServer=e):n.update()}};yI=E([b(1,U3)],yI);P2e=new S("mcpServersGalleryStatus","unavailable"),k2e=new S("hasInstalledMcpServers",!0);(r=>{r.scheme="mcp-resource";let t="dylo78gyp";function e(i,s){return typeof s=="string"&&(s=I.parse(s)),s.with({scheme:r.scheme,authority:Dp(A.fromString(i.id)),path:["",s.scheme,s.authority||t].join("/")+s.path})}r.fromServer=e;function n(i){if(typeof i=="string"&&(i=I.parse(i)),i.scheme!==r.scheme)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);let s=i.path.split("/");if(s.length<3)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);let[,a,l,...c]=s,u=new URL(`${a}://${l.toLowerCase()===t?"":l}`);return u.pathname=c.length?"/"+c.join("/"):"",u.search=i.query,u.hash=i.fragment,{definitionId:dD(i.authority).toString(),resourceURL:u}}r.toServer=n})(F3||={});R2e=_("IMcpServerSampling"),D2e=_("IMcpElicitationService")});var O2e,A2e,fU=y(()=>{re();O2e=_("scm"),A2e=_("scmView")});var pi,Zf=y(()=>{pi=class o{constructor(t,e=t.length){this.path=t;this.viewEnd=e;if(t.length===0||e<1)throw new Error("cannot create test with empty path")}static fromExtHostTestItem(t,e,n=t.parent){if(t._isRoot)return new o([e]);let r=[t.id];for(let i=n;i&&i.id!==e;i=i.parent)r.push(i.id);return r.push(e),new o(r.reverse())}static isRoot(t){return!t.includes("\0")}static root(t){let e=t.indexOf("\0");return e===-1?t:t.slice(0,e)}static fromString(t){return new o(t.split("\0"))}static join(t,e){return new o([...t.path,e])}static split(t){return t.split("\0")}static joinToString(t,e){return t.toString()+"\0"+e}static parentId(t){let e=t.lastIndexOf("\0");return e===-1?void 0:t.slice(0,e)}static localId(t){let e=t.lastIndexOf("\0");return e===-1?t:t.slice(e+1)}static isChild(t,e){return e[t.length]==="\0"&&e.startsWith(t)}static compare(t,e){return t===e?0:o.isChild(t,e)?2:o.isChild(e,t)?3:1}static getLengthOfCommonPrefix(t,e){if(t===0)return 0;let n=0;for(;n<t-1;){for(let r=1;r<t;r++){let i=e(r-1),s=e(r);if(i.path[n]!==s.path[n])return n}n++}return n}get rootId(){return new o(this.path,1)}get parentId(){return this.viewEnd>1?new o(this.path,this.viewEnd-1):void 0}get localId(){return this.path[this.viewEnd-1]}get controllerId(){return this.path[0]}get isRoot(){return this.viewEnd===1}*idsFromRoot(){for(let t=1;t<=this.viewEnd;t++)yield new o(this.path,t)}*idsToRoot(){for(let t=this.viewEnd;t>0;t--)yield new o(this.path,t)}compare(t){if(typeof t=="string")return o.compare(this.toString(),t);for(let e=0;e<t.viewEnd&&e<this.viewEnd;e++)if(t.path[e]!==this.path[e])return 1;return t.viewEnd>this.viewEnd?2:t.viewEnd<this.viewEnd?3:0}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let t=1;t<this.viewEnd;t++)this.stringifed+="\0",this.stringifed+=this.path[t]}return this.stringifed}}});function VP(o){return{...o,location:o.location?.toJSON()}}function WP(o){return o.location=o.location?ai.isIPosition(o.location)?ai.lift(o.location):An.lift(o.location):void 0,o}var q2e,eg,kP,RP,DP,_P,bI,gU,UP,FP,LP,Mu,MP,V3,hU,W3,B3,OP,AP,NP,H3,II=y(()=>{ce();qb();Gl();pe();Zf();q2e={2:d(1437,null),4:d(1436,null),8:d(1435,null)};(e=>(e.serialize=n=>({range:n.range.toJSON(),uri:n.uri.toJSON()}),e.deserialize=(n,r)=>({range:An.lift(r.range),uri:n.asCanonicalUri(I.revive(r.uri))})))(eg||={});(e=>(e.serialize=n=>({label:n.label,uri:n.uri?.toJSON(),position:n.position?.toJSON()}),e.deserialize=(n,r)=>({label:r.label,uri:r.uri?n.asCanonicalUri(I.revive(r.uri)):void 0,position:r.position?ai.lift(r.position):void 0})))(kP||={});(e=>(e.serialize=n=>({message:n.message,type:0,expected:n.expected,actual:n.actual,contextValue:n.contextValue,location:n.location&&eg.serialize(n.location),stackTrace:n.stackTrace?.map(kP.serialize)}),e.deserialize=(n,r)=>({message:r.message,type:0,expected:r.expected,actual:r.actual,contextValue:r.contextValue,location:r.location&&eg.deserialize(n,r.location),stackTrace:r.stackTrace&&r.stackTrace.map(i=>kP.deserialize(n,i))})))(RP||={});(e=>(e.serialize=n=>({message:n.message,type:1,offset:n.offset,length:n.length,location:n.location&&eg.serialize(n.location)}),e.deserialize=(n,r)=>({message:r.message,type:1,offset:r.offset,length:r.length,location:r.location&&eg.deserialize(n,r.location)})))(DP||={});(n=>(n.serialize=r=>r.type===0?RP.serialize(r):DP.serialize(r),n.deserialize=(r,i)=>i.type===0?RP.deserialize(r,i):DP.deserialize(r,i),n.isDiffable=r=>r.type===0&&r.actual!==void 0&&r.expected!==void 0))(_P||={});(n=>(n.serializeWithoutMessages=r=>({state:r.state,duration:r.duration,messages:[]}),n.serialize=r=>({state:r.state,duration:r.duration,messages:r.messages.map(_P.serialize)}),n.deserialize=(r,i)=>({state:i.state,duration:i.duration,messages:i.messages.map(s=>_P.deserialize(r,s))})))(bI||={});gU="\0",UP=(o,t)=>o+gU+t,FP=o=>{let t=o.indexOf(gU);return{ctrlId:o.slice(0,t),tagId:o.slice(t+1)}};(e=>(e.serialize=n=>({extId:n.extId,label:n.label,tags:n.tags,busy:n.busy,children:void 0,uri:n.uri?.toJSON(),range:n.range?.toJSON()||null,description:n.description,error:n.error,sortText:n.sortText}),e.deserialize=(n,r)=>({extId:r.extId,label:r.label,tags:r.tags,busy:r.busy,children:void 0,uri:r.uri?n.asCanonicalUri(I.revive(r.uri)):void 0,range:r.range?An.lift(r.range):null,description:r.description,error:r.error,sortText:r.sortText})))(LP||={});(e=>(e.serialize=n=>({expand:n.expand,item:LP.serialize(n.item)}),e.deserialize=(n,r)=>({controllerId:pi.root(r.item.extId),expand:r.expand,item:LP.deserialize(n,r.item)})))(Mu||={});(e=>(e.serialize=n=>{let r;return n.item&&(r={},n.item.label!==void 0&&(r.label=n.item.label),n.item.tags!==void 0&&(r.tags=n.item.tags),n.item.busy!==void 0&&(r.busy=n.item.busy),n.item.uri!==void 0&&(r.uri=n.item.uri?.toJSON()),n.item.range!==void 0&&(r.range=n.item.range?.toJSON()),n.item.description!==void 0&&(r.description=n.item.description),n.item.error!==void 0&&(r.error=n.item.error),n.item.sortText!==void 0&&(r.sortText=n.item.sortText)),{extId:n.extId,expand:n.expand,item:r}},e.deserialize=n=>{let r;return n.item&&(r={},n.item.label!==void 0&&(r.label=n.item.label),n.item.tags!==void 0&&(r.tags=n.item.tags),n.item.busy!==void 0&&(r.busy=n.item.busy),n.item.range!==void 0&&(r.range=n.item.range?An.lift(n.item.range):null),n.item.description!==void 0&&(r.description=n.item.description),n.item.error!==void 0&&(r.error=n.item.error),n.item.sortText!==void 0&&(r.sortText=n.item.sortText)),{extId:n.extId,expand:n.expand,item:r}}))(MP||={});(n=>(n.serializeWithoutMessages=r=>({...Mu.serialize(r),ownComputedState:r.ownComputedState,computedState:r.computedState,tasks:r.tasks.map(bI.serializeWithoutMessages)}),n.serialize=r=>({...Mu.serialize(r),ownComputedState:r.ownComputedState,computedState:r.computedState,tasks:r.tasks.map(bI.serialize)}),n.deserialize=(r,i)=>({...Mu.deserialize(r,i),ownComputedState:i.ownComputedState,computedState:i.computedState,tasks:i.tasks.map(s=>bI.deserialize(r,s)),retired:!0})))(V3||={});(e=>(e.empty=()=>({covered:0,total:0}),e.sum=(n,r)=>{n.covered+=r.covered,n.total+=r.total}))(hU||={});(n=>(n.serialize=r=>({id:r.id,statement:r.statement,branch:r.branch,declaration:r.declaration,testIds:r.testIds,uri:r.uri.toJSON()}),n.deserialize=(r,i)=>({id:i.id,statement:i.statement,branch:i.branch,declaration:i.declaration,testIds:i.testIds,uri:r.asCanonicalUri(I.revive(i.uri))}),n.empty=(r,i)=>({id:r,uri:i,statement:hU.empty()})))(W3||={});(e=>(e.serialize=n=>n.type===0?AP.serialize(n):NP.serialize(n),e.deserialize=n=>n.type===0?AP.deserialize(n):NP.deserialize(n)))(B3||={});(e=>(e.serialize=VP,e.deserialize=WP))(OP||={});(e=>(e.serialize=VP,e.deserialize=WP))(AP||={});(e=>(e.serialize=n=>({...VP(n),branches:n.branches?.map(OP.serialize)}),e.deserialize=n=>({...WP(n),branches:n.branches?.map(OP.deserialize)})))(NP||={});(e=>(e.deserialize=(n,r)=>r.op===0?{op:r.op,item:Mu.deserialize(n,r.item)}:r.op===1?{op:r.op,item:MP.deserialize(r.item)}:r.op===2?{op:r.op,uri:n.asCanonicalUri(I.revive(r.uri)),docv:r.docv}:r,e.serialize=n=>n.op===0?{op:n.op,item:Mu.serialize(n.item)}:n.op===1?{op:n.op,item:MP.serialize(n.item)}:n))(H3||={})});var Q2e,vU=y(()=>{re();Q2e=_("IAiSettingsSearchService")});function L(o){let t=new BP(o);return $3[t.nid]=t,t}var BP,$3,Ou,xI=y(()=>{BP=class o{constructor(t){this._proxyIdentifierBrand=void 0;this.sid=t,this.nid=++o.count}static{this.count=0}},$3=[];Ou=class{constructor(t){this.value=t}}});var tg,z3,uFe,HP,Au,$P,yU,zP=y(()=>{ze();de();q();hi();II();Zf();tg=(o,t)=>o===t,z3={range:(o,t)=>o===t?!0:!o||!t?!1:o.equalsRange(t),busy:tg,label:tg,description:tg,error:tg,sortText:tg,tags:(o,t)=>!(o.length!==t.length||o.some(e=>!t.includes(e)))},uFe=Object.entries(z3),HP=class extends Error{constructor(t){super(`Attempted to insert a duplicate test item ID ${t}`)}},Au=class extends Error{constructor(t){super(`TestItem with ID "${t}" is invalid. Make sure to create it from the createTestItem method.`)}},$P=class extends Error{constructor(t,e,n){super(`TestItem with ID "${t}" is from controller "${e}" and cannot be added as a child of an item from controller "${n}".`)}},yU=(o,t,e)=>{let n=new Map;return{get size(){return n.size},forEach(r,i){for(let s of n.values())r.call(i,s,this)},[Symbol.iterator](){return n.entries()},replace(r){let i=new Map,s=new Set(n.keys()),a={op:5,ops:[]};for(let l of r){if(!(l instanceof e))throw new Au(l.id);let c=t(l).controllerId;if(c!==o.controllerId)throw new $P(l.id,c,o.controllerId);if(i.has(l.id))throw new HP(l.id);i.set(l.id,l),s.delete(l.id),a.ops.push({op:0,item:l})}for(let l of s.keys())a.ops.push({op:3,id:l});o.listener?.(a),n=i},add(r){if(!(r instanceof e))throw new Au(r.id);n.set(r.id,r),o.listener?.({op:0,item:r})},delete(r){n.delete(r)&&o.listener?.({op:3,id:r})},get(r){return n.get(r)},toJSON(){return Array.from(n.values())}}}});var bU,IU,SI,GP=y(()=>{zP();bU=new WeakMap,IU=(o,t)=>{let e={controllerId:t};return bU.set(o,e),e},SI=o=>{let t=bU.get(o);if(!t)throw new Au(o?.id||"<unknown>");return t}});function pk(o){return typeof o>"u"?o:typeof o=="string"?I.file(o):o}function DU(o){switch(typeof o.mimeType=="string"?o.mimeType.toLowerCase():""){case"image/png":case"image/jpeg":case"image/jpg":case"image/gif":case"image/webp":case"image/bmp":return!0;default:return!1}}var uk,ue,Ps,G3,ks,q3,qP,K3,KP,wI,j3,st,ng,jP,xU,Q3,Vi,J3,Rs,Yl,QP,X3,ig,Y3,Z3,Ua,eB,tB,nB,rB,oB,JP,iB,SU,sB,EU,aB,wU,lB,XP,YP,cB,dB,CU,TU,uB,pB,mB,fB,gB,hB,ZP,vB,yB,ek,bB,Fi,IB,mk,tk,nk,xB,rg,rk,ok,SB,EB,wB,CB,TB,PU,Fa,fk,kU,sg,PB,kB,RB,gk,DB,EI,_B,RU,og,LB,MB,ik,_U,LU,MU,OU,sk,AU,ak,NU,UU,FU,VU,WU,BU,HU,$U,OB,AB,lk,zU,GU,qU,KU,ck,jU,NB,UB,QU,FB,JU,CI,hk,XU,VB,YU,WB,BB,dk,HB,ZU,$B,e2,zB,GB,qB,KB,jB,t2,QB,JB,XB,n2,r2,YB,vk=y(()=>{At();et();wO();mp();oa();Hn();WO();rd();Cc();_l();on();me();HO();Nt();fm();Me();ce();sn();YO();Gl();CT();kT();RT();rA();iA();_a();pA();hA();Xb();VT();wA();pN();sU();aU();mU();$y();$y();fU();Zf();II();vU();Kf();dP();xI();GP();Fb();Fb();(e=>{function o(n){let{selectionStartLineNumber:r,selectionStartColumn:i,positionLineNumber:s,positionColumn:a}=n,l=new Re(r-1,i-1),c=new Re(s-1,a-1);return new oi(l,c)}e.to=o;function t(n){let{anchor:r,active:i}=n;return{selectionStartLineNumber:r.line+1,selectionStartColumn:r.character+1,positionLineNumber:i.line+1,positionColumn:i.character+1}}e.from=t})(uk||={});(e=>{function o(n){if(!n)return;let{start:r,end:i}=n;return{startLineNumber:r.line+1,startColumn:r.character+1,endLineNumber:i.line+1,endColumn:i.character+1}}e.from=o;function t(n){if(!n)return;let{startLineNumber:r,startColumn:i,endLineNumber:s,endColumn:a}=n;return new Be(r-1,i-1,s-1,a-1)}e.to=t})(ue||={});(e=>{function o(n){return{uri:n.uri,range:ue.from(n.range)}}e.from=o;function t(n){return new sr(I.revive(n.uri),ue.to(n.range))}e.to=t})(Ps||={});(t=>{function o(e){switch(e){case 1:return 1;case 0:return 0;case 3:return 3;case 2:return 2}}t.to=o})(G3||={});(e=>{function o(n){return new Re(n.lineNumber-1,n.column-1)}e.to=o;function t(n){return{lineNumber:n.line+1,column:n.character+1}}e.from=t})(ks||={});(n=>{function o(r,i,s){return Qn(Bg(r).map(a=>t(a,i,s)))}n.from=o;function t(r,i,s){if(typeof r=="string")return{$serialized:!0,language:r,isBuiltin:s?.isBuiltin};if(r)return{$serialized:!0,language:r.language,scheme:e(r.scheme,i),pattern:Fi.from(r.pattern)??void 0,exclusive:r.exclusive,notebookType:r.notebookType,isBuiltin:s?.isBuiltin}}function e(r,i){return i&&typeof r=="string"?i.transformOutgoingScheme(r):r}})(q3||={});(e=>{function o(n){switch(n){case 1:return 1;case 2:return 2}}e.from=o;function t(n){switch(n){case 1:return 1;case 2:return 2;default:return}}e.to=t})(qP||={});(e=>{function o(n){let r;return n.code&&(ne(n.code)||Jn(n.code)?r=String(n.code):r={value:String(n.code.value),target:n.code.target}),{...ue.from(n.range),message:n.message,source:n.source,code:r,severity:wI.from(n.severity),relatedInformation:n.relatedInformation&&n.relatedInformation.map(KP.from),tags:Array.isArray(n.tags)?Qn(n.tags.map(qP.from)):void 0}}e.from=o;function t(n){let r=new Ll(ue.to(n),n.message,wI.to(n.severity));return r.source=n.source,r.code=ne(n.code)?n.code:n.code?.value,r.relatedInformation=n.relatedInformation&&n.relatedInformation.map(KP.to),r.tags=n.tags&&Qn(n.tags.map(qP.to)),r}e.to=t})(K3||={});(e=>{function o(n){return{...ue.from(n.location.range),message:n.message,resource:n.location.uri}}e.from=o;function t(n){return new Ea(new sr(n.resource,ue.to(n)),n.message)}e.to=t})(KP||={});(e=>{function o(n){switch(n){case 0:return 8;case 1:return 4;case 2:return 2;case 3:return 1}return 8}e.from=o;function t(n){switch(n){case 2:return 2;case 4:return 1;case 8:return 0;case 1:return 3;default:return 0}}e.to=t})(wI||={});(e=>{function o(n){return typeof n=="number"&&n>=1?n-1:n===-2?DN:RN}e.from=o;function t(n){if(typeof n=="number"&&n>=0)return n+1;throw new Error("invalid 'EditorGroupColumn'")}e.to=t})(j3||={});(s=>{function o(a){return a.map(s.from)}s.fromMany=o;function t(a){return a&&typeof a=="object"&&typeof a.language=="string"&&typeof a.value=="string"}function e(a){let l;if(t(a)){let{language:p,value:m}=a;l={value:"```"+p+`
- `+m+"\n```\n"}}else xr.isMarkdownString(a)?l={value:a.value,isTrusted:a.isTrusted,supportThemeIcons:a.supportThemeIcons,supportHtml:a.supportHtml,supportAlertSyntax:a.supportAlertSyntax,baseUri:a.baseUri}:typeof a=="string"?l={value:a}:l={value:""};let c=Object.create(null);l.uris=c;let u=({href:p})=>{try{let m=I.parse(p,!0);m=m.with({query:n(m.query,c)}),c[p]=m}catch{}return""};return Tt.walkTokens(Tt.lexer(l.value),p=>{p.type==="link"?u({href:p.href}):p.type==="image"&&typeof p.href=="string"&&u(W_(p.href))}),l}s.from=e;function n(a,l){if(!a)return a;let c;try{c=uv(a)}catch{}if(!c)return a;let u=!1;return c=yr(c,p=>{if(I.isUri(p)){let m=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[m]=p,u=!0,m}else return}),u?JSON.stringify(c):a}function r(a){let l=new xr(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.supportAlertSyntax=a.supportAlertSyntax,l.baseUri=a.baseUri?I.from(a.baseUri):void 0,l}s.to=r;function i(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=i})(st||={});(t=>{function o(e){return typeof e>"u"?e:{contentText:e.contentText,contentIconPath:e.contentIconPath?pk(e.contentIconPath):void 0,border:e.border,borderColor:e.borderColor,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,color:e.color,backgroundColor:e.backgroundColor,margin:e.margin,width:e.width,height:e.height}}t.from=o})(ng||={});(t=>{function o(e){return typeof e>"u"?e:{backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?pk(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?ng.from(e.before):void 0,after:e.after?ng.from(e.after):void 0}}t.from=o})(jP||={});(t=>{function o(e){if(typeof e>"u")return e;switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3}}t.from=o})(xU||={});(t=>{function o(e){return{isWholeLine:e.isWholeLine,rangeBehavior:e.rangeBehavior?xU.from(e.rangeBehavior):void 0,overviewRulerLane:e.overviewRulerLane,light:e.light?jP.from(e.light):void 0,dark:e.dark?jP.from(e.dark):void 0,backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?pk(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?ng.from(e.before):void 0,after:e.after?ng.from(e.after):void 0}}t.from=o})(Q3||={});(e=>{function o(n){return{text:n.newText,eol:n.newEol&&ZP.from(n.newEol),range:ue.from(n.range)}}e.from=o;function t(n){let r=new ar(ue.to(n.range),n.text);return r.newEol=typeof n.eol>"u"?void 0:ZP.to(n.eol),r}e.to=t})(Vi||={});(e=>{function o(n,r){let i={edits:[]};if(n instanceof wa){let s=new Ls;for(let a of n._allEntries())a._type===1&&I.isUri(a.to)&&a.from===void 0&&s.add(a.to);for(let a of n._allEntries())if(a._type===1){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:_o(A.wrap(a.options.contents))}:l={type:"dataTransferItem",id:a.options.contents._itemId}),i.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:l},metadata:a.metadata})}else a._type===2?i.edits.push({resource:a.uri,textEdit:Vi.from(a.edit),versionId:s.has(a.uri)?void 0:r?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===6?i.edits.push({resource:a.uri,textEdit:{range:ue.from(a.range),text:a.edit.value,insertAsSnippet:!0,keepWhitespace:a.keepWhitespace},versionId:s.has(a.uri)?void 0:r?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===3?i.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:r?.getNotebookDocumentVersion(a.uri)}):a._type===5&&i.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:r?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:1,index:a.index,count:a.count,cells:a.cells.map(rg.from)}})}return i}e.from=o;function t(n){let r=new wa,i=new lt;for(let s of n.edits)if(s.textEdit){let a=s,l=I.revive(a.resource),c=ue.to(a.textEdit.range),u=a.textEdit.text,p=a.textEdit.insertAsSnippet,m;p?m=Ml.replace(c,new Sr(u)):m=ar.replace(c,u);let g=i.get(l);g?g.push(m):i.set(l,[m])}else r.renameFile(I.revive(s.oldResource),I.revive(s.newResource),s.options);for(let[s,a]of i)r.set(s,a);return r}e.to=t})(J3||={});(n=>{let o=Object.create(null);o[0]=0,o[1]=1,o[2]=2,o[3]=3,o[4]=4,o[5]=5,o[6]=6,o[7]=7,o[8]=8,o[9]=9,o[10]=10,o[11]=11,o[12]=12,o[13]=13,o[14]=14,o[15]=15,o[16]=16,o[17]=17,o[18]=18,o[19]=19,o[20]=20,o[21]=21,o[22]=22,o[23]=23,o[24]=24,o[25]=25;function t(r){return typeof o[r]=="number"?o[r]:6}n.from=t;function e(r){for(let i in o)if(o[i]===r)return Number(i);return 6}n.to=e})(Rs||={});(e=>{function o(n){if(n===1)return 1}e.from=o;function t(n){if(n===1)return 1}e.to=t})(Yl||={});(e=>{function o(n){return{name:n.name,kind:Rs.from(n.kind),tags:n.tags&&n.tags.map(Yl.from),containerName:n.containerName,location:Ua.from(n.location)}}e.from=o;function t(n){let r=new vs(n.name,Rs.to(n.kind),n.containerName,Ua.to(n.location));return r.tags=n.tags&&n.tags.map(Yl.to),r}e.to=t})(QP||={});(e=>{function o(n){let r={name:n.name||"!!MISSING: name!!",detail:n.detail,range:ue.from(n.range),selectionRange:ue.from(n.selectionRange),kind:Rs.from(n.kind),tags:n.tags?.map(Yl.from)??[]};return n.children&&(r.children=n.children.map(o)),r}e.from=o;function t(n){let r=new Is(n.name,n.detail,Rs.to(n.kind),ue.to(n.range),ue.to(n.selectionRange));return ja(n.tags)&&(r.tags=n.tags.map(Yl.to)),n.children&&(r.children=n.children.map(t)),r}e.to=t})(X3||={});(e=>{function o(n){let r=new mu(Rs.to(n.kind),n.name,n.detail||"",I.revive(n.uri),ue.to(n.range),ue.to(n.selectionRange));return r._sessionId=n._sessionId,r._itemId=n._itemId,r}e.to=o;function t(n,r,i){if(r=r??n._sessionId,i=i??n._itemId,r===void 0||i===void 0)throw new Error("invalid item");return{_sessionId:r,_itemId:i,name:n.name,detail:n.detail,kind:Rs.from(n.kind),uri:n.uri,range:ue.from(n.range),selectionRange:ue.from(n.selectionRange),tags:n.tags?.map(Yl.from)}}e.from=t})(ig||={});(t=>{function o(e){return new pb(ig.to(e.from),e.fromRanges.map(n=>ue.to(n)))}t.to=o})(Y3||={});(t=>{function o(e){return new mb(ig.to(e.to),e.fromRanges.map(n=>ue.to(n)))}t.to=o})(Z3||={});(e=>{function o(n){return{range:n.range&&ue.from(n.range),uri:n.uri}}e.from=o;function t(n){return new sr(I.revive(n.uri),ue.to(n.range))}e.to=t})(Ua||={});(e=>{function o(n){let r=n,i=n;return{originSelectionRange:r.originSelectionRange?ue.from(r.originSelectionRange):void 0,uri:r.targetUri?r.targetUri:i.uri,range:ue.from(r.targetRange?r.targetRange:i.range),targetSelectionRange:r.targetSelectionRange?ue.from(r.targetSelectionRange):void 0}}e.from=o;function t(n){return{targetUri:I.revive(n.uri),targetRange:ue.to(n.range),targetSelectionRange:n.targetSelectionRange?ue.to(n.targetSelectionRange):void 0,originSelectionRange:n.originSelectionRange?ue.to(n.originSelectionRange):void 0}}e.to=t})(eB||={});(e=>{function o(n){return{range:ue.from(n.range),contents:st.fromMany(n.contents),canIncreaseVerbosity:n.canIncreaseVerbosity,canDecreaseVerbosity:n.canDecreaseVerbosity}}e.from=o;function t(n){let r=n.contents.map(st.to),i=ue.to(n.range),s=n.canIncreaseVerbosity,a=n.canDecreaseVerbosity;return new Xd(r,i,s,a)}e.to=t})(tB||={});(e=>{function o(n){return{range:ue.from(n.range),expression:n.expression}}e.from=o;function t(n){return new lu(ue.to(n.range),n.expression)}e.to=t})(nB||={});(e=>{function o(n){if(n instanceof cu)return{type:"text",range:ue.from(n.range),text:n.text};if(n instanceof du)return{type:"variable",range:ue.from(n.range),variableName:n.variableName,caseSensitiveLookup:n.caseSensitiveLookup};if(n instanceof uu)return{type:"expression",range:ue.from(n.range),expression:n.expression};throw new Error("Unknown 'InlineValue' type")}e.from=o;function t(n){switch(n.type){case"text":return{range:ue.to(n.range),text:n.text};case"variable":return{range:ue.to(n.range),variableName:n.variableName,caseSensitiveLookup:n.caseSensitiveLookup};case"expression":return{range:ue.to(n.range),expression:n.expression}}}e.to=t})(rB||={});(e=>{function o(n){return{frameId:n.frameId,stoppedLocation:ue.from(n.stoppedLocation)}}e.from=o;function t(n){return new pu(n.frameId,ue.to(n.stoppedLocation))}e.to=t})(oB||={});(e=>{function o(n){return{range:ue.from(n.range),kind:n.kind}}e.from=o;function t(n){return new Yd(ue.to(n.range),n.kind)}e.to=t})(JP||={});(e=>{function o(n){return{uri:n.uri,highlights:n.highlights.map(JP.from)}}e.from=o;function t(n){return new Zd(I.revive(n.uri),n.highlights.map(JP.to))}e.to=t})(iB||={});(t=>{function o(e){switch(e){case 1:return 1;case 2:return 2;case 0:default:return 0}}t.to=o})(SU||={});(t=>{function o(e){return{triggerKind:SU.to(e.triggerKind),triggerCharacter:e.triggerCharacter}}t.to=o})(sB||={});(e=>{function o(n){if(n===1)return 1}e.from=o;function t(n){if(n===1)return 1}e.to=t})(EU||={});(t=>{function o(e,n,r){return"icon"in e&&"command"in e?{command:n.toInternal(e.command,r),icon:t2.fromThemeIcon(e.icon)}:{command:n.toInternal(e,r)}}t.from=o})(aB||={});(r=>{let o=new Map([[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,7],[21,6],[8,8],[9,9],[10,12],[11,13],[20,14],[12,15],[19,16],[13,17],[14,28],[0,18],[15,19],[16,20],[17,21],[18,23],[22,10],[23,11],[24,24],[26,26],[25,25]]);function t(i){return o.get(i)??9}r.from=t;let e=new Map([[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[7,7],[6,21],[8,8],[9,9],[12,10],[13,11],[14,20],[15,12],[16,19],[17,13],[28,14],[18,0],[19,15],[20,16],[21,17],[23,18],[10,22],[11,23],[24,24],[25,25],[26,26]]);function n(i){return e.get(i)??9}r.to=n})(wU||={});(t=>{function o(e,n){let r=new ru(e.label);return r.insertText=e.insertText,r.kind=wU.to(e.kind),r.tags=e.tags?.map(EU.to),r.detail=e.detail,r.documentation=pd(e.documentation)?st.to(e.documentation):e.documentation,r.sortText=e.sortText,r.filterText=e.filterText,r.preselect=e.preselect,r.commitCharacters=e.commitCharacters,An.isIRange(e.range)?r.range=ue.to(e.range):typeof e.range=="object"&&(r.range={inserting:ue.to(e.range.insert),replacing:ue.to(e.range.replace)}),r.keepWhitespace=typeof e.insertTextRules>"u"?!1:!!(e.insertTextRules&1),typeof e.insertTextRules<"u"&&e.insertTextRules&4?r.insertText=new Sr(e.insertText):(r.insertText=e.insertText,r.textEdit=r.range instanceof Be?new ar(r.range,r.insertText):void 0),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(r.additionalTextEdits=e.additionalTextEdits.map(i=>Vi.to(i))),r.command=n&&e.command?n.fromInternal(e.command):void 0,r}t.to=o})(lB||={});(e=>{function o(n){if(typeof n.label!="string"&&!Array.isArray(n.label))throw new TypeError("Invalid label");return{label:n.label,documentation:st.fromStrict(n.documentation)}}e.from=o;function t(n){return{label:n.label,documentation:pd(n.documentation)?st.to(n.documentation):n.documentation}}e.to=t})(XP||={});(e=>{function o(n){return{label:n.label,documentation:st.fromStrict(n.documentation),parameters:Array.isArray(n.parameters)?n.parameters.map(XP.from):[],activeParameter:n.activeParameter}}e.from=o;function t(n){return{label:n.label,documentation:pd(n.documentation)?st.to(n.documentation):n.documentation,parameters:Array.isArray(n.parameters)?n.parameters.map(XP.to):[],activeParameter:n.activeParameter}}e.to=t})(YP||={});(e=>{function o(n){return{activeSignature:n.activeSignature,activeParameter:n.activeParameter,signatures:Array.isArray(n.signatures)?n.signatures.map(YP.from):[]}}e.from=o;function t(n){return{activeSignature:n.activeSignature,activeParameter:n.activeParameter,signatures:Array.isArray(n.signatures)?n.signatures.map(YP.to):[]}}e.to=t})(cB||={});(t=>{function o(e,n){let r=new nu(ks.to(n.position),typeof n.label=="string"?n.label:n.label.map(CU.to.bind(void 0,e)),n.kind&&TU.to(n.kind));return r.textEdits=n.textEdits&&n.textEdits.map(Vi.to),r.tooltip=pd(n.tooltip)?st.to(n.tooltip):n.tooltip,r.paddingLeft=n.paddingLeft,r.paddingRight=n.paddingRight,r}t.to=o})(dB||={});(t=>{function o(e,n){let r=new tu(n.label);return r.tooltip=pd(n.tooltip)?st.to(n.tooltip):n.tooltip,PT.is(n.command)&&(r.command=e.fromInternal(n.command)),n.location&&(r.location=Ua.to(n.location)),r}t.to=o})(CU||={});(e=>{function o(n){return n}e.from=o;function t(n){return n}e.to=t})(TU||={});(e=>{function o(n){return{range:ue.from(n.range),url:n.target,tooltip:n.tooltip}}e.from=o;function t(n){let r;if(n.url)try{r=typeof n.url=="string"?I.parse(n.url,!0):I.revive(n.url)}catch{}let i=new ou(ue.to(n.range),r);return i.tooltip=n.tooltip,i}e.to=t})(uB||={});(e=>{function o(n){let r=new iu(n.label);return n.textEdit&&(r.textEdit=Vi.to(n.textEdit)),n.additionalTextEdits&&(r.additionalTextEdits=n.additionalTextEdits.map(i=>Vi.to(i))),r}e.to=o;function t(n){return{label:n.label,textEdit:n.textEdit?Vi.from(n.textEdit):void 0,additionalTextEdits:n.additionalTextEdits?n.additionalTextEdits.map(r=>Vi.from(r)):void 0}}e.from=t})(pB||={});(e=>{function o(n){return new Ol(n[0],n[1],n[2],n[3])}e.to=o;function t(n){return[n.red,n.green,n.blue,n.alpha]}e.from=t})(mB||={});(e=>{function o(n){return{range:ue.from(n.range)}}e.from=o;function t(n){return new eu(ue.to(n.range))}e.to=t})(fB||={});(t=>{function o(e){switch(e){case 2:return 2;case 1:return 1;case 3:case 4:return 3}}t.to=o})(gB||={});(e=>{function o(n){switch(n){case 0:return 0;case 2:return 2;case 3:return 3;case 1:default:return 1}}e.from=o;function t(n){switch(n){case 0:return 0;case 2:return 2;case 3:return 3;case 1:default:return 1}}e.to=t})(hB||={});(e=>{function o(n){if(n===2)return 1;if(n===1)return 0}e.from=o;function t(n){if(n===1)return 2;if(n===0)return 1}e.to=t})(ZP||={});(t=>{function o(e){if(typeof e=="object")return e.viewId;switch(e){case 1:return 3;case 10:return 10;case 15:return 15}throw new Error("Unknown 'ProgressLocation'")}t.from=o})(vB||={});(e=>{function o(n){let r={start:n.start+1,end:n.end+1};return n.kind&&(r.kind=ek.from(n.kind)),r}e.from=o;function t(n){let r={start:n.start-1,end:n.end-1};return n.kind&&(r.kind=ek.to(n.kind)),r}e.to=t})(yB||={});(e=>{function o(n){if(n)switch(n){case 1:return ws.Comment;case 2:return ws.Imports;case 3:return ws.Region}}e.from=o;function t(n){if(n)switch(n.value){case ws.Comment.value:return 1;case ws.Imports.value:return 2;case ws.Region.value:return 3}}e.to=t})(ek||={});(t=>{function o(e){if(e)return{pinned:typeof e.preview=="boolean"?!e.preview:void 0,inactive:e.background,preserveFocus:e.preserveFocus,selection:typeof e.selection=="object"?ue.from(e.selection):void 0,override:typeof e.override=="boolean"?AT.id:void 0}}t.from=o})(bB||={});(r=>{function o(i){return i instanceof Ca?i.toJSON():typeof i=="string"?i:t(i)||e(i)?new Ca(i.baseUri??i.base,i.pattern).toJSON():i}r.from=o;function t(i){let s=i;return s?I.isUri(s.baseUri)&&typeof s.pattern=="string":!1}function e(i){let s=i;return s?typeof s.base=="string"&&typeof s.pattern=="string":!1}function n(i){return typeof i=="string"?i:new Ca(I.revive(i.baseUri),i.pattern)}r.to=n})(Fi||={});(t=>{function o(e){if(e){if(Array.isArray(e))return e.map(o);if(typeof e=="string")return e;{let n=e;return{language:n.language,scheme:n.scheme,pattern:Fi.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType}}}else return}t.from=o})(IB||={});(e=>{function o(n){return{start:n.start,end:n.end}}e.from=o;function t(n){return new ri(n.start,n.end)}e.to=t})(mk||={});(e=>{function o(n){return{timing:typeof n.runStartTime=="number"&&typeof n.runEndTime=="number"?{startTime:n.runStartTime,endTime:n.runEndTime}:void 0,executionOrder:n.executionOrder,success:n.lastRunSuccess}}e.to=o;function t(n){return{lastRunSuccess:n.success,runStartTime:n.timing?.startTime,runEndTime:n.timing?.endTime,executionOrder:n.executionOrder}}e.from=t})(tk||={});(e=>{function o(n){switch(n){case 1:return 1;case 2:default:return 2}}e.from=o;function t(n){switch(n){case 1:return 1;case 2:default:return 2}}e.to=t})(nk||={});(e=>{function o(n){let r={metadata:n.metadata??Object.create(null),cells:[]};for(let i of n.cells)Jd.validate(i),r.cells.push(rg.from(i));return r}e.from=o;function t(n){let r=new Ym(n.cells.map(rg.to));return hc(n.metadata)||(r.metadata=n.metadata),r}e.to=t})(xB||={});(e=>{function o(n){return{cellKind:nk.from(n.kind),language:n.languageId,mime:n.mime,source:n.value,metadata:n.metadata,internalMetadata:tk.from(n.executionSummary??{}),outputs:n.outputs?n.outputs.map(ok.from):[]}}e.from=o;function t(n){return new Jd(nk.to(n.cellKind),n.source,n.language,n.mime,n.outputs?n.outputs.map(ok.to):void 0,n.metadata,n.internalMetadata?tk.to(n.internalMetadata):void 0)}e.to=t})(rg||={});(e=>{function o(n){return{mime:n.mime,valueBytes:A.wrap(n.data)}}e.from=o;function t(n){return new Zm(n.valueBytes.buffer,n.mime)}e.to=t})(rk||={});(e=>{function o(n){return{outputId:n.id,items:n.items.map(rk.from),metadata:n.metadata}}e.from=o;function t(n){let r=n.items.map(rk.to);return new ef(r,n.outputId,n.metadata)}e.to=t})(ok||={});(n=>{function o(r){return e(r)?{include:Fi.from(r.include)??void 0,exclude:Fi.from(r.exclude)??void 0}:Fi.from(r)??void 0}n.from=o;function t(r){return e(r)?{include:Fi.to(r.include),exclude:Fi.to(r.exclude)}:Fi.to(r)}n.to=t;function e(r){let i=r;return i?!_t(i.include)&&!_t(i.exclude):!1}})(SB||={});(t=>{function o(e,n,r){let i=typeof e.command=="string"?{title:"",command:e.command}:e.command;return{alignment:e.alignment===1?1:2,command:n.toInternal(i,r),text:e.text,tooltip:e.tooltip,accessibilityInformation:e.accessibilityInformation,priority:e.priority}}t.from=o})(EB||={});(t=>{function o(e,n,r){let i=typeof e.command=="string"?{title:"",command:e.command}:e.command;return{command:n.toInternal(i,r),label:e.label,description:e.description,detail:e.detail,documentation:e.documentation}}t.from=o})(wB||={});(t=>{function o(e){return{transientOutputs:e?.transientOutputs??!1,transientCellMetadata:e?.transientCellMetadata??{},transientDocumentMetadata:e?.transientDocumentMetadata??{},cellContentMetadata:e?.cellContentMetadata??{}}}t.from=o})(CB||={});(e=>{function o(n){return{uri:n.uri,provides:n.provides}}e.from=o;function t(n){return new hb(I.revive(n.uri),n.provides)}e.to=t})(TB||={});(e=>{function o(n){return{message:st.fromStrict(n.message)||"",type:0,expected:n.expectedOutput,actual:n.actualOutput,contextValue:n.contextValue,location:n.location&&{range:ue.from(n.location.range),uri:n.location.uri},stackTrace:n.stackTrace?.map(r=>({label:r.label,position:r.position&&ks.from(r.position),uri:r.uri&&I.revive(r.uri).toJSON()}))}}e.from=o;function t(n){let r=new Ta(typeof n.message=="string"?n.message:st.to(n.message));return r.actualOutput=n.actual,r.expectedOutput=n.expected,r.contextValue=n.contextValue,r.location=n.location?Ua.to(n.location):void 0,r}e.to=t})(PU||={});(e=>(e.namespace=UP,e.denamespace=FP))(Fa||={});(t=>{function o(e){return{controllerId:e.controllerId,profileId:e.profileId,group:kU.from(e.kind)}}t.from=o})(fk||={});(e=>{let o={3:8,2:4,1:2};function t(n){return o.hasOwnProperty(n)?o[n]:2}e.from=t})(kU||={});(e=>{function o(n){let r=SI(n).controllerId;return{extId:pi.fromExtHostTestItem(n,r).toString(),label:n.label,uri:I.revive(n.uri),busy:n.busy,tags:n.tags.map(i=>Fa.namespace(r,i.id)),range:An.lift(ue.from(n.range)),description:n.description||null,sortText:n.sortText||null,error:n.error&&st.fromStrict(n.error)||null}}e.from=o;function t(n){return{parent:void 0,error:void 0,id:pi.fromString(n.extId).localId,label:n.label,uri:I.revive(n.uri),tags:(n.tags||[]).map(r=>{let{tagId:i}=Fa.denamespace(r);return new Nl(i)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:ue.to(n.range||void 0),canResolveChildren:!1,busy:n.busy,description:n.description||void 0,sortText:n.sortText||void 0}}e.toPlain=t})(sg||={});(e=>{function o(n){return{id:n.id}}e.from=o;function t(n){return new Nl(n.id)}e.to=t})(Fa||={});(e=>{let o=(n,r)=>{let i=n.value;if(!i)return;let s={...sg.toPlain(i.item),parent:r,taskStates:i.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===0).map(PU.to)})),children:[]};if(n.children)for(let a of n.children.values()){let l=o(a,s);l&&s.children.push(l)}return s};function t(n){let r=new $b;for(let a of n.items)r.insert(pi.fromString(a.item.extId).path,a);let i=[r.nodes],s=[];for(;i.length;)for(let a of i.pop())a.value?s.push(a):a.children&&i.push(a.children.values());return{completedAt:n.completedAt,results:s.map(a=>o(a)).filter(io)}}e.to=t})(PB||={});(s=>{function o(a){return{covered:a.covered,total:a.total}}function t(a){return"line"in a?ks.from(a):ue.from(a)}function e(a){if(a)return"endLineNumber"in a?ue.to(a):ks.to(a)}function n(a){if(a.type===1){let l=[];if(a.branches)for(let c of a.branches)l.push({executed:c.count,location:e(c.location),label:c.label});return new bb(a.count,e(a.location),a.branches?.map(c=>new Ib(c.count,e(c.location),c.label)))}else return new xb(a.name,a.count,e(a.location))}s.to=n;function r(a){if(typeof a.executed=="number"&&a.executed<0)throw new Error(`Invalid coverage count ${a.executed}`);return"branches"in a?{count:a.executed,location:t(a.location),type:1,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&t(l.location),label:l.label})):void 0}:{type:0,name:a.name,count:a.executed,location:t(a.location)}}s.fromDetails=r;function i(a,l,c){return Tf(c.statementCoverage),Tf(c.branchCoverage),Tf(c.declarationCoverage),{id:l,uri:c.uri,statement:o(c.statementCoverage),branch:c.branchCoverage&&o(c.branchCoverage),declaration:c.declarationCoverage&&o(c.declarationCoverage),testIds:c instanceof yb&&c.includesTests.length?c.includesTests.map(u=>pi.fromExtHostTestItem(u,a).toString()):void 0}}s.fromFile=i})(kB||={});(t=>{function o(e){switch(e){case 1:return 1;case 2:return 2}}t.to=o})(RB||={});(e=>{function o(n){let r=new gu(Rs.to(n.kind),n.name,n.detail||"",I.revive(n.uri),ue.to(n.range),ue.to(n.selectionRange));return r._sessionId=n._sessionId,r._itemId=n._itemId,r}e.to=o;function t(n,r,i){if(r=r??n._sessionId,i=i??n._itemId,r===void 0||i===void 0)throw new Error("invalid item");return{_sessionId:r,_itemId:i,kind:Rs.from(n.kind),name:n.name,detail:n.detail??"",uri:n.uri,range:ue.from(n.range),selectionRange:ue.from(n.selectionRange),tags:n.tags?.map(Yl.from)}}e.from=t})(gk||={});(t=>{function o(e){if(e)return{value:e.value,tooltip:e.tooltip}}t.from=o})(DB||={});(r=>{function o(i,s,a){let l=s.fileData;return l?new fb(new gb(l.name,I.revive(l.uri),l.id,Ka(()=>a(l.id)))):i===Ir.uriList&&s.uriListData?new fu(n(s.uriListData)):new fu(s.asString)}r.to=o;async function t(i,s,a=Ce()){let l=await s.asString();if(i===Ir.uriList)return{id:a,asString:l,fileData:void 0,uriListData:e(l)};let c=s.asFile();return{id:a,asString:l,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}r.from=t;function e(i){return Vb.split(i).map(s=>{if(s.startsWith("#"))return s;try{return I.parse(s)}catch{}return s})}function n(i){return Vb.create(i.map(s=>typeof s=="string"?s:I.revive(s)))}})(EI||={});(n=>{function o(r,i){let s=r.items.map(([a,l])=>[a,EI.to(a,l,i)]);return new au(s)}n.toDataTransfer=o;async function t(r){return{items:await Promise.all(Array.from(r,async([s,a])=>[s,await EI.from(s,a)]))}}n.from=t;async function e(r){return{items:await Promise.all(Array.from(r,async([s,a])=>[s,await EI.from(s,a,a.id)]))}}n.fromList=e})(_B||={});(e=>{function o(n,r){return{kind:"reply",agentId:n.participant??r?.agentId??"",subCommand:n.command??r?.command,message:n.prompt,title:n.label}}e.from=o;function t(n){return{prompt:n.message,label:n.title,participant:n.agentId,command:n.subCommand}}e.to=t})(RU||={});(e=>{function o(n){switch(n){case 0:return 3;case 1:return 1;case 2:return 2}}e.to=o;function t(n){switch(n){case 3:return 0;case 1:return 1;case 2:return 2}return 1}e.from=t})(og||={});(e=>{function o(n){let r=n.content.map(a=>{if(a.type==="text")return new bn(a.value,a.audience);if(a.type==="tool_result"){let l=Qn(a.value.map(c=>c.type==="text"?new bn(c.value,c.audience):c.type==="data"?new Er(c.data.buffer,c.mimeType):c.type==="prompt_tsx"?new Oi(c.value):void 0));return new Vl(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return new Er(a.value.data.buffer,a.value.mimeType);if(a.type==="data")return new Er(a.data.buffer,a.mimeType);if(a.type==="tool_use")return new Wl(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),i=og.to(n.role);return new Lb(i,r,n.name)}e.to=o;function t(n){let r=og.from(n.role),i=n.name,s=n.content;typeof s=="string"&&(s=[new bn(s)]);let a=s.map(l=>{if(l instanceof Vl)return{type:"tool_result",toolCallId:l.callId,value:Qn(l.content.map(c=>c instanceof bn?{type:"text",value:c.value,audience:c.audience}:c instanceof Oi?{type:"prompt_tsx",value:c.value}:c instanceof Er?{type:"data",mimeType:c.mimeType,data:A.wrap(c.data),audience:c.audience}:void 0)),isError:l.isError};if(l instanceof Er)return DU(l)?{type:"image_url",value:{mimeType:l.mimeType,data:A.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:A.wrap(l.data),audience:l.audience};if(l instanceof Wl)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof bn)return{type:"text",value:l.value};if(typeof l!="string")throw new Error("Unexpected chat message content type");return{type:"text",value:l}});return{role:r,name:i,content:a}}e.from=t})(LB||={});(e=>{function o(n){let r=n.content.map(a=>{if(a.type==="text")return new bn(a.value,a.audience);if(a.type==="tool_result"){let l=a.value.map(c=>c.type==="text"?new bn(c.value,c.audience):c.type==="data"?new Er(c.data.buffer,c.mimeType):new Oi(c.value));return new Vl(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new Er(a.value.data.buffer,a.value.mimeType):a.type==="data"?new Er(a.data.buffer,a.mimeType):a.type==="thinking"?new hu(a.value,a.id,a.metadata):new Wl(a.toolCallId,a.name,a.parameters)}),i=og.to(n.role);return new Mb(i,r,n.name)}e.to=o;function t(n){let r=og.from(n.role),i=n.name,s=n.content;typeof s=="string"&&(s=[new bn(s)]);let a=s.map(l=>{if(l instanceof Vl)return{type:"tool_result",toolCallId:l.callId,value:Qn(l.content.map(c=>c instanceof bn?{type:"text",value:c.value,audience:c.audience}:c instanceof Oi?{type:"prompt_tsx",value:c.value}:c instanceof Er?{type:"data",mimeType:c.mimeType,data:A.wrap(c.data),audience:c.audience}:void 0)),isError:l.isError};if(l instanceof Er)return DU(l)?{type:"image_url",value:{mimeType:l.mimeType,data:A.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:A.wrap(l.data),audience:l.audience};if(l instanceof Wl)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof bn)return{type:"text",value:l.value};if(l instanceof hu)return{type:"thinking",value:l.value,id:l.id,metadata:l.metadata};if(typeof l!="string")throw new Error("Unexpected chat message content type llm 2");return{type:"text",value:l}});return{role:r,name:i,content:a}}e.from=t})(MB||={});(e=>{function o(n){return{kind:"markdownContent",content:st.from(n.value)}}e.from=o;function t(n){return new cf(st.to(n.content))}e.to=t})(ik||={});(e=>{function o(n){return{kind:"codeblockUri",uri:n.value,isEdit:n.isEdit,undoStopId:n.undoStopId}}e.from=o;function t(n){return new If(I.revive(n.uri),n.isEdit,n.undoStopId)}e.to=t})(_U||={});(e=>{function o(n){return{kind:"markdownVuln",content:st.from(n.value),vulnerabilities:n.vulnerabilities}}e.from=o;function t(n){return new df(st.to(n.content),n.vulnerabilities)}e.to=t})(LU||={});(t=>{function o(e){return{kind:"confirmation",title:e.title,message:st.from(e.message),data:e.data,buttons:e.buttons}}t.from=o})(MU||={});(r=>{function o(i){switch(i){case 1:return"text";case 2:return"singleSelect";case 3:return"multiSelect";default:return"text"}}function t(i){switch(i){case"text":return 1;case"singleSelect":return 2;case"multiSelect":return 3;default:return 1}}function e(i){return{kind:"questionCarousel",questions:i.questions.map(s=>({id:s.id,type:o(s.type),title:s.title,message:s.message?st.from(s.message):void 0,options:s.options?.map(a=>({id:a.id,label:a.label,value:String(a.value)})),defaultValue:s.defaultValue,allowFreeformInput:s.allowFreeformInput})),allowSkip:i.allowSkip}}r.from=e;function n(i){let s=i.questions.map(a=>new Pb(a.id,t(a.type),a.title,{message:a.message?typeof a.message=="string"?new xr(a.message):st.to(a.message):void 0,options:a.options?.map(l=>({id:l.id,label:l.label,value:l.value})),defaultValue:a.defaultValue,allowFreeformInput:a.allowFreeformInput}));return new Sf(s,i.allowSkip)}r.to=n})(OU||={});(e=>{function o(n){let{value:r,baseUri:i}=n;function s(a,l){return a.map(c=>{let u=I.joinPath(l,c.name);return{label:c.name,uri:u,children:c.children&&s(c.children,u)}})}return{kind:"treeData",treeData:{label:Zn(i),uri:i,children:s(r,i)}}}e.from=o;function t(n){let r=ir(n.treeData);function i(l){return l.map(c=>({name:c.label,children:c.children&&i(c.children)}))}let s=r.uri,a=r.children?i(r.children):[];return new uf(a,s)}e.to=t})(sk||={});(e=>{function o(n){return{kind:"multiDiffData",multiDiffData:{title:n.title,resources:n.value.map(r=>({originalUri:r.originalUri,modifiedUri:r.modifiedUri,goToFileUri:r.goToFileUri,added:r.added,removed:r.removed}))},readOnly:n.readOnly}}e.from=o;function t(n){let r=n.multiDiffData.resources.map(i=>({originalUri:i.originalUri?I.revive(i.originalUri):void 0,modifiedUri:i.modifiedUri?I.revive(i.modifiedUri):void 0,goToFileUri:i.goToFileUri?I.revive(i.goToFileUri):void 0,added:i.added,removed:i.removed}));return new pf(r,n.multiDiffData.title,n.readOnly)}e.to=t})(AU||={});(e=>{function o(n){let r=s=>I.isUri(s),i=s=>"name"in s;return{kind:"inlineReference",name:n.title,inlineReference:r(n.value)?n.value:i(n.value)?QP.from(n.value):Ps.from(n.value)}}e.from=o;function t(n){let r=ir(n);return new mf(I.isUri(r.inlineReference)?r.inlineReference:"location"in r.inlineReference?QP.to(r.inlineReference):Ps.to(r.inlineReference),n.name)}e.to=t})(ak||={});(e=>{function o(n){return{kind:"progressMessage",content:st.from(n.value)}}e.from=o;function t(n){return new ff(n.content.value)}e.to=t})(NU||={});(e=>{function o(n){return{kind:"thinking",value:n.value,id:n.id,metadata:n.metadata}}e.from=o;function t(n){return new gf(n.value??"",n.id,n.metadata)}e.to=t})(UU||={});(e=>{function o(n){return{kind:"hook",hookType:n.hookType,stopReason:n.stopReason,systemMessage:n.systemMessage,metadata:n.metadata}}e.from=o;function t(n){return new hf(n.hookType,n.stopReason,n.systemMessage,n.metadata)}e.to=t})(FU||={});(e=>{function o(n){return{kind:"warning",content:st.from(n.value)}}e.from=o;function t(n){return new vf(n.content.value)}e.to=t})(VU||={});(t=>{function o(e){return{kind:"extensions",extensions:e.extensions}}t.from=o})(WU||={});(t=>{function o(e,n,r){let i;if(e.command)i=n.toInternal(e.command,r);else{if(!e.uri)throw new Error("Pull request part must have a command if URI is provided");i={title:"Open Pull Request",id:"vscode.open",arguments:[e.uri]}}return{kind:"pullRequest",author:e.author,title:e.title,description:e.description,uri:e.uri,linkTag:e.linkTag,command:i}}t.from=o})(BU||={});(e=>{function o(n){return{kind:"move",uri:n.uri,range:ue.from(n.range)}}e.from=o;function t(n){return new xf(I.revive(n.uri),ue.to(n.range))}e.to=t})(HU||={});(l=>{function o(c){let u,p;c.toolSpecificData&&t(c.toolSpecificData)?(u=e(c.toolSpecificData,c.isError),p=void 0):p=c.toolSpecificData?n(c.toolSpecificData):void 0;let m=c.presentation==="hidden"?"hidden":c.presentation==="hiddenAfterComplete"?"hiddenAfterComplete":void 0;return c.enablePartialUpdate?{kind:"externalToolInvocationUpdate",toolCallId:c.toolCallId,toolName:c.toolName,isComplete:!!c.isComplete,invocationMessage:c.invocationMessage?st.from(c.invocationMessage):void 0,pastTenseMessage:c.pastTenseMessage?st.from(c.pastTenseMessage):void 0,toolSpecificData:p,subagentInvocationId:c.subAgentInvocationId,resultDetails:u}:{kind:"toolInvocationSerialized",toolCallId:c.toolCallId,toolId:c.toolName,invocationMessage:c.invocationMessage?st.from(c.invocationMessage):c.toolName,originMessage:c.originMessage?st.from(c.originMessage):void 0,pastTenseMessage:c.pastTenseMessage?st.from(c.pastTenseMessage):void 0,isConfirmed:c.isConfirmed,isComplete:!0,source:oP.External,toolSpecificData:p,resultDetails:u,presentation:m,subAgentInvocationId:c.subAgentInvocationId}}l.from=o;function t(c){return c!==null&&typeof c=="object"&&"input"in c&&typeof c.input=="string"&&"output"in c&&Array.isArray(c.output)}function e(c,u){return{input:c.input,output:c.output.map(p=>{let m=p.mimeType.startsWith("text/");return{type:"embed",mimeType:p.mimeType,value:m?A.wrap(p.data).toString():_o(A.wrap(p.data)),isText:m}}),isError:u??!1}}function n(c){return"command"in c&&"language"in c?{kind:"terminal",command:c.command,language:c.language}:"commandLine"in c&&"language"in c?{kind:"terminal",presentationOverrides:c.presentationOverrides&&typeof c.presentationOverrides.commandLine=="string"?{commandLine:c.presentationOverrides.commandLine,language:c.presentationOverrides.language}:void 0,commandLine:c.commandLine,language:c.language,terminalCommandOutput:typeof c.output?.text=="string"?{text:c.output.text}:void 0,terminalCommandState:c.state?{exitCode:c.state.exitCode,duration:c.state.duration}:void 0}:"todoList"in c&&Array.isArray(c.todoList)?{kind:"todoList",todoList:c.todoList.map(u=>({id:String(u.id),title:u.title,status:r(u.status)}))}:"input"in c&&"output"in c&&!Array.isArray(c.output)?{kind:"simpleToolInvocation",input:typeof c.input=="string"?c.input:"",output:typeof c.output=="string"?c.output:""}:c&&"values"in c&&Array.isArray(c.values)?{kind:"resources",values:c.values.map(u=>u instanceof sr?Ps.from(u):I.revive(u))}:c instanceof Eb?{kind:"subagent",description:c.description,agentName:c.agentName,prompt:c.prompt,result:c.result}:c}function r(c){switch(c){case 1:return"not-started";case 2:return"in-progress";case 3:return"completed";default:return"not-started"}}function i(c){switch(c){case"not-started":return 1;case"in-progress":return 2;case"completed":return 3;default:return 1}}function s(c){let u=new wf(c.toolId||c.toolName,c.toolCallId,c.errorMessage);return c.invocationMessage&&(u.invocationMessage=c.invocationMessage),c.originMessage&&(u.originMessage=c.originMessage),c.pastTenseMessage&&(u.pastTenseMessage=c.pastTenseMessage),c.isConfirmed!==void 0&&(u.isConfirmed=c.isConfirmed),c.isComplete!==void 0&&(u.isComplete=c.isComplete),c.toolSpecificData&&(u.toolSpecificData=a(c.toolSpecificData)),u.subAgentInvocationId=c.subAgentInvocationId,u.subAgentName=c.subAgentName,u}l.to=s;function a(c){if(c.kind==="terminal")if(c.commandLine){let u={commandLine:c.commandLine,language:c.language};return c.terminalCommandOutput&&(u.output={text:c.terminalCommandOutput.text,truncated:c.terminalCommandOutput.truncated,lineCount:c.terminalCommandOutput.lineCount}),c.terminalCommandState&&(u.state={exitCode:c.terminalCommandState.exitCode,duration:c.terminalCommandState.duration}),u}else return{command:c.command,language:c.language};else{if(c.kind==="terminal2")return{commandLine:c.commandLine,language:c.language};if(c.kind==="todoList")return{todoList:c.todoList.map((u,p)=>{let m=Number(u.id);return{id:Number.isFinite(m)?m:p,title:u.title,status:i(u.status)}})}}return c}})($U||={});(t=>{function o(e){return{kind:"progressTask",content:st.from(e.value)}}t.from=o})(OB||={});(t=>{function o(e){return{kind:"progressTaskResult",content:typeof e=="string"?st.from(e):void 0}}t.from=o})(AB||={});(e=>{function o(n,r,i){return{kind:"command",command:r.toInternal(n.value,i)??{command:n.value.command,title:n.value.title}}}e.from=o;function t(n,r){return new yf(r.fromInternal(n.command)??{command:n.command.id,title:n.command.title})}e.to=t})(lk||={});(e=>{function o(n){return{kind:"textEdit",uri:n.uri,edits:n.edits.map(r=>Vi.from(r)),done:n.isDone}}e.from=o;function t(n){let r=new Ef(I.revive(n.uri),n.edits.map(i=>Vi.to(i)));return r.isDone=n.done,r}e.to=t})(zU||={});(t=>{function o(e){return e.newCellMetadata?{editType:3,index:e.range.start,metadata:e.newCellMetadata}:e.newNotebookMetadata?{editType:5,metadata:e.newNotebookMetadata}:{editType:1,index:e.range.start,count:e.range.end-e.range.start,cells:e.newCells.map(rg.from)}}t.from=o})(GU||={});(t=>{function o(e){return{kind:"notebookEdit",uri:e.uri,edits:e.edits.map(GU.from),done:e.isDone}}t.from=o})(qU||={});(t=>{function o(e){return{kind:"workspaceEdit",edits:e.edits.map(n=>({oldResource:n.oldResource,newResource:n.newResource}))}}t.from=o})(KU||={});(e=>{function o(n){let r=yo.isThemeIcon(n.iconPath)?n.iconPath:I.isUri(n.iconPath)?{light:I.revive(n.iconPath)}:n.iconPath&&"light"in n.iconPath&&"dark"in n.iconPath&&I.isUri(n.iconPath.light)&&I.isUri(n.iconPath.dark)?{light:I.revive(n.iconPath.light),dark:I.revive(n.iconPath.dark)}:void 0;return typeof n.value=="object"&&"variableName"in n.value?{kind:"reference",reference:{variableName:n.value.variableName,value:I.isUri(n.value.value)||!n.value.value?n.value.value:Ps.from(n.value.value)},iconPath:r,options:n.options}:{kind:"reference",reference:I.isUri(n.value)||typeof n.value=="string"?n.value:Ps.from(n.value),iconPath:r,options:n.options}}e.from=o;function t(n){let r=ir(n),i=s=>I.isUri(s)?s:Ps.to(s);return new bf(typeof r.reference=="string"?r.reference:"variableName"in r.reference?{variableName:r.reference.variableName,value:r.reference.value&&i(r.reference.value)}:i(r.reference))}e.to=t})(ck||={});(t=>{function o(e){return{kind:"codeCitation",value:e.value,license:e.license,snippet:e.snippet}}t.from=o})(jU||={});(n=>{function o(r,i,s){return r instanceof cf?ik.from(r):r instanceof mf?ak.from(r):r instanceof bf?ck.from(r):r instanceof ff?NU.from(r):r instanceof gf?UU.from(r):r instanceof hf?FU.from(r):r instanceof uf?sk.from(r):r instanceof pf?AU.from(r):r instanceof yf?lk.from(r,i,s):r instanceof Ef?zU.from(r):r instanceof kb?qU.from(r):r instanceof df?LU.from(r):r instanceof If?_U.from(r):r instanceof vf?VU.from(r):r instanceof Sb?MU.from(r):r instanceof Sf?OU.from(r):r instanceof wb?jU.from(r):r instanceof xf?HU.from(r):r instanceof Cb?WU.from(r):r instanceof Tb?BU.from(r,i,s):r instanceof wf?$U.from(r):r instanceof Rb?KU.from(r):{kind:"markdownContent",content:st.from("")}}n.from=o;function t(r,i){switch(r.kind){case"reference":return ck.to(r);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return e(r,i)}}n.to=t;function e(r,i){switch(r.kind){case"markdownContent":return ik.to(r);case"inlineReference":return ak.to(r);case"progressMessage":return;case"treeData":return sk.to(r);case"command":return lk.to(r,i)}}n.toContent=e})(NB||={});(t=>{function o(e,n,r,i,s,a,l,c){let u=[],p=[];for(let h of e.variables.variables)h.kind==="tool"?u.push(h):h.kind==="toolset"?u.push(...h.value):p.push(h);let m=FT.parseLocalSessionId(e.sessionResource)??e.sessionResource.toString(),g={id:e.requestId,prompt:e.message,command:e.command,attempt:e.attempt??0,enableCommandDetection:e.enableCommandDetection??!0,isParticipantDetected:e.isParticipantDetected??!1,sessionId:m,sessionResource:e.sessionResource,references:p.map(h=>JU.to(h,s,c)).filter(io),toolReferences:u.map(CI.to),location:QU.to(e.location),acceptedConfirmationData:e.acceptedConfirmationData,rejectedConfirmationData:e.rejectedConfirmationData,location2:n,toolInvocationToken:Object.freeze({sessionResource:e.sessionResource}),tools:a,model:r,modelConfiguration:i,editedFileEvents:e.editedFileEvents,modeInstructions:e.modeInstructions?.content,modeInstructions2:XU.to(e.modeInstructions),permissionLevel:e.permissionLevel,subAgentInvocationId:e.subAgentInvocationId,subAgentName:e.subAgentName,parentRequestId:e.parentRequestId,hasHooksEnabled:e.hasHooksEnabled??!1,hooks:e.hooks?n2.to(e.hooks):void 0,isSystemInitiated:e.isSystemInitiated};return pI(l,"chatParticipantPrivate")||(delete g.id,delete g.attempt,delete g.enableCommandDetection,delete g.isParticipantDetected,delete g.location,delete g.location2,delete g.editedFileEvents,delete g.sessionId,delete g.subAgentInvocationId,delete g.subAgentName,delete g.parentRequestId,delete g.hasHooksEnabled,delete g.hooks),pI(l,"chatParticipantAdditions")||(delete g.acceptedConfirmationData,delete g.rejectedConfirmationData,delete g.tools),g}t.to=o})(UB||={});(e=>{function o(n){switch(n){case"notebook":return 3;case"terminal":return 2;case"panel":return 1;case"editor":return 4}}e.to=o;function t(n){switch(n){case 3:return"notebook";case 2:return"terminal";case 1:return"panel";case 4:return"editor"}}e.from=t})(QU||={});(t=>{function o(e){return e.id}t.from=o})(FB||={});(t=>{function o(e,n,r){let i=e.value;if(!i){let a;try{a=JSON.stringify(e)}catch{a=`kind=${e.kind}, id=${e.id}, name=${e.name}`}r.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${a}`);return}if(el(i))i=I.revive(i);else if(i&&typeof i=="object"&&"uri"in i&&"range"in i&&el(i.uri))i=Ps.to(ir(i));else if(mA(e)){let a=e.references?.[0]?.reference;i=new Db(e.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(e.value))),a&&I.isUri(a)?a:void 0)}else if(e.kind==="diagnostic"){let a=e.filterSeverity&&wI.to(e.filterSeverity),l=e.filterUri&&I.revive(e.filterUri).toString();i=new _b(n.map(([c,u])=>e.filterUri&&c.toString()!==l?[c,[]]:[c,u.filter(p=>!(a&&p.severity>a||e.filterRange&&!An.areIntersectingOrTouching(e.filterRange,ue.from(p.range))))]).filter(([,c])=>c.length>0))}let s;return(fA(e)||gA(e))&&e.toolReferences&&(s=hk.to(e.toolReferences)),{id:e.id,name:e.name,range:e.range&&[e.range.start,e.range.endExclusive],toolReferences:s,value:i,modelDescription:e.modelDescription}}t.to=o})(JU||={});(t=>{function o(e){if(e.value)throw new Error("Invalid tool reference");return{name:e.id,range:e.range&&[e.range.start,e.range.endExclusive]}}t.to=o})(CI||={});(t=>{function o(e){let n=[];for(let r of e)if(r.kind==="tool")n.push(CI.to(r));else if(r.kind==="toolset")n.push(...r.value.map(CI.to));else throw new Error("Invalid tool reference in prompt variables");return n}t.to=o})(hk||={});(e=>{function o(n){if(n)return{uri:I.revive(n.uri),name:n.name,content:n.content,toolReferences:hk.to(ir(n.toolReferences)),metadata:n.metadata,isBuiltin:n.isBuiltin}}e.to=o;function t(n){if(n)return{uri:n.uri,name:n.name,content:n.content,toolReferences:n.toolReferences?.map(r=>({kind:"tool",id:r.name,name:r.name,value:void 0,range:r.range?{start:r.range[0],endExclusive:r.range[1]}:void 0}))??[],metadata:n.metadata,isBuiltin:n.isBuiltin}}e.from=t})(XU||={});(t=>{function o(e,n,r){return{id:e.id,label:e.label,fullName:e.fullName,icon:e.icon?.id,value:e.values[0].value,insertText:e.insertText,detail:e.detail,documentation:e.documentation,command:n.toInternal(e.command,r)}}t.from=o})(VB||={});(n=>{function o(r){return{errorDetails:r.errorDetails,metadata:e(r.metadata),nextQuestion:r.nextQuestion,details:r.details}}n.to=o;function t(r){return{errorDetails:r.errorDetails,metadata:r.metadata,nextQuestion:r.nextQuestion,details:r.details}}n.from=t;function e(r){return yr(r,i=>{if(i.$mid===20)return new Cf(yr(i.content,e));if(i.$mid===21)return new bn(i.value);if(i.$mid===22)return new hu(i.value,i.id,i.metadata);if(i.$mid===23)return new Oi(i.value);if(i.$mid===24){let s;if(i.data&&typeof i.data=="object"&&i.data.type==="Buffer"&&Array.isArray(i.data.data))s=new Uint8Array(i.data.data);else if(typeof i.data=="string")try{s=Yi(i.data).buffer}catch{s=new Uint8Array(0)}else s=new Uint8Array(0);return new Er(s,i.mimeType,i.audience)}})}})(YU||={});(t=>{function o(e,n,r){if(n.action.kind==="vote")return;let i=YU.to(e);if(n.action.kind==="command"){let s=n.action.commandButton.command;return{action:{kind:"command",commandButton:{command:r.fromInternal(s)??{command:s.id,title:s.title}}},result:i}}else return n.action.kind==="followUp"?{action:{kind:"followUp",followup:RU.to(n.action.followup)},result:i}:n.action.kind==="inlineChat"?{action:{kind:"editor",accepted:n.action.action==="accepted"},result:i}:n.action.kind==="chatEditingSessionAction"?{action:{kind:"chatEditingSessionAction",outcome:new Map([["accepted",1],["rejected",2],["saved",3]]).get(n.action.outcome)??2,uri:I.revive(n.action.uri),hasRemainingEdits:n.action.hasRemainingEdits},result:i}:n.action.kind==="chatEditingHunkAction"?{action:{kind:"chatEditingHunkAction",outcome:new Map([["accepted",1],["rejected",2]]).get(n.action.outcome)??2,uri:I.revive(n.action.uri),hasRemainingEdits:n.action.hasRemainingEdits,lineCount:n.action.lineCount,linesAdded:n.action.linesAdded,linesRemoved:n.action.linesRemoved},result:i}:{action:n.action,result:i}}t.to=o})(WB||={});(t=>{function o(e,n,r){return"terminalCommand"in e?{terminalCommand:e.terminalCommand,shouldExecute:e.shouldExecute}:"uri"in e?{uri:e.uri}:n.toInternal(e,r)}t.from=o})(BB||={});(t=>{function o(e){return{...e,documentation:st.fromStrict(e.documentation)}}t.from=o})(dk||={});(t=>{function o(e,n){return Array.isArray(e)?{items:e.map(r=>dk.from(r))}:{items:e.items.map(r=>dk.from(r)),resourceOptions:e.resourceOptions?ZU.from(e.resourceOptions,n):void 0}}t.from=o})(HB||={});(t=>{function o(e,n){return{...e,pathSeparator:n,cwd:e.cwd,globPattern:Fi.from(e.globPattern)??void 0}}t.from=o})(ZU||={});(t=>{function o(e){return{kind:e2.to(e.kind),acceptedLength:e.acceptedLength}}t.to=o})($B||={});(t=>{function o(e){switch(e){case 0:return 1;case 1:return 2;case 2:return 3;default:return 0}}t.to=o})(e2||={});(t=>{function o(e,n){if(e.kind===2){let r=e.supersededBy?n(e.supersededBy):void 0;return{kind:2,supersededBy:r,userTypingDisagreed:e.userTypingDisagreed}}else if(e.kind===0)return{kind:0};return{kind:1}}t.to=o})(zB||={});(e=>{function o(n){return n===2?2:1}e.from=o;function t(n){return n===2?2:1}e.to=t})(GB||={});(t=>{function o(e,n){return{id:n,label:e.label,description:e.description,canEdit:e.canEdit,collapsibleState:e.collapsibleState||0,contextValue:e.contextValue}}t.from=o})(qB||={});(t=>{function o(e){return e.type==="mcp"?new Ab(e.label,e.serverLabel||e.label,e.instructions):e.type==="extension"?new Ob(e.extensionId.value,e.label):void 0}t.to=o})(KB||={});(e=>{function o(n){let r=new Cf(n.content.map(i=>i.kind==="text"?new bn(i.value,i.audience):i.kind==="data"?new Er(i.value.data.buffer,i.value.mimeType,i.audience):new Oi(i.value)));return n.toolMetadata!==void 0&&(r.toolMetadata=n.toolMetadata),n.toolResultError&&(r.hasError=!!n.toolResultError),r}e.to=o;function t(n,r){n.toolResultMessage&&cP(r,"chatParticipantPrivate");let i=c=>{c.audience&&cP(r,"languageModelToolResultAudience")},s=!1,a;Array.isArray(n.toolResultDetails)?a=n.toolResultDetails?.map(c=>I.isUri(c)?c:Ps.from(c)):n.toolResultDetails2&&(a={output:{type:"data",mimeType:n.toolResultDetails2.mime,value:A.wrap(n.toolResultDetails2.value)}},s=!0);let l={content:n.content.map(c=>{if(c instanceof bn)return i(c),{kind:"text",value:c.value,audience:c.audience};if(c instanceof Oi)return{kind:"promptTsx",value:c.value};if(c instanceof Er)return i(c),s=!0,{kind:"data",value:{mimeType:c.mimeType,data:A.wrap(c.data)},audience:c.audience};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:st.fromStrict(n.toolResultMessage),toolResultDetails:a,toolMetadata:n.toolMetadata,toolResultError:n.hasError};return s?new Ou(l):l}e.from=t})(jB||={});(n=>{function o(r){return r}n.fromThemeIcon=o;function t(r){if(r){if(yo.isThemeIcon(r))return r;if(I.isUri(r))return r;if(typeof r=="string")return I.file(r);if(typeof r=="object"&&r!==null&&"dark"in r){let i=typeof r.dark=="string"?I.file(r.dark):r.dark,s=typeof r.light=="string"?I.file(r.light):r.light;return i?{dark:i,light:s??i}:void 0}else return}else return}n.from=t;function e(r){if(r){if(yo.isThemeIcon(r))return r;if(el(r))return I.revive(r);{let i=r;return{light:I.revive(i.light),dark:I.revive(i.dark)}}}else return}n.to=e})(t2||={});(e=>{function o(n){return{query:n.query,kind:t(n.kind),settings:n.settings}}e.fromSettingsSearchResult=o;function t(n){switch(n){case 1:return 1;case 2:return 2;case 3:return 3;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(QB||={});(n=>{function o(r){return!!r.uri}function t(r){return Yf.toSerialized(o(r)?{type:2,uri:r.uri,headers:Object.entries(r.headers),authentication:r.authentication?{providerId:r.authentication.providerId,scopes:r.authentication.scopes}:void 0}:{type:1,cwd:r.cwd?.fsPath,args:r.args,command:r.command,env:r.env,envFile:void 0,sandbox:void 0})}n.from=t;function e(r){let i=Yf.fromSerialized(r.launch);if(i.type===2)return new Ub(r.label,i.uri,Object.fromEntries(i.headers),r.cacheNonce==="$$NONE"?void 0:r.cacheNonce);{let s=new Nb(r.label,i.command,[...i.args],Object.fromEntries(Object.entries(i.env).map(([a,l])=>[a,l===null?null:String(l)])),r.cacheNonce==="$$NONE"?void 0:r.cacheNonce);return i.cwd&&(s.cwd=I.file(i.cwd)),s}}n.to=e})(JB||={});(t=>{function o(e){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;default:throw new Error("Unknown SourceControlInputBoxValidationType")}}t.from=o})(XB||={});(t=>{function o(e){let n={};for(let[r,i]of Object.entries(e)){if(!i||i.length===0)continue;let s=[];for(let a of i){let l=r2.to(a);l&&s.push(l)}s.length>0&&(n[r]=s)}return n}t.to=o})(n2||={});(t=>{function o(e){let n=EA(e,Or);if(n)return{command:n,cwd:e.cwd,env:e.env,timeout:e.timeout}}t.to=o})(r2||={});(e=>{function o(n){if(n!==void 0)switch(n){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;default:return}}function t(n){let r=n.timing,i=r?.created??r?.startTime??0,s=r?.lastRequestStarted??r?.startTime,a=r?.lastRequestEnded??r?.endTime;return{resource:n.resource,label:n.label,description:n.description?st.from(n.description):void 0,badge:n.badge?st.from(n.badge):void 0,status:o(n.status),archived:n.archived,tooltip:st.fromStrict(n.tooltip),timing:{created:i,lastRequestStarted:s,lastRequestEnded:a},changes:n.changes instanceof Array?n.changes:void 0,metadata:n.metadata}}e.from=t})(YB||={})});var i2,yk,D5e,s2=y(()=>{xI();i2=class o{static{this._n=0}static mixin(t){return t._id=o._n++,t}},yk={MainThreadAuthentication:L("MainThreadAuthentication"),MainThreadBulkEdits:L("MainThreadBulkEdits"),MainThreadLanguageModels:L("MainThreadLanguageModels"),MainThreadEmbeddings:L("MainThreadEmbeddings"),MainThreadChatAgents2:L("MainThreadChatAgents2"),MainThreadCodeMapper:L("MainThreadCodeMapper"),MainThreadLanguageModelTools:L("MainThreadChatSkills"),MainThreadGitExtension:L("MainThreadGitExtension"),MainThreadClipboard:L("MainThreadClipboard"),MainThreadCommands:L("MainThreadCommands"),MainThreadComments:L("MainThreadComments"),MainThreadConfiguration:L("MainThreadConfiguration"),MainThreadConsole:L("MainThreadConsole"),MainThreadDebugService:L("MainThreadDebugService"),MainThreadDecorations:L("MainThreadDecorations"),MainThreadDiagnostics:L("MainThreadDiagnostics"),MainThreadDialogs:L("MainThreadDiaglogs"),MainThreadDocuments:L("MainThreadDocuments"),MainThreadDocumentContentProviders:L("MainThreadDocumentContentProviders"),MainThreadTextEditors:L("MainThreadTextEditors"),MainThreadEditorInsets:L("MainThreadEditorInsets"),MainThreadEditorTabs:L("MainThreadEditorTabs"),MainThreadErrors:L("MainThreadErrors"),MainThreadTreeViews:L("MainThreadTreeViews"),MainThreadDownloadService:L("MainThreadDownloadService"),MainThreadLanguageFeatures:L("MainThreadLanguageFeatures"),MainThreadLanguages:L("MainThreadLanguages"),MainThreadLogger:L("MainThreadLogger"),MainThreadMessageService:L("MainThreadMessageService"),MainThreadOutputService:L("MainThreadOutputService"),MainThreadProgress:L("MainThreadProgress"),MainThreadQuickDiff:L("MainThreadQuickDiff"),MainThreadQuickOpen:L("MainThreadQuickOpen"),MainThreadStatusBar:L("MainThreadStatusBar"),MainThreadSecretState:L("MainThreadSecretState"),MainThreadStorage:L("MainThreadStorage"),MainThreadSpeech:L("MainThreadSpeechProvider"),MainThreadTelemetry:L("MainThreadTelemetry"),MainThreadMeteredConnection:L("MainThreadMeteredConnection"),MainThreadTerminalService:L("MainThreadTerminalService"),MainThreadTerminalShellIntegration:L("MainThreadTerminalShellIntegration"),MainThreadWebviews:L("MainThreadWebviews"),MainThreadWebviewPanels:L("MainThreadWebviewPanels"),MainThreadWebviewViews:L("MainThreadWebviewViews"),MainThreadCustomEditors:L("MainThreadCustomEditors"),MainThreadUrls:L("MainThreadUrls"),MainThreadUriOpeners:L("MainThreadUriOpeners"),MainThreadProfileContentHandlers:L("MainThreadProfileContentHandlers"),MainThreadWorkspace:L("MainThreadWorkspace"),MainThreadFileSystem:L("MainThreadFileSystem"),MainThreadFileSystemEventService:L("MainThreadFileSystemEventService"),MainThreadExtensionService:L("MainThreadExtensionService"),MainThreadSCM:L("MainThreadSCM"),MainThreadSearch:L("MainThreadSearch"),MainThreadShare:L("MainThreadShare"),MainThreadTask:L("MainThreadTask"),MainThreadWindow:L("MainThreadWindow"),MainThreadPower:L("MainThreadPower"),MainThreadLabelService:L("MainThreadLabelService"),MainThreadNotebook:L("MainThreadNotebook"),MainThreadNotebookDocuments:L("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:L("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:L("MainThreadNotebookKernels"),MainThreadNotebookRenderers:L("MainThreadNotebookRenderers"),MainThreadInteractive:L("MainThreadInteractive"),MainThreadTheming:L("MainThreadTheming"),MainThreadTunnelService:L("MainThreadTunnelService"),MainThreadManagedSockets:L("MainThreadManagedSockets"),MainThreadTimeline:L("MainThreadTimeline"),MainThreadTesting:L("MainThreadTesting"),MainThreadLocalization:L("MainThreadLocalizationShape"),MainThreadMcp:L("MainThreadMcpShape"),MainThreadAiRelatedInformation:L("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:L("MainThreadAiEmbeddingVector"),MainThreadChatStatus:L("MainThreadChatStatus"),MainThreadAiSettingsSearch:L("MainThreadAiSettingsSearch"),MainThreadDataChannels:L("MainThreadDataChannels"),MainThreadChatSessions:L("MainThreadChatSessions"),MainThreadChatOutputRenderer:L("MainThreadChatOutputRenderer"),MainThreadChatContext:L("MainThreadChatContext"),MainThreadChatDebug:L("MainThreadChatDebug"),MainThreadBrowsers:L("MainThreadBrowsers")},D5e={ExtHostCodeMapper:L("ExtHostCodeMapper"),ExtHostCommands:L("ExtHostCommands"),ExtHostConfiguration:L("ExtHostConfiguration"),ExtHostDiagnostics:L("ExtHostDiagnostics"),ExtHostDebugService:L("ExtHostDebugService"),ExtHostDecorations:L("ExtHostDecorations"),ExtHostDocumentsAndEditors:L("ExtHostDocumentsAndEditors"),ExtHostDocuments:L("ExtHostDocuments"),ExtHostDocumentContentProviders:L("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:L("ExtHostDocumentSaveParticipant"),ExtHostEditors:L("ExtHostEditors"),ExtHostTreeViews:L("ExtHostTreeViews"),ExtHostFileSystem:L("ExtHostFileSystem"),ExtHostFileSystemInfo:L("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:L("ExtHostFileSystemEventService"),ExtHostLanguages:L("ExtHostLanguages"),ExtHostLanguageFeatures:L("ExtHostLanguageFeatures"),ExtHostQuickOpen:L("ExtHostQuickOpen"),ExtHostQuickDiff:L("ExtHostQuickDiff"),ExtHostStatusBar:L("ExtHostStatusBar"),ExtHostShare:L("ExtHostShare"),ExtHostExtensionService:L("ExtHostExtensionService"),ExtHostLogLevelServiceShape:L("ExtHostLogLevelServiceShape"),ExtHostTerminalService:L("ExtHostTerminalService"),ExtHostTerminalShellIntegration:L("ExtHostTerminalShellIntegration"),ExtHostSCM:L("ExtHostSCM"),ExtHostSearch:L("ExtHostSearch"),ExtHostTask:L("ExtHostTask"),ExtHostWorkspace:L("ExtHostWorkspace"),ExtHostWindow:L("ExtHostWindow"),ExtHostPower:L("ExtHostPower"),ExtHostWebviews:L("ExtHostWebviews"),ExtHostWebviewPanels:L("ExtHostWebviewPanels"),ExtHostCustomEditors:L("ExtHostCustomEditors"),ExtHostWebviewViews:L("ExtHostWebviewViews"),ExtHostEditorInsets:L("ExtHostEditorInsets"),ExtHostEditorTabs:L("ExtHostEditorTabs"),ExtHostProgress:L("ExtHostProgress"),ExtHostComments:L("ExtHostComments"),ExtHostSecretState:L("ExtHostSecretState"),ExtHostStorage:L("ExtHostStorage"),ExtHostUrls:L("ExtHostUrls"),ExtHostUriOpeners:L("ExtHostUriOpeners"),ExtHostChatOutputRenderer:L("ExtHostChatOutputRenderer"),ExtHostProfileContentHandlers:L("ExtHostProfileContentHandlers"),ExtHostOutputService:L("ExtHostOutputService"),ExtHostLabelService:L("ExtHostLabelService"),ExtHostNotebook:L("ExtHostNotebook"),ExtHostNotebookDocuments:L("ExtHostNotebookDocuments"),ExtHostNotebookEditors:L("ExtHostNotebookEditors"),ExtHostNotebookKernels:L("ExtHostNotebookKernels"),ExtHostNotebookRenderers:L("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:L("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:L("ExtHostInteractive"),ExtHostChatAgents2:L("ExtHostChatAgents"),ExtHostLanguageModelTools:L("ExtHostChatSkills"),ExtHostChatProvider:L("ExtHostChatProvider"),ExtHostChatContext:L("ExtHostChatContext"),ExtHostChatDebug:L("ExtHostChatDebug"),ExtHostSpeech:L("ExtHostSpeech"),ExtHostEmbeddings:L("ExtHostEmbeddings"),ExtHostAiRelatedInformation:L("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:L("ExtHostAiEmbeddingVector"),ExtHostAiSettingsSearch:L("ExtHostAiSettingsSearch"),ExtHostTheming:L("ExtHostTheming"),ExtHostTunnelService:L("ExtHostTunnelService"),ExtHostManagedSockets:L("ExtHostManagedSockets"),ExtHostAuthentication:L("ExtHostAuthentication"),ExtHostTimeline:L("ExtHostTimeline"),ExtHostTesting:L("ExtHostTesting"),ExtHostTelemetry:L("ExtHostTelemetry"),ExtHostMeteredConnection:L("ExtHostMeteredConnection"),ExtHostLocalization:L("ExtHostLocalization"),ExtHostMcp:L("ExtHostMcp"),ExtHostDataChannels:L("ExtHostDataChannels"),ExtHostChatSessions:L("ExtHostChatSessions"),ExtHostGitExtension:L("ExtHostGitExtension"),ExtHostBrowsers:L("ExtHostBrowsers")}});var a2,l2=y(()=>{re();a2=_("IExtHostRpcService")});var Zl,Nu,Va,Uu,ZB,ag,bk,c2=y(()=>{ce();Gl();Zf();zP();II();GP();vk();Zl=(o,t,e,n)=>{let r=t;return{enumerable:!0,configurable:!1,get(){return r},set(i){if(!e(r,i)){let s=r;r=i,o.listener?.(n(i,s))}}}},Nu=(o,t)=>o===t,Va={range:(o,t)=>o===t?!0:!o||!t?!1:o.isEqual(t),label:Nu,description:Nu,sortText:Nu,busy:Nu,error:Nu,canResolveChildren:Nu,tags:(o,t)=>!(o.length!==t.length||o.some(e=>!t.find(n=>e.id===n.id)))},Uu=o=>t=>({op:4,update:o(t)}),ZB=(o,t)=>({range:(()=>{let e,n=Uu(r=>({range:An.lift(ue.from(r))}));return{enumerable:!0,configurable:!1,get(){return e},set(r){o.listener?.({op:6}),Va.range(e,r)||(e=r,o.listener?.(n(r)))}}})(),label:Zl(o,t,Va.label,Uu(e=>({label:e}))),description:Zl(o,void 0,Va.description,Uu(e=>({description:e}))),sortText:Zl(o,void 0,Va.sortText,Uu(e=>({sortText:e}))),canResolveChildren:Zl(o,!1,Va.canResolveChildren,e=>({op:2,state:e})),busy:Zl(o,!1,Va.busy,Uu(e=>({busy:e}))),error:Zl(o,void 0,Va.error,Uu(e=>({error:st.fromStrict(e)||null}))),tags:Zl(o,[],Va.tags,(e,n)=>({op:1,new:e.map(Fa.from),old:n.map(Fa.from)}))}),ag=class o{constructor(t,e,n,r){if(e.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(e)} symbol`);let i=IU(this,t);Object.defineProperties(this,{id:{value:e,enumerable:!0,writable:!1},uri:{value:r,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return i.parent instanceof bk?void 0:i.parent}},children:{value:yU(i,SI,o),enumerable:!0,writable:!1},...ZB(i,n)})}},bk=class extends ag{constructor(e,n){super(e,e,n,void 0);this._isRoot=!0}}});var d2,u2=y(()=>{re();d2=_("IExtHostInitDataService")});var p2=y(()=>{et()});function eH(o){let t=Date.now()-new Date(o).getTime();return isNaN(t)?!1:t<1e3*60*60*24}var TI,Ik,m2,f2=y(()=>{re();de();nr();Fe();u2();p2();Ao();on();q();pe();TI=class extends D{constructor(e,n,r){super();this.initData=n;this._onDidChangeTelemetryEnabled=this._register(new P);this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event;this._onDidChangeTelemetryConfiguration=this._register(new P);this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event;this._productConfig={usage:!0,error:!0};this._level=0;this._inLoggingOnlyMode=!1;this._telemetryLoggers=new Map;this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;let i=n.remote.isRemote?"remoteExtHostTelemetry":e?"workerExtHostTelemetry":"extHostTelemetry";this._outputLogger=this._register(r.createLogger(i,{name:d(1021,null,this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0,group:Qh}))}getTelemetryConfiguration(){return this._level===3}getTelemetryDetails(){return{isCrashEnabled:this._level>=1,isErrorsEnabled:this._productConfig.error?this._level>=2:!1,isUsageEnabled:this._productConfig.usage?this._level>=3:!1}}instantiateLogger(e,n,r){let i=this.getTelemetryDetails(),s=new Ik(n,r,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:i.isUsageEnabled,isErrorsEnabled:i.isErrorsEnabled}),a=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...a,s]),s.apiTelemetryLogger}$initializeTelemetryLevel(e,n,r){this._level=e,this._productConfig=r??{usage:!0,error:!0}}getBuiltInCommonProperties(e){let n=Object.create(null);switch(n["common.extname"]=`${e.publisher}.${e.name}`,n["common.extversion"]=e.version,n["common.vscodemachineid"]=this.initData.telemetryInfo.machineId,n["common.vscodesessionid"]=this.initData.telemetryInfo.sessionId,n["common.vscodecommithash"]=this.initData.commit,n["common.sqmid"]=this.initData.telemetryInfo.sqmId,n["common.devDeviceId"]=this.initData.telemetryInfo.devDeviceId??this.initData.telemetryInfo.machineId,n["common.vscodeversion"]=this.initData.version,n["common.vscodereleasedate"]=this.initData.date,n["common.isnewappinstall"]=eH(this.initData.telemetryInfo.firstSessionDate),n["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case 2:n["common.uikind"]="web";break;case 1:n["common.uikind"]="desktop";break;default:n["common.uikind"]="unknown"}return n["common.remotename"]=T0(this.initData.remote.authority,this.initData),n}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;let n=this.getTelemetryDetails();this._telemetryLoggers.forEach((r,i)=>{let s=r.filter(a=>!a.isDisposed);s.length===0?this._telemetryLoggers.delete(i):this._telemetryLoggers.set(i,s)}),this._telemetryLoggers.forEach(r=>{for(let i of r)i.updateTelemetryEnablements(n.isUsageEnabled,n.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(e,n){let i=this._telemetryLoggers.get(e.value)?.filter(a=>!a.isDisposed);if(!i)return this._telemetryLoggers.delete(e.value),!1;let s=!1;for(let a of i)a.ignoreUnhandledExtHostErrors||(a.logError(n),s=!0);return s}};TI=E([b(1,d2),b(2,vr)],TI);Ik=class{constructor(t,e,n,r,i,s,a){this._extension=n;this._logger=r;this._inLoggingOnlyMode=i;this._commonProperties=s;this._onDidChangeEnableStates=new P;this.ignoreUnhandledExtHostErrors=e?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=e?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=e?.additionalCommonProperties,this._sender=t,this._telemetryEnablements={isUsageEnabled:a.isUsageEnabled,isErrorsEnabled:a.isErrorsEnabled}}static validateSender(t){if(typeof t!="object")throw new TypeError("TelemetrySender argument is invalid");if(typeof t.sendEventData!="function")throw new TypeError("TelemetrySender.sendEventData must be a function");if(typeof t.sendErrorData!="function")throw new TypeError("TelemetrySender.sendErrorData must be a function");if(typeof t.flush<"u"&&typeof t.flush!="function")throw new TypeError("TelemetrySender.flush must be a function or undefined")}updateTelemetryEnablements(t,e){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:t,isErrorsEnabled:e},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(t){let e=t.properties?t.properties??{}:t;return e=nm(e,[]),this._additionalCommonProperties&&(e=ns(e,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(e=ns(e,this._commonProperties)),t.properties?t.properties=e:t=e,t}logEvent(t,e){this._sender&&(this._extension.publisher==="vscode"?t=this._extension.name+"/"+t:t=this._extension.identifier.value+"/"+t,e=this.mixInCommonPropsAndCleanData(e||{}),this._inLoggingOnlyMode||this._sender?.sendEventData(t,e),this._logger.trace(t,e))}logUsage(t,e){this._telemetryEnablements.isUsageEnabled&&this.logEvent(t,e)}logError(t,e){if(!(!this._telemetryEnablements.isErrorsEnabled||!this._sender))if(typeof t=="string")this.logEvent(t,e);else{let n={name:t.name,message:t.message,stack:t.stack,cause:t.cause},r=nm(n,[]),i=new Error(typeof r.message=="string"?r.message:void 0,{cause:r.cause});i.stack=typeof r.stack=="string"?r.stack:void 0,i.name=typeof r.name=="string"?r.name:"unknown",e=this.mixInCommonPropsAndCleanData(e||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(i,e),this._logger.trace("exception",e)}}get apiTelemetryLogger(){if(!this._apiObject){let t=this,e={logUsage:t.logUsage.bind(t),get isUsageEnabled(){return t._telemetryEnablements.isUsageEnabled},get isErrorsEnabled(){return t._telemetryEnablements.isErrorsEnabled},logError:t.logError.bind(t),dispose:t.dispose.bind(t),onDidChangeEnableStates:t._onDidChangeEnableStates.event.bind(t)};this._apiObject=Object.freeze(e)}return this._apiObject}get isDisposed(){return!this._sender}dispose(){if(this._sender?.flush){let t=this._sender;this._sender=void 0,Promise.resolve(t.flush()).then(t=void 0),this._apiObject=void 0}else this._sender=void 0;this._onDidChangeEnableStates.dispose()}};m2=_("IExtHostTelemetry")});var PI,h2,xk,g2,Sk,v2=y(()=>{Me();Fb();vk();on();s2();At();Fe();rd();Gl();qb();ce();q();re();l2();c2();et();xI();rl();Ns();Ao();f2();sn();Se();PI=class{constructor(t,e,n){this._commands=new Map;this._apiCommands=new Map;this.$d=t.getProxy(yk.MainThreadCommands),this._logService=e,this.$f=n,this.$e=t.getProxy(yk.MainThreadTelemetry),this.converter=new xk(this,r=>{let i=this._apiCommands.get(r);return i?.result===Sk.Void?i:void 0},e),this._argumentProcessors=[{processArgument(r){return ir(r)}},{processArgument(r){return yr(r,function(i){if(An.isIRange(i))return ue.to(i);if(ai.isIPosition(i))return ks.to(i);if(An.isIRange(i.range)&&I.isUri(i.uri))return Ua.to(i);if(i instanceof A)return i.buffer.buffer;if(!Array.isArray(i))return i})}}]}$d;$e;$f;registerArgumentProcessor(t){this._argumentProcessors.push(t)}registerApiCommand(t){let e=this.registerCommand(!1,t.id,async(...n)=>{let r=t.args.map((s,a)=>{if(!s.validate(n[a]))throw new Error(`Invalid argument '${s.name}' when running '${t.id}', received: ${typeof n[a]=="object"?JSON.stringify(n[a],null," "):n[a]} `);return s.convert(n[a])}),i=await this.executeCommand(t.internalId,...r);return t.result.convert(i,n,this.converter)},void 0,{description:t.description,args:t.args,returns:t.result.description});return this._apiCommands.set(t.id,t),new bs(()=>{e.dispose(),this._apiCommands.delete(t.id)})}registerCommand(t,e,n,r,i,s){if(this._logService.trace("ExtHostCommands#registerCommand",e),!e.trim().length)throw new Error("invalid id");if(this._commands.has(e))throw new Error(`command '${e}' already exists`);return this._commands.set(e,{callback:n,thisArg:r,metadata:i,extension:s}),t&&this.$d.$registerCommand(e),new bs(()=>{this._commands.delete(e)&&t&&this.$d.$unregisterCommand(e)})}executeCommand(t,...e){return this._logService.trace("ExtHostCommands#executeCommand",t),this._doExecuteCommand(t,e,!0)}async _doExecuteCommand(t,e,n){if(this._commands.has(t))return this.$d.$fireCommandActivationEvent(t),this._executeContributedCommand(t,e,!1);{let r=!1,i=yr(e,function(s){if(s instanceof Re)return ks.from(s);if(s instanceof Be)return ue.from(s);if(s instanceof sr)return Ua.from(s);if(ri.isNotebookRange(s))return mk.from(s);if(s instanceof ArrayBuffer)return r=!0,A.wrap(new Uint8Array(s));if(s instanceof Uint8Array)return r=!0,A.wrap(s);if(s instanceof A)return r=!0,s;if(!Array.isArray(s))return s});try{let s=await this.$d.$executeCommand(t,r?new Ou(i):i,n);return ir(s)}catch(s){if(s instanceof Error&&s.message==="$executeCommand:retry")return this._doExecuteCommand(t,e,!1);throw s}}}async _executeContributedCommand(t,e,n){let r=this._commands.get(t);if(!r)throw new Error("Unknown command");let{callback:i,thisArg:s,metadata:a}=r;if(a?.args)for(let c=0;c<a.args.length;c++)try{n1(e[c],a.args[c].constraint)}catch{throw new Error(`Running the contributed command: '${t}' failed. Illegal argument '${a.args[c].name}' - ${a.args[c].description}`)}let l=Yn.create();try{return await i.apply(s,e)}catch(c){if(t===this.converter.delegatingCommandId){let u=this.converter.getActualCommand(...e);u&&(t=u.command)}if(Tn(c)||this._logService.error(c,t,r.extension?.identifier),!n)throw c;if(r.extension?.identifier){let u=this.$f.onExtensionError(r.extension.identifier,c);this._logService.trace("forwarded error to extension?",u,r.extension?.identifier)}throw new class extends Error{constructor(){super(Do(c));this.id=t;this.source=r.extension?.displayName??r.extension?.name}}}finally{this._reportTelemetry(r,t,l.elapsed())}}_reportTelemetry(t,e,n){t.extension&&(e.startsWith("code.copilot.logStructured")||this.$e.$publicLog2("Extension:ActionExecuted",{extensionId:t.extension.identifier.value,id:new Oo(e),duration:n}))}$executeContributedCommand(t,...e){this._logService.trace("ExtHostCommands#$executeContributedCommand",t);let n=this._commands.get(t);return n?(e=e.map(r=>this._argumentProcessors.reduce((i,s)=>s.processArgument(i,n.extension),r)),this._executeContributedCommand(t,e,!0)):Promise.reject(new Error(`Contributed command '${t}' does not exist.`))}getCommands(t=!1){return this._logService.trace("ExtHostCommands#getCommands",t),this.$d.$getCommands().then(e=>(t&&(e=e.filter(n=>n[0]!=="_")),e))}$getContributedCommandMetadata(){let t=Object.create(null);for(let[e,n]of this._commands){let{metadata:r}=n;r&&(t[e]=r)}return Promise.resolve(t)}};PI=E([b(0,a2),b(1,Q),b(2,m2)],PI);h2=_("IExtHostCommands"),xk=class{constructor(t,e,n){this._commands=t;this._lookupApiCommand=e;this._logService=n;this.delegatingCommandId=`__vsc${Ce()}`;this._cache=new Map;this._cachIdPool=0;this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(t,e){if(!t)return;let n={$ident:void 0,id:t.command,title:t.title,tooltip:t.tooltip};if(!t.command)return n;let r=this._lookupApiCommand(t.command);if(r)n.id=r.internalId,n.arguments=r.args.map((i,s)=>i.convert(t.arguments&&t.arguments[s]));else if(ja(t.arguments)){let i=`${t.command} /${++this._cachIdPool}`;this._cache.set(i,t),e.add(ie(()=>{this._cache.delete(i),this._logService.trace("CommandsConverter#DISPOSE",i)})),n.$ident=i,n.id=this.delegatingCommandId,n.arguments=[i],this._logService.trace("CommandsConverter#CREATE",t.command,i)}return n}fromInternal(t){return typeof t.$ident=="string"?this._cache.get(t.$ident):{command:t.id,title:t.title,arguments:t.arguments}}getActualCommand(...t){return this._cache.get(t[0])}_executeConvertedCommand(...t){let e=this.getActualCommand(...t);return this._logService.trace("CommandsConverter#EXECUTE",t[0],e?e.command:"MISSING"),e?this._commands.executeCommand(e.command,...e.arguments||[]):Promise.reject(`Actual command not found, wanted to execute ${t[0]}`)}},g2=class o{constructor(t,e,n,r){this.name=t;this.description=e;this.validate=n;this.convert=r}static{this.Uri=new o("uri","Uri of a text document",t=>I.isUri(t),t=>t)}static{this.Position=new o("position","A position in a text document",t=>Re.isPosition(t),ks.from)}static{this.Range=new o("range","A range in a text document",t=>Be.isRange(t),ue.from)}static{this.Selection=new o("selection","A selection in a text document",t=>oi.isSelection(t),uk.from)}static{this.Number=new o("number","",t=>typeof t=="number",t=>t)}static{this.String=new o("string","",t=>typeof t=="string",t=>t)}static Arr(t){return new o(`${t.name}_array`,`Array of ${t.name}, ${t.description}`,e=>Array.isArray(e)&&e.every(n=>t.validate(n)),e=>e.map(n=>t.convert(n)))}static{this.CallHierarchyItem=new o("item","A call hierarchy item",t=>t instanceof mu,ig.from)}static{this.TypeHierarchyItem=new o("item","A type hierarchy item",t=>t instanceof gu,gk.from)}static{this.TestItem=new o("testItem","A VS Code TestItem",t=>t instanceof ag,sg.from)}static{this.TestProfile=new o("testProfile","A VS Code test profile",t=>t instanceof vb,fk.from)}optional(){return new o(this.name,`(optional) ${this.description}`,t=>t==null||this.validate(t),t=>t===void 0?void 0:t===null?null:this.convert(t))}with(t,e){return new o(t??this.name,e??this.description,this.validate,this.convert)}},Sk=class o{constructor(t,e){this.description=t;this.convert=e}static{this.Void=new o("no result",t=>t)}}});import*as RI from"fs";var lg,kI,y2=y(()=>{Nm();v2();ce();Fe();pv();lg=class{constructor(t,e,n){this._commands=t;this.logService=e;this._ipcHandlePath=n;this._server=void 0;this._disposed=!1;this.setup()}get ipcHandlePath(){return this._ipcHandlePath}async setup(){try{let t=await import("http");if(this._disposed)return;this._server=t.createServer((e,n)=>this.onRequest(e,n));try{this._server.listen(this.ipcHandlePath),this._server.on("error",e=>this.logService.error(e))}catch{this.logService.error("Could not start open from terminal server.")}}catch(t){this.logService.error("Error setting up CLI server",t)}}onRequest(t,e){let n=(i,s)=>{e.writeHead(i,{"content-type":"application/json"}),e.end(JSON.stringify(s||null),a=>a&&this.logService.error(a))},r=[];t.setEncoding("utf8"),t.on("data",i=>r.push(i)),t.on("end",async()=>{try{let i=JSON.parse(r.join("")),s;switch(i.type){case"open":s=await this.open(i);break;case"openExternal":s=await this.openExternal(i);break;case"status":s=await this.getStatus(i);break;case"extensionManagement":s=await this.manageExtensions(i);break;default:n(404,`Unknown message type: ${i.type}`);break}n(200,s)}catch(i){let s=i instanceof Error?i.message:JSON.stringify(i);n(500,s),this.logService.error("Error while processing pipe request",i)}})}async open(t){let{fileURIs:e,folderURIs:n,forceNewWindow:r,diffMode:i,mergeMode:s,addMode:a,removeMode:l,forceReuseWindow:c,gotoLineMode:u,waitMarkerFilePath:p,remoteAuthority:m}=t,g=[];if(Array.isArray(n))for(let T of n)try{g.push({folderUri:I.parse(T)})}catch{}if(Array.isArray(e))for(let T of e)try{o_(T)?g.push({workspaceUri:I.parse(T)}):g.push({fileUri:I.parse(T)})}catch{}let h=p?I.file(p):void 0,x={forceNewWindow:r,diffMode:i,mergeMode:s,addMode:a,removeMode:l,gotoLineMode:u,forceReuseWindow:c,preferNewWindow:!c&&!h&&!a&&!l,waitMarkerFileURI:h,remoteAuthority:m};this._commands.executeCommand("_remoteCLI.windowOpen",g,x)}async openExternal(t){for(let e of t.uris)I.parse(e).scheme!=="file"&&await this._commands.executeCommand("_remoteCLI.openExternal",e)}async manageExtensions(t){let e=r=>r?.map(i=>/\.vsix$/i.test(i)?I.parse(i):i),n={list:t.list,install:e(t.install),uninstall:e(t.uninstall),force:t.force};return await this._commands.executeCommand("_remoteCLI.manageExtensions",n)}async getStatus(t){return await this._commands.executeCommand("_remoteCLI.getSystemStatus")}dispose(){this._disposed=!0,this._server?.close(),this._ipcHandlePath&&process.platform!=="win32"&&RI.existsSync(this._ipcHandlePath)&&RI.unlinkSync(this._ipcHandlePath)}},kI=class extends lg{constructor(t,e){super(t,e,Nd())}};kI=E([b(0,h2),b(1,Q)],kI)});var b2=y(()=>{});function I2(o,t,e=!1){return o.scope?!!(o.scope.workspaceFolder&&t?.workspaceFolder&&o.scope.workspaceFolder.index===t.workspaceFolder.index):e?t===o.scope:!0}function x2(o,t){if(!t)return o;let e=new Set;t.forEach(r=>e.add(r.extensionIdentifier));let n=[];return o.forEach(r=>{e.has(r.extensionIdentifier)||n.push(r)}),n.length===0?void 0:n}function oH(o,t){if(!t)return;let e=new Map;t.forEach(r=>e.set(r.extensionIdentifier,r));let n=[];return o.forEach(r=>{let i=e.get(r.extensionIdentifier);i&&(r.type!==i.type||r.value!==i.value||r.scope?.workspaceFolder?.index!==i.scope?.workspaceFolder?.index)&&n.push(i)}),n.length===0?void 0:n}var tH,nH,rH,DI,S2=y(()=>{me();b2();tH=new Map([[2,"APPEND"],[3,"PREPEND"],[1,"REPLACE"]]),nH=/^VSCODE_PYTHON_(PWSH|ZSH|BASH|FISH)_ACTIVATE/,rH="ms-python.vscode-python-envs",DI=class{constructor(t){this.collections=t;this.map=new Map;this.descriptionMap=new Map;t.forEach((e,n)=>{this.populateDescriptionMap(e,n);let r=e.map.entries(),i=r.next();for(;!i.done;){let s=i.value[1],a=i.value[0];if(this.blockPythonActivationVar(a,n)){i=r.next();continue}let l=this.map.get(a);if(l||(l=[],this.map.set(a,l)),l.length>0&&l[0].type===1){i=r.next();continue}let c={extensionIdentifier:n,value:s.value,type:s.type,scope:s.scope,variable:s.variable,options:s.options};c.scope||delete c.scope,l.unshift(c),i=r.next()}})}async applyToProcessEnvironment(t,e,n){let r;te&&(r={},Object.keys(t).forEach(i=>r[i.toLowerCase()]=i));for(let[i,s]of this.getVariableMap(e)){let a=te&&r[i.toLowerCase()]||i;for(let l of s){let c=n?await n(l.value):l.value;if(!this.blockPythonActivationVar(l.variable,l.extensionIdentifier)){if(l.options?.applyAtProcessCreation??!0)switch(l.type){case 2:t[a]=(t[a]||"")+c;break;case 3:t[a]=c+(t[a]||"");break;case 1:t[a]=c;break}if(l.options?.applyAtShellIntegration??!1){let u=`VSCODE_ENV_${tH.get(l.type)}`;t[u]=(t[u]?t[u]+":":"")+i+"="+this._encodeColons(c)}}}}}_encodeColons(t){return t.replaceAll(":","\\x3a")}blockPythonActivationVar(t,e){return!!(nH.test(t)&&rH!==e)}diff(t,e){let n=new Map,r=new Map,i=new Map;if(t.getVariableMap(e).forEach((s,a)=>{let l=this.getVariableMap(e).get(a),c=x2(s,l);c&&n.set(a,c)}),this.getVariableMap(e).forEach((s,a)=>{let l=t.getVariableMap(e).get(a),c=x2(s,l);c&&i.set(a,c)}),this.getVariableMap(e).forEach((s,a)=>{let l=t.getVariableMap(e).get(a),c=oH(s,l);c&&r.set(a,c)}),!(n.size===0&&r.size===0&&i.size===0))return{added:n,changed:r,removed:i}}getVariableMap(t){let e=new Map;for(let n of this.map.values()){let r=n.filter(i=>I2(i,t));r.length>0&&e.set(r[0].variable,r)}return e}getDescriptionMap(t){let e=new Map;for(let n of this.descriptionMap.values()){let r=n.filter(i=>I2(i,t,!0));for(let i of r)e.set(i.extensionIdentifier,i.description)}return e}populateDescriptionMap(t,e){if(!t.descriptionMap)return;let n=t.descriptionMap.entries(),r=n.next();for(;!r.done;){let i=r.value[1],s=r.value[0],a=this.descriptionMap.get(s);a||(a=[],this.descriptionMap.set(s,a));let l={extensionIdentifier:e,scope:i.scope,description:i.description};l.scope||delete l.scope,a.push(l),r=n.next()}}}});function E2(o){return[...o.entries()]}function w2(o){return o?[...o.entries()]:[]}function C2(o){return new Map(o)}function T2(o){return new Map(o??[])}var Ek=y(()=>{});var wk=y(()=>{});function Ck(o){return o.match(/^['"].*['"]$/)&&(o=o.substring(1,o.length-1)),Or===1&&o&&o[1]===":"?o[0].toUpperCase()+o.substring(1):o}function P2(o){return!o.strictEnv}var Tk=y(()=>{me();Sa()});function k2(o,t){if(t)if(te)for(let e in t){let n=e;for(let i in o)if(e.toLowerCase()===i.toLowerCase()){n=i;break}let r=t[e];r!==void 0&&R2(o,n,r)}else Object.keys(t).forEach(e=>{let n=t[e];n!==void 0&&R2(o,e,n)})}function R2(o,t,e){ne(e)?o[t]=e:delete o[t]}function sH(o,t,e,n){o.TERM_PROGRAM="vscode",t&&(o.TERM_PROGRAM_VERSION=t),aH(o,n)&&(o.LANG=lH(e)),o.COLORTERM="truecolor"}function D2(o,t){if(t)for(let e of Object.keys(t)){let n=t[e];n!=null&&(o[e]=n)}}async function _2(o,t){return await Promise.all(Object.entries(t).map(async([e,n])=>{if(ne(n))try{t[e]=await o(n)}catch{t[e]=n}})),t}function aH(o,t){if(t==="on")return!0;if(t==="auto"){let e=o.LANG;return!e||e.search(/\.UTF\-8$/)===-1&&e.search(/\.utf8$/)===-1&&e.search(/\.euc.+/)===-1}return!1}function lH(o){let t=o?o.split("-"):[],e=t.length;if(e===0)return"en_US.UTF-8";if(e===1){let n={af:"ZA",am:"ET",be:"BY",bg:"BG",ca:"ES",cs:"CZ",da:"DK",de:"DE",el:"GR",en:"US",es:"ES",et:"EE",eu:"ES",fi:"FI",fr:"FR",he:"IL",hr:"HR",hu:"HU",hy:"AM",is:"IS",it:"IT",ja:"JP",kk:"KZ",ko:"KR",lt:"LT",nl:"NL",no:"NO",pl:"PL",pt:"BR",ro:"RO",ru:"RU",sk:"SK",sl:"SI",sr:"YU",sv:"SE",tr:"TR",uk:"UA",zh:"CN"};Object.prototype.hasOwnProperty.call(n,t[0])&&t.push(n[t[0]])}else t[1]=t[1].toUpperCase();return t.join("_")+".UTF-8"}async function M2(o,t,e,n,r,i){if(o.cwd){let a=typeof o.cwd=="object"?o.cwd.fsPath:o.cwd,l=await L2(a,e);return Ck(l||a)}let s;return!o.ignoreConfigurationCwd&&r&&(e&&(r=await L2(r,e,i)),r&&(ro(r)?s=r:n&&(s=H(n.fsPath,r)))),s||(s=n?n.fsPath:t||""),Ck(s)}async function L2(o,t,e){if(t)try{return await t(o)}catch(n){e?.error("Could not resolve terminal cwd",n);return}return o}function O2(o,t,e){if(e)return n=>e.resolveWithEnvironment(t,o,n)}async function A2(o,t,e,n,r,i){let s={};if(o.strictEnv)D2(s,o.env);else{D2(s,i);let a={...t};e&&(a&&await _2(e,a),o.env&&await _2(e,o.env)),rt&&(s.VSCODE_NODE_OPTIONS&&(s.NODE_OPTIONS=s.VSCODE_NODE_OPTIONS,delete s.VSCODE_NODE_OPTIONS),s.VSCODE_NODE_REPL_EXTERNAL_MODULE&&(s.NODE_REPL_EXTERNAL_MODULE=s.VSCODE_NODE_REPL_EXTERNAL_MODULE,delete s.VSCODE_NODE_REPL_EXTERNAL_MODULE)),o0(s,"VSCODE_IPC_HOOK_CLI"),k2(s,a),k2(s,o.env),sH(s,n,Cn,r)}return s}var N2=y(()=>{Le();ce();Jp();Sa();me();Tk();Me()});var U2,Pk,F2,Kn,kk=y(()=>{Se();re();U2=_("configurationResolverService"),Pk=(se=>(se.Unknown="unknown",se.Env="env",se.Config="config",se.Command="command",se.Input="input",se.ExtensionInstallFolder="extensionInstallFolder",se.TaskVar="taskVar",se.WorkspaceFolder="workspaceFolder",se.Cwd="cwd",se.WorkspaceFolderBasename="workspaceFolderBasename",se.UserHome="userHome",se.LineNumber="lineNumber",se.ColumnNumber="columnNumber",se.SelectedText="selectedText",se.File="file",se.FileWorkspaceFolder="fileWorkspaceFolder",se.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",se.RelativeFile="relativeFile",se.RelativeFileDirname="relativeFileDirname",se.FileDirname="fileDirname",se.FileExtname="fileExtname",se.FileBasename="fileBasename",se.FileBasenameNoExtension="fileBasenameNoExtension",se.FileDirnameBasename="fileDirnameBasename",se.ExecPath="execPath",se.ExecInstallFolder="execInstallFolder",se.PathSeparator="pathSeparator",se.PathSeparatorAlias="/",se))(Pk||{}),F2=Object.values(Pk).filter(o=>typeof o=="string"),Kn=class extends ur{constructor(e,n){super(n);this.variable=e}}});var ec,Rk=y(()=>{Ko();me();ec=class o{constructor(t){this.locations=new Map;this.newReplacementNotifiers=new Set;typeof t=="string"?(this.stringRoot=!0,this.root={value:t}):(this.stringRoot=!1,this.root=structuredClone(t))}static{this.VARIABLE_LHS="${"}static parse(t){if(t instanceof o)return t;let e=new o(t);return e.applyPlatformSpecificKeys(),e.parseObject(e.root),e}applyPlatformSpecificKeys(){let t=this.root,e=te?"windows":rt?"osx":_e?"linux":void 0;e&&t&&typeof t=="object"&&t.hasOwnProperty(e)&&Object.keys(t[e]).forEach(n=>t[n]=t[e][n]),delete t.windows,delete t.osx,delete t.linux}parseVariable(t,e){if(t[e]!=="$"||t[e+1]!=="{")return;let n=e+2,r=1;for(;n<t.length;){if(t[n]==="{")r++;else if(t[n]==="}"&&(r--,r===0))break;n++}if(r!==0)return;let i=t.slice(e,n+1),s=t.substring(e+2,n),a=s.indexOf(":");return a===-1?{replacement:{id:i,name:s,inner:s},end:n}:{replacement:{id:i,inner:s,name:s.slice(0,a),arg:s.slice(a+1)},end:n}}parseObject(t){if(!(typeof t!="object"||t===null)){if(Array.isArray(t)){for(let e=0;e<t.length;e++){let n=t[e];typeof n=="string"?this.parseString(t,e,n):this.parseObject(n)}return}for(let[e,n]of Object.entries(t))this.parseString(t,e,e,!0),typeof n=="string"?this.parseString(t,e,n):this.parseObject(n)}}parseString(t,e,n,r,i){let s=0;for(;s<n.length;){let a=n.indexOf("${",s);if(a===-1)break;let l=this.parseVariable(n,a);if(l){if(s=l.end+1,i?.includes(l.replacement.id))continue;let c=this.locations.get(l.replacement.id)||{locations:[],replacement:l.replacement},u={object:t,propertyName:e,replaceKeyName:r};c.locations.push(u),this.locations.set(l.replacement.id,c),c.resolved?this._resolveAtLocation(l.replacement,u,c.resolved,i):this.newReplacementNotifiers.forEach(p=>p(l.replacement))}else s=a+2}}*unresolved(){let t=new Map,e=n=>{t.set(n.id,n)};for(let n of this.locations.values())n.resolved===void 0&&t.set(n.replacement.id,n.replacement);for(this.newReplacementNotifiers.add(e);;){let n=fn.first(t);if(!n)break;let[r,i]=n;yield i,t.delete(r)}this.newReplacementNotifiers.delete(e)}resolved(){return fn.map(fn.filter(this.locations.values(),t=>!!t.resolved),t=>[t.replacement,t.resolved])}resolve(t,e){typeof e!="object"&&(e={value:String(e)});let n=this.locations.get(t.id);if(n&&(n.resolved=e,e.value!==void 0))for(let r of n.locations||fn.empty())this._resolveAtLocation(t,r,e)}_resolveAtLocation(t,{replaceKeyName:e,propertyName:n,object:r},i,s=[]){if(i.value!==void 0){if(s.push(t.id),e&&typeof n=="string"){let a=r[n],l=n.replaceAll(t.id,i.value);delete r[n],r[l]=a,this._renameKeyInLocations(r,n,l),this.parseString(r,l,i.value,!0,s)}else r[n]=r[n].replaceAll(t.id,i.value),this.parseString(r,n,i.value,!1,s);s.pop()}}_renameKeyInLocations(t,e,n){for(let r of this.locations.values())for(let i of r.locations)i.object===t&&i.propertyName===e&&(i.propertyName=n)}toObject(){return this.stringRoot?this.root.value:this.root}}});var _I,V2=y(()=>{Ff();Le();me();no();Me();pe();kk();Rk();_I=class{constructor(t,e,n,r){this._contributedVariables=new Map;this.resolvableVariables=new Set(F2);this._context=t,this._labelService=e,this._userHomePromise=n,r&&(this._envVariablesPromise=r.then(i=>this.prepareEnv(i)))}prepareEnv(t){if(te){let e=Object.create(null);return Object.keys(t).forEach(n=>{e[n.toLowerCase()]=t[n]}),e}return t}async resolveWithEnvironment(t,e,n){let r=ec.parse(n);for(let i of r.unresolved()){let s=await this.evaluateSingleVariable(i,e?.uri,t);s!==void 0&&r.resolve(i,String(s))}return r.toObject()}async resolveAsync(t,e){let n=ec.parse(e);for(let r of n.unresolved()){let i=await this.evaluateSingleVariable(r,t?.uri);i!==void 0&&n.resolve(r,String(i))}return n.toObject()}resolveWithInteractionReplace(t,e){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(t,e){throw new Error("resolveWithInteraction not implemented.")}contributeVariable(t,e){if(this._contributedVariables.has(t))throw new Error("Variable "+t+" is contributed twice.");this.resolvableVariables.add(t),this._contributedVariables.set(t,e)}fsPath(t){return this._labelService?this._labelService.getUriLabel(t,{noPrefix:!0}):t.fsPath}async evaluateSingleVariable(t,e,n,r){let i={env:n!==void 0?this.prepareEnv(n):await this._envVariablesPromise,userHome:n!==void 0?void 0:await this._userHomePromise},{name:s,arg:a}=t,l=p=>{let m=this._context.getFilePath();if(m)return wu(m);throw new Kn(p,d(1455,null,t.id))},c=p=>{let m=l(p);if(this._context.getWorkspaceFolderPathForFile){let g=this._context.getWorkspaceFolderPathForFile();if(g)return wu(g)}throw new Kn(p,d(1456,null,t.id,at(m)))},u=p=>{if(a){let m=this._context.getFolderUri(a);if(m)return m;throw new Kn(p,d(1453,null,p,a))}if(e)return e;throw this._context.getWorkspaceFolderCount()>1?new Kn(p,d(1461,null,p)):new Kn(p,d(1460,null,p))};switch(s){case"env":if(a){if(i.env){let p=i.env[te?a.toLowerCase():a];if(ne(p))return p}return""}throw new Kn("env",d(1466,null,t.id));case"config":if(a){let p=this._context.getConfigurationValue(e,a);if(_t(p))throw new Kn("config",d(1463,null,t.id,a));if(Ue(p))throw new Kn("config",d(1462,null,t.id,a));return p}throw new Kn("config",d(1465,null,t.id));case"command":return this.resolveFromMap("command",t.id,a,r,"command");case"input":return this.resolveFromMap("input",t.id,a,r,"input");case"extensionInstallFolder":if(a){let p=await this._context.getExtension(a);if(!p)throw new Kn("extensionInstallFolder",d(1464,null,t.id,a));return this.fsPath(p.extensionLocation)}throw new Kn("extensionInstallFolder",d(1467,null,t.id));default:switch(s){case"workspaceRoot":case"workspaceFolder":{let p=u("workspaceFolder");return p?wu(this.fsPath(p)):void 0}case"cwd":{if(!e&&!a)return to();let p=u("cwd");return p?wu(this.fsPath(p)):void 0}case"workspaceRootFolderName":case"workspaceFolderBasename":{let p=u("workspaceFolderBasename");return p?wu(at(this.fsPath(p))):void 0}case"userHome":if(i.userHome)return i.userHome;throw new Kn("userHome",d(1459,null,t.id));case"lineNumber":{let p=this._context.getLineNumber();if(p)return p;throw new Kn("lineNumber",d(1457,null,t.id))}case"columnNumber":{let p=this._context.getColumnNumber();if(p)return p;throw new Error(d(1454,null,t.id))}case"selectedText":{let p=this._context.getSelectedText();if(p)return p;throw new Kn("selectedText",d(1458,null,t.id))}case"file":return l("file");case"fileWorkspaceFolder":return c("fileWorkspaceFolder");case"fileWorkspaceFolderBasename":return at(c("fileWorkspaceFolderBasename"));case"relativeFile":return e||a?ji(this.fsPath(u("relativeFile")),l("relativeFile")):l("relativeFile");case"relativeFileDirname":{let p=Ct(l("relativeFileDirname"));if(e||a){let m=ji(this.fsPath(u("relativeFileDirname")),p);return m.length===0?".":m}return p}case"fileDirname":return Ct(l("fileDirname"));case"fileExtname":return qo(l("fileExtname"));case"fileBasename":return at(l("fileBasename"));case"fileBasenameNoExtension":{let p=at(l("fileBasenameNoExtension"));return p.slice(0,p.length-qo(p).length)}case"fileDirnameBasename":return at(Ct(l("fileDirnameBasename")));case"execPath":{let p=this._context.getExecPath();return p||t.id}case"execInstallFolder":{let p=this._context.getAppRoot();return p||t.id}case"pathSeparator":case"/":return Zt;default:try{return this.resolveFromMap("unknown",t.id,a,r,void 0)}catch{return t.id}}}}resolveFromMap(t,e,n,r,i){if(n&&r){let s=i===void 0?r[n]:r[i+":"+n];if(typeof s=="string")return s;throw new Kn(t,d(1468,null,e))}return e}}});import*as _k from"os";var Dk,LI,W2=y(()=>{de();on();q();Le();me();ce();Nm();Qm();y2();S2();Ek();wk();N2();V2();Fw();ze();Tk();Dk=class extends _I{constructor(t,e,n,r,i){super({getFolderUri:s=>{let a=e.filter(l=>l.name===s);if(a&&a.length>0)return a[0].uri},getWorkspaceFolderCount:()=>e.length,getConfigurationValue:(s,a)=>r[`config:${a}`],getExecPath:()=>t.VSCODE_EXEC_PATH,getAppRoot:()=>t.VSCODE_CWD,getFilePath:()=>{if(n)return In(n.fsPath)},getSelectedText:()=>r.selectedText,getLineNumber:()=>r.lineNumber,getColumnNumber:()=>r.columnNumber,getExtension:async s=>{let l=(await i.getInstalled()).find(c=>c.identifier.id===s);return l&&{extensionLocation:l.location}}},void 0,Promise.resolve(_k.homedir()),Promise.resolve(t))}},LI=class extends D{constructor(e,n,r,i,s,a){super();this._environmentService=e;this._logService=n;this._ptyHostService=r;this._productService=i;this._extensionManagementService=s;this._configurationService=a;this._lastReqId=0;this._pendingCommands=new Map;this._onExecuteCommand=this._register(new P);this.onExecuteCommand=this._onExecuteCommand.event}async call(e,n,r){switch(n){case"$restartPtyHost":return this._ptyHostService.restartPtyHost.apply(this._ptyHostService,r);case"$createProcess":{let i=gs(e.remoteAuthority);return this._createProcess(i,r)}case"$attachToProcess":return this._ptyHostService.attachToProcess.apply(this._ptyHostService,r);case"$detachFromProcess":return this._ptyHostService.detachFromProcess.apply(this._ptyHostService,r);case"$listProcesses":return this._ptyHostService.listProcesses.apply(this._ptyHostService,r);case"$getLatency":return this._ptyHostService.getLatency.apply(this._ptyHostService,r);case"$getPerformanceMarks":return this._ptyHostService.getPerformanceMarks.apply(this._ptyHostService,r);case"$orphanQuestionReply":return this._ptyHostService.orphanQuestionReply.apply(this._ptyHostService,r);case"$acceptPtyHostResolvedVariables":return this._ptyHostService.acceptPtyHostResolvedVariables.apply(this._ptyHostService,r);case"$start":return this._ptyHostService.start.apply(this._ptyHostService,r);case"$input":return this._ptyHostService.input.apply(this._ptyHostService,r);case"$sendSignal":return this._ptyHostService.sendSignal.apply(this._ptyHostService,r);case"$acknowledgeDataEvent":return this._ptyHostService.acknowledgeDataEvent.apply(this._ptyHostService,r);case"$shutdown":return this._ptyHostService.shutdown.apply(this._ptyHostService,r);case"$resize":return this._ptyHostService.resize.apply(this._ptyHostService,r);case"$clearBuffer":return this._ptyHostService.clearBuffer.apply(this._ptyHostService,r);case"$getInitialCwd":return this._ptyHostService.getInitialCwd.apply(this._ptyHostService,r);case"$getCwd":return this._ptyHostService.getCwd.apply(this._ptyHostService,r);case"$processBinary":return this._ptyHostService.processBinary.apply(this._ptyHostService,r);case"$sendCommandResult":return this._sendCommandResult(r[0],r[1],r[2]);case"$installAutoReply":return this._ptyHostService.installAutoReply.apply(this._ptyHostService,r);case"$uninstallAllAutoReplies":return this._ptyHostService.uninstallAllAutoReplies.apply(this._ptyHostService,r);case"$getDefaultSystemShell":return this._getDefaultSystemShell.apply(this,r);case"$getProfiles":return this._getProfiles.apply(this,r);case"$getEnvironment":return this._getEnvironment();case"$getWslPath":return this._getWslPath(r[0],r[1]);case"$getTerminalLayoutInfo":return this._ptyHostService.getTerminalLayoutInfo(r);case"$setTerminalLayoutInfo":return this._ptyHostService.setTerminalLayoutInfo(r);case"$serializeTerminalState":return this._ptyHostService.serializeTerminalState.apply(this._ptyHostService,r);case"$reviveTerminalProcesses":return this._ptyHostService.reviveTerminalProcesses.apply(this._ptyHostService,r);case"$getRevivedPtyNewId":return this._ptyHostService.getRevivedPtyNewId.apply(this._ptyHostService,r);case"$setUnicodeVersion":return this._ptyHostService.setUnicodeVersion.apply(this._ptyHostService,r);case"$setNextCommandId":return this._ptyHostService.setNextCommandId.apply(this._ptyHostService,r);case"$reduceConnectionGraceTime":return this._reduceConnectionGraceTime();case"$updateIcon":return this._ptyHostService.updateIcon.apply(this._ptyHostService,r);case"$updateTitle":return this._ptyHostService.updateTitle.apply(this._ptyHostService,r);case"$updateProperty":return this._ptyHostService.updateProperty.apply(this._ptyHostService,r);case"$refreshProperty":return this._ptyHostService.refreshProperty.apply(this._ptyHostService,r);case"$requestDetachInstance":return this._ptyHostService.requestDetachInstance(r[0],r[1]);case"$acceptDetachedInstance":return this._ptyHostService.acceptDetachInstanceReply(r[0],r[1]);case"$freePortKillProcess":return this._ptyHostService.freePortKillProcess.apply(this._ptyHostService,r);case"$acceptDetachInstanceReply":return this._ptyHostService.acceptDetachInstanceReply.apply(this._ptyHostService,r)}throw new Error(`IPC Command ${n} not found`)}listen(e,n,r){switch(n){case"$onPtyHostExitEvent":return this._ptyHostService.onPtyHostExit||F.None;case"$onPtyHostStartEvent":return this._ptyHostService.onPtyHostStart||F.None;case"$onPtyHostUnresponsiveEvent":return this._ptyHostService.onPtyHostUnresponsive||F.None;case"$onPtyHostResponsiveEvent":return this._ptyHostService.onPtyHostResponsive||F.None;case"$onPtyHostRequestResolveVariablesEvent":return this._ptyHostService.onPtyHostRequestResolveVariables||F.None;case"$onProcessDataEvent":return this._ptyHostService.onProcessData;case"$onProcessReadyEvent":return this._ptyHostService.onProcessReady;case"$onProcessExitEvent":return this._ptyHostService.onProcessExit;case"$onProcessReplayEvent":return this._ptyHostService.onProcessReplay;case"$onProcessOrphanQuestion":return this._ptyHostService.onProcessOrphanQuestion;case"$onExecuteCommand":return this.onExecuteCommand;case"$onDidRequestDetach":return this._ptyHostService.onDidRequestDetach||F.None;case"$onDidChangeProperty":return this._ptyHostService.onDidChangeProperty}throw new Error(`IPC Command ${n} not found`)}async _createProcess(e,n){let r={name:n.shellLaunchConfig.name,executable:n.shellLaunchConfig.executable,args:n.shellLaunchConfig.args,cwd:typeof n.shellLaunchConfig.cwd=="string"||typeof n.shellLaunchConfig.cwd>"u"?n.shellLaunchConfig.cwd:I.revive(e.transformIncoming(n.shellLaunchConfig.cwd)),env:n.shellLaunchConfig.env,useShellEnvironment:n.shellLaunchConfig.useShellEnvironment,reconnectionProperties:n.shellLaunchConfig.reconnectionProperties,type:n.shellLaunchConfig.type,isFeatureTerminal:n.shellLaunchConfig.isFeatureTerminal,forceShellIntegration:n.shellLaunchConfig.forceShellIntegration,tabActions:n.shellLaunchConfig.tabActions,shellIntegrationEnvironmentReporting:n.shellLaunchConfig.shellIntegrationEnvironmentReporting},i=await Uw(n.resolverEnv,!!n.shellLaunchConfig.useShellEnvironment,Cn,this._environmentService,this._logService,this._configurationService);this._logService.trace("baseEnv",i);let s=M=>({uri:I.revive(e.transformIncoming(M.uri)),name:M.name,index:M.index,toResource:()=>{throw new Error("Not implemented")}}),a=n.workspaceFolders.map(s),l=n.activeWorkspaceFolder?s(n.activeWorkspaceFolder):void 0,c=n.activeFileResource?I.revive(e.transformIncoming(n.activeFileResource)):void 0,u=new Dk(i,a,c,n.resolvedVariables,this._extensionManagementService),p=O2(l,i,u),m=await M2(r,_k.homedir(),p,l?.uri,n.configuration["terminal.integrated.cwd"],this._logService);r.cwd=m;let g=te?"terminal.integrated.env.windows":rt?"terminal.integrated.env.osx":"terminal.integrated.env.linux",h=n.configuration[g],v=await A2(r,h,p,this._productService.version,n.configuration["terminal.integrated.detectLocale"],i);if(P2(r)){let M=[];for(let[Y,G,W]of n.envVariableCollections)M.push([Y,{map:C2(G),descriptionMap:T2(W)}]);let B=new Map(M),He=new DI(B),U=l?l??void 0:void 0;await He.applyToProcessEnvironment(v,{workspaceFolder:U},p)}this._logService.debug("Terminal process launching on remote agent",{shellLaunchConfig:r,initialCwd:m,cols:n.cols,rows:n.rows,env:v});let x=Nd();v.VSCODE_IPC_HOOK_CLI=x;let T=await this._ptyHostService.createProcess(r,m,n.cols,n.rows,n.unicodeVersion,v,i,n.options,n.shouldPersistTerminal,n.workspaceId,n.workspaceName),w={executeCommand:(M,...B)=>this._executeCommand(T,M,B,e)},k=new lg(w,this._logService,x);return this._ptyHostService.onProcessExit(M=>M.id===T&&k.dispose()),{persistentTerminalId:T,resolvedShellLaunchConfig:r}}_executeCommand(e,n,r,i){let{resolve:s,reject:a,promise:l}=eS(),c=++this._lastReqId;this._pendingCommands.set(c,{resolve:s,reject:a,uriTransformer:i});let u=yr(r,p=>{if(p&&p.$mid===1)return i.transformOutgoing(p);if(p&&p instanceof I)return i.transformOutgoingURI(p)});return this._onExecuteCommand.fire({reqId:c,persistentProcessId:e,commandId:n,commandArgs:u}),l}_sendCommandResult(e,n,r){let i=this._pendingCommands.get(e);if(!i)return;this._pendingCommands.delete(e);let s=yr(r,a=>{if(a&&a.$mid===1)return i.uriTransformer.transformIncoming(a)});n?i.reject(s):i.resolve(s)}_getDefaultSystemShell(e){return this._ptyHostService.getDefaultSystemShell(e)}async _getProfiles(e,n,r,i){return this._ptyHostService.getProfiles(e,n,r,i)||[]}_getEnvironment(){return{...process.env}}_getWslPath(e,n){return this._ptyHostService.getWslPath(e,n)}_reduceConnectionGraceTime(){return this._ptyHostService.reduceConnectionGraceTime()}}});var AI,pH,b9e,I9e,x9e,mH,S9e,E9e,w9e,C9e,MI,B2,OI,Lk,H2,$2,z2=y(()=>{Si();xn();re();AI=".vscode",pH="settings",b9e=`${AI}/${pH}.json`,I9e=[1,3],x9e=[2,4,5,6,7],mH=[4,5,6],S9e=[1,...mH],E9e=[2,3,4,5,6,7],w9e=[4,5,6,7],C9e=[5,6,7],MI="tasks",B2="launch",OI="mcp",Lk=Object.create(null);Lk[MI]=`${AI}/${MI}.json`;Lk[B2]=`${AI}/${B2}.json`;Lk[OI]=`${AI}/${OI}.json`;H2=Object.create(null);H2[MI]=`${MI}.json`;H2[OI]=`${OI}.json`;$2=xt});var G2,q2=y(()=>{re();G2=_("labelService")});var K2,j2=y(()=>{re();K2=_("environmentVariableService")});var Q2,NI,J2=y(()=>{z2();my();SP();pv();Ek();kk();_a();Kf();$e();q2();j2();Sa();wk();Rk();Q2="remoteterminal",NI=class{constructor(t,e,n,r,i,s,a,l,c,u,p){this._remoteAuthority=t;this._channel=e;this._configurationService=n;this._workspaceContextService=r;this._resolverService=i;this._environmentVariableService=s;this._remoteAuthorityResolverService=a;this._logService=l;this._editorService=c;this._labelService=u;this._environmentService=p}get onPtyHostExit(){return this._channel.listen("$onPtyHostExitEvent")}get onPtyHostStart(){return this._channel.listen("$onPtyHostStartEvent")}get onPtyHostUnresponsive(){return this._channel.listen("$onPtyHostUnresponsiveEvent")}get onPtyHostResponsive(){return this._channel.listen("$onPtyHostResponsiveEvent")}get onPtyHostRequestResolveVariables(){return this._channel.listen("$onPtyHostRequestResolveVariablesEvent")}get onProcessData(){return this._channel.listen("$onProcessDataEvent")}get onProcessExit(){return this._channel.listen("$onProcessExitEvent")}get onProcessReady(){return this._channel.listen("$onProcessReadyEvent")}get onProcessReplay(){return this._channel.listen("$onProcessReplayEvent")}get onProcessOrphanQuestion(){return this._channel.listen("$onProcessOrphanQuestion")}get onExecuteCommand(){return this._channel.listen("$onExecuteCommand")}get onDidRequestDetach(){return this._channel.listen("$onDidRequestDetach")}get onDidChangeProperty(){return this._channel.listen("$onDidChangeProperty")}restartPtyHost(){return this._channel.call("$restartPtyHost",[])}async createProcess(t,e,n,r,i,s,a,l){await this._configurationService.whenRemoteConfigurationLoaded();let c=Object.create(null),u=n?this._workspaceContextService.getWorkspaceFolder(n)??void 0:void 0,p=ec.parse({shellLaunchConfig:t,configuration:e});try{await this._resolverService.resolveAsync(u,p)}catch(M){this._logService.error(M)}for(let[{inner:M},B]of p.resolved())(/^config:/.test(M)||M==="selectedText"||M==="lineNumber")&&(c[M]=B.value);let m=[];for(let[M,B]of this._environmentVariableService.collections.entries())m.push([M,E2(B.map),w2(B.descriptionMap)]);let g=await this._remoteAuthorityResolverService.resolveAuthority(this._remoteAuthority),h={...this._environmentService.debugExtensionHost.env??{},...g.options?.extensionHostEnv},v=this._workspaceContextService.getWorkspace(),x=v.folders,T=n?this._workspaceContextService.getWorkspaceFolder(n):null,w=Eu.getOriginalUri(this._editorService.activeEditor,{supportSideBySide:1,filterByScheme:[z.file,z.vscodeUserData,z.vscodeRemote]}),k={configuration:e,resolvedVariables:c,envVariableCollections:m,shellLaunchConfig:t,workspaceId:v.id,workspaceName:this._labelService.getWorkspaceLabel(v),workspaceFolders:x,activeWorkspaceFolder:T,activeFileResource:w,shouldPersistTerminal:i,options:r,cols:s,rows:a,unicodeVersion:l,resolverEnv:h};return await this._channel.call("$createProcess",k)}requestDetachInstance(t,e){return this._channel.call("$requestDetachInstance",[t,e])}acceptDetachInstanceReply(t,e){return this._channel.call("$acceptDetachInstanceReply",[t,e])}attachToProcess(t){return this._channel.call("$attachToProcess",[t])}detachFromProcess(t,e){return this._channel.call("$detachFromProcess",[t,e])}listProcesses(){return this._channel.call("$listProcesses")}getLatency(){return this._channel.call("$getLatency")}getPerformanceMarks(){return this._channel.call("$getPerformanceMarks")}reduceConnectionGraceTime(){return this._channel.call("$reduceConnectionGraceTime")}processBinary(t,e){return this._channel.call("$processBinary",[t,e])}start(t){return this._channel.call("$start",[t])}input(t,e){return this._channel.call("$input",[t,e])}sendSignal(t,e){return this._channel.call("$sendSignal",[t,e])}acknowledgeDataEvent(t,e){return this._channel.call("$acknowledgeDataEvent",[t,e])}setUnicodeVersion(t,e){return this._channel.call("$setUnicodeVersion",[t,e])}setNextCommandId(t,e,n){return this._channel.call("$setNextCommandId",[t,e,n])}shutdown(t,e){return this._channel.call("$shutdown",[t,e])}resize(t,e,n,r,i){return this._channel.call("$resize",[t,e,n,r,i])}clearBuffer(t){return this._channel.call("$clearBuffer",[t])}getInitialCwd(t){return this._channel.call("$getInitialCwd",[t])}getCwd(t){return this._channel.call("$getCwd",[t])}orphanQuestionReply(t){return this._channel.call("$orphanQuestionReply",[t])}sendCommandResult(t,e,n){return this._channel.call("$sendCommandResult",[t,e,n])}freePortKillProcess(t){return this._channel.call("$freePortKillProcess",[t])}getDefaultSystemShell(t){return this._channel.call("$getDefaultSystemShell",[t])}getProfiles(t,e,n){return this._channel.call("$getProfiles",[this._workspaceContextService.getWorkspace().id,t,e,n])}acceptPtyHostResolvedVariables(t,e){return this._channel.call("$acceptPtyHostResolvedVariables",[t,e])}getEnvironment(){return this._channel.call("$getEnvironment")}getWslPath(t,e){return this._channel.call("$getWslPath",[t,e])}setTerminalLayoutInfo(t){let n={workspaceId:this._workspaceContextService.getWorkspace().id,tabs:t?t.tabs:[],background:t?t.background:null};return this._channel.call("$setTerminalLayoutInfo",n)}updateTitle(t,e,n){return this._channel.call("$updateTitle",[t,e,n])}updateIcon(t,e,n,r){return this._channel.call("$updateIcon",[t,e,n,r])}refreshProperty(t,e){return this._channel.call("$refreshProperty",[t,e])}updateProperty(t,e,n){return this._channel.call("$updateProperty",[t,e,n])}getTerminalLayoutInfo(){let e={workspaceId:this._workspaceContextService.getWorkspace().id};return this._channel.call("$getTerminalLayoutInfo",e)}reviveTerminalProcesses(t,e,n){return this._channel.call("$reviveTerminalProcesses",[t,e,n])}getRevivedPtyNewId(t){return this._channel.call("$getRevivedPtyNewId",[t])}serializeTerminalState(t){return this._channel.call("$serializeTerminalState",[t])}installAutoReply(t,e){return this._channel.call("$installAutoReply",[t,e])}uninstallAllAutoReplies(){return this._channel.call("$uninstallAllAutoReplies",[])}};NI=E([b(2,$2),b(3,e_),b(4,U2),b(5,K2),b(6,iM),b(7,DM),b(8,Du),b(9,G2),b(10,gI)],NI)});var X2=y(()=>{et();rl();Se();de();q();_c();sn();nt();Cl()});var Y2,Z2=y(()=>{Se();q();$e();me();X2();Y2="remoteFilesystem"});async function Nk(o,t,e){e===void 0&&(e=!!(globalThis._VSCODE_PRODUCT_JSON??globalThis.vscode?.context?.configuration()?.product)?.commit);let n=t?`${o}/${t}`:o;if(Mk.has(n))return Mk.get(n);let r;if(/^\w[\w\d+.-]*:\/\//.test(n))r=n;else{let l=`${fH&&e&&!Yt?M1:L1}/${n}`;r=yt.asBrowserUri(l).toString(!0)}let i=Ak.INSTANCE.load(r);return Mk.set(n,i),i}var fH,Ok,Ak,Mk,eF=y(()=>{$e();me();ce();sn();fH=!1,Ok=class{constructor(t,e,n){this.id=t;this.dependencies=e;this.callback=n}},Ak=class o{constructor(){this._isWebWorker=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope";this._isRenderer=typeof document=="object";this._defineCalls=[];this._state=1}static{this.INSTANCE=new o}_initialize(){if(this._state===1){if(globalThis.define){this._state=3;return}}else return;this._state=2,globalThis.define=(t,e,n)=>{typeof t!="string"&&(n=e,e=t,t=null),(typeof e!="object"||!Array.isArray(e))&&(n=e,e=null),this._defineCalls.push(new Ok(t,e,n))},globalThis.define.amd=!0,this._isRenderer?this._amdPolicy=globalThis._VSCODE_WEB_PACKAGE_TTP??window.trustedTypes?.createPolicy("amdLoader",{createScriptURL(t){if(t.startsWith(window.location.origin)||t.startsWith(`${z.vscodeFileResource}://${jx}`))return t;throw new Error(`[trusted_script_src] Invalid script url: ${t}`)}}):this._isWebWorker&&(this._amdPolicy=globalThis._VSCODE_WEB_PACKAGE_TTP??globalThis.trustedTypes?.createPolicy("amdLoader",{createScriptURL(t){return t}}))}async load(t){if(this._initialize(),this._state===3)return new Promise(s=>{let a=Ce();globalThis.define(a,[t],function(l){s(l)})});let e=await(this._isWebWorker?this._workerLoadScript(t):this._isRenderer?this._rendererLoadScript(t):this._nodeJSLoadScript(t));if(!e){console.warn(`Did not receive a define call from script ${t}`);return}let n={},r=[],i=[];if(Array.isArray(e.dependencies))for(let s of e.dependencies)s==="exports"?r.push(n):i.push(s);if(i.length>0)throw new Error(`Cannot resolve dependencies for script ${t}. The dependencies are: ${i.join(", ")}`);return typeof e.callback=="function"?e.callback(...r)??n:e.callback}_rendererLoadScript(t){return new Promise((e,n)=>{let r=document.createElement("script");r.setAttribute("async","async"),r.setAttribute("type","text/javascript");let i=()=>{r.removeEventListener("load",s),r.removeEventListener("error",a)},s=l=>{i(),e(this._defineCalls.pop())},a=l=>{i(),n(l)};r.addEventListener("load",s),r.addEventListener("error",a),this._amdPolicy&&(t=this._amdPolicy.createScriptURL(t)),r.setAttribute("src",t),window.document.getElementsByTagName("head")[0].appendChild(r)})}async _workerLoadScript(t){return this._amdPolicy&&(t=this._amdPolicy.createScriptURL(t)),await import(t),this._defineCalls.pop()}async _nodeJSLoadScript(t){try{let e=(await import("fs")).default,n=(await import("vm")).default,r=(await import("module")).default,i=I.parse(t).fsPath,s=e.readFileSync(i).toString(),a=r.wrap(s.replace(/^#!.*/,""));return new n.Script(a).runInThisContext().apply(),this._defineCalls.pop()}catch(e){throw e}}},Mk=new Map});async function hH(o,t,e){let n=Yt?await Nk("@microsoft/1ds-core-js","bundle/ms.core.min.js"):await import("@microsoft/1ds-core-js"),r=Yt?await Nk("@microsoft/1ds-post-js","bundle/ms.post.min.js"):await import("@microsoft/1ds-post-js"),i=new n.AppInsightsCore,s=new r.PostChannel,a={instrumentationKey:o,endpointUrl:tF,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[s]]};if(e){a.extensionConfig={};let l={alwaysUseXhrOverride:!0,ignoreMc1Ms0CookieProcessing:!0,httpXHROverride:e};a.extensionConfig[s.identifier]=l}return i.initialize(a,[]),i.addTelemetryInitializer(l=>{l.ext=l.ext??{},l.ext.web=l.ext.web??{},l.ext.web.consentDetails='{"GPC_DataSharingOptIn":false}',t&&(l.ext.utc=l.ext.utc??{},l.ext.utc.flags=8462029)}),i}var tF,gH,UI,nF=y(()=>{eF();Se();on();me();Ao();tF="https://mobile.events.data.microsoft.com/OneCollector/1.0",gH="https://mobile.events.data.microsoft.com/ping";UI=class{constructor(t,e,n,r,i){this._isInternalTelemetry=t;this._eventPrefix=e;this._defaultData=n;this._xhrOverride=i;this.endPointUrl=tF;this.endPointHealthUrl=gH;this._defaultData||(this._defaultData={}),typeof r=="function"?this._aiCoreOrKey=r():this._aiCoreOrKey=r,this._asyncAiCore=null}_withAIClient(t){if(this._aiCoreOrKey){if(typeof this._aiCoreOrKey!="string"){t(this._aiCoreOrKey);return}this._asyncAiCore||(this._asyncAiCore=hH(this._aiCoreOrKey,this._isInternalTelemetry,this._xhrOverride)),this._asyncAiCore.then(e=>{t(e)},e=>{Ke(e),console.error(e)})}}log(t,e){if(!this._aiCoreOrKey)return;e=ns(e,this._defaultData);let n=Zh(e),r=this._eventPrefix+"/"+t;try{this._withAIClient(i=>{i.pluginVersionString=n?.properties.version??"Unknown",i.track({name:r,baseData:{name:r,properties:n?.properties,measurements:n?.measurements}})})}catch{}}flush(){return this._aiCoreOrKey?new Promise(t=>{this._withAIClient(e=>{e.unload(!0,()=>{this._aiCoreOrKey=void 0,t(void 0)})})}):Promise.resolve(void 0)}}});async function vH(o,t){let e=await t.request(o,Ee.None),n=(await Br(e.stream)).toString(),r=e.res.statusCode??200;return{headers:e.res.headers,statusCode:r,responseData:n}}async function yH(o){let t=await import("https"),e={method:o.type,headers:o.headers};return new Promise((r,i)=>{let s=t.request(o.url??"",e,a=>{a.on("data",function(l){r({headers:a.headers,statusCode:a.statusCode??200,responseData:l.toString()})}),a.on("error",function(l){i(l)})});s.write(o.data,a=>{a&&i(a)}),s.end()})}async function bH(o,t,e){let n=typeof t.data=="string"?t.data:new TextDecoder().decode(t.data),r={type:"POST",headers:{...t.headers,"Content-Type":"application/json","Content-Length":Buffer.byteLength(t.data).toString()},url:t.urlString,data:n,callSite:JD};try{let i=o?await vH(r,o):await yH(r);e(i.statusCode,i.headers,i.responseData)}catch{e(0,{})}}var FI,rF=y(()=>{et();Wt();Zo();nF();FI=class extends UI{constructor(t,e,n,r,i){let s={sendPOST:(a,l)=>{bH(t,a,l)}};super(e,n,r,i,s)}}});function oF(o,t,e,n,r){let i=new gl;return o.forEach(s=>{let a=i.get(s.identifier);a&&r.warn(d(1559,null,a.extensionLocation.fsPath,s.extensionLocation.fsPath)),i.set(s.identifier,s)}),t.forEach(s=>{let a=i.get(s.identifier);if(a)if(a.isBuiltin){if(H0(a.version,s.version)){r.warn(`Skipping extension ${s.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}s.isBuiltin=!0}else r.warn(d(1559,null,a.extensionLocation.fsPath,s.extensionLocation.fsPath));else if(s.isBuiltin){r.warn(`Skipping obsolete builtin extension ${s.extensionLocation.path}`);return}i.set(s.identifier,s)}),e.forEach(s=>{let a=i.get(s.identifier);a&&r.warn(d(1560,null,a.extensionLocation.fsPath,s.extensionLocation.fsPath)),i.set(s.identifier,s)}),n.forEach(s=>{r.info(d(1558,null,s.extensionLocation.fsPath));let a=i.get(s.identifier);a&&a.isBuiltin&&(s.isBuiltin=!0),i.set(s.identifier,s)}),Array.from(i.values())}var iF=y(()=>{_n();pe();ta()});var VI,WI,sF=y(()=>{Le();me();no();ce();zo();xa();mo();Id();_n();iF();$e();No();VI=class{constructor(t,e,n,r,i,s,a,l){this._extensionManagementCLI=t;this._userDataProfilesService=n;this._extensionsScannerService=r;this._logService=i;this._extensionGalleryService=s;this._languagePackService=a;this._extensionManagementService=l;this._whenBuiltinExtensionsReady=Promise.resolve({failed:[]});this._whenExtensionsReady=Promise.resolve({failed:[]});let c=e.args["install-builtin-extension"];if(c){i.trace("Installing builtin extensions passed via args...");let p={isMachineScoped:!!e.args["do-not-sync"],installPreReleaseVersion:!!e.args["pre-release"]};Ot("code/server/willInstallBuiltinExtensions"),this._whenExtensionsReady=this._whenBuiltinExtensionsReady=t.installExtensions([],this._asExtensionIdOrVSIX(c),p,!!e.args.force).then(()=>(Ot("code/server/didInstallBuiltinExtensions"),i.trace("Finished installing builtin extensions"),{failed:[]}),m=>(i.error(m),{failed:[]}))}let u=e.args["install-extension"];if(u){i.trace("Installing extensions passed via args...");let p={isMachineScoped:!!e.args["do-not-sync"],installPreReleaseVersion:!!e.args["pre-release"],isApplicationScoped:!0};this._whenExtensionsReady=this._whenBuiltinExtensionsReady.then(()=>t.installExtensions(this._asExtensionIdOrVSIX(u),[],p,!!e.args.force)).then(async()=>(i.trace("Finished installing extensions"),{failed:[]}),async m=>{i.error(m);let g=[],h=await this._extensionManagementService.getInstalled(1);for(let v of this._asExtensionIdOrVSIX(u))typeof v=="string"&&(h.some(x=>we(x.identifier,{id:v}))||g.push({id:v,installOptions:p}));return g.length?(i.info(`Relaying the following extensions to install later: ${g.map(v=>v.id).join(", ")}`),{failed:g}):(i.trace("No extensions to report as failed"),{failed:[]})})}}_asExtensionIdOrVSIX(t){return t.map(e=>/\.vsix$/i.test(e)?I.file(ro(e)?e:H(to(),e)):e)}whenExtensionsReady(){return this._whenExtensionsReady}async scanExtensions(t,e,n,r,i){Ot("code/server/willScanExtensions"),this._logService.trace(`Scanning extensions using UI language: ${t}`),await this._whenBuiltinExtensionsReady;let s=r?r.filter(l=>l.scheme===z.file).map(l=>l.fsPath):void 0;e=e??this._userDataProfilesService.defaultProfile.extensionsResource;let a=await this._scanExtensions(e,t??Cn,n,s,i);return this._logService.trace("Scanned Extensions",a),this._massageWhenConditions(a),Ot("code/server/didScanExtensions"),a}async _scanExtensions(t,e,n,r,i){await this._ensureLanguagePackIsInstalled(e,i);let[s,a,l,c]=await Promise.all([this._scanBuiltinExtensions(e),this._scanInstalledExtensions(t,e),this._scanWorkspaceInstalledExtensions(e,n),this._scanDevelopedExtensions(e,r)]);return oF(s,a,l,c,this._logService)}async _scanDevelopedExtensions(t,e){return e?(await Promise.all(e.map(n=>this._extensionsScannerService.scanOneOrMultipleExtensions(I.file(Bn(n)),1,{language:t})))).flat().map(n=>vm(n,!0)):[]}async _scanWorkspaceInstalledExtensions(t,e){let n=[];if(e?.length){let r=await Promise.all(e.map(i=>this._extensionsScannerService.scanExistingExtension(i,1,{language:t})));for(let i of r)i&&n.push(vm(i,!1))}return n}async _scanBuiltinExtensions(t){return(await this._extensionsScannerService.scanSystemExtensions({language:t})).map(n=>vm(n,!1))}async _scanInstalledExtensions(t,e){return(await this._extensionsScannerService.scanUserExtensions({profileLocation:t,language:e,useCache:!0})).map(r=>vm(r,!1))}async _ensureLanguagePackIsInstalled(t,e){if(!(t===zi||!this._extensionGalleryService.isEnabled())){try{if((await this._languagePackService.getInstalledLanguages()).find(r=>r.id===t)){this._logService.trace(`Language Pack ${t} is already installed. Skipping language pack installation.`);return}}catch(n){this._logService.error(n)}if(!e){this._logService.trace(`No language pack id provided for language ${t}. Skipping language pack installation.`);return}this._logService.trace(`Language Pack ${e} for language ${t} is not installed. It will be installed now.`);try{await this._extensionManagementCLI.installExtensions([e],[],{isMachineScoped:!0},!0)}catch(n){this._logService.error(n)}}}_massageWhenConditions(t){let e=(l,c)=>l.replace(/file/g,"vscode-remote"),n=l=>{let c="";return c+=l.global?"g":"",c+=l.ignoreCase?"i":"",c+=l.multiline?"m":"",new RegExp(e(l.source,!0),c)},r=new class{mapDefined(l){return es.create(l)}mapNot(l){return ts.create(l)}mapEquals(l,c){return l==="resourceScheme"&&typeof c=="string"?zs.create(l,e(c,!1)):zs.create(l,c)}mapNotEquals(l,c){return l==="resourceScheme"&&typeof c=="string"?Gs.create(l,e(c,!1)):Gs.create(l,c)}mapGreater(l,c){return qs.create(l,c)}mapGreaterEquals(l,c){return il.create(l,c)}mapSmaller(l,c){return sl.create(l,c)}mapSmallerEquals(l,c){return al.create(l,c)}mapRegex(l,c){return l==="resourceScheme"&&c?Ks.create(l,n(c)):Ks.create(l,c)}mapIn(l,c){return Lc.create(l,c)}mapNotIn(l,c){return Mc.create(l,c)}},i=l=>{if(!l||!l.when||!/resourceScheme/.test(l.when))return;let c=Lt.deserialize(l.when);if(!c)return;let u=c.map(r);l.when=u.serialize()},s=l=>{if(Array.isArray(l))for(let c of l)i(c);else i(l)},a=l=>{for(let c in l)s(l[c])};t.forEach(l=>{l.contributes&&(l.contributes.menus&&a(l.contributes.menus),l.contributes.keybindings&&s(l.contributes.keybindings),l.contributes.views&&a(l.contributes.views))})}},WI=class{constructor(t,e){this.service=t;this.getUriTransformer=e}listen(t,e){throw new Error("Invalid listen")}async call(t,e,n){let r=this.getUriTransformer(t);switch(e){case"whenExtensionsReady":return await this.service.whenExtensionsReady();case"scanExtensions":{let i=n[0],s=n[1]?I.revive(r.transformIncoming(n[1])):void 0,a=Array.isArray(n[2])?n[2].map(p=>I.revive(r.transformIncoming(p))):void 0,l=Array.isArray(n[3])?n[3].map(p=>I.revive(r.transformIncoming(p))):void 0,c=n[4];return(await this.service.scanExtensions(i,s,a,l,c)).map(p=>bo(p,r))}}throw new Error("Invalid call")}}});var F8e,aF,lF=y(()=>{re();F8e=_("IRemoteExtensionsScannerService"),aF="remoteExtensionsScanner"});var BI,cF=y(()=>{de();zr();xa();q();BI=class{constructor(t,e){this.service=t;this.getUriTransformer=e}listen(t,e){let n=this.getUriTransformer(t);if(e==="onDidChangeProfiles")return F.map(this.service.onDidChangeProfiles,r=>({all:r.all.map(i=>bo({...i},n)),added:r.added.map(i=>bo({...i},n)),removed:r.removed.map(i=>bo({...i},n)),updated:r.updated.map(i=>bo({...i},n))}));throw new Error(`Invalid listen ${e}`)}async call(t,e,n){let r=this.getUriTransformer(t);switch(e){case"createProfile":{let i=await this.service.createProfile(n[0],n[1],n[2]);return bo({...i},r)}case"updateProfile":{let i=gE(Gw(n[0],r),this.service.profilesHome.scheme);return i=await this.service.updateProfile(i,n[1]),bo({...i},r)}case"removeProfile":{let i=gE(Gw(n[0],r),this.service.profilesHome.scheme);return this.service.removeProfile(i)}}throw new Error(`Invalid call ${e}`)}}});var Fu,dF=y(()=>{q();$e();Jv();vn();oy();Fu=class extends D{constructor(e,n){super();this._reconnectConstants=e;this._environmentService=n}start(){let e={serverName:"Pty Host",args:["--type=ptyHost","--logsPath",this._environmentService.logsHome.with({scheme:z.file}).fsPath],env:{VSCODE_ESM_ENTRYPOINT:"vs/platform/terminal/node/ptyHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true",VSCODE_RECONNECT_GRACE_TIME:this._reconnectConstants.graceTime,VSCODE_RECONNECT_SHORT_GRACE_TIME:this._reconnectConstants.shortGraceTime,VSCODE_RECONNECT_SCROLLBACK:this._reconnectConstants.scrollback}},n=ML(this._environmentService.args,this._environmentService.isBuilt);n&&(n.break&&n.port?e.debugBrk=n.port:!n.break&&n.port&&(e.debug=n.port));let r=new ca(yt.asFileUri("bootstrap-fork").fsPath,e),i=new le;return i.add(r),{client:r,store:i,onDidProcessExit:r.onDidProcessExit}}};Fu=E([b(1,It)],Fu)});var Vu,uF=y(()=>{de();q();$e();Jv();vn();oy();Vu=class extends D{constructor(e){super();this._environmentService=e;this._onRequestConnection=this._register(new P);this.onRequestConnection=this._onRequestConnection.event}setWebSocketConfig(e){this._wsConfig=e,this._onRequestConnection.fire()}start(){let e={VSCODE_ESM_ENTRYPOINT:"vs/platform/agentHost/node/agentHostMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"};this._wsConfig&&(this._wsConfig.port&&(e.VSCODE_AGENT_HOST_PORT=this._wsConfig.port),this._wsConfig.socketPath&&(e.VSCODE_AGENT_HOST_SOCKET_PATH=this._wsConfig.socketPath),this._wsConfig.host&&(e.VSCODE_AGENT_HOST_HOST=this._wsConfig.host),this._wsConfig.connectionToken&&(e.VSCODE_AGENT_HOST_CONNECTION_TOKEN=this._wsConfig.connectionToken));let n={serverName:"Agent Host",args:["--type=agentHost","--logsPath",this._environmentService.logsHome.with({scheme:z.file}).fsPath],env:e},r=OL(this._environmentService.args,this._environmentService.isBuilt);r&&(r.break&&r.port?n.debugBrk=r.port:!r.break&&r.port&&(n.debug=r.port));let i=new ca(yt.asFileUri("bootstrap-fork").fsPath,n),s=new le;return s.add(i),{client:i,store:s,onDidProcessExit:i.onDidProcessExit}}};Vu=E([b(0,It)],Vu)});var IH,y6e,b6e,pF=y(()=>{ce();re();(n=>{function o(r,i){return I.from({scheme:r,path:`/${i}`})}n.uri=o;function t(r){return(typeof r=="string"?I.parse(r):r).path.substring(1)}n.id=t;function e(r){return(typeof r=="string"?I.parse(r):r).scheme||void 0}n.provider=e})(IH||={});y6e=_("agentService"),b6e=_("agentHostService")});var D6e,Wu,mF=y(()=>{q();la();pF();re();Fe();ky();Sy();D6e=_("serverAgentHostManager"),Wu=class extends D{constructor(e,n,r,i){super();this._starter=e;this._logService=n;this._loggerService=r;this._serverLifetimeService=i;this._restartCount=0;this._lifetimeToken=this._register(new mr);this._hasActiveSessions=!1;this._connectionCount=0;this._register(this._starter),this._start()}_start(){let e=this._starter.start();this._logService.info("ServerAgentHostManager: agent host started"),e.store.add(new zd(this._loggerService,e.client.getChannel("agentHostLogger"))),this._trackActiveSessions(e),this._trackClientConnections(e),e.store.add(e.onDidProcessExit(n=>{this._store.isDisposed||(this._hasActiveSessions=!1,this._connectionCount=0,this._lifetimeToken.clear(),this._restartCount<=5?(this._logService.error(`ServerAgentHostManager: agent host terminated unexpectedly with code ${n.code}`),this._restartCount++,e.store.dispose(),this._start()):this._logService.error(`ServerAgentHostManager: agent host terminated with code ${n.code}, giving up after 5 restarts`))})),this._register(ie(()=>e.store.dispose()))}_trackActiveSessions(e){let n=ds.toService(e.client.getChannel("agentHost"));e.store.add(n.onDidAction(r=>{r.action.type==="root/activeSessionsChanged"&&(this._hasActiveSessions=r.action.activeSessions>0,this._updateLifetimeToken())}))}_trackClientConnections(e){let n=ds.toService(e.client.getChannel("agentHostConnectionTracker"));e.store.add(n.onDidChangeConnectionCount(r=>{this._connectionCount=r,this._updateLifetimeToken()}))}_updateLifetimeToken(){this._hasActiveSessions||this._connectionCount>0?this._lifetimeToken.value??=this._serverLifetimeService.active("AgentHost"):this._lifetimeToken.clear()}};Wu=E([b(1,Q),b(2,vr),b(3,Wd)],Wu)});import{spawn as xH}from"child_process";var HI,Bu,Uk=y(()=>{Le();$e();Ns();vn();re();Fe();HI=_("ICSSDevelopmentService"),Bu=class{constructor(t,e){this.envService=t;this.logService=e}get isEnabled(){return!this.envService.isBuilt}getCssModules(){return this._cssModules??=this.computeCssModules(),this._cssModules}async computeCssModules(){if(!this.isEnabled)return[];let t=await import("@vscode/ripgrep");return await new Promise(e=>{let n=Yn.create(),r=[],i=yt.asFileUri("").fsPath,s=xH(t.rgPath,["-g","**/*.css","--files","--no-ignore",i],{});s.stdout.on("data",a=>{r.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(r).toString("utf8"),l=a.split(`
- `).filter(Boolean).map(c=>ji(i,c).replace(/\\/g,"/")).filter(Boolean).sort();l.some(c=>c.indexOf("vs/")!==0)&&this.logService.error(`[CSS_DEV] Detected invalid paths in css modules, raw output: ${a}`),e(l),this.logService.info(`[CSS_DEV] DONE, ${l.length} css modules (${Math.round(n.elapsed())}ms)`)})})}};Bu=E([b(0,It),b(1,Q)],Bu)});var Hu,fF=y(()=>{q();pe();vn();Fe();yn();Ao();Hu=class extends D{constructor(e,n,r,i,s){super();this.prefix=e;let a=n?"remoteTelemetry":rE,l=r.getLogger(a);if(l)this.logger=this._register(l);else{let u=Xh(s,i)?" (Not Sent)":"";this.logger=this._register(r.createLogger(a,{name:d(918,null,u),group:Qh,hidden:!0}))}}flush(){return Promise.resolve()}log(e,n){this.logger.trace(`${this.prefix}telemetry/${e}`,Zh(n))}};Hu=E([b(2,vr),b(3,It),b(4,Ve)],Hu)});var $I,gF,Fk=y(()=>{re();$I=_("INativeMcpDiscoveryHelperService"),gF="NativeMcpDiscoveryHelper"});var $u,hF=y(()=>{xa();Fk();$u=class{constructor(t,e){this.getUriTransformer=t;this.nativeMcpDiscoveryHelperService=e}listen(t,e){throw new Error("Invalid listen")}async call(t,e,n){let r=this.getUriTransformer?.(t);if(e==="load"){let i=await this.nativeMcpDiscoveryHelperService.load();return r?bo(i,r):i}throw new Error("Invalid call")}};$u=E([b(1,$I)],$u)});import{homedir as SH}from"os";var zI,vF=y(()=>{me();ce();zI=class{constructor(){}load(){return Promise.resolve({platform:Go,homedir:I.file(SH()),winAppData:this.uriFromEnvVariable("APPDATA"),xdgHome:this.uriFromEnvVariable("XDG_CONFIG_HOME")})}uriFromEnvVariable(t){let e=process.env[t];if(e)return I.file(e)}}});var GI,yF,bF,Vk=y(()=>{re();GI=_("IMcpGatewayService"),yF="mcpGateway",bF="mcpGatewayToolBroker"});function EH(o){return"method"in o&&"id"in o&&(typeof o.id=="string"||typeof o.id=="number")}function Wk(o){return ko(o,{id:!0,result:!0})||ko(o,{id:!0,error:!0})}function Bk(o){return ko(o,{method:!0})&&!ko(o,{id:!0})}function wH(o){return typeof o=="object"&&o!==null&&"then"in o&&typeof o.then=="function"}var Bo,zu,Hk=y(()=>{ze();Wt();Se();q();Me();Bo=class extends Error{constructor(e,n,r){super(n);this.code=e;this.data=r}},zu=class o extends D{constructor(e,n){super();this._send=e;this._handlers=n;this._nextRequestId=1;this._pendingRequests=new Map}static{this.ParseError=-32700}static{this.MethodNotFound=-32601}static{this.InternalError=-32603}sendNotification(e){this._send({jsonrpc:"2.0",...e})}sendRequest(e,n=Ee.None,r){if(this._store.isDisposed)return Promise.reject(new Ye);let i=this._nextRequestId++,s=new Wr,a=new gt;this._pendingRequests.set(i,{promise:s,cts:a});let l=n.onCancellationRequested(()=>{s.isSettled||(this._pendingRequests.delete(i),a.cancel(),r?.(i),s.cancel()),l.dispose()});return this._send({jsonrpc:"2.0",id:i,...e}),s.p.finally(()=>{l.dispose(),this._pendingRequests.delete(i),a.dispose(!0)})}async handleMessage(e){if(Array.isArray(e)){let r=[];for(let i of e){let s=await this._handleMessage(i);s&&r.push(s)}return r}let n=await this._handleMessage(e);return n?[n]:[]}cancelPendingRequest(e){let n=this._pendingRequests.get(e);n&&(this._pendingRequests.delete(e),n.cts.cancel(),n.promise.cancel(),n.cts.dispose(!0))}cancelAllRequests(){for(let[e,n]of this._pendingRequests)this._pendingRequests.delete(e),n.cts.cancel(),n.promise.cancel(),n.cts.dispose(!0)}async _handleMessage(e){if(Wk(e)){ko(e,{result:!0})?this._handleResult(e):this._handleError(e);return}if(EH(e))return this._handleRequest(e);Bk(e)&&this._handlers.handleNotification?.(e)}_handleResult(e){let n=this._pendingRequests.get(e.id);n&&(this._pendingRequests.delete(e.id),n.promise.complete(e.result),n.cts.dispose(!0))}_handleError(e){if(e.id===void 0)return;let n=this._pendingRequests.get(e.id);n&&(this._pendingRequests.delete(e.id),n.promise.error(new Bo(e.error.code,e.error.message,e.error.data)),n.cts.dispose(!0))}async _handleRequest(e){if(!this._handlers.handleRequest){let r={jsonrpc:"2.0",id:e.id,error:{code:o.MethodNotFound,message:`Method not found: ${e.method}`}};return this._send(r),r}let n=new gt;this._register(ie(()=>n.dispose(!0)));try{let r=this._handlers.handleRequest(e,n.token),i=wH(r)?await r:r,s={jsonrpc:"2.0",id:e.id,result:i};return this._send(s),s}catch(r){let i;return r instanceof Bo?i={jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:i={jsonrpc:"2.0",id:e.id,error:{code:o.InternalError,message:r instanceof Error?r.message:"Internal error"}},this._send(i),i}finally{n.dispose(!0)}}dispose(){this.cancelAllRequests(),super.dispose()}static createParseError(e,n){return{jsonrpc:"2.0",error:{code:o.ParseError,message:e,data:n}}}}});function IF(o){let t=Array.isArray(o)?o[0]:o;return!t||!ko(t,{method:!0})?!1:t.method==="initialize"}var CH,TH,PH,kH,cg,qI,xF=y(()=>{Hk();q();Me();CH="2025-11-25",TH=["2025-11-25","2025-06-18","2025-03-26","2024-11-05","2024-10-07"],PH=-32600,kH=-32601,cg=-32602,qI=class extends D{constructor(e,n,r,i){super();this.id=e;this._logService=n;this._onDidDispose=r;this._serverInvoker=i;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._rpc=this._register(new zu(s=>this._handleOutgoingMessage(s),{handleRequest:s=>this._handleRequest(s),handleNotification:s=>this._handleNotification(s)})),this._register(this._serverInvoker.onDidChangeTools(()=>{this._isInitialized&&(this._logService.info(`[McpGateway][session ${this.id}] Tools changed, notifying client`),this._rpc.sendNotification({method:"notifications/tools/list_changed"}))})),this._register(this._serverInvoker.onDidChangeResources(()=>{this._isInitialized&&(this._logService.info(`[McpGateway][session ${this.id}] Resources changed, notifying client`),this._rpc.sendNotification({method:"notifications/resources/list_changed"}))}))}attachSseClient(e,n){n.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),n.write(`: connected
- `),this._sseClients.add(n),this._logService.info(`[McpGateway][session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),n.on("close",()=>{this._sseClients.delete(n),this._logService.info(`[McpGateway][session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){return this._rpc.handleMessage(e)}dispose(){this._logService.info(`[McpGateway][session ${this.id}] Disposing session (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._onDidDispose(),super.dispose()}_handleOutgoingMessage(e){if(Wk(e)){this._logService.debug(`[McpGateway][session ${this.id}] --> response: ${JSON.stringify(e)}`);return}if(Bk(e)){this._logService.debug(`[McpGateway][session ${this.id}] --> notification: ${e.method}`),this._broadcastSse(e);return}this._logService.warn("[McpGatewayService] Ignored unsupported outgoing gateway message")}_broadcastSse(e){if(this._sseClients.size===0){this._logService.debug(`[McpGateway][session ${this.id}] No SSE clients to broadcast to, dropping message`);return}let n=JSON.stringify(e),r=String(++this._lastEventId);this._logService.debug(`[McpGateway][session ${this.id}] Broadcasting SSE event id=${r} to ${this._sseClients.size}`);let i=n.split(/\r?\n/g),s=[`id: ${r}`,"event: message",...i.map(a=>`data: ${a}`),"",""].join(`
- `);for(let a of[...this._sseClients]){if(a.destroyed||a.writableEnded){this._sseClients.delete(a);continue}a.write(s)}}async _handleRequest(e){if(this._logService.debug(`[McpGateway][session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`),e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw this._logService.warn(`[McpGateway][session ${this.id}] Rejected request '${e.method}': session not initialized`),new Bo(PH,"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 Bo(kH,`Method not found: ${e.method}`)}}_handleNotification(e){this._logService.debug(`[McpGateway][session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,this._logService.info(`[McpGateway][session ${this.id}] Session initialized`),this._rpc.sendNotification({method:"notifications/tools/list_changed"}),this._rpc.sendNotification({method:"notifications/resources/list_changed"}))}_handleInitialize(e){let n=typeof e.params=="object"&&e.params?e.params:void 0,r=typeof n?.protocolVersion=="string"?n.protocolVersion:void 0,i=n?.clientInfo,s=r&&TH.includes(r)?r:CH;return this._logService.info(`[McpGateway] Initialize: client=${i?.name??"unknown"}/${i?.version??"?"}, clientProtocol=${r??"(none)"}, negotiated=${s}`),r&&r!==s&&this._logService.warn(`[McpGateway] Client requested unsupported protocol version '${r}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0}},serverInfo:{name:"VS Code MCP Gateway",version:"1.0.0"}}}async _handleCallTool(e){let n=typeof e.params=="object"&&e.params?e.params:void 0;if(!n||typeof n.name!="string")throw new Bo(cg,"Missing tool call params");if(n.arguments&&typeof n.arguments!="object")throw new Bo(cg,"Invalid tool call arguments");let r=n.arguments&&typeof n.arguments=="object"?n.arguments:{};this._logService.debug(`[McpGateway][session ${this.id}] Calling tool '${n.name}' with args: ${JSON.stringify(r)}`);try{let i=await this._serverInvoker.callTool(n.name,r);return this._logService.debug(`[McpGateway][session ${this.id}] Tool '${n.name}' completed (isError=${i.isError??!1}, content blocks=${i.content.length})`),i}catch(i){throw this._logService.error(`[McpGateway][session ${this.id}] Tool '${n.name}' invocation failed`,i),new Bo(cg,String(i))}}async _handleListTools(){let e=await this._serverInvoker.listTools();return this._logService.debug(`[McpGateway][session ${this.id}] Listed ${e.length} tool(s): [${e.map(n=>n.name).join(", ")}]`),{tools:e}}async _handleListResources(){let e=await this._serverInvoker.listResources();return this._logService.debug(`[McpGateway][session ${this.id}] Listed ${e.length} resource(s)`),{resources:e}}async _handleReadResource(e){let n=typeof e.params=="object"&&e.params?e.params:void 0;if(!n||typeof n.uri!="string")throw new Bo(cg,"Missing resource URI");this._logService.debug(`[McpGateway][session ${this.id}] Reading resource '${n.uri}'`);try{let r=await this._serverInvoker.readResource(n.uri);return this._logService.debug(`[McpGateway][session ${this.id}] Resource read returned ${r.contents.length} content(s)`),r}catch(r){throw this._logService.error(`[McpGateway][session ${this.id}] Resource read failed for '${n.uri}'`,r),new Bo(cg,String(r))}}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 Gu,$k,SF=y(()=>{ze();de();Hk();q();ce();sn();Fe();xF();Gu=class extends D{constructor(e){super();this._routes=new Map;this._gatewayRoutes=new Map;this._gatewayServerRoutes=new Map;this._gatewayToClient=new Map;this._gatewayDisposables=new Map;this._logger=this._register(e.createLogger("mcpGateway",{name:"MCP Gateway",logLevel:"always"})),this._logger.info("[McpGatewayService] Initialized")}async createGateway(e,n){if(await this._ensureServer(),this._port===void 0)throw new Error("[McpGatewayService] Server failed to start, port is undefined");if(!n)throw new Error("[McpGatewayService] Tool invoker is required to create gateway");let r=Ce(),i=new Set,s=new Map;this._gatewayRoutes.set(r,i),this._gatewayServerRoutes.set(r,s);let a=new le;this._gatewayDisposables.set(r,a);try{let l=n.listServers(),c=[];for(let p of l){let m=this._createRouteForServer(r,p.id,p.label,n,i,s);c.push(m)}e?(this._gatewayToClient.set(r,e),this._logger.info(`[McpGatewayService] Created gateway ${r} with ${c.length} server(s) for client ${e}`)):this._logger.warn(`[McpGatewayService] Created gateway ${r} with ${c.length} server(s) without client tracking`);let u=a.add(new P);return a.add(n.onDidChangeServers(p=>{this._refreshGatewayServers(r,p,n,i,s,u)})),{servers:c,onDidChangeServers:u.event,gatewayId:r}}catch(l){throw this._cleanupGateway(r),l}}_refreshGatewayServers(e,n,r,i,s,a){if(!this._gatewayRoutes.has(e))return;let l=new Set(n.map(p=>p.id)),c=new Set(s.keys());for(let p of c)if(!l.has(p)){let m=s.get(p);m&&(this._disposeRoute(m),i.delete(m),s.delete(p))}for(let p of n){if(!c.has(p.id)){this._createRouteForServer(e,p.id,p.label,r,i,s);continue}let m=s.get(p.id),g=m?this._routes.get(m):void 0;g&&g.label!==p.label&&(g.label=p.label)}let u=this._getGatewayServers(e);this._logger.info(`[McpGatewayService] Gateway ${e} servers changed: ${u.length} server(s)`),a.fire(u)}_cleanupGateway(e){let n=this._gatewayRoutes.get(e);if(n)for(let r of n)this._disposeRoute(r);this._gatewayRoutes.delete(e),this._gatewayServerRoutes.delete(e),this._gatewayToClient.delete(e),this._gatewayDisposables.get(e)?.dispose(),this._gatewayDisposables.delete(e)}_createRouteForServer(e,n,r,i,s,a){let l=Ce(),c={onDidChangeTools:i.onDidChangeTools,onDidChangeResources:i.onDidChangeResources,listTools:()=>i.listToolsForServer(n),callTool:(m,g)=>i.callToolForServer(n,m,g),listResources:()=>i.listResourcesForServer(n),readResource:m=>i.readResourceForServer(n,m),listResourceTemplates:()=>i.listResourceTemplatesForServer(n)},u=new $k(l,this._logger,c,r);this._routes.set(l,u),s.add(l),a.set(n,l);let p=I.parse(`http://127.0.0.1:${this._port}/gateway/${l}`);return this._logger.info(`[McpGatewayService] Created route ${l} for server '${r}' (${n}) at ${p}`),{label:r,address:p}}_getGatewayServers(e){let n=this._gatewayServerRoutes.get(e);if(!n)return[];let r=[];for(let[i,s]of n){let a=this._routes.get(s);a&&r.push({label:a.label,address:I.parse(`http://127.0.0.1:${this._port}/gateway/${s}`)})}return r}_disposeRoute(e){let n=this._routes.get(e);n&&(n.dispose(),this._routes.delete(e),this._logger.info(`[McpGatewayService] Disposed route: ${e}`))}async disposeGateway(e){if(!this._gatewayRoutes.has(e)){this._logger.warn(`[McpGatewayService] Attempted to dispose unknown gateway: ${e}`);return}this._cleanupGateway(e),this._logger.info(`[McpGatewayService] Disposed gateway: ${e} (remaining routes: ${this._routes.size})`),this._routes.size===0&&this._stopServer()}disposeGatewaysForClient(e){let n=[];for(let[r,i]of this._gatewayToClient)i===e&&n.push(r);if(n.length>0){this._logger.info(`[McpGatewayService] Disposing ${n.length} gateway(s) for disconnected client ${e}`);for(let r of n)this._cleanupGateway(r);this._routes.size===0&&this._stopServer()}}async _ensureServer(){if(!this._server?.listening){if(this._serverStartPromise)return this._serverStartPromise;this._serverStartPromise=this._startServer();try{await this._serverStartPromise}finally{this._serverStartPromise=void 0}}}async _startServer(){let{createServer:e}=await import("http"),n=new Wr;this._server=e((i,s)=>{this._handleRequest(i,s)});let r=setTimeout(()=>{n.error(new Error("[McpGatewayService] Timeout waiting for server to start"))},5e3);return this._server.on("listening",()=>{let i=this._server.address();if(typeof i=="string")this._port=parseInt(i);else if(i instanceof Object)this._port=i.port;else{clearTimeout(r),n.error(new Error("[McpGatewayService] Unable to determine port"));return}clearTimeout(r),this._logger.info(`[McpGatewayService] Server started on port ${this._port}`),n.complete()}),this._server.on("error",i=>{if(i.code==="EADDRINUSE"){this._logger.warn("[McpGatewayService] Port in use, retrying with random port..."),this._server.listen(0,"127.0.0.1");return}clearTimeout(r),this._logger.error(`[McpGatewayService] Server error: ${i}`),n.error(i)}),this._server.listen(0,"127.0.0.1"),n.p}_stopServer(){this._server&&(this._logger.info("[McpGatewayService] Stopping server (no more routes)"),this._server.close(e=>{e?this._logger.error(`[McpGatewayService] Error closing server: ${e}`):this._logger.info("[McpGatewayService] Server stopped")}),this._server=void 0,this._port=void 0)}_handleRequest(e,n){let r=new URL(e.url,`http://${e.headers.host}`),i=r.pathname.split("/").filter(Boolean);if(this._logger.debug(`[McpGatewayService] ${e.method} ${r.pathname} (active routes: ${this._routes.size})`),i.length>=2&&i[0]==="gateway"){let s=i[1],a=this._routes.get(s);if(a){a.handleRequest(e,n);return}}this._logger.warn(`[McpGatewayService] ${e.method} ${r.pathname}: route not found`),n.writeHead(404,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Gateway not found"}))}dispose(){this._logger.info(`[McpGatewayService] Disposing service (routes: ${this._routes.size})`),this._stopServer();for(let e of this._routes.values())e.dispose();this._routes.clear(),this._gatewayRoutes.clear(),this._gatewayServerRoutes.clear(),this._gatewayToClient.clear();for(let e of this._gatewayDisposables.values())e.dispose();this._gatewayDisposables.clear(),super.dispose()}};Gu=E([b(0,vr)],Gu);$k=class o extends D{constructor(e,n,r,i=""){super();this.routeId=e;this._logger=n;this._serverInvoker=r;this.label=i;this._sessions=new Map}static{this.SessionHeaderName="mcp-session-id"}handleRequest(e,n){if(this._logger.debug(`[McpGateway][route ${this.routeId}] ${e.method} request (sessions: ${this._sessions.size})`),e.method==="POST"){this._handlePost(e,n);return}if(e.method==="GET"){this._handleGet(e,n);return}if(e.method==="DELETE"){this._handleDelete(e,n);return}this._respondHttpError(n,405,"Method not allowed")}dispose(){this._logger.info(`[McpGateway][route ${this.routeId}] Disposing route (sessions: ${this._sessions.size})`);for(let e of this._sessions.values())e.dispose();this._sessions.clear(),super.dispose()}_handleDelete(e,n){let r=this._getSessionId(e);if(!r){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let i=this._sessions.get(r);if(!i){this._respondHttpError(n,404,"Session not found");return}this._logger.info(`[McpGateway][route ${this.routeId}] Deleting session ${r}`),i.dispose(),this._sessions.delete(r),n.writeHead(204),n.end()}_handleGet(e,n){let r=this._getSessionId(e);if(!r){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let i=this._sessions.get(r);if(!i){this._respondHttpError(n,404,"Session not found");return}this._logger.info(`[McpGateway][route ${this.routeId}] SSE connection requested for session ${r}`),i.attachSseClient(e,n)}async _handlePost(e,n){let r=await this._readRequestBody(e);if(r===void 0){this._respondHttpError(n,413,"Payload too large");return}this._logger.debug(`[McpGateway][route ${this.routeId}] Handling POST`);let i;try{i=JSON.parse(r)}catch(l){this._logger.warn(`[McpGateway][route ${this.routeId}] JSON parse error: ${l instanceof Error?l.message:String(l)}`),n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(zu.createParseError("Parse error",l instanceof Error?l.message:String(l))));return}let s=this._getSessionId(e),a=this._resolveSessionForPost(s,i,n);if(a)try{let l=await a.handleIncoming(i),c={"Content-Type":"application/json","Mcp-Session-Id":a.id};if(l.length===0){this._logger.debug(`[McpGateway][route ${this.routeId}] POST response: 202 (no content)`),n.writeHead(202,c),n.end();return}let u=JSON.stringify(Array.isArray(i)?l:l[0]);this._logger.debug(`[McpGateway][route ${this.routeId}] POST response: 200, body: ${u}`),n.writeHead(200,c),n.end(u)}catch(l){this._logger.error("[McpGatewayService] Failed handling gateway request",l),this._respondHttpError(n,500,"Internal server error")}}_resolveSessionForPost(e,n,r){if(e){let a=this._sessions.get(e);if(!a){this._logger.warn(`[McpGateway][route ${this.routeId}] Session not found: ${e}`),this._respondHttpError(r,404,"Session not found");return}return a}if(!IF(n)){this._respondHttpError(r,400,"Missing Mcp-Session-Id header");return}let i=Ce();this._logger.info(`[McpGateway][route ${this.routeId}] Creating new session ${i}`);let s=new qI(i,this._logger,()=>{this._sessions.delete(i)},this._serverInvoker);return this._sessions.set(i,s),s}_respondHttpError(e,n,r){this._logger.debug(`[McpGateway][route ${this.routeId}] HTTP error response: ${n} ${r}`),e.writeHead(n,{"Content-Type":"application/json"}),e.end(JSON.stringify({jsonrpc:"2.0",error:{code:n,message:r}}))}_getSessionId(e){let n=e.headers[o.SessionHeaderName];return Array.isArray(n)?n[0]:n}async _readRequestBody(e){let n=[],r=0,i=1024*1024;for await(let s of e){let a=Buffer.isBuffer(s)?s:Buffer.from(s);if(r+=a.byteLength,r>i)return;n.push(a)}return Buffer.concat(n).toString("utf8")}}});function RH(o,t){return o.getChannel(bF,e=>e.ctx===t)}var qu,EF=y(()=>{de();q();Fe();Vk();qu=class extends D{constructor(e,n,r){super();this._ipcServer=e;this.mcpGatewayService=n;this._loggerService=r;this._onDidChangeGatewayServers=this._register(new P);this._gatewayDisposables=this._register(new Ur);this._clientGateways=new Map;this._register(e.onDidRemoveConnection(i=>{this._loggerService.getLogger("mcpGateway")?.info(`[McpGateway][Channel] Client disconnected: ${i.ctx}, cleaning up gateways`),n.disposeGatewaysForClient(i.ctx);let s=this._clientGateways.get(i.ctx);if(s){for(let a of s)this._gatewayDisposables.deleteAndDispose(a);this._clientGateways.delete(i.ctx)}}))}listen(e,n){if(n==="onDidChangeGatewayServers")return this._onDidChangeGatewayServers.event;throw new Error(`Invalid listen: ${n}`)}async call(e,n,r){let i=this._loggerService.getLogger("mcpGateway");switch(i?.debug(`[McpGateway][Channel] IPC call: ${n} from client ${e}`),n){case"createGateway":{let{chatSessionResource:s}=r??{},a=RH(this._ipcServer,e),l=await a.call("listServers"),c=a.listen("onDidChangeServers"),u=await this.mcpGatewayService.createGateway(e,{onDidChangeServers:F.map(c,g=>(l=g,g)),onDidChangeTools:a.listen("onDidChangeTools"),onDidChangeResources:a.listen("onDidChangeResources"),listServers:()=>l,listToolsForServer:g=>a.call("listToolsForServer",{serverId:g}),callToolForServer:(g,h,v)=>a.call("callToolForServer",{serverId:g,name:h,args:v,chatSessionResource:s}),listResourcesForServer:g=>a.call("listResourcesForServer",{serverId:g}),readResourceForServer:(g,h)=>a.call("readResourceForServer",{serverId:g,uri:h}),listResourceTemplatesForServer:g=>a.call("listResourceTemplatesForServer",{serverId:g})}),p=new le;p.add(u.onDidChangeServers(g=>{this._onDidChangeGatewayServers.fire({gatewayId:u.gatewayId,servers:g})})),this._gatewayDisposables.set(u.gatewayId,p);let m=this._clientGateways.get(e);return m||(m=new Set,this._clientGateways.set(e,m)),m.add(u.gatewayId),i?.info(`[McpGateway][Channel] Gateway created: ${u.gatewayId} with ${u.servers.length} server(s) for client ${e}`),{gatewayId:u.gatewayId,servers:u.servers}}case"disposeGateway":{let s=r;i?.info(`[McpGateway][Channel] Disposing gateway: ${s} for client ${e}`),this._gatewayDisposables.deleteAndDispose(s);let a=this._clientGateways.get(e);a&&(a.delete(s),a.size===0&&this._clientGateways.delete(e)),await this.mcpGatewayService.disposeGateway(s);return}}throw new Error(`Invalid call: ${n}`)}};qu=E([b(1,GI),b(2,vr)],qu)});var Ku,wF=y(()=>{ze();de();yn();yl();Ew();Ku=class extends Ia{constructor(e,n){super(n);this._onDidChangeExtensionGalleryManifest=this._register(new P);this.onDidChangeExtensionGalleryManifest=this._onDidChangeExtensionGalleryManifest.event;this._onDidChangeExtensionGalleryManifestStatus=this._register(new P);this.onDidChangeExtensionGalleryManifestStatus=this._onDidChangeExtensionGalleryManifestStatus.event;this.barrier=new lo;e.registerChannel("extensionGalleryManifest",{listen:()=>F.None,call:async(r,i,s)=>{if(i==="setExtensionGalleryManifest")return Promise.resolve(this.setExtensionGalleryManifest(s[0]));throw new Error("Invalid call")}})}get extensionGalleryManifestStatus(){return this._extensionGalleryManifest?"available":"unavailable"}async getExtensionGalleryManifest(){return await this.barrier.wait(),this._extensionGalleryManifest??null}setExtensionGalleryManifest(e){this._extensionGalleryManifest=e,this._onDidChangeExtensionGalleryManifest.fire(e),this._onDidChangeExtensionGalleryManifestStatus.fire(this.extensionGalleryManifestStatus),this.barrier.open()}};Ku=E([b(1,Ve)],Ku)});var tc,zk,nc,KI,rc=y(()=>{re();tc=_("IMcpGalleryService"),zk=_("IMcpManagementService"),nc=_("IAllowedMcpServersService"),KI="chat.mcp.access"});var Gk=y(()=>{});var Wa,oc,jI=y(()=>{hi();ze();et();Ii();q();Hn();xn();nt();Mm();re();br();Gk();Wa=_("IMcpResourceScannerService"),oc=class extends D{constructor(e,n){super();this.fileService=e;this.uriIdentityService=n;this.resourcesAccessQueueMap=new lt}async scanMcpServers(e,n){return this.withProfileMcpServers(e,n)}async addMcpServers(e,n,r){await this.withProfileMcpServers(n,r,i=>{let s=i.inputs??[],a=i.servers??{};for(let{name:l,config:c,inputs:u}of e)if(a[l]=c,u){let p=new Set(s.map(g=>g.id)),m=u.filter(g=>!p.has(g.id));s=[...s,...m]}return{servers:a,inputs:s,sandbox:i.sandbox}})}async updateSandboxConfig(e,n,r){await this.withProfileMcpServers(n,r,e)}async removeMcpServers(e,n,r){await this.withProfileMcpServers(n,r,i=>{for(let s of e)i.servers?.[s]&&delete i.servers[s];return i})}async withProfileMcpServers(e,n,r){return this.getResourceAccessQueue(e).queue(async()=>{n=n??2;let i={};try{let s=await this.fileService.readFile(e),a=[],l=Lo(s.value.toString(),a,{allowTrailingComma:!0,allowEmptyContent:!0})||{};if(a.length>0)throw new Error("Failed to parse scanned MCP servers: "+a.join(", "));if(n===2)i=this.fromUserMcpServers(l);else if(n===6)i=this.fromWorkspaceFolderMcpServers(l);else if(n===5){let c=l;c.settings?.mcp&&(i=this.fromWorkspaceFolderMcpServers(c.settings?.mcp))}}catch(s){if(kt(s)!==1)throw s}return r&&(i=r(i??{}),n===2?await this.writeScannedMcpServers(e,i):n===6?await this.writeScannedMcpServersToWorkspaceFolder(e,i):n===5?await this.writeScannedMcpServersToWorkspace(e,i):Qa(n,`Invalid Target: ${RD(n)}`)),i})}async writeScannedMcpServers(e,n){n.servers&&Object.keys(n.servers).length>0||n.inputs&&n.inputs.length>0||n.sandbox!==void 0?await this.fileService.writeFile(e,A.fromString(JSON.stringify(n,null," "))):await this.fileService.del(e)}async writeScannedMcpServersToWorkspaceFolder(e,n){await this.fileService.writeFile(e,A.fromString(JSON.stringify(n,null," ")))}async writeScannedMcpServersToWorkspace(e,n){let r;try{let i=await this.fileService.readFile(e),s=[];if(r=Lo(i.value.toString(),s,{allowTrailingComma:!0,allowEmptyContent:!0}),s.length>0)throw new Error("Failed to parse scanned MCP servers: "+s.join(", "))}catch(i){if(kt(i)!==1)throw i;r={settings:{}}}r.settings||(r.settings={}),r.settings.mcp=n,await this.fileService.writeFile(e,A.fromString(JSON.stringify(r,null," ")))}fromUserMcpServers(e){let n={inputs:e.inputs,sandbox:e.sandbox},r=Object.entries(e.servers??{});if(r.length>0){n.servers={};for(let[i,s]of r)n.servers[i]=this.sanitizeServer(s)}return n}fromWorkspaceFolderMcpServers(e){let n={inputs:e.inputs,sandbox:e.sandbox},r=Object.entries(e.servers??{});if(r.length>0){n.servers={};for(let[i,s]of r){let a=this.sanitizeServer(s);n.servers[i]=a}}return n}sanitizeServer(e){let n;if(e.config){let r=e;n={...r.config,version:r.version,gallery:r.gallery}}else n=e;return(n.type===void 0||n.type!=="http"&&n.type!=="stdio")&&(n.type=n.command?"stdio":"http"),n}getResourceAccessQueue(e){let n=this.resourcesAccessQueueMap.get(e);return n||(n=new co,this.resourcesAccessQueueMap.set(e,n)),n}};oc=E([b(0,Oe),b(1,ot)],oc);fa(Wa,oc,1)});var ju,dg,ic,sc,Qu,qk=y(()=>{ze();et();Wt();de();oa();q();Hn();on();Me();ce();pe();xn();vn();nt();re();Fe();br();zr();rc();Gk();jI();ju=class extends D{constructor(e){super();this.logService=e}getMcpServerConfigurationFromManifest(e,n){if(n==="remote"&&e.remotes?.length){let c=e.remotes[0].url,u=e.remotes[0].headers??[],{inputs:p,variables:m}=this.processKeyValueInputs(c.startsWith("https://api.githubcopilot.com/mcp")?u.filter(g=>g.name.toLowerCase()!=="authorization"):u);return{mcpServerConfiguration:{config:{type:"http",url:e.remotes[0].url,headers:Object.keys(p).length?p:void 0},inputs:m.length?m:void 0},notices:[]}}let r=e.packages?.find(c=>c.registryType===n)??e.packages?.[0];if(!r)throw new Error("No server package found");let i=[],s=[],a={},l=[];if(r.registryType==="oci"&&(i.push("run"),i.push("-i"),i.push("--rm")),r.runtimeArguments?.length){let c=this.processArguments(r.runtimeArguments??[]);i.push(...c.args),s.push(...c.variables),l.push(...c.notices)}if(r.environmentVariables?.length){let{inputs:c,variables:u,notices:p}=this.processKeyValueInputs(r.environmentVariables??[]);s.push(...u),l.push(...p);for(let[m,g]of Object.entries(c))a[m]=g,r.registryType==="oci"&&(i.push("-e"),i.push(m))}switch(r.registryType){case"npm":r.registryBaseUrl&&i.push("--registry",r.registryBaseUrl),i.push(r.version?`${r.identifier}@${r.version}`:r.identifier);break;case"pypi":r.registryBaseUrl&&i.push("--index-url",r.registryBaseUrl),i.push(r.version?`${r.identifier}@${r.version}`:r.identifier);break;case"oci":{let c=r.registryBaseUrl?`${r.registryBaseUrl}/${r.identifier}`:r.identifier;i.push(r.version?`${c}:${r.version}`:c);break}case"nuget":i.push(r.version?`${r.identifier}@${r.version}`:r.identifier),i.push("--yes"),r.registryBaseUrl&&i.push("--source",r.registryBaseUrl),r.packageArguments?.length&&i.push("--");break}if(r.packageArguments?.length){let c=this.processArguments(r.packageArguments);i.push(...c.args),s.push(...c.variables),l.push(...c.notices)}return{notices:l,mcpServerConfiguration:{config:{type:"stdio",command:this.getCommandName(r.registryType),args:i.length?i:void 0,env:Object.keys(a).length?a:void 0},inputs:s.length?s:void 0}}}getCommandName(e){switch(e){case"npm":return"npx";case"oci":return"docker";case"pypi":return"uvx";case"nuget":return"dnx"}return e}getVariables(e){let n=[];for(let[r,i]of Object.entries(e))n.push({id:r,type:i.choices?"pickString":"promptString",description:i.description??"",password:!!i.isSecret,default:i.default,options:i.choices});return n}processKeyValueInputs(e){let n=[],r={},i=[];for(let s of e){let a=s.variables?this.getVariables(s.variables):[],l=s.value||"";if(a.length){for(let c of a)l=l.replace(`{${c.id}}`,`\${input:${c.id}}`);i.push(...a)}else!l&&(s.description||s.choices||s.default!==void 0)&&(i.push({id:s.name,type:s.choices?"pickString":"promptString",description:s.description??"",password:!!s.isSecret,default:s.default,options:s.choices}),l=`\${input:${s.name}}`);r[s.name]=l}return{inputs:r,variables:i,notices:n}}processArguments(e){let n=[],r=[],i=[];for(let s of e){let a=s.variables?this.getVariables(s.variables):[];if(s.type==="positional"){let l=s.value;if(l){for(let c of a)l=l.replace(`{${c.id}}`,`\${input:${c.id}}`);n.push(l),a.length&&r.push(...a)}else s.valueHint&&(s.description||s.default!==void 0)?(r.push({id:s.valueHint,type:"promptString",description:s.description??"",password:!1,default:s.default}),n.push(`\${input:${s.valueHint}}`)):n.push(s.valueHint??"")}else if(s.type==="named"){if(!s.name){i.push(`Named argument is missing a name. ${JSON.stringify(s)}`);continue}if(n.push(s.name),s.value){let l=s.value;for(let c of a)l=l.replace(`{${c.id}}`,`\${input:${c.id}}`);n.push(l),a.length&&r.push(...a)}else if(s.description||s.default!==void 0){let l=s.name.replace(/^--?/,"");r.push({id:l,type:"promptString",description:s.description??"",password:!1,default:s.default}),n.push(`\${input:${l}}`)}}}return{args:n,variables:r,notices:i}}};ju=E([b(0,Q)],ju);dg=class extends ju{constructor(e,n,r,i,s,a,l){super(a);this.mcpResource=e;this.target=n;this.mcpGalleryService=r;this.fileService=i;this.uriIdentityService=s;this.mcpResourceScannerService=l;this.local=new Map;this._onInstallMcpServer=this._register(new P);this.onInstallMcpServer=this._onInstallMcpServer.event;this._onDidInstallMcpServers=this._register(new P);this._onDidUpdateMcpServers=this._register(new P);this._onUninstallMcpServer=this._register(new P);this._onDidUninstallMcpServer=this._register(new P);this.reloadConfigurationScheduler=this._register(new Qo(()=>this.updateLocal(),50))}get onDidInstallMcpServers(){return this._onDidInstallMcpServers.event}get onDidUpdateMcpServers(){return this._onDidUpdateMcpServers.event}get onUninstallMcpServer(){return this._onUninstallMcpServer.event}get onDidUninstallMcpServer(){return this._onDidUninstallMcpServer.event}initialize(){return this.initializePromise||(this.initializePromise=(async()=>{try{this.local=await this.populateLocalServers()}finally{this.startWatching()}})()),this.initializePromise}async populateLocalServers(){this.logService.trace("AbstractMcpResourceManagementService#populateLocalServers",this.mcpResource.toString());let e=new Map;try{let n=await this.mcpResourceScannerService.scanMcpServers(this.mcpResource,this.target);n.servers&&await Promise.allSettled(Object.entries(n.servers).map(async([r,i])=>{let s=await this.scanLocalServer(r,i,n.sandbox);e.set(r,s)}))}catch(n){throw this.logService.debug("Could not read user MCP servers:",n),n}return e}startWatching(){this._register(this.fileService.watch(this.mcpResource)),this._register(this.fileService.onDidFilesChange(e=>{e.affects(this.mcpResource)&&this.reloadConfigurationScheduler.schedule()}))}async updateLocal(){try{let e=await this.populateLocalServers(),n=[],r=[],i=[...this.local.keys()].filter(s=>!e.has(s));for(let s of i)this.local.delete(s);for(let[s,a]of e){let l=this.local.get(s);l?Ut(l,a)||(r.push(a),this.local.set(s,a)):(n.push(a),this.local.set(s,a))}for(let s of i)this.local.delete(s),this._onDidUninstallMcpServer.fire({name:s,mcpResource:this.mcpResource});r.length&&this._onDidUpdateMcpServers.fire(r.map(s=>({name:s.name,local:s,mcpResource:this.mcpResource}))),n.length&&this._onDidInstallMcpServers.fire(n.map(s=>({name:s.name,local:s,mcpResource:this.mcpResource})))}catch(e){this.logService.error("Failed to load installed MCP servers:",e)}}async getInstalled(){return await this.initialize(),Array.from(this.local.values())}async scanLocalServer(e,n,r){let i=await this.getLocalServerInfo(e,n);return i||(i={name:e,version:n.version,galleryUrl:ne(n.gallery)?n.gallery:void 0}),{name:e,config:n,rootSandbox:r,mcpResource:this.mcpResource,version:i.version,location:i.location,displayName:i.displayName,description:i.description,publisher:i.publisher,publisherDisplayName:i.publisherDisplayName,galleryUrl:i.galleryUrl,galleryId:i.galleryId,repositoryUrl:i.repositoryUrl,readmeUrl:i.readmeUrl,icon:i.icon,codicon:i.codicon,manifest:i.manifest,source:n.gallery?"gallery":"local"}}async install(e,n){this.logService.trace("MCP Management Service: install",e.name),this._onInstallMcpServer.fire({name:e.name,mcpResource:this.mcpResource});try{await this.mcpResourceScannerService.addMcpServers([e],this.mcpResource,this.target),await this.updateLocal();let r=this.local.get(e.name);if(!r)throw new Error(`Failed to install MCP server: ${e.name}`);return r}catch(r){throw this._onDidInstallMcpServers.fire([{name:e.name,error:r,mcpResource:this.mcpResource}]),r}}async uninstall(e,n){this.logService.trace("MCP Management Service: uninstall",e.name),this._onUninstallMcpServer.fire({name:e.name,mcpResource:this.mcpResource});try{if(!(await this.mcpResourceScannerService.scanMcpServers(this.mcpResource,this.target)).servers)return;await this.mcpResourceScannerService.removeMcpServers([e.name],this.mcpResource,this.target),e.location&&await this.fileService.del(I.revive(e.location),{recursive:!0}),await this.updateLocal()}catch(r){throw this._onDidUninstallMcpServer.fire({name:e.name,error:r,mcpResource:this.mcpResource}),r}}};dg=E([b(2,tc),b(3,Oe),b(4,ot),b(5,Q),b(6,Wa)],dg);ic=class extends dg{constructor(t,e,n,r,i,s,a){super(t,2,e,n,r,i,s),this.mcpLocation=r.extUri.joinPath(a.userRoamingDataHome,"mcp")}async installFromGallery(t,e){throw new Error("Not supported")}async updateMetadata(t,e){await this.updateMetadataFromGallery(e),await this.updateLocal();let n=(await this.getInstalled()).find(r=>r.name===t.name);if(!n)throw new Error(`Failed to find MCP server: ${t.name}`);return n}async updateMetadataFromGallery(t){let e=t.configuration,n=this.getLocation(t.name,t.version),r=this.uriIdentityService.extUri.joinPath(n,"manifest.json"),i={galleryUrl:t.galleryUrl,galleryId:t.id,name:t.name,displayName:t.displayName,description:t.description,version:t.version,publisher:t.publisher,publisherDisplayName:t.publisherDisplayName,repositoryUrl:t.repositoryUrl,licenseUrl:t.license,icon:t.icon,codicon:t.codicon,manifest:e};if(await this.fileService.writeFile(r,A.fromString(JSON.stringify(i))),t.readmeUrl||t.readme){let s=t.readme?t.readme:await this.mcpGalleryService.getReadme(t,Ee.None);await this.fileService.writeFile(this.uriIdentityService.extUri.joinPath(n,"README.md"),A.fromString(s))}return e}async getLocalServerInfo(t,e){let n,r,i;if(e.gallery){r=this.getLocation(t,e.version);let s=this.uriIdentityService.extUri.joinPath(r,"manifest.json");try{let a=await this.fileService.readFile(s);n=JSON.parse(a.value.toString()),n.galleryUrl?.includes("/v0/")&&(n.galleryUrl=n.galleryUrl.substring(0,n.galleryUrl.indexOf("/v0/")),await this.fileService.writeFile(s,A.fromString(JSON.stringify(n)))),n.location=r,i=this.uriIdentityService.extUri.joinPath(r,"README.md"),await this.fileService.exists(i)||(i=void 0),n.readmeUrl=i}catch(a){this.logService.error("MCP Management Service: failed to read manifest",r.toString(),a)}}return n}getLocation(t,e){return t=t.replace("/","."),this.uriIdentityService.extUri.joinPath(this.mcpLocation,e?`${t}-${e}`:t)}installFromUri(t,e){throw new Error("Method not supported.")}canInstall(){throw new Error("Not supported")}};ic=E([b(1,tc),b(2,Oe),b(3,ot),b(4,Q),b(5,Wa),b(6,It)],ic);sc=class extends ju{constructor(e,n){super(n);this.allowedMcpServersService=e}canInstall(e){let n=this.allowedMcpServersService.isAllowed(e);return n!==!0?new Sn(d(892,null,n.value)):!0}};sc=E([b(0,nc),b(1,Q)],sc);Qu=class extends sc{constructor(e,n,r,i){super(e,n);this.userDataProfilesService=r;this.instantiationService=i;this._onInstallMcpServer=this._register(new P);this.onInstallMcpServer=this._onInstallMcpServer.event;this._onDidInstallMcpServers=this._register(new P);this.onDidInstallMcpServers=this._onDidInstallMcpServers.event;this._onDidUpdateMcpServers=this._register(new P);this.onDidUpdateMcpServers=this._onDidUpdateMcpServers.event;this._onUninstallMcpServer=this._register(new P);this.onUninstallMcpServer=this._onUninstallMcpServer.event;this._onDidUninstallMcpServer=this._register(new P);this.onDidUninstallMcpServer=this._onDidUninstallMcpServer.event;this.mcpResourceManagementServices=new lt}getMcpResourceManagementService(e){let n=this.mcpResourceManagementServices.get(e);if(!n){let r=new le,i=r.add(this.createMcpResourceManagementService(e));r.add(i.onInstallMcpServer(s=>this._onInstallMcpServer.fire(s))),r.add(i.onDidInstallMcpServers(s=>this._onDidInstallMcpServers.fire(s))),r.add(i.onDidUpdateMcpServers(s=>this._onDidUpdateMcpServers.fire(s))),r.add(i.onUninstallMcpServer(s=>this._onUninstallMcpServer.fire(s))),r.add(i.onDidUninstallMcpServer(s=>this._onDidUninstallMcpServer.fire(s))),this.mcpResourceManagementServices.set(e,n={service:i,dispose:()=>r.dispose()})}return n.service}async getInstalled(e){let n=e||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(n).getInstalled()}async install(e,n){let r=n?.mcpResource||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(r).install(e,n)}async uninstall(e,n){let r=n?.mcpResource||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(r).uninstall(e,n)}async installFromGallery(e,n){let r=n?.mcpResource||this.userDataProfilesService.defaultProfile.mcpResource;return this.getMcpResourceManagementService(r).installFromGallery(e,n)}async updateMetadata(e,n,r){return this.getMcpResourceManagementService(r||this.userDataProfilesService.defaultProfile.mcpResource).updateMetadata(e,n)}dispose(){this.mcpResourceManagementServices.forEach(e=>e.dispose()),this.mcpResourceManagementServices.clear(),super.dispose()}createMcpResourceManagementService(e){return this.instantiationService.createInstance(ic,e)}};Qu=E([b(0,nc),b(1,Q),b(2,an),b(3,gr)],Qu)});var ug,QI,TF=y(()=>{vn();nt();Fe();br();rc();qk();jI();ug=class extends ic{constructor(t,e,n,r,i,s,a){super(t,e,n,r,i,s,a)}async installFromGallery(t,e){this.logService.trace("MCP Management Service: installGallery",t.name,t.galleryUrl),this._onInstallMcpServer.fire({name:t.name,mcpResource:this.mcpResource});try{let n=await this.updateMetadataFromGallery(t),r=e?.packageType??(n.remotes?.length?"remote":n.packages?.[0]?.registryType??"remote"),{mcpServerConfiguration:i,notices:s}=this.getMcpServerConfigurationFromManifest(n,r);s.length>0&&this.logService.warn(`MCP Management Service: Warnings while installing ${t.name}`,s);let a={name:t.name,config:{...i.config,gallery:t.galleryUrl??!0,version:t.version},inputs:i.inputs};await this.mcpResourceScannerService.addMcpServers([a],this.mcpResource,this.target),await this.updateLocal();let l=(await this.getInstalled()).find(c=>c.name===t.name);if(!l)throw new Error(`Failed to install MCP server: ${t.name}`);return l}catch(n){throw this._onDidInstallMcpServers.fire([{name:t.name,source:t,error:n,mcpResource:this.mcpResource}]),n}}};ug=E([b(1,tc),b(2,Oe),b(3,ot),b(4,Q),b(5,Wa),b(6,It)],ug);QI=class extends Qu{createMcpResourceManagementService(t){return this.instantiationService.createInstance(ug,t)}}});var PF,JI,Kk,_H,LH,jk,Ju,kF=y(()=>{Wt();oa();q();$e();Qt();ce();pe();nt();Fe();Zo();rc();Xf();Se();Me();(r=>{r.VERSION="v0-2025-07-09",r.SCHEMA="https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json";class e{toRawGalleryMcpServerResult(s){if(!s||typeof s!="object"||!Array.isArray(s.servers))return;let a=s,l=[];for(let c of a.servers){let u=this.toRawGalleryMcpServer(c);if(!u)return;l.push(u)}return{metadata:{count:a.metadata.count??0,nextCursor:a.metadata?.next_cursor},servers:l}}toRawGalleryMcpServer(s){if(!s||typeof s!="object")return;let a=s;if(!a.name||!ne(a.name)||!a.description||!ne(a.description)||!a.version||!ne(a.version)||a.$schema&&a.$schema!==r.SCHEMA)return;let l=a._meta?.["io.modelcontextprotocol.registry/official"];function c(x){return{...x,isRequired:x.is_required,isSecret:x.is_secret}}function u(x){let T={};for(let[w,k]of Object.entries(x))T[w]=c(k);return T}function p(x){return x.type==="positional"?{...x,valueHint:x.value_hint,isRepeated:x.is_repeated,isRequired:x.is_required,isSecret:x.is_secret,variables:x.variables?u(x.variables):void 0}:{...x,isRepeated:x.is_repeated,isRequired:x.is_required,isSecret:x.is_secret,variables:x.variables?u(x.variables):void 0}}function m(x){return{...x,isRequired:x.is_required,isSecret:x.is_secret,variables:x.variables?u(x.variables):void 0}}function g(x){switch(x.type){case"stdio":return{type:"stdio"};case"streamable-http":return{type:"streamable-http",url:x.url,headers:x.headers?.map(m)};case"sse":return{type:"sse",url:x.url,headers:x.headers?.map(m)};default:return{type:"stdio"}}}function h(x){switch(x){case"npm":return"npm";case"docker":case"docker-hub":case"oci":return"oci";case"pypi":return"pypi";case"nuget":return"nuget";case"mcpb":return"mcpb";default:return"npm"}}let v=a._meta["io.modelcontextprotocol.registry/publisher-provided"]?.github;return{id:l.id,name:a.name,description:a.description,repository:a.repository?{url:a.repository.url,source:a.repository.source,id:a.repository.id}:void 0,readme:a.repository?.readme,version:a.version,createdAt:a.created_at,updatedAt:a.updated_at,packages:a.packages?.map(x=>({identifier:x.identifier??x.name,registryType:h(x.registry_type??x.registry_name),version:x.version,fileSha256:x.file_sha256,registryBaseUrl:x.registry_base_url,transport:x.transport?g(x.transport):{type:"stdio"},packageArguments:x.package_arguments?.map(p),runtimeHint:x.runtime_hint,runtimeArguments:x.runtime_arguments?.map(p),environmentVariables:x.environment_variables?.map(m)})),remotes:a.remotes?.map(x=>({type:(x.type??x.transport_type??x.transport)==="sse"?"sse":"streamable-http",url:x.url,headers:x.headers?.map(m)})),registryInfo:{isLatest:l.is_latest,publishedAt:l.published_at,updatedAt:l.updated_at},githubInfo:v?{name:v.name,nameWithOwner:v.name_with_owner,displayName:v.display_name,isInOrganization:v.is_in_organization,license:v.license,opengraphImageUrl:v.opengraph_image_url,ownerAvatarUrl:v.owner_avatar_url,primaryLanguage:v.primary_language,primaryLanguageColor:v.primary_language_color,pushedAt:v.pushed_at,stargazerCount:v.stargazer_count,topics:v.topics,usesCustomOpengraphImage:v.uses_custom_opengraph_image}:void 0}}}r.SERIALIZER=new e})(PF||={});(n=>{n.VERSION="v0.1";class t{toRawGalleryMcpServerResult(i){if(!i||typeof i!="object"||!Array.isArray(i.servers))return;let s=i,a=[];for(let l of s.servers){let c=this.toRawGalleryMcpServer(l);if(!c){if(a.length===0)return;continue}a.push(c)}return{metadata:s.metadata,servers:a}}toRawGalleryMcpServer(i){if(!i||typeof i!="object")return;let s=i;if(!s.server||!Ue(s.server)||!s.server.name||!ne(s.server.name)||!s.server.description||!ne(s.server.description)||!s.server.version||!ne(s.server.version))return;let{"io.modelcontextprotocol.registry/official":a,...l}=s._meta,c=s.server._meta?.["io.modelcontextprotocol.registry/publisher-provided"]?.github;return{name:s.server.name,description:s.server.description,version:s.server.version,title:s.server.title,repository:s.server.repository?{url:s.server.repository.url,source:s.server.repository.source,id:s.server.repository.id}:void 0,readme:c?.readme,icons:s.server.icons,websiteUrl:s.server.websiteUrl,packages:s.server.packages,remotes:s.server.remotes,status:a?.status,registryInfo:a,githubInfo:c,apicInfo:l}}}n.SERIALIZER=new t})(JI||={});(n=>{n.VERSION="v0";class t{constructor(){this.galleryMcpServerDataSerializers=[];this.galleryMcpServerDataSerializers.push(JI.SERIALIZER),this.galleryMcpServerDataSerializers.push(PF.SERIALIZER)}toRawGalleryMcpServerResult(i){for(let s of this.galleryMcpServerDataSerializers){let a=s.toRawGalleryMcpServerResult(i);if(a)return a}}toRawGalleryMcpServer(i){for(let s of this.galleryMcpServerDataSerializers){let a=s.toRawGalleryMcpServer(i);if(a)return a}}}n.SERIALIZER=new t})(Kk||={});_H=50,LH={pageSize:_H},jk=class o{constructor(t=LH){this.state=t}get pageSize(){return this.state.pageSize}get searchText(){return this.state.searchText}get cursor(){return this.state.cursor}withPage(t,e=this.pageSize){return new o({...this.state,pageSize:e,cursor:t})}withSearchText(t){return new o({...this.state,searchText:t})}},Ju=class extends D{constructor(e,n,r,i){super();this.requestService=e;this.fileService=n;this.logService=r;this.mcpGalleryManifestService=i;this.galleryMcpServerDataSerializers=new Map,this.galleryMcpServerDataSerializers.set(Kk.VERSION,Kk.SERIALIZER),this.galleryMcpServerDataSerializers.set(JI.VERSION,JI.SERIALIZER)}isEnabled(){return this.mcpGalleryManifestService.mcpGalleryManifestStatus==="available"}async query(e,n=Ee.None){let r=await this.mcpGalleryManifestService.getMcpGalleryManifest();if(!r)return{firstPage:{items:[],hasMore:!1},getNextPage:async()=>({items:[],hasMore:!1})};let i=new jk;e?.text&&(i=i.withSearchText(e.text.trim()));let{servers:s,metadata:a}=await this.queryGalleryMcpServers(i,r,n),l=a.nextCursor;return{firstPage:{items:s,hasMore:!!a.nextCursor},getNextPage:async c=>{if(c.isCancellationRequested)throw new Ye;if(!l)return{items:[],hasMore:!1};let{servers:u,metadata:p}=await this.queryGalleryMcpServers(i.withPage(l).withSearchText(void 0),r,c);return l=p.nextCursor,{items:u,hasMore:!!p.nextCursor}}}}async getMcpServersFromGallery(e){let n=await this.mcpGalleryManifestService.getMcpGalleryManifest();if(!n)return[];let r=[];return await Promise.allSettled(e.map(async i=>{let s=await this.getMcpServerByName(i,n);s&&r.push(s)})),r}async getMcpServerByName({name:e,id:n},r){let i=this.getLatestServerVersionUrl(e,r);if(i){let l=await this.getMcpServer(i);if(l)return l}let s=this.getNamedServerUrl(e,r);if(s){let l=await this.getMcpServer(s);if(l)return l}let a=n?this.getServerIdUrl(n,r):void 0;if(a){let l=await this.getMcpServer(a);if(l)return l}}async getReadme(e,n){let r=e.readmeUrl;if(!r)return Promise.resolve(d(890,null));let i=I.parse(r);if(i.scheme===z.file)try{return(await this.fileService.readFile(i)).value.toString()}catch(l){this.logService.error(`Failed to read file from ${i}: ${l}`)}if(i.authority!=="raw.githubusercontent.com")return new Sn(d(891,null,r)).value;let s=await this.requestService.request({type:"GET",url:r,callSite:"mcpGalleryService.getReadme"},n),a=await jc(s);if(!a)throw new Error(`Failed to fetch README from ${r}`);return a}toGalleryMcpServer(e,n){let r="",i=e.title;if(e.githubInfo?.name)i||(i=e.githubInfo.name.split("-").map(c=>c.toLowerCase()==="mcp"?"MCP":c.toLowerCase()==="github"?"GitHub":Wx(c)).join(" ")),r=e.githubInfo.nameWithOwner.split("/")[0];else{let c=e.name.split("/");if(c.length>0){let u=c[0].split(".");u.length>0&&(r=u[u.length-1])}i||(i=c[c.length-1].split("-").map(u=>Wx(u)).join(" "))}e.githubInfo?.displayName&&(i=e.githubInfo.displayName);let s;if(e.githubInfo?.preferredImage)s={light:e.githubInfo.preferredImage,dark:e.githubInfo.preferredImage};else if(e.githubInfo?.ownerAvatarUrl)s={light:e.githubInfo.ownerAvatarUrl,dark:e.githubInfo.ownerAvatarUrl};else if(e.apicInfo?.["x-ms-icon"])s={light:e.apicInfo["x-ms-icon"],dark:e.apicInfo["x-ms-icon"]};else if(e.icons&&e.icons.length>0){let c=e.icons.find(p=>p.theme==="light")??e.icons[0],u=e.icons.find(p=>p.theme==="dark")??c;s={light:c.src,dark:u.src}}let a=n?this.getWebUrl(e.name,n):void 0,l=n?this.getPublisherUrl(r,n):void 0;return{id:e.id,name:e.name,displayName:i,galleryUrl:n?.url,webUrl:a,description:e.description,status:e.status??"active",version:e.version,isLatest:e.registryInfo?.isLatest??!0,publishDate:e.registryInfo?.publishedAt?Date.parse(e.registryInfo.publishedAt):void 0,lastUpdated:e.githubInfo?.pushedAt?Date.parse(e.githubInfo.pushedAt):e.registryInfo?.updatedAt?Date.parse(e.registryInfo.updatedAt):void 0,repositoryUrl:e.repository?.url,readme:e.readme,icon:s,publisher:r,publisherUrl:l,license:e.githubInfo?.license,starsCount:e.githubInfo?.stargazerCount,topics:e.githubInfo?.topics,configuration:{packages:e.packages,remotes:e.remotes}}}async queryGalleryMcpServers(e,n,r){let{servers:i,metadata:s}=await this.queryRawGalleryMcpServers(e,n,r);return{servers:i.map(a=>this.toGalleryMcpServer(a,n)),metadata:s}}async queryRawGalleryMcpServers(e,n,r){let i=this.getMcpGalleryUrl(n);if(!i)return{servers:[],metadata:{count:0}};let s=I.parse(i);if(s.scheme===z.file)try{let m=(await this.fileService.readFile(s)).value.toString();return JSON.parse(m)}catch(p){this.logService.error(`Failed to read file from ${s}: ${p}`)}let a=`${i}?limit=${e.pageSize}&version=latest`;if(e.cursor&&(a+=`&cursor=${e.cursor}`),e.searchText){let p=encodeURIComponent(e.searchText);a+=`&search=${p}`}let l=await this.requestService.request({type:"GET",url:a,callSite:"mcpGalleryService.queryMcpServers"},r),c=await Ci(l);if(!c)return{servers:[],metadata:{count:0}};let u=this.serializeMcpServersResult(c,n);if(!u)throw new Error(`Failed to serialize MCP servers result from ${i}`,c);return u}async getMcpServer(e,n){let r=await this.requestService.request({type:"GET",url:e,callSite:"mcpGalleryService.getMcpServer"},Ee.None);if(r.res.statusCode&&r.res.statusCode>=400&&r.res.statusCode<500)return;let i=await Ci(r);if(!i)return;n||(n=await this.mcpGalleryManifestService.getMcpGalleryManifest()),n=n&&e.startsWith(n.url)?n:null;let s=this.serializeMcpServer(i,n);if(!s)throw new Error(`Failed to serialize MCP server from ${e}`,i);return this.toGalleryMcpServer(s,n)}serializeMcpServer(e,n){return this.getSerializer(n)?.toRawGalleryMcpServer(e)}serializeMcpServersResult(e,n){return this.getSerializer(n)?.toRawGalleryMcpServerResult(e)}getSerializer(e){let n=e?.version??"v0";return this.galleryMcpServerDataSerializers.get(n)}getNamedServerUrl(e,n){let r=Xl(n,"McpServerNamedResourceUriTemplate");if(r)return so(r,{name:e})}getServerIdUrl(e,n){let r=Xl(n,"McpServerIdUriTemplate");if(r)return so(r,{id:e})}getLatestServerVersionUrl(e,n){let r=Xl(n,"McpServerLatestVersionUriTemplate");if(r)return so(r,{name:encodeURIComponent(e)})}getWebUrl(e,n){let r=Xl(n,"McpServerWebUriTemplate");if(r)return so(r,{name:e})}getPublisherUrl(e,n){let r=Xl(n,"PublisherUriTemplate");if(r)return so(r,{name:e})}getMcpGalleryUrl(e){return Xl(e,"McpServersQueryService")}};Ju=E([b(0,Rn),b(1,Oe),b(2,Q),b(3,vI)],Ju)});function ac(o,t){return o?I.revive(t?t.transformIncoming(o):o):void 0}function Ba(o,t){t=t||Bd;let e=o.manifest;return{...Hd({...o,manifest:void 0},t),manifest:e}}function Qk(o,t){return o?.mcpResource?Hd(o,t??Bd):o}function Jk(o,t){return t?yr(o,e=>e instanceof I?t.transformOutgoingURI(e):void 0):o}function pg(o,t){return t?t.transformOutgoingURI(o):o}var YI,XI,RF=y(()=>{de();on();ce();xa();Fe();rc();qk();YI=class{constructor(t,e){this.service=t;this.getUriTransformer=e;this.onInstallMcpServer=F.buffer(t.onInstallMcpServer,"onInstallMcpServer",!0),this.onDidInstallMcpServers=F.buffer(t.onDidInstallMcpServers,"onDidInstallMcpServers",!0),this.onDidUpdateMcpServers=F.buffer(t.onDidUpdateMcpServers,"onDidUpdateMcpServers",!0),this.onUninstallMcpServer=F.buffer(t.onUninstallMcpServer,"onUninstallMcpServer",!0),this.onDidUninstallMcpServer=F.buffer(t.onDidUninstallMcpServer,"onDidUninstallMcpServer",!0)}listen(t,e){let n=this.getUriTransformer(t);switch(e){case"onInstallMcpServer":return F.map(this.onInstallMcpServer,r=>({...r,mcpResource:pg(r.mcpResource,n)}));case"onDidInstallMcpServers":return F.map(this.onDidInstallMcpServers,r=>r.map(i=>({...i,local:i.local?Jk(i.local,n):i.local,mcpResource:pg(i.mcpResource,n)})));case"onDidUpdateMcpServers":return F.map(this.onDidUpdateMcpServers,r=>r.map(i=>({...i,local:i.local?Jk(i.local,n):i.local,mcpResource:pg(i.mcpResource,n)})));case"onUninstallMcpServer":return F.map(this.onUninstallMcpServer,r=>({...r,mcpResource:pg(r.mcpResource,n)}));case"onDidUninstallMcpServer":return F.map(this.onDidUninstallMcpServer,r=>({...r,mcpResource:pg(r.mcpResource,n)}))}throw new Error("Invalid listen")}async call(t,e,n){let r=this.getUriTransformer(t),i=Array.isArray(n)?n:[];switch(e){case"getInstalled":return(await this.service.getInstalled(ac(i[0],r))).map(a=>Jk(a,r));case"install":return this.service.install(i[0],Qk(i[1],r));case"installFromGallery":return this.service.installFromGallery(i[0],Qk(i[1],r));case"uninstall":return this.service.uninstall(Ba(i[0],r),Qk(i[1],r));case"updateMetadata":return this.service.updateMetadata(Ba(i[0],r),i[1],ac(i[2],r))}throw new Error("Invalid call")}},XI=class extends sc{constructor(e,n,r){super(n,r);this.channel=e;this._onInstallMcpServer=this._register(new P);this._onDidInstallMcpServers=this._register(new P);this._onUninstallMcpServer=this._register(new P);this._onDidUninstallMcpServer=this._register(new P);this._onDidUpdateMcpServers=this._register(new P);this._register(this.channel.listen("onInstallMcpServer")(i=>this._onInstallMcpServer.fire({...i,mcpResource:ac(i.mcpResource,null)}))),this._register(this.channel.listen("onDidInstallMcpServers")(i=>this._onDidInstallMcpServers.fire(i.map(s=>({...s,local:s.local?Ba(s.local,null):s.local,mcpResource:ac(s.mcpResource,null)}))))),this._register(this.channel.listen("onDidUpdateMcpServers")(i=>this._onDidUpdateMcpServers.fire(i.map(s=>({...s,local:s.local?Ba(s.local,null):s.local,mcpResource:ac(s.mcpResource,null)}))))),this._register(this.channel.listen("onUninstallMcpServer")(i=>this._onUninstallMcpServer.fire({...i,mcpResource:ac(i.mcpResource,null)}))),this._register(this.channel.listen("onDidUninstallMcpServer")(i=>this._onDidUninstallMcpServer.fire({...i,mcpResource:ac(i.mcpResource,null)})))}get onInstallMcpServer(){return this._onInstallMcpServer.event}get onDidInstallMcpServers(){return this._onDidInstallMcpServers.event}get onUninstallMcpServer(){return this._onUninstallMcpServer.event}get onDidUninstallMcpServer(){return this._onDidUninstallMcpServer.event}get onDidUpdateMcpServers(){return this._onDidUpdateMcpServers.event}install(e,n){return Promise.resolve(this.channel.call("install",[e,n])).then(r=>Ba(r,null))}installFromGallery(e,n){return Promise.resolve(this.channel.call("installFromGallery",[e,n])).then(r=>Ba(r,null))}uninstall(e,n){return Promise.resolve(this.channel.call("uninstall",[e,n]))}getInstalled(e){return Promise.resolve(this.channel.call("getInstalled",[e])).then(n=>n.map(r=>Ba(r,null)))}updateMetadata(e,n,r){return Promise.resolve(this.channel.call("updateMetadata",[e,n,r])).then(i=>Ba(i,null))}};XI=E([b(1,nc),b(2,Q)],XI)});var Xu,DF=y(()=>{q();pe();oa();xn();de();rc();Xu=class extends D{constructor(e){super();this.configurationService=e;this._onDidChangeAllowedMcpServers=this._register(new P);this.onDidChangeAllowedMcpServers=this._onDidChangeAllowedMcpServers.event;this._register(this.configurationService.onDidChangeConfiguration(n=>{n.affectsConfiguration(KI)&&this._onDidChangeAllowedMcpServers.fire()}))}isAllowed(e){if(this.configurationService.getValue(KI)!=="none")return!0;let n=Tv("workbench.action.openSettings",{query:`@id:${KI}`}).toString();return new Sn(d(889,null,n))}};Xu=E([b(0,xt)],Xu)});var ZI,_F=y(()=>{ze();de();q();Xf();ZI=class extends D{constructor(e){super();this._onDidChangeMcpGalleryManifest=this._register(new P);this.onDidChangeMcpGalleryManifest=this._onDidChangeMcpGalleryManifest.event;this._onDidChangeMcpGalleryManifestStatus=this._register(new P);this.onDidChangeMcpGalleryManifestStatus=this._onDidChangeMcpGalleryManifestStatus.event;this.barrier=new lo;e.registerChannel("mcpGalleryManifest",{listen:()=>F.None,call:async(n,r,i)=>{if(r==="setMcpGalleryManifest"){let s=Array.isArray(i)?i[0]:null;return Promise.resolve(this.setMcpGalleryManifest(s))}throw new Error("Invalid call")}})}get mcpGalleryManifestStatus(){return this._mcpGalleryManifest?"available":"unavailable"}async getMcpGalleryManifest(){return await this.barrier.wait(),this._mcpGalleryManifest??null}setMcpGalleryManifest(e){this._mcpGalleryManifest=e,this._onDidChangeMcpGalleryManifest.fire(e),this._onDidChangeMcpGalleryManifestStatus.fire(this.mcpGalleryManifestStatus),this.barrier.open()}}});var LF,ex,MF=y(()=>{LF="sandboxHelper",ex=class{constructor(t){this.service=t}listen(t,e){throw new Error("Invalid listen")}call(t,e,n,r){if(e==="checkSandboxDependencies")return this.service.checkSandboxDependencies();throw new Error("Invalid call")}}});var tx,OF=y(()=>{me();Yp();tx=class o{static async checkSandboxDependenciesWith(t,e=_e){if(!e)return;let[n,r]=await Promise.all([t("bwrap"),t("socat")]);return{bubblewrapInstalled:!!n,socatInstalled:!!r}}checkSandboxDependencies(){return o.checkSandboxDependenciesWith(Xp)}}});import{hostname as MH,release as OH}from"os";async function AF(o,t,e,n){let r=new Bs,i=new Zk,s={_serviceBrand:void 0,...St};r.set(Ve,s);let a=new _i(t,s);r.set(It,a),r.set(Dn,a);let l=new Ad(Up(a),a.logsHome);r.set(vr,l),i.registerChannel("logger",new Py(l,se=>lc(se.remoteAuthority)));let c=l.createLogger("remoteagent",{name:d(1002,null)}),u=n.add(new Od(c,[new eR(Up(a))]));r.set(Q,u),setTimeout(()=>NH(a.logsHome.with({scheme:z.file}).fsPath).then(null,se=>u.error(se)),1e4),n.add(u.onDidChangeLogLevel(se=>yD(u,se,`Log level changed to ${gS(u.getLevel())}`))),u.trace(`Remote configuration data at ${e}`),u.trace("process arguments:",a.args),Array.isArray(s.serverGreeting)&&u.info(`
- ${s.serverGreeting.join(`
- `)}
- `),i.registerChannel(Bm.ChannelName,new Bm);let p=new Qv(se=>se.clientId==="renderer"),m=n.add(new ki(u));r.set(Oe,m),m.registerProvider(z.file,n.add(new Di(u)));let g=new us(m);r.set(ot,g);let h=new Kc(a.machineSettingsResource,m,new Zs,u);r.set(xt,h);let v=new va(g,a,m,u);r.set(an,v),i.registerChannel("userDataProfiles",new BI(v,se=>lc(se.remoteAuthority))),r.set(HI,new tt(Bu,void 0,!0));let[,,x,T,w]=await Promise.all([h.initialize(),v.init(),vM(u.error.bind(u)),yM(u.error.bind(u)),bM(u.error.bind(u))]),k=new hy;r.set(vy,k);let M=new ea("remote",h,a,u);r.set(Rn,M);let B=C0,He=k0(s,h);if(Jh(s,a)){!Xh(s,a)&&s.aiConfig?.ariaKey&&(B=new FI(M,He,AH,null,s.aiConfig.ariaKey),n.add(ie(()=>B?.flush())));let se={appenders:[B,new Hu("",!0,l,a,s)],commonProperties:x0(OH(),MH(),process.arch,s.commit,s.version+"-remote",x,T,w,He,s.date,"remoteAgent"),piiPaths:R0(a)},Ht=a.args["telemetry-level"],ct=3;Ht==="all"?ct=3:Ht==="error"?ct=2:Ht==="crash"?ct=1:Ht!==void 0&&(ct=0),r.set(Vy,new tt(jd,[se,ct]))}else r.set(Vy,rO);r.set(Pi,new Ku(i,s)),r.set(vI,new ZI(i)),r.set($n,new tt(ra));let U=i.getChannel("download",p);r.set(ud,new Ey(U,()=>lc("renderer"))),r.set(Gr,new tt(ya)),r.set(ls,new tt(ga)),r.set(xd,new tt(ia)),r.set(vo,new tt(ba)),r.set(Sm,new tt(sa)),r.set($I,new tt(zI)),r.set(GI,new tt(Gu));let Y=new Ed(r);r.set(_m,Y.createInstance(ma));let G=Y.createInstance(Fu,{graceTime:a.reconnectionGraceTime,shortGraceTime:a.reconnectionGraceTime>0?Math.min(3e5,a.reconnectionGraceTime):0,scrollback:h.getValue("terminal.integrated.persistentSessionScrollback")??100}),W=Y.createInstance(Kd,G);r.set(RM,W);let ee=Y.createInstance(Vd,{enableAutoShutdown:!!t["enable-remote-auto-shutdown"],shutdownWithoutDelay:!!t["remote-auto-shutdown-without-delay"]});if(r.set(Wd,ee),t["agent-host-port"]||t["agent-host-path"]){let se=Y.createInstance(Vu);se.setWebSocketConfig({port:t["agent-host-port"],socketPath:t["agent-host-path"],host:t.host||"localhost",connectionToken:o.type===2?o.value:void 0}),n.add(Y.createInstance(Wu,se))}return r.set(nc,new tt(Xu)),r.set(Wa,new tt(oc)),r.set(tc,new tt(Ju)),r.set(zk,new tt(QI)),Y.invokeFunction(se=>{let Ht=se.get(zk),ct=se.get(Sm),$=se.get(ls),V=se.get($n),K=se.get(_m),Z=new Oy(o,a,v,k,u);i.registerChannel("remoteextensionsenvironment",Z);let ae=new Fy(se.get(Vy),B);i.registerChannel("telemetry",ae),i.registerChannel(LF,new ex(new tx)),i.registerChannel(Q2,new LI(a,u,W,s,ct,h));let ve=new VI(Y.createInstance(pa,s.extensionsForceVersionByQuality??[],u),a,v,$,u,V,K,ct);i.registerChannel(aF,new WI(ve,Ne=>lc(Ne.remoteAuthority))),i.registerChannel(gF,Y.createInstance($u,Ne=>lc(Ne.remoteAuthority))),i.registerChannel(yF,Y.createInstance(qu,i));let Ie=n.add(new Uy(u,a,h));i.registerChannel(Y2,Ie),i.registerChannel("request",new Ty(se.get(Rn)));let mt=new Cy(ct,Ne=>lc(Ne.remoteAuthority));return i.registerChannel("extensions",mt),i.registerChannel("mcpManagement",new YI(Ht,Ne=>lc(Ne.remoteAuthority))),ve.whenExtensionsReady().then(()=>ct.cleanUp()),n.add(new qm(se.get(Ft))),{telemetryService:se.get(Ft)}}),{socketServer:i,instantiationService:Y}}function lc(o){return Xk[o]||(Xk[o]=gs(o)),Xk[o]}function Wi(){let o=new Date;return`${Yk(o.getHours())}:${Yk(o.getMinutes())}:${Yk(o.getSeconds())}`}function Yk(o){return o<10?`0${o}`:String(o)}async function NH(o){let t=at(o),e=Ct(o);if(!await Te.exists(e))return;let i=(await Te.readdir(e)).filter(a=>/^\d{8}T\d{6}$/.test(a)).sort().filter(a=>a!==t),s=i.slice(0,Math.max(0,i.length-9));await Promise.all(s.map(a=>Te.rm(H(e,a))))}var AH,Xk,Zk,eR,NF=y(()=>{de();q();$e();Le();$w();fr();la();Rl();xn();WS();IM();Ev();xM();vn();TE();rr();Rv();dw();wM();HE();nt();jE();km();Fp();zE();dh();ay();uw();Fe();Js();yn();Zo();CM();YS();nE();nr();Ao();kM();Sa();qM();br();mw();YM();eO();tO();oO();W2();Qm();Wm();Dl();J2();Z2();Ow();Id();gw();El();zr();Kp();rF();Iw();vw();yw();bw();ky();pe();sF();lF();cF();dF();uF();mF();Sy();Uk();Sw();fF();Fk();hF();vF();Vk();SF();EF();yl();wF();rc();TF();kF();jI();RF();DF();Xf();_F();MF();OF();AH="monacoworkbench";Xk=Object.create(null);Zk=class extends Pm{constructor(){let t=new P;super(t.event),this._onDidConnectEmitter=t}acceptConnection(t,e){this._onDidConnectEmitter.fire({protocol:t,onDidClientDisconnect:e})}},eR=class extends cl{constructor(t=Np){super(),this.setLevel(t),this.useColors=!!process.stdout.isTTY}trace(t,...e){this.canLog(1)&&(this.useColors?console.log(`\x1B[90m[${Wi()}]\x1B[0m`,t,...e):console.log(`[${Wi()}]`,t,...e))}debug(t,...e){this.canLog(2)&&(this.useColors?console.log(`\x1B[90m[${Wi()}]\x1B[0m`,t,...e):console.log(`[${Wi()}]`,t,...e))}info(t,...e){this.canLog(3)&&(this.useColors?console.log(`\x1B[90m[${Wi()}]\x1B[0m`,t,...e):console.log(`[${Wi()}]`,t,...e))}warn(t,...e){this.canLog(4)&&(this.useColors?console.warn(`\x1B[93m[${Wi()}]\x1B[0m`,t,...e):console.warn(`[${Wi()}]`,t,...e))}error(t,...e){this.canLog(5)&&(this.useColors?console.error(`\x1B[91m[${Wi()}]\x1B[0m`,t,...e):console.error(`[${Wi()}]`,t,...e))}flush(){}}});import{createReadStream as UH,promises as mg}from"fs";import*as FF from"url";import*as fg from"cookie";import*as VF from"crypto";async function Xr(o,t,e,n){t.writeHead(e,{"Content-Type":"text/plain"}),t.end(n)}async function nR(o,t,e,n,r,i){try{let s=await mg.stat(o);if(t===1){let l=`W/"${[s.ino,s.size,s.mtime.getTime()].join("-")}"`;if(n.headers["if-none-match"]===l)return r.writeHead(304),void r.end();i.Etag=l}else t===2?i["Cache-Control"]="public, max-age=31536000":t===0&&(i["Cache-Control"]="no-store");i["Content-Type"]=FH[qo(o)]||iO(o)||"text/plain";let a=UH(o);await new Promise((l,c)=>{a.on("error",c),a.on("open",()=>{r.writeHead(200,i),a.pipe(r),r.once("close",()=>a.destroy()),a.on("end",l),a.removeAllListeners("error"),a.on("error",u=>{e.error(u),console.error(u.toString()),r.destroy()})})})}catch(s){return s.code!=="ENOENT"?(e.error(s),console.error(s.toString())):console.error(`File not found: ${o}`),r.writeHead(404,{"Content-Type":"text/plain"}),void r.end("Not found")}}var FH,tR,nx,UF,rx,Yu,WF=y(()=>{yi();_l();me();Fe();Dl();Le();$e();sn();yn();Wm();Zo();Wt();ce();et();Me();Ro();Uk();FH={".html":"text/html",".js":"text/javascript",".json":"application/json",".css":"text/css",".svg":"image/svg+xml"};tR=Ct(yt.asFileUri("").fsPath),nx="/static",UF="/callback",rx="/web-extension-resource",Yu=class{constructor(t,e,n,r,i,s,a,l){this._connectionToken=t;this._basePath=e;this._productPath=n;this._environmentService=r;this._logService=i;this._requestService=s;this._productService=a;this._cssDevService=l;this._webExtensionResourceUrlTemplate=this._productService.extensionsGallery?.resourceUrlTemplate?I.parse(this._productService.extensionsGallery.resourceUrlTemplate):void 0}async handle(t,e,n,r){try{return r.startsWith(nx)&&r.charCodeAt(nx.length)===47?this._handleStatic(t,e,r.substring(nx.length)):r==="/"?this._handleRoot(t,e,n):r===UF?this._handleCallback(e):r.startsWith(rx)&&r.charCodeAt(rx.length)===47?this._handleWebExtensionResource(t,e,r.substring(rx.length)):Xr(t,e,404,"Not found.")}catch(i){return this._logService.error(i),console.error(i.toString()),Xr(t,e,500,"Internal Server Error.")}}async _handleStatic(t,e,n){let r=Object.create(null),i=decodeURIComponent(n),s=H(tR,i);return Vr(s,tR,!_e)?nR(s,this._environmentService.isBuilt?2:1,this._logService,t,e,r):Xr(t,e,400,"Bad request.")}_getResourceURLTemplateAuthority(t){let e=t.authority.indexOf(".");return e!==-1?t.authority.substring(e+1):void 0}async _handleWebExtensionResource(t,e,n){if(!this._webExtensionResourceUrlTemplate)return Xr(t,e,500,"No extension gallery service configured.");let r=decodeURIComponent(n),i=In(r),s=I.parse(i).with({scheme:this._webExtensionResourceUrlTemplate.scheme,authority:i.substring(0,i.indexOf("/")),path:i.substring(i.indexOf("/")+1)});if(this._getResourceURLTemplateAuthority(this._webExtensionResourceUrlTemplate)!==this._getResourceURLTemplateAuthority(s))return Xr(t,e,403,"Request Forbidden");let a={},l=h=>{let v=t.headers[h];v&&(ne(v)||v[0])?a[h]=ne(v)?v:v[0]:h!==h.toLowerCase()&&l(h.toLowerCase())};l("X-Client-Name"),l("X-Client-Version"),l("X-Machine-Id"),l("X-Client-Commit");let c=await this._requestService.request({type:"GET",url:s.toString(!0),headers:a,callSite:"webClientServer.fetchAndWriteFile"},Ee.None),u=c.res.statusCode||500;if(u!==200){let h=null;try{h=await wi(c)}catch{}return Xr(t,e,u,h||`Request failed with status ${u}`)}let p=Object.create(null),m=h=>{let v=c.res.headers[h];v?p[h]=v:h!==h.toLowerCase()&&m(h.toLowerCase())};m("Cache-Control"),m("Content-Type"),e.writeHead(200,p);let g=await Br(c.stream);e.end(g.buffer)}async _handleRoot(t,e,n){let r=$=>{let V=t.headers[$];return Array.isArray(V)?V[0]:V},i=r("x-forwarded-prefix")||this._basePath,s=n.query[Ws];if(typeof s=="string"){let $=Object.create(null);$["Set-Cookie"]=fg.serialize(Ip,s,{sameSite:"lax",maxAge:3600*24*7});let V=Object.create(null);for(let Z in n.query)Z!==Ws&&(V[Z]=n.query[Z]);let K=FF.format({pathname:i,query:V});return $.Location=K,e.writeHead(302,$),void e.end()}let a=($,V)=>{let K=$?.indexOf(":");return K!==-1&&($=$?.substring(0,K)),$+=`:${V}`,$},l=!this._environmentService.isBuilt&&this._environmentService.args["use-test-resolver"],c=l?"test+test":r("x-original-host")||r("x-forwarded-host")||t.headers.host;if(!c)return Xr(t,e,400,"Bad request.");let u=r("x-forwarded-port");u&&(c=a(c,u));function p($){return JSON.stringify($).replace(/"/g,""")}let m;this._environmentService.args["enable-smoke-test-driver"]&&(m=!1),this._logService.getLevel()===1&&(["x-original-host","x-forwarded-host","x-forwarded-port","host"].forEach($=>{let V=r($);V&&this._logService.trace(`[WebClientServer] ${$}: ${V}`)}),this._logService.trace(`[WebClientServer] Request URL: ${t.url}, basePath: ${i}, remoteAuthority: ${c}`));let g=We.join(i,this._productPath,nx),h=We.join(i,this._productPath,UF),v=We.join(i,this._productPath,rx),x=$=>$&&I.file(Bn($)).with({scheme:z.vscodeRemote,authority:c}),T=yt.asFileUri(`vs/code/browser/workbench/workbench${this._environmentService.isBuilt?"":"-dev"}.html`).fsPath,w=!this._environmentService.isBuilt&&this._environmentService.args["github-auth"]?{id:Ce(),providerId:"github",accessToken:this._environmentService.args["github-auth"],scopes:[["user:email"],["repo"]]}:void 0,k={embedderIdentifier:"server-distro",extensionsGallery:this._webExtensionResourceUrlTemplate&&this._productService.extensionsGallery?{...this._productService.extensionsGallery,resourceUrlTemplate:this._webExtensionResourceUrlTemplate.with({scheme:"http",authority:c,path:`${v}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`}).toString(!0)}:void 0},M=this._environmentService.args["enable-proposed-api"];if(M?.length&&(k.extensionsEnabledWithApiProposalVersion??=[],k.extensionsEnabledWithApiProposalVersion.push(...M)),!this._environmentService.isBuilt)try{let $=JSON.parse((await mg.readFile(H(tR,"product.overrides.json"))).toString());Object.assign(k,$)}catch{}let B={remoteAuthority:c,serverBasePath:i,_wrapWebWorkerExtHostInIframe:m,developmentOptions:{enableSmokeTestDriver:this._environmentService.args["enable-smoke-test-driver"]?!0:void 0,logLevel:this._logService.getLevel()},settingsSyncOptions:!this._environmentService.isBuilt&&this._environmentService.args["enable-sync"]?{enabled:!0}:void 0,enableWorkspaceTrust:!this._environmentService.args["disable-workspace-trust"],folderUri:x(this._environmentService.args["default-folder"]),workspaceUri:x(this._environmentService.args["default-workspace"]),productConfiguration:k,callbackRoute:h},U=fg.parse(t.headers.cookie||"")["vscode.nls.locale"]||t.headers["accept-language"]?.split(",")[0]?.toLowerCase()||"en",Y,G;!U.startsWith("en")&&this._productService.nlsCoreBaseUrl?(Y=this._productService.nlsCoreBaseUrl,G=`${Y}${this._productService.commit}/${this._productService.version}/${U}/nls.messages.js`):G="";let W={WORKBENCH_WEB_CONFIGURATION:p(B),WORKBENCH_AUTH_SESSION:w?p(w):"",WORKBENCH_WEB_BASE_URL:g,WORKBENCH_NLS_URL:G,WORKBENCH_NLS_FALLBACK_URL:`${g}/out/nls.messages.js`};if(this._cssDevService.isEnabled){let $=await this._cssDevService.getCssModules();W.WORKBENCH_DEV_CSS_MODULES=JSON.stringify($)}if(l){let $=[];for(let V of["vscode-test-resolver","github-authentication"]){let K=JSON.parse((await mg.readFile(yt.asFileUri(`${_1}/${V}/package.json`).fsPath)).toString());$.push({extensionPath:V,packageJSON:K})}W.WORKBENCH_BUILTIN_EXTENSIONS=p($)}let ee;try{ee=(await mg.readFile(T)).toString().replace(/\{\{([^}]+)\}\}/g,(V,K)=>W[K]??"undefined")}catch{return e.writeHead(404,{"Content-Type":"text/plain"}),void e.end("Not found")}let ct={"Content-Type":"text/html","Content-Security-Policy":["default-src 'self';","img-src 'self' https: data: blob:;","media-src 'self';",`script-src 'self' 'unsafe-eval' ${Y??""} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(ee).join(" ")} 'sha256-2Q+j4hfT09+1+imS46J2YlkCtHWQt0/BE79PXjJ0ZJ8=' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${l?"":`http://${c}`};`,"child-src 'self';","frame-src 'self' https://*.vscode-cdn.net data:;","worker-src 'self' data: blob:;","style-src 'self' 'unsafe-inline';","connect-src 'self' ws: wss: https:;","font-src 'self' blob:;","manifest-src 'self';"].join(" ")};return this._connectionToken.type!==0&&(ct["Set-Cookie"]=fg.serialize(Ip,this._connectionToken.value,{sameSite:"lax",maxAge:3600*24*7})),e.writeHead(200,ct),void e.end(ee)}_getScriptCspHashes(t){let e=/<script>([\s\S]+?)<\/script>/img,n=[],r;for(;r=e.exec(t);){let i=VF.createHash("sha256"),s=r[1].replace(/\r\n/g,`
- `),a=i.update(Buffer.from(s)).digest().toString("base64");n.push(`'sha256-${a}'`)}return n}async _handleCallback(t){let e=yt.asFileUri("vs/code/browser/workbench/callback.html").fsPath,n=(await mg.readFile(e)).toString(),r=["default-src 'self';","img-src 'self' https: data: blob:;","media-src 'none';",`script-src 'self' ${this._getScriptCspHashes(n).join(" ")};`,"style-src 'self' 'unsafe-inline';","font-src 'self' blob:;"].join(" ");return t.writeHead(200,{"Content-Type":"text/html","Content-Security-Policy":r}),void t.end(n)}};Yu=E([b(3,ua),b(4,Q),b(5,Rn),b(6,Ve),b(7,HI)],Yu)});import*as gg from"fs";import*as BF from"net";import{createRequire as VH}from"node:module";import{performance as WH}from"perf_hooks";import*as rR from"url";async function HF(o,t,e){let n=await mM(t);n instanceof fs&&(console.warn(n.message),process.exit(1));function r(w){Ug(k=>{Fg(k)&&k.stack&&/unexpectedErrorHandler/.test(k.stack)||w(k)})}let i=[];r(w=>{i.push(w),console.error(w)});let s=!1;process.on("SIGPIPE",()=>{s||(s=!0,Ke(new Error("Unexpected SIGPIPE")))});let a=new le,{socketServer:l,instantiationService:c}=await AF(n,t,e,a);c.invokeFunction(w=>{let k=w.get(Q);i.forEach(M=>k.error(M)),i.length=0,r(M=>k.error(M))}),c.invokeFunction(w=>{let k=w.get(xt);te&&(k.getValue("security.restrictUNCAccess")===!1?py():Am(k.getValue("security.allowedUNCHosts")))}),c.invokeFunction(w=>{let k=w.get(Q);if(te&&process.env.HOMEDRIVE&&process.env.HOMEPATH){let M=H(process.env.HOMEDRIVE,"node_modules"),B=Ct(H(process.env.HOMEDRIVE,process.env.HOMEPATH)),He=H(B,"node_modules");if(gg.existsSync(M)||gg.existsSync(He)){let U=`
- *
- * !!!! Server terminated due to presence of CVE-2020-1416 !!!!
- *
- * Please remove the following directories and re-try
- * ${M}
- * ${He}
- *
- * For more information on the vulnerability https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1416
- *
- `;k.warn(U),console.warn(U),process.exit(0)}}});let u=c.invokeFunction(w=>{let k=w.get(Q);if(gg.existsSync(H(yt.asFileUri("").fsPath,"../node_modules/vsda")))try{return BH("vsda")}catch(B){k.error(B)}return null}),p=t["server-base-path"];p&&!p.startsWith("/")&&(p=`/${p}`);let m=gg.existsSync(yt.asFileUri("vs/code/browser/workbench/workbench.html").fsPath);if(m&&o&&typeof o!="string"){let w=n.type!==0?`?${Ws}=${n.value}`:"";console.log(`Web UI available at http://localhost${o.port===80?"":`:${o.port}`}${p??""}${w}`)}let g=c.createInstance(hg,l,n,u,m,p);Ot("code/server/ready");let h=WH.now(),v=global.vscodeServerStartTime,x=global.vscodeServerListenTime,T=global.vscodeServerCodeLoadedTime;if(c.invokeFunction(async w=>{let k=w.get(Ft);if(k.publicLog2("serverStart",{startTime:v,startedTime:x,codeLoadedTime:T,readyTime:h}),_e){let M=w.get(Q),B=await YL(M.error.bind(M));B&&k.publicLog2("serverPlatformInfo",{platformId:B.id,platformVersionId:B.version_id,platformIdLike:B.id_like})}}),t["print-startup-performance"]){let w="";w+=`Start-up time: ${x-v}
- `,w+=`Code loading time: ${T-v}
- `,w+=`Initialized time: ${h-v}
- `,w+=`
- `,console.log(w)}return g}var BH,hg,oR,$F=y(()=>{et();Ro();Se();yi();q();$e();Le();zo();me();Qt();ce();sn();ZL();nM();xw();Rl();Nm();xn();re();Fe();yn();aM();nr();Fw();uM();Wm();Dl();Sy();NF();WF();BH=VH(import.meta.url),hg=class extends D{constructor(e,n,r,i,s,a,l,c,u,p){super();this._socketServer=e;this._connectionToken=n;this._vsdaMod=r;this._environmentService=a;this._productService=l;this._logService=c;this._instantiationService=u;this._serverLifetimeService=p;this._extHostLifetimeTokens=this._register(new Ur);this._webEndpointOriginChecker=oR.create(this._productService),s!==void 0&&s.charCodeAt(s.length-1)===47&&(s=s.substring(0,s.length-1)),this._serverBasePath=s,this._serverProductPath=`/${Kx(l)}`,this._extHostConnections=Object.create(null),this._managementConnections=Object.create(null),this._allReconnectionTokens=new Set,this._webClientServer=i?this._instantiationService.createInstance(Yu,this._connectionToken,s??"/",this._serverProductPath):null,this._logService.info("Extension host agent started."),this._reconnectionGraceTime=this._environmentService.reconnectionGraceTime}async handleRequest(e,n){if(e.method!=="GET")return Xr(e,n,405,`Unsupported method ${e.method}`);if(!e.url)return Xr(e,n,400,"Bad request.");let r=rR.parse(e.url,!0),i=r.pathname;if(!i)return Xr(e,n,400,"Bad request.");if(this._serverBasePath!==void 0&&i.startsWith(this._serverBasePath)&&(i=i.substring(this._serverBasePath.length)||"/"),i.startsWith(this._serverProductPath)&&i.charCodeAt(this._serverProductPath.length)===47&&(i=i.substring(this._serverProductPath.length)),i==="/version")return n.writeHead(200,{"Content-Type":"text/plain"}),void n.end(this._productService.commit||"");if(i==="/delay-shutdown")return this._serverLifetimeService.delay(),n.writeHead(200),void n.end("OK");if(!fM(this._connectionToken,e,r))return Xr(e,n,403,"Forbidden.");if(i==="/vscode-remote-resource"){let s=r.query.path;if(typeof s!="string")return Xr(e,n,400,"Bad request.");let a;try{a=I.from({scheme:z.file,path:s}).fsPath}catch{return Xr(e,n,400,"Bad request.")}let l=Object.create(null);this._environmentService.isBuilt&&(Vr(a,this._environmentService.builtinExtensionsPath,!_e)||Vr(a,this._environmentService.extensionsPath,!_e))&&(l["Cache-Control"]="public, max-age=31536000"),l.Vary="Origin";let c=e.headers.origin;return c&&this._webEndpointOriginChecker.matches(c)&&(l["Access-Control-Allow-Origin"]=c),nR(a,1,this._logService,e,n,l)}if(this._webClientServer){this._webClientServer.handle(e,n,r,i);return}return n.writeHead(404,{"Content-Type":"text/plain"}),void n.end("Not found")}handleUpgrade(e,n){let r=Ce(),i=!1,s=!1;if(e.url){let l=rR.parse(e.url,!0).query;typeof l.reconnectionToken=="string"&&(r=l.reconnectionToken),l.reconnection==="true"&&(i=!0),l.skipWebSocketFrames==="true"&&(s=!0)}let a=oM(e,n,{debugLabel:`server-connection-${r}`,skipWebSocketFrames:s,disableWebSocketCompression:this._environmentService.args["disable-websocket-compression"]});a&&this._handleWebSocketConnection(a,i,r)}handleServerError(e){this._logService.error("Error occurred in server"),this._logService.error(e)}_getRemoteAddress(e){let n;return e instanceof ps?n=e.socket:n=e.socket.socket,n.remoteAddress||"<unknown>"}async _rejectWebSocketConnection(e,n,r){let i=n.getSocket();this._logService.error(`${e} ${r}.`);let s={type:"error",reason:r};n.sendControl(A.fromString(JSON.stringify(s))),n.dispose(),await i.drain(),i.dispose()}_handleWebSocketConnection(e,n,r){let i=this._getRemoteAddress(e),s=`[${i}][${r.substr(0,8)}]`,a=new Dm({socket:e}),l=this._vsdaMod?new this._vsdaMod.validator:null,c=this._vsdaMod?new this._vsdaMod.signer:null,u;(w=>(w[w.WaitingForAuth=0]="WaitingForAuth",w[w.WaitingForConnectionType=1]="WaitingForConnectionType",w[w.Done=2]="Done",w[w.Error=3]="Error"))(u||={});let p=0,m=h=>{p=3,g.dispose(),this._rejectWebSocketConnection(s,a,h)},g=a.onControlMessage(h=>{if(p===0){let v;try{v=JSON.parse(h.toString())}catch{return m("Malformed first message")}if(v.type!=="auth")return m("Invalid first message");if(this._connectionToken.type===2&&!this._connectionToken.validate(v.auth))return m("Unauthorized client refused: auth mismatch");let x=Ce();if(c)try{x=c.sign(v.data)}catch{}let T=Ce();if(l)try{T=l.createNewMessage(T)}catch{}let w={type:"sign",data:T,signedData:x};a.sendControl(A.fromString(JSON.stringify(w))),p=1}else if(p===1){let v;try{v=JSON.parse(h.toString())}catch{return m("Malformed second message")}if(v.type!=="connectionType")return m("Invalid second message");if(typeof v.signedData!="string")return m("Invalid second message field type");let x=v.commit,T=this._productService.commit;if(x&&T&&x!==T)return m("Client refused: version mismatch");let w=!1;if(!l)w=!0;else if(this._connectionToken.validate(v.signedData))w=!0;else try{w=l.validate(v.signedData)==="ok"}catch{}if(!w){if(this._environmentService.isBuilt)return m("Unauthorized client refused");this._logService.error(`${s} Unauthorized client handshake failed but we proceed because of dev mode.`)}for(let k in this._managementConnections)this._managementConnections[k].shortenReconnectionGraceTimeIfNecessary();for(let k in this._extHostConnections)this._extHostConnections[k].shortenReconnectionGraceTimeIfNecessary();p=2,g.dispose(),this._handleConnectionType(i,s,a,e,n,r,v)}})}async _handleConnectionType(e,n,r,i,s,a,l){let c=l.desiredConnectionType===1?`${n}[ManagementConnection]`:l.desiredConnectionType===2?`${n}[ExtensionHostConnection]`:n;if(l.desiredConnectionType===1)if(i instanceof ms&&i.setRecordInflateBytes(!1),s){if(!this._managementConnections[a])return this._allReconnectionTokens.has(a)?this._rejectWebSocketConnection(c,r,"Unknown reconnection token (seen before)"):this._rejectWebSocketConnection(c,r,"Unknown reconnection token (never seen)");r.sendControl(A.fromString(JSON.stringify({type:"ok"})));let u=r.readEntireBuffer();r.dispose(),this._managementConnections[a].acceptReconnection(e,i,u)}else{if(this._managementConnections[a])return this._rejectWebSocketConnection(c,r,"Duplicate reconnection token");r.sendControl(A.fromString(JSON.stringify({type:"ok"})));let u=new Iy(this._logService,a,e,r,this._reconnectionGraceTime);this._socketServer.acceptConnection(u.protocol,u.onClose),this._managementConnections[a]=u,this._allReconnectionTokens.add(a),u.onClose(()=>{delete this._managementConnections[a]})}else if(l.desiredConnectionType===2){let u=l.args||{language:"en"},p=await this._updateWithFreeDebugPort(u);if(p.port&&this._logService.trace(`${c} - startParams debug port ${p.port}`),this._logService.trace(`${c} - startParams language: ${p.language}`),this._logService.trace(`${c} - startParams env: ${JSON.stringify(p.env)}`),s){if(!this._extHostConnections[a])return this._allReconnectionTokens.has(a)?this._rejectWebSocketConnection(c,r,"Unknown reconnection token (seen before)"):this._rejectWebSocketConnection(c,r,"Unknown reconnection token (never seen)");r.sendPause(),r.sendControl(A.fromString(JSON.stringify(p.port?{debugPort:p.port}:{})));let m=r.readEntireBuffer();r.dispose(),this._extHostConnections[a].acceptReconnection(e,i,m)}else{if(this._extHostConnections[a])return this._rejectWebSocketConnection(c,r,"Duplicate reconnection token");r.sendPause(),r.sendControl(A.fromString(JSON.stringify(p.port?{debugPort:p.port}:{})));let m=r.readEntireBuffer();r.dispose();let g=this._instantiationService.createInstance(Fd,a,e,i,m);this._extHostConnections[a]=g,this._allReconnectionTokens.add(a),this._extHostLifetimeTokens.set(a,this._serverLifetimeService.active(`ExtensionHost:${a.substring(0,8)}`)),g.onClose(()=>{g.dispose(),delete this._extHostConnections[a],this._extHostLifetimeTokens.deleteAndDispose(a)}),g.start(p)}}else if(l.desiredConnectionType===3){i instanceof ms&&i.setRecordInflateBytes(!1);let u=l.args;this._createTunnel(r,u)}else return this._rejectWebSocketConnection(c,r,"Unknown initial data received")}async _createTunnel(e,n){let r=e.getSocket().socket,i=e.readEntireBuffer();e.dispose(),r.pause();let s=await this._connectTunnelSocket(n.host,n.port);i.byteLength>0&&s.write(i.buffer),s.on("end",()=>r.end()),s.on("close",()=>r.end()),s.on("error",()=>r.destroy()),r.on("end",()=>s.end()),r.on("close",()=>s.end()),r.on("error",()=>s.destroy()),s.pipe(r),r.pipe(s)}_connectTunnelSocket(e,n){return new Promise((r,i)=>{let s=BF.createConnection({host:e,port:n,autoSelectFamily:!0},()=>{s.removeListener("error",i),s.pause(),r(s)});s.once("error",i)})}_updateWithFreeDebugPort(e){return typeof e.port=="number"?tM(e.port,10,5e3).then(n=>(e.port=n,e)):(e.debugId=void 0,e.port=void 0,e.break=void 0,Promise.resolve(e))}};hg=E([b(5,ua),b(6,Ve),b(7,Q),b(8,gr),b(9,Wd)],hg);oR=class o{constructor(t){this._originRegExp=t}static create(t){let e=t.webEndpointUrlTemplate,n=t.commit,r=t.quality;if(!e||!n||!r)return new o(null);let i=Ce(),a=new URL(e.replace("{{uuid}}",i).replace("{{commit}}",n).replace("{{quality}}",r)).origin,l=ao(a).replace(i,"[a-zA-Z0-9\\-]+");try{let c=v1(`^${l}$`,!0,{matchCase:!1});return new o(c)}catch{return new o(null)}}matches(t){return this._originRegExp?this._originRegExp.test(t):!1}}});var GF={};s4(GF,{createServer:()=>JH,spawnCli:()=>QH});import*as zF from"os";import*as ox from"fs";import{performance as HH}from"perf_hooks";function QH(){JL(Ha,vg,cw)}function JH(o){return HF(o,Ha,vg)}var $H,Ha,vg,ix,iR,zH,GH,qH,KH,jH,qF=y(()=>{$e();XL();$F();Zp();Le();Dl();Js();zo();Ot("code/server/codeLoaded");global.vscodeServerCodeLoadedTime=HH.now();$H={onMultipleValues:(o,t)=>{console.error(`Option '${o}' can only be defined once. Using value ${t}.`)},onEmptyValue:o=>{console.error(`Ignoring option '${o}': Value must not be empty.`)},onUnknownOption:o=>{console.error(`Ignoring option '${o}': not supported for server.`)},onDeprecatedOption:(o,t)=>{console.warn(`Option '${o}' is deprecated: ${t}`)}},Ha=qh(process.argv.slice(2),cw,$H),vg=Ha["server-data-dir"]||process.env.VSCODE_AGENT_FOLDER||H(zF.homedir(),St.serverDataFolderName||".vscode-remote"),ix=H(vg,"data"),iR=H(ix,"User"),zH=H(iR,"globalStorage"),GH=H(iR,"History"),qH=H(ix,"Machine");Ha["user-data-dir"]=ix;KH=Ct(yt.asFileUri("").fsPath),jH=H(KH,"extensions");Ha["builtin-extensions-dir"]=jH;Ha["extensions-dir"]=Ha["extensions-dir"]||H(vg,"extensions");[vg,Ha["extensions-dir"],ix,iR,qH,zH,GH].forEach(o=>{try{ox.existsSync(o)||ox.mkdirSync(o,{mode:448,recursive:!0})}catch(t){console.error(t)}})});delete process.env.ELECTRON_RUN_AS_NODE;var ZF=pR(ux(),1);import*as QF from"node:path";import*as aR from"node:http";import*as JF from"node:os";import*as XF from"node:readline";import{performance as YF}from"node:perf_hooks";import*as Hi from"node:path";import{createRequire as c4}from"node:module";var hR=c4(import.meta.url),d4=process.platform==="win32";Error.stackTraceLimit=100;if(!process.env.VSCODE_HANDLES_SIGPIPE){let o=!1;process.on("SIGPIPE",()=>{o||(o=!0,console.error(new Error("Unexpected SIGPIPE")))})}function u4(){try{typeof process.env.VSCODE_CWD!="string"&&(process.env.VSCODE_CWD=process.cwd()),process.platform==="win32"&&process.chdir(Hi.dirname(process.execPath))}catch(o){console.error(o)}}u4();function vR(o){if(!process.env.VSCODE_DEV)return;if(!o)throw new Error("Missing injectPath");hR("node:module").register("./bootstrap-import.js",{parentURL:import.meta.url,data:o})}function yR(){if(typeof process?.versions?.electron=="string")return;let o=hR("module"),t=o.globalPaths,e=o._resolveLookupPaths;o._resolveLookupPaths=function(r,i){let s=e(r,i);if(Array.isArray(s)){let a=0;for(;a<s.length&&s[s.length-1-a]===t[t.length-1-a];)a++;return s.slice(0,s.length-a)}return s};let n=o._nodeModulePaths;o._nodeModulePaths=function(r){let i=n(r);if(!d4)return i;let s=a=>a.length>=3&&a.endsWith(":\\");if(s(r)||(i=i.filter(a=>!s(Hi.dirname(a)))),process.env.HOMEDRIVE&&process.env.HOMEPATH){let a=Hi.dirname(Hi.join(process.env.HOMEDRIVE,process.env.HOMEPATH)),l=c=>Hi.relative(c,a).length===0;l(r)||(i=i.filter(c=>!l(Hi.dirname(c))))}return i}}import*as Eg from"node:fs";import{register as g4}from"node:module";import{createRequire as p4}from"node:module";var ip=p4(import.meta.url),$o={BUILD_INSERT_PRODUCT_CONFIGURATION:"BUILD_INSERT_PRODUCT_CONFIGURATION"};$o.BUILD_INSERT_PRODUCT_CONFIGURATION&&($o=ip("../product.json"));var sp={"name":"Code","version":"1.116.0","private":true,"overrides":{"node-gyp-build":"4.8.1","kerberos@2.1.1":{"node-addon-api":"7.1.0"},"ssh2":{"cpu-features":"0.0.0"}},"type":"module"};sp.BUILD_INSERT_PACKAGE_CONFIGURATION&&(sp=ip("../package.json"));if(process.isEmbeddedApp){$o.parentPolicyConfig={win32RegValueName:$o.win32RegValueName,darwinBundleIdentifier:$o.darwinBundleIdentifier,urlProtocol:$o.urlProtocol};try{let o=ip("../product.sub.json");$o=Object.assign($o,o)}catch{}try{let o=ip("../package.sub.json");sp=Object.assign(sp,o)}catch{}}var bR={};if(process.env.VSCODE_DEV)try{bR=ip("../product.overrides.json"),$o=Object.assign($o,bR)}catch{}var To=$o,IR=sp;zo();(process.env.ELECTRON_RUN_AS_NODE||process.versions.electron)&&g4(`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={...To};globalThis._VSCODE_PACKAGE_JSON={...IR};globalThis._VSCODE_FILE_ROOT=import.meta.dirname;var fx;function h4(){return fx||(fx=v4()),fx}async function v4(){Ot("code/willLoadNls");let o,t;if(process.env.VSCODE_NLS_CONFIG)try{o=JSON.parse(process.env.VSCODE_NLS_CONFIG),o?.languagePack?.messagesFile?t=o.languagePack.messagesFile:o?.defaultMessagesFile&&(t=o.defaultMessagesFile),globalThis._VSCODE_NLS_LANGUAGE=o?.resolvedLanguage}catch(e){console.error(`Error reading VSCODE_NLS_CONFIG from environment: ${e}`)}if(!(process.env.VSCODE_DEV||!t)){try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await Eg.promises.readFile(t)).toString())}catch(e){if(console.error(`Error reading NLS messages file ${t}: ${e}`),o?.languagePack?.corruptMarkerFile)try{await Eg.promises.writeFile(o.languagePack.corruptMarkerFile,"corrupted")}catch(n){console.error(`Error writing corrupted NLS marker file: ${n}`)}if(o?.defaultMessagesFile&&o.defaultMessagesFile!==t)try{globalThis._VSCODE_NLS_MESSAGES=JSON.parse((await Eg.promises.readFile(o.defaultMessagesFile)).toString())}catch(n){console.error(`Error reading default NLS messages file ${o.defaultMessagesFile}: ${n}`)}}return Ot("code/didLoadNls"),o}}async function SR(){await h4()}rS();zo();Ot("code/server/start");globalThis.vscodeServerStartTime=YF.now();var Yr=(0,ZF.default)(process.argv.slice(2),{boolean:["start-server","list-extensions","print-ip-address","help","version","accept-server-license-terms","update-extensions"],string:["install-extension","install-builtin-extension","uninstall-extension","locate-extension","socket-path","host","port","compatibility","agent-host-port","agent-host-path"],alias:{help:"h",version:"v"}});["host","port","accept-server-license-terms"].forEach(o=>{if(!Yr[o]){let t=process.env[`VSCODE_SERVER_${o.toUpperCase().replace("-","_")}`];t&&(Yr[o]=t)}});var XH=["list-extensions","locate-extension"],YH=["install-extension","install-builtin-extension","uninstall-extension","update-extensions"],ZH=Yr.help||Yr.version||XH.some(o=>!!Yr[o])||YH.some(o=>!!Yr[o])&&!Yr["start-server"],KF=await ch({userLocale:"en",osLocale:"en",commit:To.commit,userDataPath:"",nlsMetadataPath:import.meta.dirname});if(ZH)jF(KF).then(o=>{o.spawnCli()});else{let o=null,t=null,e=()=>(t||(t=jF(KF).then(async c=>{let u=await c.createServer(i);return o=u,u})),t);if(Array.isArray(To.serverLicense)&&To.serverLicense.length&&(console.log(To.serverLicense.join(`
- `)),To.serverLicensePrompt&&Yr["accept-server-license-terms"]!==!0)){r$()&&(console.log("To accept the license terms, start the server with --accept-server-license-terms"),process.exit(1));try{await e4(To.serverLicensePrompt)||process.exit(1)}catch(c){console.log(c),process.exit(1)}}let n=!0,r=!0,i=null,s=aR.createServer(async(c,u)=>(n&&(n=!1,Ot("code/server/firstRequest")),(await e()).handleRequest(c,u)));s.on("upgrade",async(c,u)=>(r&&(r=!1,Ot("code/server/firstWebSocket")),(await e()).handleUpgrade(c,u))),s.on("error",async c=>(await e()).handleServerError(c));let a=sR(Yr.host)||(Yr.compatibility!=="1.63"?"localhost":void 0),l=Yr["socket-path"]?{path:sR(Yr["socket-path"])}:{host:a,port:await e$(a,sR(Yr.port))};s.listen(l,async()=>{let c=Array.isArray(To.serverGreeting)&&To.serverGreeting.length?`
- ${To.serverGreeting.join(`
- `)}
- `:"";if(typeof l.port=="number"&&Yr["print-ip-address"]){let u=JF.networkInterfaces();Object.keys(u).forEach(function(p){u[p]?.forEach(function(m){!m.internal&&m.family==="IPv4"&&(c+=`IP Address: ${m.address}
- `)})})}if(i=s.address(),i===null)throw new Error("Unexpected server address");c+=`Server bound to ${typeof i=="string"?i:`${i.address}:${i.port} (${i.family})`}
- `,c+=`Extension host agent listening on ${typeof i=="string"?i:i.port}
- `,console.log(c),Ot("code/server/started"),globalThis.vscodeServerListenTime=YF.now(),await e()}),process.on("exit",()=>{s.close(),o&&o.dispose()})}function sR(o){return Array.isArray(o)&&(o=o.pop()),typeof o=="string"?o:void 0}async function e$(o,t){if(t){let e;if(t.match(/^\d+$/))return parseInt(t,10);if(e=t$(t)){let n=await n$(o,e.start,e.end);if(n!==void 0)return n;console.warn(`--port: Could not find free port in range: ${e.start} - ${e.end} (inclusive).`),process.exit(1)}else console.warn(`--port "${t}" is not a valid number or range. Ranges must be in the form 'from-to' with 'from' an integer larger than 0 and not larger than 'end'.`),process.exit(1)}return 8e3}function t$(o){let t=o.match(/^(\d+)-(\d+)$/);if(t){let e=parseInt(t[1],10),n=parseInt(t[2],10);if(e>0&&e<=n&&n<=65535)return{start:e,end:n}}}async function n$(o,t,e){let n=r=>new Promise(i=>{let s=aR.createServer();s.listen(r,o,()=>{s.close(),i(!0)}).on("error",()=>{i(!1)})});for(let r=t;r<=e;r++)if(await n(r))return r}async function jF(o){return process.env.VSCODE_NLS_CONFIG=JSON.stringify(o),process.env.VSCODE_HANDLES_SIGPIPE="true",process.env.VSCODE_DEV?(process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH=process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH||QF.join(import.meta.dirname,"..","remote","node_modules"),vR(process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH)):delete process.env.VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH,yR(),await SR(),Promise.resolve().then(()=>(qF(),GF))}function r$(){try{return!process.stdin.isTTY}catch{}return!1}function e4(o){let t=XF.createInterface({input:process.stdin,output:process.stdout});return new Promise((e,n)=>{t.question(o+" ",async function(r){t.close();let i=r.toString().trim().toLowerCase();i===""||i==="y"||i==="yes"?e(!0):i==="n"||i==="no"?e(!1):(process.stdout.write(`
- Invalid Response. Answer either yes (y, yes) or no (n, no)
- `),e(await e4(o)))})})}
- //# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/560a9dba96f961efea7b1612916f89e5d5d4d679/core/server-main.js.map
|